16 #ifndef _aspect_boundary_velocity_interface_h 17 #define _aspect_boundary_velocity_interface_h 27 #include <boost/core/demangle.hpp> 39 namespace BoundaryVelocity
47 class Interface :
public Plugins::InterfaceBase
74 class Manager :
public Plugins::ManagerBase<Interface<dim>>,
public SimulatorAccess<dim>
105 register_boundary_velocity (
const std::string &name,
106 const std::string &description,
108 std::unique_ptr<Interface<dim>> (*factory_function) ());
127 const std::map<types::boundary_id, std::pair<std::string,std::vector<std::string>>> &
128 get_active_boundary_velocity_names ()
const;
143 const std::map<types::boundary_id,std::vector<std::unique_ptr<BoundaryVelocity::Interface<dim>>>> &
144 get_active_boundary_velocity_conditions ()
const;
152 const std::vector<types::boundary_id> &
153 get_active_plugin_boundary_indicators()
const;
172 const std::set<types::boundary_id> &
173 get_prescribed_boundary_velocity_indicators ()
const;
179 const std::set<types::boundary_id> &
180 get_zero_boundary_velocity_indicators ()
const;
186 const std::set<types::boundary_id> &
187 get_tangential_boundary_velocity_indicators ()
const;
219 template <
typename BoundaryVelocityType,
220 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,BoundaryVelocityType>::value>>
223 has_matching_boundary_velocity_model ()
const;
241 template <
typename BoundaryVelocityType,
242 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,BoundaryVelocityType>::value>>
244 const BoundaryVelocityType &
245 get_matching_boundary_velocity_model ()
const;
266 <<
"Could not find entry <" 268 <<
"> among the names of registered boundary velocity objects.");
335 template <
typename BoundaryVelocityType,
typename>
340 for (
const auto &boundary : boundary_velocity_objects)
341 for (
const auto &p : boundary.second)
342 if (Plugins::plugin_type_matches<BoundaryVelocityType>(*p))
349 template <
typename BoundaryVelocityType,
typename>
351 const BoundaryVelocityType &
354 AssertThrow(has_matching_boundary_velocity_model<BoundaryVelocityType> (),
355 ExcMessage(
"You asked BoundaryVelocity::Manager::get_boundary_velocity_model() for a " 356 "boundary velocity model of type <" + boost::core::demangle(
typeid(BoundaryVelocityType).name()) +
"> " 357 "that could not be found in the current model. Activate this " 358 "boundary velocity model in the input file."));
360 for (
const auto &boundary : boundary_velocity_objects)
361 for (
const auto &p : boundary)
362 if (Plugins::plugin_type_matches<BoundaryVelocityType>(*p))
363 return Plugins::get_plugin_as_type<BoundaryVelocityType>(*p);
366 return Plugins::get_plugin_as_type<BoundaryVelocityType>(**(boundary_velocity_objects.begin()));
388 #define ASPECT_REGISTER_BOUNDARY_VELOCITY_MODEL(classname, name, description) \ 389 template class classname<2>; \ 390 template class classname<3>; \ 391 namespace ASPECT_REGISTER_BOUNDARY_VELOCITY_MODEL_ ## classname \ 393 aspect::internal::Plugins::RegisterHelper<aspect::BoundaryVelocity::Interface<2>,classname<2>> \ 394 dummy_ ## classname ## _2d (&aspect::BoundaryVelocity::Manager<2>::register_boundary_velocity, \ 395 name, description); \ 396 aspect::internal::Plugins::RegisterHelper<aspect::BoundaryVelocity::Interface<3>,classname<3>> \ 397 dummy_ ## classname ## _3d (&aspect::BoundaryVelocity::Manager<3>::register_boundary_velocity, \ 398 name, description); \ virtual void parse_parameters(ParameterHandler &prm)
#define AssertThrow(cond, exc)
void write_plugin_graph(std::ostream &output_stream)
DEAL_II_DEPRECATED const BoundaryVelocityType & get_matching_boundary_velocity_model() const
std::set< types::boundary_id > tangential_velocity_boundary_indicators
std::set< types::boundary_id > prescribed_velocity_boundary_indicators
virtual Tensor< 1, dim > boundary_velocity(const types::boundary_id boundary_indicator, const Point< dim > &position) const =0
std::map< types::boundary_id, std::pair< std::string, std::vector< std::string > > > boundary_velocity_indicators
DEAL_II_DEPRECATED bool has_matching_boundary_velocity_model() const
std::string get_valid_model_names_pattern()
std::map< types::boundary_id, std::vector< std::unique_ptr< BoundaryVelocity::Interface< dim > > > > boundary_velocity_objects
std::vector< ComponentMask > component_masks
static ::ExceptionBase & ExcMessage(std::string arg1)
std::set< types::boundary_id > zero_velocity_boundary_indicators
#define DEAL_II_DEPRECATED
static void declare_parameters(ParameterHandler &prm)
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.")
std::vector< types::boundary_id > boundary_indicators