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;
146 void save (std::map<std::string, std::string> &status_strings)
const;
160 void load (
const std::map<std::string, std::string> &status_strings);
237 template <
class Archive>
238 void save (Archive &ar,
239 const unsigned int version)
const;
245 template <
class Archive>
246 void load (Archive &ar,
247 const unsigned int version);
249 BOOST_SERIALIZATION_SPLIT_MEMBER()
270 register_mesh_deformation
271 (
const std::string &name,
272 const std::string &description,
273 void (*declare_parameters_function) (ParameterHandler &),
280 const std::map<types::boundary_id, std::vector<std::string>> &
281 get_active_mesh_deformation_names ()
const;
287 const std::map<types::boundary_id,std::vector<std::unique_ptr<Interface<dim>>>> &
288 get_active_mesh_deformation_models ()
const;
294 const std::set<types::boundary_id> &
295 get_active_mesh_deformation_boundary_indicators ()
const;
301 const std::set<types::boundary_id> &
302 get_boundary_indicators_requiring_stabilization ()
const;
309 const std::set<types::boundary_id> &
310 get_free_surface_boundary_indicators ()
const;
315 double get_free_surface_theta ()
const;
332 get_initial_topography ()
const;
339 get_mesh_displacements ()
const;
344 const DoFHandler<dim> &
345 get_mesh_deformation_dof_handler ()
const;
356 template <
typename MeshDeformationType,
357 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshDeformationType>::value>>
359 has_matching_mesh_deformation_object ()
const;
372 template <
typename MeshDeformationType,
373 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshDeformationType>::value>>
374 const MeshDeformationType &
375 get_matching_mesh_deformation_object ()
const;
384 get_level_mapping(
const unsigned int level)
const;
404 <<
"Could not find entry <" 406 <<
"> among the names of registered mesh deformation objects.");
416 void make_initial_constraints ();
430 void make_constraints ();
436 void compute_mesh_displacements ();
442 void compute_mesh_displacements_gmg ();
459 void set_initial_topography ();
464 void interpolate_mesh_velocity ();
469 void update_multilevel_deformation ();
631 template <
class Archive>
633 const unsigned int)
const 638 std::map<std::string,std::string> saved_text;
639 for (
const auto &boundary_id_and_mesh_deformation_objects : mesh_deformation_objects)
640 for (
const auto &p : boundary_id_and_mesh_deformation_objects.second)
641 p->
save (saved_text);
648 template <
class Archive>
656 std::map<std::string,std::string> saved_text;
659 for (
const auto &boundary_id_and_mesh_deformation_objects : mesh_deformation_objects)
660 for (
const auto &p : boundary_id_and_mesh_deformation_objects.second)
661 p->
load (saved_text);
668 template <
typename MeshDeformationType,
typename>
673 for (
const auto &object_iterator : mesh_deformation_objects)
674 for (
const auto &p : object_iterator.second)
675 if (Plugins::plugin_type_matches<MeshDeformationType>(*p))
684 template <
typename MeshDeformationType,
typename>
686 const MeshDeformationType &
689 AssertThrow(has_matching_mesh_deformation_object<MeshDeformationType> (),
690 ExcMessage(
"You asked MeshDeformation::MeshDeformationHandler::get_matching_mesh_deformation_object() for a " 691 "mesh deformation object of type <" + boost::core::demangle(
typeid(MeshDeformationType).name()) +
"> " 692 "that could not be found in the current model. Activate this " 693 "mesh deformation in the input file."));
695 for (
const auto &object_iterator : mesh_deformation_objects)
696 for (
const auto &p : object_iterator.second)
697 if (Plugins::plugin_type_matches<MeshDeformationType>(*p))
698 return Plugins::get_plugin_as_type<MeshDeformationType>(*p);
701 typename std::vector<std::unique_ptr<Interface<dim>>>::const_iterator mesh_def;
702 return Plugins::get_plugin_as_type<MeshDeformationType>(*(*mesh_def));
726 #define ASPECT_REGISTER_MESH_DEFORMATION_MODEL(classname,name,description) \ 727 template class classname<2>; \ 728 template class classname<3>; \ 729 namespace ASPECT_REGISTER_MESH_DEFORMATION_MODEL_ ## classname \ 731 aspect::internal::Plugins::RegisterHelper<aspect::MeshDeformation::Interface<2>,classname<2>> \ 732 dummy_ ## classname ## _2d (&aspect::MeshDeformation::MeshDeformationHandler<2>::register_mesh_deformation, \ 733 name, description); \ 734 aspect::internal::Plugins::RegisterHelper<aspect::MeshDeformation::Interface<3>,classname<3>> \ 735 dummy_ ## classname ## _3d (&aspect::MeshDeformation::MeshDeformationHandler<3>::register_mesh_deformation, \ 736 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
const double free_surface_theta
::MGTransferMatrixFree< dim, NumberType > MGTransferMF
void execute(internal::Assembly::Scratch::ScratchBase< dim > &scratch, internal::Assembly::CopyData::CopyDataBase< dim > &data) const override
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.")