16 #ifndef _aspect_mesh_deformation_interface_h 17 #define _aspect_mesh_deformation_interface_h 31 #include <deal.II/multigrid/mg_transfer_global_coarsening.templates.h> 71 namespace MeshDeformation
89 virtual bool needs_surface_stabilization()
const;
117 compute_initial_deformation_as_constraints(
const Mapping<dim> &mapping,
131 compute_velocity_constraints_on_boundary(
const DoFHandler<dim> &mesh_deformation_dof_handler,
133 const std::set<types::boundary_id> &boundary_ids)
const;
153 const unsigned int compositional_field)
const;
230 template <
class Archive>
231 void save (Archive &ar,
232 const unsigned int version)
const;
238 template <
class Archive>
239 void load (Archive &ar,
240 const unsigned int version);
242 BOOST_SERIALIZATION_SPLIT_MEMBER()
263 register_mesh_deformation
264 (
const std::string &name,
265 const std::string &description,
273 const std::map<types::boundary_id, std::vector<std::string>> &
274 get_active_mesh_deformation_names ()
const;
280 const std::map<types::boundary_id,std::vector<std::unique_ptr<Interface<dim>>>> &
281 get_active_mesh_deformation_models ()
const;
287 const std::set<types::boundary_id> &
288 get_active_mesh_deformation_boundary_indicators ()
const;
295 const std::set<types::boundary_id> &
296 get_tangential_velocity_with_active_mesh_deformation_boundary_indicators ()
const;
303 const std::set<types::boundary_id> &
304 get_tangential_velocity_without_active_mesh_deformation_boundary_indicators ()
const;
310 const std::set<types::boundary_id> &
311 get_boundary_indicators_requiring_stabilization ()
const;
318 const std::set<types::boundary_id> &
319 get_free_surface_boundary_indicators ()
const;
324 double get_free_surface_theta ()
const;
341 get_initial_topography ()
const;
348 get_mesh_displacements ()
const;
354 get_mesh_deformation_dof_handler ()
const;
365 template <
typename MeshDeformationType,
366 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshDeformationType>::value>>
368 has_matching_mesh_deformation_object ()
const;
381 template <
typename MeshDeformationType,
382 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshDeformationType>::value>>
383 const MeshDeformationType &
384 get_matching_mesh_deformation_object ()
const;
393 get_level_mapping(
const unsigned int level)
const;
405 const unsigned int compositional_field)
const;
425 <<
"Could not find entry <" 427 <<
"> among the names of registered mesh deformation objects.");
441 void make_initial_constraints (
const double initial_deformation_scale);
455 void make_constraints ();
461 void compute_mesh_displacements ();
467 void compute_mesh_displacements_gmg ();
477 unsigned int get_mapping_degree ()
const;
484 template <
unsigned int mesh_deformation_fe_degree>
485 void compute_mesh_displacements_gmg_for_degree();
493 void check_mesh_deformation ();
499 template <
unsigned int mesh_deformation_fe_degree,
500 typename SystemOperatorType>
501 void solve_mesh_deformation_local_smoothing(
502 const SystemOperatorType &laplace_operator,
503 const ::LinearAlgebra::distributed::Vector<double> &rhs,
510 template <
unsigned int mesh_deformation_fe_degree,
511 typename SystemOperatorType>
512 void solve_mesh_deformation_global_coarsening(
513 const SystemOperatorType &laplace_operator,
514 const ::LinearAlgebra::distributed::Vector<double> &rhs,
523 std::set<types::boundary_id>
524 get_dirichlet_mesh_deformation_boundary_ids()
const;
532 create_distributed_mesh_displacements()
const;
538 void setup_local_smoothing_multigrid();
544 void setup_global_coarsening_multigrid();
561 void set_initial_topography ();
566 void interpolate_mesh_velocity ();
572 void update_local_smoothing_multigrid();
578 void update_global_coarsening_multigrid();
813 template <
class Archive>
815 const unsigned int)
const 820 std::map<std::string,std::string> saved_text;
821 for (
const auto &boundary_id_and_mesh_deformation_objects : mesh_deformation_objects)
822 for (
const auto &p : boundary_id_and_mesh_deformation_objects.second)
823 p->
save (saved_text);
830 template <
class Archive>
838 std::map<std::string,std::string> saved_text;
841 for (
const auto &boundary_id_and_mesh_deformation_objects : mesh_deformation_objects)
842 for (
const auto &p : boundary_id_and_mesh_deformation_objects.second)
843 p->
load (saved_text);
850 template <
typename MeshDeformationType,
typename>
855 for (
const auto &object_iterator : mesh_deformation_objects)
856 for (
const auto &p : object_iterator.second)
857 if (Plugins::plugin_type_matches<MeshDeformationType>(*p))
866 template <
typename MeshDeformationType,
typename>
868 const MeshDeformationType &
871 AssertThrow(has_matching_mesh_deformation_object<MeshDeformationType> (),
872 ExcMessage(
"You asked MeshDeformation::MeshDeformationHandler::get_matching_mesh_deformation_object() for a " 873 "mesh deformation object of type <" + boost::core::demangle(
typeid(MeshDeformationType).name()) +
"> " 874 "that could not be found in the current model. Activate this " 875 "mesh deformation in the input file."));
877 for (
const auto &object_iterator : mesh_deformation_objects)
878 for (
const auto &p : object_iterator.second)
879 if (Plugins::plugin_type_matches<MeshDeformationType>(*p))
880 return Plugins::get_plugin_as_type<MeshDeformationType>(*p);
883 typename std::vector<std::unique_ptr<Interface<dim>>>::const_iterator mesh_def;
884 return Plugins::get_plugin_as_type<MeshDeformationType>(*(*mesh_def));
908 #define ASPECT_REGISTER_MESH_DEFORMATION_MODEL(classname,name,description) \ 909 template class classname<2>; \ 910 template class classname<3>; \ 911 namespace ASPECT_REGISTER_MESH_DEFORMATION_MODEL_ ## classname \ 913 aspect::internal::Plugins::RegisterHelper<aspect::MeshDeformation::Interface<2>,classname<2>> \ 914 dummy_ ## classname ## _2d (&aspect::MeshDeformation::MeshDeformationHandler<2>::register_mesh_deformation, \ 915 name, description); \ 916 aspect::internal::Plugins::RegisterHelper<aspect::MeshDeformation::Interface<3>,classname<3>> \ 917 dummy_ ## classname ## _3d (&aspect::MeshDeformation::MeshDeformationHandler<3>::register_mesh_deformation, \ 918 name, description); \
virtual void parse_parameters(ParameterHandler &prm)
std::vector< index_type > data
ApplyStabilization(const double stabilization_theta)
#define AssertThrow(cond, exc)
void write_plugin_graph(std::ostream &output_stream)
virtual void load(const std::map< std::string, std::string > &status_strings)
const double free_surface_theta
std::string get_valid_model_names_pattern()
static ::ExceptionBase & ExcMessage(std::string arg1)
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)
ObserverPointer< const Simulator< dim >, SimulatorAccess< dim > > simulator
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.")