22 #ifndef _aspect_boundary_velocity_interface_h 23 #define _aspect_boundary_velocity_interface_h 30 #include <deal.II/base/point.h> 31 #include <deal.II/base/parameter_handler.h> 33 #include <boost/core/demangle.hpp> 45 namespace BoundaryVelocity
53 class Interface :
public Plugins::InterfaceBase
71 const Point<dim> &position)
const = 0;
80 class Manager :
public Plugins::ManagerBase<Interface<dim>>,
public SimulatorAccess<dim>
90 const Point<dim> &position)
const;
111 register_boundary_velocity (
const std::string &name,
112 const std::string &description,
113 void (*declare_parameters_function) (ParameterHandler &),
114 std::unique_ptr<Interface<dim>> (*factory_function) ());
133 const std::map<types::boundary_id, std::pair<std::string,std::vector<std::string>>> &
134 get_active_boundary_velocity_names ()
const;
149 const std::map<types::boundary_id,std::vector<std::unique_ptr<BoundaryVelocity::Interface<dim>>>> &
150 get_active_boundary_velocity_conditions ()
const;
158 const std::vector<types::boundary_id> &
159 get_active_plugin_boundary_indicators()
const;
172 get_component_mask(
const types::boundary_id boundary_id)
const;
178 const std::set<types::boundary_id> &
179 get_prescribed_boundary_velocity_indicators ()
const;
185 const std::set<types::boundary_id> &
186 get_zero_boundary_velocity_indicators ()
const;
192 const std::set<types::boundary_id> &
193 get_tangential_boundary_velocity_indicators ()
const;
225 template <
typename BoundaryVelocityType,
226 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,BoundaryVelocityType>::value>>
229 has_matching_boundary_velocity_model ()
const;
247 template <
typename BoundaryVelocityType,
248 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,BoundaryVelocityType>::value>>
250 const BoundaryVelocityType &
251 get_matching_boundary_velocity_model ()
const;
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 void parse_parameters(ParameterHandler &prm)
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
std::set< types::boundary_id > zero_velocity_boundary_indicators
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