22 #ifndef _aspect_mesh_deformation_interface_h 23 #define _aspect_mesh_deformation_interface_h 29 #include <deal.II/fe/fe_system.h> 30 #include <deal.II/dofs/dof_handler.h> 31 #include <deal.II/lac/affine_constraints.h> 32 #include <deal.II/base/index_set.h> 33 #include <deal.II/base/mg_level_object.h> 34 #include <deal.II/lac/la_parallel_vector.h> 35 #include <deal.II/multigrid/mg_constrained_dofs.h> 36 #include <deal.II/multigrid/mg_transfer_matrix_free.h> 37 #include <deal.II/multigrid/mg_transfer_global_coarsening.templates.h> 77 namespace MeshDeformation
95 virtual bool needs_surface_stabilization()
const;
107 compute_initial_deformation_on_boundary(
const types::boundary_id boundary_indicator,
108 const Point<dim> &position)
const;
119 compute_velocity_constraints_on_boundary(
const DoFHandler<dim> &mesh_deformation_dof_handler,
120 AffineConstraints<double> &mesh_velocity_constraints,
121 const std::set<types::boundary_id> &boundary_ids)
const;
198 template <
class Archive>
199 void save (Archive &ar,
200 const unsigned int version)
const;
206 template <
class Archive>
207 void load (Archive &ar,
208 const unsigned int version);
210 BOOST_SERIALIZATION_SPLIT_MEMBER()
231 register_mesh_deformation
232 (
const std::string &name,
233 const std::string &description,
234 void (*declare_parameters_function) (ParameterHandler &),
241 const std::map<types::boundary_id, std::vector<std::string>> &
242 get_active_mesh_deformation_names ()
const;
248 const std::map<types::boundary_id,std::vector<std::unique_ptr<Interface<dim>>>> &
249 get_active_mesh_deformation_models ()
const;
255 const std::set<types::boundary_id> &
256 get_active_mesh_deformation_boundary_indicators ()
const;
262 const std::set<types::boundary_id> &
263 get_boundary_indicators_requiring_stabilization ()
const;
270 const std::set<types::boundary_id> &
271 get_free_surface_boundary_indicators ()
const;
276 double get_free_surface_theta ()
const;
293 get_initial_topography ()
const;
300 get_mesh_displacements ()
const;
305 const DoFHandler<dim> &
306 get_mesh_deformation_dof_handler ()
const;
317 template <
typename MeshDeformationType,
318 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshDeformationType>::value>>
320 has_matching_mesh_deformation_object ()
const;
333 template <
typename MeshDeformationType,
334 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshDeformationType>::value>>
335 const MeshDeformationType &
336 get_matching_mesh_deformation_object ()
const;
345 get_level_mapping(
const unsigned int level)
const;
365 <<
"Could not find entry <" 367 <<
"> among the names of registered mesh deformation objects.");
377 void make_initial_constraints ();
391 void make_constraints ();
397 void compute_mesh_displacements ();
403 void compute_mesh_displacements_gmg ();
420 void set_initial_topography ();
425 void interpolate_mesh_velocity ();
430 void update_multilevel_deformation ();
592 template <
class Archive>
594 const unsigned int)
const 599 std::map<std::string,std::string> saved_text;
600 for (
const auto &boundary_id_and_mesh_deformation_objects : mesh_deformation_objects)
601 for (
const auto &p : boundary_id_and_mesh_deformation_objects.second)
602 p->
save (saved_text);
609 template <
class Archive>
617 std::map<std::string,std::string> saved_text;
620 for (
const auto &boundary_id_and_mesh_deformation_objects : mesh_deformation_objects)
621 for (
const auto &p : boundary_id_and_mesh_deformation_objects.second)
622 p->
load (saved_text);
629 template <
typename MeshDeformationType,
typename>
634 for (
const auto &object_iterator : mesh_deformation_objects)
635 for (
const auto &p : object_iterator.second)
636 if (Plugins::plugin_type_matches<MeshDeformationType>(*p))
645 template <
typename MeshDeformationType,
typename>
647 const MeshDeformationType &
650 AssertThrow(has_matching_mesh_deformation_object<MeshDeformationType> (),
651 ExcMessage(
"You asked MeshDeformation::MeshDeformationHandler::get_matching_mesh_deformation_object() for a " 652 "mesh deformation object of type <" + boost::core::demangle(
typeid(MeshDeformationType).name()) +
"> " 653 "that could not be found in the current model. Activate this " 654 "mesh deformation in the input file."));
656 for (
const auto &object_iterator : mesh_deformation_objects)
657 for (
const auto &p : object_iterator.second)
658 if (Plugins::plugin_type_matches<MeshDeformationType>(*p))
659 return Plugins::get_plugin_as_type<MeshDeformationType>(*p);
662 typename std::vector<std::unique_ptr<Interface<dim>>>::const_iterator mesh_def;
663 return Plugins::get_plugin_as_type<MeshDeformationType>(*(*mesh_def));
687 #define ASPECT_REGISTER_MESH_DEFORMATION_MODEL(classname,name,description) \ 688 template class classname<2>; \ 689 template class classname<3>; \ 690 namespace ASPECT_REGISTER_MESH_DEFORMATION_MODEL_ ## classname \ 692 aspect::internal::Plugins::RegisterHelper<aspect::MeshDeformation::Interface<2>,classname<2>> \ 693 dummy_ ## classname ## _2d (&aspect::MeshDeformation::MeshDeformationHandler<2>::register_mesh_deformation, \ 694 name, description); \ 695 aspect::internal::Plugins::RegisterHelper<aspect::MeshDeformation::Interface<3>,classname<3>> \ 696 dummy_ ## classname ## _3d (&aspect::MeshDeformation::MeshDeformationHandler<3>::register_mesh_deformation, \ 697 name, description); \
virtual void parse_parameters(ParameterHandler &prm)
const Simulator< dim > * simulator
::TrilinosWrappers::MPI::BlockVector BlockVector
ApplyStabilization(const double stabilization_theta)
void write_plugin_graph(std::ostream &output_stream)
::TrilinosWrappers::MPI::Vector Vector
virtual void load(const std::map< std::string, std::string > &status_strings)
const double free_surface_theta
std::string get_valid_model_names_pattern()
::MGTransferMatrixFree< dim, NumberType > MGTransferMF
void execute(internal::Assembly::Scratch::ScratchBase< dim > &scratch, internal::Assembly::CopyData::CopyDataBase< dim > &data) const override
virtual void save(std::map< std::string, std::string > &status_strings) const
virtual void initialize()
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.")