22 #ifndef _aspect_boundary_velocity_interface_h
23 #define _aspect_boundary_velocity_interface_h
33 #include <boost/core/demangle.hpp>
45 namespace BoundaryVelocity
112 const std::string &description,
133 const std::map<types::boundary_id, std::pair<std::string,std::vector<std::string>>> &
149 const std::map<types::boundary_id,std::vector<std::unique_ptr<BoundaryVelocity::Interface<dim>>>> &
158 const std::vector<types::boundary_id> &
178 const std::set<types::boundary_id> &
185 const std::set<types::boundary_id> &
192 const std::set<types::boundary_id> &
225 template <
typename BoundaryVelocityType,
226 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,BoundaryVelocityType>::value>>
247 template <
typename BoundaryVelocityType,
248 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,BoundaryVelocityType>::value>>
250 const BoundaryVelocityType &
272 <<
"Could not find entry <"
274 <<
"> among the names of registered boundary velocity objects.");
341 template <
typename BoundaryVelocityType,
typename>
346 for (
const auto &boundary : boundary_velocity_objects)
347 for (
const auto &p : boundary.second)
348 if (Plugins::plugin_type_matches<BoundaryVelocityType>(*p))
355 template <
typename BoundaryVelocityType,
typename>
357 const BoundaryVelocityType &
360 AssertThrow(has_matching_boundary_velocity_model<BoundaryVelocityType> (),
361 ExcMessage(
"You asked BoundaryVelocity::Manager::get_boundary_velocity_model() for a "
362 "boundary velocity model of type <" + boost::core::demangle(
typeid(BoundaryVelocityType).name()) +
"> "
363 "that could not be found in the current model. Activate this "
364 "boundary velocity model in the input file."));
366 for (
const auto &boundary : boundary_velocity_objects)
367 for (
const auto &p : boundary)
368 if (Plugins::plugin_type_matches<BoundaryVelocityType>(*p))
369 return Plugins::get_plugin_as_type<BoundaryVelocityType>(*p);
372 return Plugins::get_plugin_as_type<BoundaryVelocityType>(**(boundary_velocity_objects.begin()));
394 #define ASPECT_REGISTER_BOUNDARY_VELOCITY_MODEL(classname, name, description) \
395 template class classname<2>; \
396 template class classname<3>; \
397 namespace ASPECT_REGISTER_BOUNDARY_VELOCITY_MODEL_ ## classname \
399 aspect::internal::Plugins::RegisterHelper<aspect::BoundaryVelocity::Interface<2>,classname<2>> \
400 dummy_ ## classname ## _2d (&aspect::BoundaryVelocity::Manager<2>::register_boundary_velocity, \
401 name, description); \
402 aspect::internal::Plugins::RegisterHelper<aspect::BoundaryVelocity::Interface<3>,classname<3>> \
403 dummy_ ## classname ## _3d (&aspect::BoundaryVelocity::Manager<3>::register_boundary_velocity, \
404 name, description); \
virtual Tensor< 1, dim > boundary_velocity(const types::boundary_id boundary_indicator, const Point< dim > &position) const =0
Tensor< 1, dim > boundary_velocity(const types::boundary_id boundary_indicator, const Point< dim > &position) const
std::set< types::boundary_id > prescribed_velocity_boundary_indicators
std::set< types::boundary_id > tangential_velocity_boundary_indicators
std::map< types::boundary_id, std::vector< std::unique_ptr< BoundaryVelocity::Interface< dim > > > > boundary_velocity_objects
std::vector< types::boundary_id > boundary_indicators
std::set< types::boundary_id > zero_velocity_boundary_indicators
static void write_plugin_graph(std::ostream &output_stream)
DEAL_II_DEPRECATED bool has_matching_boundary_velocity_model() const
static void declare_parameters(ParameterHandler &prm)
const std::set< types::boundary_id > & get_prescribed_boundary_velocity_indicators() const
const std::vector< types::boundary_id > & get_active_plugin_boundary_indicators() const
void parse_parameters(ParameterHandler &prm) override
ComponentMask get_component_mask(const types::boundary_id boundary_id) const
static void register_boundary_velocity(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< Interface< dim >>(*factory_function)())
DEAL_II_DEPRECATED const std::map< types::boundary_id, std::pair< std::string, std::vector< std::string > > > & get_active_boundary_velocity_names() const
std::vector< ComponentMask > component_masks
std::map< types::boundary_id, std::pair< std::string, std::vector< std::string > > > boundary_velocity_indicators
const std::set< types::boundary_id > & get_zero_boundary_velocity_indicators() const
DEAL_II_DEPRECATED const BoundaryVelocityType & get_matching_boundary_velocity_model() const
DeclException1(ExcBoundaryVelocityNameNotFound, std::string,<< "Could not find entry <"<< arg1<< "> among the names of registered boundary velocity objects.")
DEAL_II_DEPRECATED const std::map< types::boundary_id, std::vector< std::unique_ptr< BoundaryVelocity::Interface< dim > > > > & get_active_boundary_velocity_conditions() const
const std::set< types::boundary_id > & get_tangential_boundary_velocity_indicators() const
#define DEAL_II_DEPRECATED
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
std::string get_valid_model_names_pattern()