Base class for something that determines how an adaptive mesh should be changed.
using type = double;
};
using type = double;
};
using type = double;
};
using base = Constraint;
using return_type = double;
using argument_tags = tmpl::list<FieldOne, FieldTwo>;
static void function(const gsl::not_null<double*> result,
const double field_one, const double field_two) {
*result = field_one - field_two;
}
};
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
public:
struct CriticalValue {
using type = double;
"The critical value of field one ."};
};
using options = tmpl::list<CriticalValue>;
"h-refine the grid if field one is above a critical value"};
CriterionOne() = default;
explicit CriterionOne(const double critical_value)
: critical_value_(critical_value) {}
explicit CriterionOne(CkMigrateMessage* msg) : Criterion(msg) {}
using PUP::able::register_constructor;
std::string observation_name() override { return "CriterionOne"; }
using compute_tags_for_observation_box = tmpl::list<>;
using argument_tags = tmpl::list<FieldOne>;
template <typename Metavariables>
auto operator()(
const double field_one, Parallel::GlobalCache<Metavariables>& ,
const ElementId<Metavariables::volume_dim>& ) const {
}
void pup(PUP::er& p) override {
Criterion::pup(p);
}
private:
double critical_value_{0.0};
};
PUP::able::PUP_ID CriterionOne::my_PUP_ID = 0;
public:
struct TargetValue {
using type = double;
};
using options = tmpl::list<TargetValue>;
"h-refine if the absolute value of the constraint is above the target "
"value. h-coarsen if the constraint is an order of magnitude below the "
"target value"};
CriterionTwo() = default;
explicit CriterionTwo(const double target_value)
: target_value_(target_value) {}
explicit CriterionTwo(CkMigrateMessage* ) {}
using PUP::able::register_constructor;
std::string observation_name() override { return "CriterionTwo"; }
using compute_tags_for_observation_box = tmpl::list<ConstraintCompute>;
using argument_tags = tmpl::list<Constraint>;
template <typename Metavariables>
auto operator()(
const double constraint, Parallel::GlobalCache<Metavariables>& ,
const ElementId<Metavariables::volume_dim>& ) const {
return std::abs(constraint) > target_value_
: (std::abs(constraint) < 0.1 * target_value_
}
void pup(PUP::er& p) override {
Criterion::pup(p);
}
private:
double target_value_{0.0};
};
PUP::able::PUP_ID CriterionTwo::my_PUP_ID = 0;
#pragma GCC diagnostic pop
struct Metavariables {
static constexpr size_t volume_dim = 1;
using component_list = tmpl::list<>;
using const_global_cache_tags = tmpl::list<>;
struct factory_creation
: tt::ConformsTo<Options::protocols::FactoryCreation> {
using factory_classes = tmpl::map<
tmpl::pair<amr::Criterion, tmpl::list<CriterionOne, CriterionTwo>>>;
};
};