Skip to content

Commit

Permalink
Add member function observation_name to amr::Criteria
Browse files Browse the repository at this point in the history
This will be used when observing the criteria.
  • Loading branch information
kidder committed Nov 11, 2024
1 parent bbc7c02 commit 8e3634b
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class RefineAtPunctures : public amr::Criterion {
WRAPPED_PUPable_decl_template(RefineAtPunctures); // NOLINT
/// \endcond

std::string observation_name() override { return "RefineAtPunctures"; }

using argument_tags = tmpl::list<
elliptic::Tags::Background<elliptic::analytic_data::Background>,
domain::Tags::Domain<3>>;
Expand Down
2 changes: 2 additions & 0 deletions src/ParallelAlgorithms/Amr/Criteria/Constraints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ class Constraints : public Criterion {
Events::Tags::ObserverJacobianCompute<
Dim, Frame::ElementLogical, Frame::Inertial>>>;

std::string observation_name() override { return "Constraints"; }

using argument_tags = tmpl::list<::Tags::ObservationBox>;

template <typename ComputeTagsList, typename DataBoxType,
Expand Down
2 changes: 2 additions & 0 deletions src/ParallelAlgorithms/Amr/Criteria/Criterion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class Criterion : public PUP::able {

WRAPPED_PUPable_abstract(Criterion); // NOLINT

virtual std::string observation_name() = 0;

/// Evaluates the AMR criteria by selecting the appropriate derived class
/// and forwarding its `argument_tags` from the ObservationBox (along with the
/// GlobalCache and ArrayIndex) to the call operator of the derived class
Expand Down
2 changes: 2 additions & 0 deletions src/ParallelAlgorithms/Amr/Criteria/DriveToTarget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ class DriveToTarget : public Criterion {
WRAPPED_PUPable_decl_template(DriveToTarget); // NOLINT
/// \endcond

std::string observation_name() override { return "DriveToTarget"; }

using compute_tags_for_observation_box = tmpl::list<>;

using argument_tags = tmpl::list<::domain::Tags::Mesh<Dim>>;
Expand Down
2 changes: 2 additions & 0 deletions src/ParallelAlgorithms/Amr/Criteria/IncreaseResolution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class IncreaseResolution : public Criterion {
WRAPPED_PUPable_decl_template(IncreaseResolution); // NOLINT
/// \endcond

std::string observation_name() override { return "IncreaseResolution"; }

using compute_tags_for_observation_box = tmpl::list<>;
using argument_tags = tmpl::list<>;

Expand Down
2 changes: 2 additions & 0 deletions src/ParallelAlgorithms/Amr/Criteria/Loehner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ class Loehner : public Criterion {
WRAPPED_PUPable_decl_template(Loehner); // NOLINT
/// \endcond

std::string observation_name() override { return "Loehner"; }

using compute_tags_for_observation_box = tmpl::list<>;

using argument_tags = tmpl::list<::Tags::DataBox>;
Expand Down
2 changes: 2 additions & 0 deletions src/ParallelAlgorithms/Amr/Criteria/Persson.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ class Persson : public Criterion {
WRAPPED_PUPable_decl_template(Persson); // NOLINT
/// \endcond

std::string observation_name() override { return "Persson"; }

using compute_tags_for_observation_box = tmpl::list<>;

using argument_tags = tmpl::list<::Tags::DataBox>;
Expand Down
2 changes: 2 additions & 0 deletions src/ParallelAlgorithms/Amr/Criteria/Random.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class Random : public Criterion {
WRAPPED_PUPable_decl_template(Random); // NOLINT
/// \endcond

std::string observation_name() override { return "Random"; }

using compute_tags_for_observation_box = tmpl::list<>;

using argument_tags = tmpl::list<>;
Expand Down
2 changes: 2 additions & 0 deletions src/ParallelAlgorithms/Amr/Criteria/TruncationError.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ class TruncationError : public Criterion {
WRAPPED_PUPable_decl_template(TruncationError); // NOLINT
/// \endcond

std::string observation_name() override { return "TruncationError"; }

using compute_tags_for_observation_box = tmpl::list<>;

using argument_tags = tmpl::list<::Tags::DataBox>;
Expand Down
4 changes: 4 additions & 0 deletions tests/Unit/ParallelAlgorithms/Amr/Criteria/Test_Criterion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class CriterionOne : public amr::Criterion {
using PUP::able::register_constructor;
WRAPPED_PUPable_decl_template(CriterionOne); // NOLINT

std::string observation_name() override { return "CriterionOne"; }

using compute_tags_for_observartion_box = tmpl::list<>;
using argument_tags = tmpl::list<FieldOne>;

Expand Down Expand Up @@ -108,6 +110,8 @@ class CriterionTwo : public amr::Criterion {
using PUP::able::register_constructor;
WRAPPED_PUPable_decl_template(CriterionTwo); // NOLINT

std::string observation_name() override { return "CriterionTwo"; }

using compute_tags_for_observartion_box = tmpl::list<ConstraintCompute>;
using argument_tags = tmpl::list<Constraint>;

Expand Down

0 comments on commit 8e3634b

Please sign in to comment.