17 :
libMesh::ParallelObject(other), _mortar_initd(false)
23 const std::pair<SubdomainID, SubdomainID> & subdomain_key,
28 const bool correct_edge_dropping,
29 const Real minimum_projection_angle)
44 auto periodic_map_iterator = periodic_map.find(boundary_key);
45 if (periodic_map_iterator != periodic_map.end() && periodic_map_iterator->second != periodic)
46 mooseError(
"We do not currently support enforcing both periodic and non-periodic constraints " 47 "on the same boundary primary-secondary pair");
49 periodic_map.insert(periodic_map_iterator, std::make_pair(boundary_key, periodic));
52 auto debug_flag_map_iterator = debug_flag_map.find(boundary_key);
53 if (debug_flag_map_iterator != debug_flag_map.end() && debug_flag_map_iterator->second != debug)
55 "We do not currently support generating and not generating debug output " 56 "on the same boundary primary-secondary surface pair. Please set debug_mesh = true for " 57 "all constraints sharing the same primary-secondary surface pairs");
59 debug_flag_map.insert(debug_flag_map_iterator, std::make_pair(boundary_key, debug));
62 if (mortar_interfaces.find(boundary_key) == mortar_interfaces.end())
65 mortar_interfaces.emplace(boundary_key,
73 correct_edge_dropping,
74 minimum_projection_angle));
76 it->second.initOutput();
91 std::vector<std::pair<SubdomainID, std::set<SubdomainID> *>> subdomains_to_probe;
94 subdomains_to_probe.push_back(std::make_pair(key1, &it1.first->second));
96 subdomains_to_probe.push_back(std::make_pair(key2, &it2.first->second));
98 for (
auto & pr : subdomains_to_probe)
100 for (
const Elem * lower_d_elem :
as_range(
mesh.active_local_subdomain_elements_begin(pr.first),
101 mesh.active_local_subdomain_elements_end(pr.first)))
103 const Elem * ip = lower_d_elem->interior_parent();
106 "Lower dimensional elements should always have an interior parent set when using mortar");
107 pr.second->insert(ip->subdomain_id());
117 const std::pair<SubdomainID, SubdomainID> & ,
118 bool on_displaced)
const 124 "The requested mortar interface AutomaticMortarGeneration object does not yet exist!");
132 "The requested mortar interface AutomaticMortarGeneration object does not yet exist!");
140 const std::pair<SubdomainID, SubdomainID> & subdomain_key,
145 boundary_key, subdomain_key, on_displaced));
152 update(mortar_pair.second);
154 update(mortar_pair.second);
172 const auto dim = amg.
dim();
187 mooseError(
"Invalid mesh dimension for mortar constraint");
193 const std::set<SubdomainID> &
199 "The lower dimensional ID ", lower_d_subdomain_id,
" has not been added to MortarData yet");
virtual MooseMesh & mesh()=0
void computeInactiveLMNodes()
Get list of secondary nodes that don't contribute to interaction with any primary element...
const AutomaticMortarGeneration & getMortarInterface(const std::pair< BoundaryID, BoundaryID > &boundary_key, const std::pair< SubdomainID, SubdomainID > &, bool on_displaced) const
Getter to retrieve the AutomaticMortarGeneration object corresponding to the boundary and subdomain k...
void clear()
Clears the mortar segment mesh and accompanying data structures.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Interface for notifications that the mortar mesh has been setup.
const std::set< SubdomainID > & getHigherDimSubdomainIDs(SubdomainID lower_d_subdomain_id) const
Returns the higher dimensional subdomain ids of the interior parents of the given lower-d subdomain i...
std::unordered_map< MortarKey, AutomaticMortarGeneration > _displaced_mortar_interfaces
Map from primary-secondary (in that order) boundary ID pair to the corresponding displaced AutomaticM...
void buildMortarSegmentMesh()
Builds the mortar segment mesh once the secondary and primary node projections have been completed...
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
const Parallel::Communicator & _communicator
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
MortarData(const libMesh::ParallelObject &other)
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
void projectSecondaryNodes()
Project secondary nodes (find xi^(2) values) to the closest points on the primary surface...
std::unordered_map< MortarKey, bool > _debug_flag_map
Map from undisplaced AMG key to whether the undisplaced AMG object is to output mortar segment mesh...
std::unordered_map< MortarKey, bool > _displaced_debug_flag_map
Map from displaced AMG key to whether the displaced AMG object is to output mortar segment mesh...
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
void projectPrimaryNodes()
(Inverse) project primary nodes to the points on the secondary surface where they would have come fro...
void createMortarInterface(const std::pair< BoundaryID, BoundaryID > &boundary_key, const std::pair< SubdomainID, SubdomainID > &subdomain_key, SubProblem &subproblem, bool on_displaced, bool periodic, const bool debug, const bool correct_edge_dropping, const Real minimum_projection_angle)
Create mortar generation object.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
void buildNodeToElemMaps()
Once the secondary_requested_boundary_ids and primary_requested_boundary_ids containers have been fil...
std::unordered_map< SubdomainID, std::set< SubdomainID > > _lower_d_sub_to_higher_d_subs
Map from lower dimensional subdomain ids to corresponding higher simensional subdomain ids (e...
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
std::unordered_map< MortarKey, bool > _displaced_periodic_map
Map from displaced AMG key to whether the displaced AMG object is enforcing periodic constraints...
std::unordered_map< MortarKey, bool > _periodic_map
Map from undisplaced AMG key to whether the undisplaced AMG object is enforcing periodic constraints...
void computeNodalGeometry()
Computes and stores the nodal normal/tangent vectors in a local data structure instead of using the E...
void notifyWhenMortarSetup(MortarExecutorInterface *mei)
Adds mei to the container of objects that will have their mortarSetup method called as soon as the mo...
void buildMortarSegmentMesh3d()
Builds the mortar segment mesh once the secondary and primary node projections have been completed...
std::unordered_map< MortarKey, AutomaticMortarGeneration > _mortar_interfaces
Map from primary-secondary (in that order) boundary ID pair to the corresponding undisplaced Automati...
void update()
Builds mortar segment meshes for each mortar interface.
void dontNotifyWhenMortarSetup(MortarExecutorInterface *mei)
Removes mei from the container of objects that will have their mortarSetup method called as soon as t...
Generic class for solving transient nonlinear problems.
std::set< BoundaryID > _mortar_boundary_coverage
A set containing the boundary ids covered by all the mortar interfaces in this MortarData object...
std::set< MortarExecutorInterface * > _mei_objs
A container of objects for whom the mortarSetup method will be called after the mortar mesh has been ...
std::set< SubdomainID > _mortar_subdomain_coverage
A set containing the subdomain ids covered by all the mortar interfaces in this MortarData object...
void computeInactiveLMElems()
Get list of secondary elems without any corresponding primary elements.
void set_union(T &data, const unsigned int root_id) const
bool _mortar_initd
Whether we have performed any mortar mesh construction.