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;
123 compute_initial_deformation_as_constraints(
const Mapping<dim> &mapping,
124 const DoFHandler<dim> &mesh_deformation_dof_handler,
125 const types::boundary_id boundary_indicator,
126 AffineConstraints<double> &constraints)
const;
137 compute_velocity_constraints_on_boundary(
const DoFHandler<dim> &mesh_deformation_dof_handler,
138 AffineConstraints<double> &mesh_velocity_constraints,
139 const std::set<types::boundary_id> &boundary_ids)
const;
216 template <
class Archive>
217 void save (Archive &ar,
218 const unsigned int version)
const;
224 template <
class Archive>
225 void load (Archive &ar,
226 const unsigned int version);
228 BOOST_SERIALIZATION_SPLIT_MEMBER()
249 register_mesh_deformation
250 (
const std::string &name,
251 const std::string &description,
252 void (*declare_parameters_function) (ParameterHandler &),
259 const std::map<types::boundary_id, std::vector<std::string>> &
260 get_active_mesh_deformation_names ()
const;
266 const std::map<types::boundary_id,std::vector<std::unique_ptr<Interface<dim>>>> &
267 get_active_mesh_deformation_models ()
const;
273 const std::set<types::boundary_id> &
274 get_active_mesh_deformation_boundary_indicators ()
const;
280 const std::set<types::boundary_id> &
281 get_boundary_indicators_requiring_stabilization ()
const;
288 const std::set<types::boundary_id> &
289 get_free_surface_boundary_indicators ()
const;
294 double get_free_surface_theta ()
const;
311 get_initial_topography ()
const;
318 get_mesh_displacements ()
const;
323 const DoFHandler<dim> &
324 get_mesh_deformation_dof_handler ()
const;
335 template <
typename MeshDeformationType,
336 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshDeformationType>::value>>
338 has_matching_mesh_deformation_object ()
const;
351 template <
typename MeshDeformationType,
352 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshDeformationType>::value>>
353 const MeshDeformationType &
354 get_matching_mesh_deformation_object ()
const;
363 get_level_mapping(
const unsigned int level)
const;
383 <<
"Could not find entry <" 385 <<
"> among the names of registered mesh deformation objects.");
395 void make_initial_constraints ();
409 void make_constraints ();
415 void compute_mesh_displacements ();
421 void compute_mesh_displacements_gmg ();
438 void set_initial_topography ();
443 void interpolate_mesh_velocity ();
448 void update_multilevel_deformation ();
610 template <
class Archive>
612 const unsigned int)
const 617 std::map<std::string,std::string> saved_text;
618 for (
const auto &boundary_id_and_mesh_deformation_objects : mesh_deformation_objects)
619 for (
const auto &p : boundary_id_and_mesh_deformation_objects.second)
620 p->
save (saved_text);
627 template <
class Archive>
635 std::map<std::string,std::string> saved_text;
638 for (
const auto &boundary_id_and_mesh_deformation_objects : mesh_deformation_objects)
639 for (
const auto &p : boundary_id_and_mesh_deformation_objects.second)
640 p->
load (saved_text);
647 template <
typename MeshDeformationType,
typename>
652 for (
const auto &object_iterator : mesh_deformation_objects)
653 for (
const auto &p : object_iterator.second)
654 if (Plugins::plugin_type_matches<MeshDeformationType>(*p))
663 template <
typename MeshDeformationType,
typename>
665 const MeshDeformationType &
668 AssertThrow(has_matching_mesh_deformation_object<MeshDeformationType> (),
669 ExcMessage(
"You asked MeshDeformation::MeshDeformationHandler::get_matching_mesh_deformation_object() for a " 670 "mesh deformation object of type <" + boost::core::demangle(
typeid(MeshDeformationType).name()) +
"> " 671 "that could not be found in the current model. Activate this " 672 "mesh deformation in the input file."));
674 for (
const auto &object_iterator : mesh_deformation_objects)
675 for (
const auto &p : object_iterator.second)
676 if (Plugins::plugin_type_matches<MeshDeformationType>(*p))
677 return Plugins::get_plugin_as_type<MeshDeformationType>(*p);
680 typename std::vector<std::unique_ptr<Interface<dim>>>::const_iterator mesh_def;
681 return Plugins::get_plugin_as_type<MeshDeformationType>(*(*mesh_def));
705 #define ASPECT_REGISTER_MESH_DEFORMATION_MODEL(classname,name,description) \ 706 template class classname<2>; \ 707 template class classname<3>; \ 708 namespace ASPECT_REGISTER_MESH_DEFORMATION_MODEL_ ## classname \ 710 aspect::internal::Plugins::RegisterHelper<aspect::MeshDeformation::Interface<2>,classname<2>> \ 711 dummy_ ## classname ## _2d (&aspect::MeshDeformation::MeshDeformationHandler<2>::register_mesh_deformation, \ 712 name, description); \ 713 aspect::internal::Plugins::RegisterHelper<aspect::MeshDeformation::Interface<3>,classname<3>> \ 714 dummy_ ## classname ## _3d (&aspect::MeshDeformation::MeshDeformationHandler<3>::register_mesh_deformation, \ 715 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.")