22 #ifndef _aspect_mesh_deformation_interface_h 23 #define _aspect_mesh_deformation_interface_h 36 #include <deal.II/multigrid/mg_transfer_global_coarsening.templates.h> 76 namespace MeshDeformation
94 virtual bool needs_surface_stabilization()
const;
122 compute_initial_deformation_as_constraints(
const Mapping<dim> &mapping,
136 compute_velocity_constraints_on_boundary(
const DoFHandler<dim> &mesh_deformation_dof_handler,
138 const std::set<types::boundary_id> &boundary_ids)
const;
158 const unsigned int compositional_field)
const;
235 template <
class Archive>
236 void save (Archive &ar,
237 const unsigned int version)
const;
243 template <
class Archive>
244 void load (Archive &ar,
245 const unsigned int version);
247 BOOST_SERIALIZATION_SPLIT_MEMBER()
268 register_mesh_deformation
269 (
const std::string &name,
270 const std::string &description,
278 const std::map<types::boundary_id, std::vector<std::string>> &
279 get_active_mesh_deformation_names ()
const;
285 const std::map<types::boundary_id,std::vector<std::unique_ptr<Interface<dim>>>> &
286 get_active_mesh_deformation_models ()
const;
292 const std::set<types::boundary_id> &
293 get_active_mesh_deformation_boundary_indicators ()
const;
300 const std::set<types::boundary_id> &
301 get_tangential_velocity_with_active_mesh_deformation_boundary_indicators ()
const;
308 const std::set<types::boundary_id> &
309 get_tangential_velocity_without_active_mesh_deformation_boundary_indicators ()
const;
315 const std::set<types::boundary_id> &
316 get_boundary_indicators_requiring_stabilization ()
const;
323 const std::set<types::boundary_id> &
324 get_free_surface_boundary_indicators ()
const;
329 double get_free_surface_theta ()
const;
346 get_initial_topography ()
const;
353 get_mesh_displacements ()
const;
359 get_mesh_deformation_dof_handler ()
const;
370 template <
typename MeshDeformationType,
371 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshDeformationType>::value>>
373 has_matching_mesh_deformation_object ()
const;
386 template <
typename MeshDeformationType,
387 typename =
typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshDeformationType>::value>>
388 const MeshDeformationType &
389 get_matching_mesh_deformation_object ()
const;
398 get_level_mapping(
const unsigned int level)
const;
410 const unsigned int compositional_field)
const;
430 <<
"Could not find entry <" 432 <<
"> among the names of registered mesh deformation objects.");
446 void make_initial_constraints (
const double initial_deformation_scale);
460 void make_constraints ();
466 void compute_mesh_displacements ();
472 void compute_mesh_displacements_gmg ();
482 unsigned int get_mapping_degree ()
const;
489 template <
unsigned int mesh_deformation_fe_degree>
490 void compute_mesh_displacements_gmg_for_degree();
498 void check_mesh_deformation ();
504 template <
unsigned int mesh_deformation_fe_degree,
505 typename SystemOperatorType>
506 void solve_mesh_deformation_local_smoothing(
507 const SystemOperatorType &laplace_operator,
508 const ::LinearAlgebra::distributed::Vector<double> &rhs,
515 void setup_local_smoothing_multigrid();
532 void set_initial_topography ();
537 void interpolate_mesh_velocity ();
543 void update_local_smoothing_multigrid();
739 template <
class Archive>
741 const unsigned int)
const 746 std::map<std::string,std::string> saved_text;
747 for (
const auto &boundary_id_and_mesh_deformation_objects : mesh_deformation_objects)
748 for (
const auto &p : boundary_id_and_mesh_deformation_objects.second)
749 p->
save (saved_text);
756 template <
class Archive>
764 std::map<std::string,std::string> saved_text;
767 for (
const auto &boundary_id_and_mesh_deformation_objects : mesh_deformation_objects)
768 for (
const auto &p : boundary_id_and_mesh_deformation_objects.second)
769 p->
load (saved_text);
776 template <
typename MeshDeformationType,
typename>
781 for (
const auto &object_iterator : mesh_deformation_objects)
782 for (
const auto &p : object_iterator.second)
783 if (Plugins::plugin_type_matches<MeshDeformationType>(*p))
792 template <
typename MeshDeformationType,
typename>
794 const MeshDeformationType &
797 AssertThrow(has_matching_mesh_deformation_object<MeshDeformationType> (),
798 ExcMessage(
"You asked MeshDeformation::MeshDeformationHandler::get_matching_mesh_deformation_object() for a " 799 "mesh deformation object of type <" + boost::core::demangle(
typeid(MeshDeformationType).name()) +
"> " 800 "that could not be found in the current model. Activate this " 801 "mesh deformation in the input file."));
803 for (
const auto &object_iterator : mesh_deformation_objects)
804 for (
const auto &p : object_iterator.second)
805 if (Plugins::plugin_type_matches<MeshDeformationType>(*p))
806 return Plugins::get_plugin_as_type<MeshDeformationType>(*p);
809 typename std::vector<std::unique_ptr<Interface<dim>>>::const_iterator mesh_def;
810 return Plugins::get_plugin_as_type<MeshDeformationType>(*(*mesh_def));
834 #define ASPECT_REGISTER_MESH_DEFORMATION_MODEL(classname,name,description) \ 835 template class classname<2>; \ 836 template class classname<3>; \ 837 namespace ASPECT_REGISTER_MESH_DEFORMATION_MODEL_ ## classname \ 839 aspect::internal::Plugins::RegisterHelper<aspect::MeshDeformation::Interface<2>,classname<2>> \ 840 dummy_ ## classname ## _2d (&aspect::MeshDeformation::MeshDeformationHandler<2>::register_mesh_deformation, \ 841 name, description); \ 842 aspect::internal::Plugins::RegisterHelper<aspect::MeshDeformation::Interface<3>,classname<3>> \ 843 dummy_ ## classname ## _3d (&aspect::MeshDeformation::MeshDeformationHandler<3>::register_mesh_deformation, \ 844 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.")