22 #ifndef _aspect_initial_composition_interface_h 23 #define _aspect_initial_composition_interface_h 29 #include <deal.II/base/point.h> 30 #include <deal.II/base/parameter_handler.h> 32 #include <boost/core/demangle.hpp> 38 template <
int dim>
class SimulatorAccess;
46 namespace InitialComposition
56 class Interface :
public Plugins::InterfaceBase
63 double initial_composition (
const Point<dim> &position,
const unsigned int n_comp)
const = 0;
74 class Manager :
public Plugins::ManagerBase<Interface<dim>>,
public SimulatorAccess<dim>
91 parse_parameters (ParameterHandler &prm)
override;
100 initial_composition (
const Point<dim> &position,
101 const unsigned int n_comp)
const;
122 register_initial_composition (
const std::string &name,
123 const std::string &description,
124 void (*declare_parameters_function) (ParameterHandler &),
125 std::unique_ptr<Interface<dim>> (*factory_function) ());
136 const std::vector<std::string> &
137 get_active_initial_composition_names ()
const;
147 const std::list<std::unique_ptr<Interface<dim>>> &
148 get_active_initial_composition_conditions ()
const;
164 template <
typename InitialCompositionType,
165 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,InitialCompositionType>::value>>
168 has_matching_initial_composition_model ()
const;
186 template <
typename InitialCompositionType,
187 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,InitialCompositionType>::value>>
189 const InitialCompositionType &
190 get_matching_initial_composition_model ()
const;
210 <<
"Could not find entry <" 212 <<
"> among the names of registered initial composition objects.");
226 template <
typename InitialCompositionType,
typename>
231 return this->
template has_matching_active_plugin<InitialCompositionType>();
236 template <
typename InitialCompositionType,
typename>
238 const InitialCompositionType &
241 return this->
template get_matching_active_plugin<InitialCompositionType>();
266 #define ASPECT_REGISTER_INITIAL_COMPOSITION_MODEL(classname,name,description) \ 267 template class classname<2>; \ 268 template class classname<3>; \ 269 namespace ASPECT_REGISTER_INITIAL_COMPOSITION_MODEL_ ## classname \ 271 aspect::internal::Plugins::RegisterHelper<aspect::InitialComposition::Interface<2>,classname<2>> \ 272 dummy_ ## classname ## _2d (&aspect::InitialComposition::Manager<2>::register_initial_composition, \ 273 name, description); \ 274 aspect::internal::Plugins::RegisterHelper<aspect::InitialComposition::Interface<3>,classname<3>> \ 275 dummy_ ## classname ## _3d (&aspect::InitialComposition::Manager<3>::register_initial_composition, \ 276 name, description); \
DEAL_II_DEPRECATED bool has_matching_initial_composition_model() const
void write_plugin_graph(std::ostream &output_stream)
DEAL_II_DEPRECATED const InitialCompositionType & get_matching_initial_composition_model() const
std::string get_valid_model_names_pattern()
void declare_parameters(ParameterHandler &prm)
std::vector< aspect::Utilities::Operator > model_operators
DeclException1(ProbabilityFunctionNegative, Point< dim >,<< "Your probability density function in the particle generator " "returned a negative probability density for the following position: "<< arg1<< ". Please check your function expression.")