https://mooseframework.inl.gov
MortarInterfaceWarehouse.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "Mortar3DSubpatchPlane.h"
13 #include "MooseTypes.h"
14 #include "MooseHashing.h"
15 #include "MortarSegmentInfo.h"
16 
17 #include "libmesh/parallel_object.h"
18 
19 #include <memory>
20 #include <unordered_map>
21 #include <set>
22 #include <string>
23 
24 class SubProblem;
27 class MooseEnum;
28 
36 {
37  std::unique_ptr<AutomaticMortarGeneration> amg;
38  bool periodic;
39  bool debug;
41  Mortar3DSubpatchPlane mortar_3d_subpatch_plane;
44  Mortar3DQuadraturePointMapping mortar_3d_qp_mapping;
45 };
46 
48 {
49 public:
51 
71  void createMortarInterface(const std::pair<BoundaryID, BoundaryID> & boundary_key,
72  const std::pair<SubdomainID, SubdomainID> & subdomain_key,
73  SubProblem & subproblem,
74  bool on_displaced,
75  bool periodic,
76  const bool debug,
77  const bool correct_edge_dropping,
78  const Real minimum_projection_angle,
79  const Mortar3DSubpatchPlane mortar_3d_subpatch_plane,
80  const MooseEnum & triangulation,
81  const bool triangulate_triangles,
82  const Mortar3DQuadraturePointMapping mortar_3d_qp_mapping =
83  Mortar3DQuadraturePointMapping::NORMAL_PROJECTION);
84 
90  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & boundary_key,
91  const std::pair<SubdomainID, SubdomainID> & /*subdomain_key*/,
92  bool on_displaced) const;
93 
99  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & boundary_key,
100  const std::pair<SubdomainID, SubdomainID> & /*subdomain_key*/,
101  bool on_displaced);
102 
108  const std::unordered_map<std::pair<BoundaryID, BoundaryID>, MortarInterfaceConfig> &
109  getMortarInterfaces(bool on_displaced) const
110  {
111  if (on_displaced)
113  else
114  return _mortar_interfaces;
115  }
116 
120  const std::set<SubdomainID> & getMortarSubdomainIDs() const { return _mortar_subdomain_coverage; }
121 
125  const std::set<BoundaryID> & getMortarBoundaryIDs() const { return _mortar_boundary_coverage; }
126 
130  void update();
131 
136  void meshChanged();
137 
141  bool hasDisplacedObjects() const { return _displaced_mortar_interfaces.size(); }
142 
146  bool hasObjects() const { return _mortar_interfaces.size(); }
147 
152  const std::set<SubdomainID> & getHigherDimSubdomainIDs(SubdomainID lower_d_subdomain_id) const;
153 
159 
165 
169  bool initialized() const { return _mortar_initd; }
170 
171 private:
175  void update(AutomaticMortarGeneration & amg);
176 
177  typedef std::pair<BoundaryID, BoundaryID> MortarKey;
178 
181  std::unordered_map<MortarKey, MortarInterfaceConfig> _mortar_interfaces;
182 
185  std::unordered_map<MortarKey, MortarInterfaceConfig> _displaced_mortar_interfaces;
186 
189  std::set<SubdomainID> _mortar_subdomain_coverage;
190 
193  std::set<BoundaryID> _mortar_boundary_coverage;
194 
197  std::unordered_map<SubdomainID, std::set<SubdomainID>> _lower_d_sub_to_higher_d_subs;
198 
201  std::set<MortarExecutorInterface *> _mei_objs;
202 
205 };
void dontNotifyWhenMortarSetup(MortarExecutorInterface *mei)
Removes mei from the container of objects that will have their mortarSetup method called as soon as t...
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, const Mortar3DSubpatchPlane mortar_3d_subpatch_plane, const MooseEnum &triangulation, const bool triangulate_triangles, const Mortar3DQuadraturePointMapping mortar_3d_qp_mapping=Mortar3DQuadraturePointMapping::NORMAL_PROJECTION)
Create mortar generation object.
Interface for notifications that the mortar mesh has been setup.
std::set< MortarExecutorInterface * > _mei_objs
A container of objects for whom the mortarSetup method will be called after the mortar mesh has been ...
MortarSegmentTriangulationMode triangulation
bool _mortar_initd
Whether we have performed any mortar mesh construction.
const std::set< BoundaryID > & getMortarBoundaryIDs() const
Returns the mortar covered boundaries.
Per-mortar-interface configuration.
Mortar3DSubpatchPlane mortar_3d_subpatch_plane
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
MortarSegmentTriangulationMode
void notifyWhenMortarSetup(MortarExecutorInterface *mei)
Adds mei to the container of objects that will have their mortarSetup method called as soon as the mo...
Mortar3DQuadraturePointMapping mortar_3d_qp_mapping
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...
const std::unordered_map< std::pair< BoundaryID, BoundaryID >, MortarInterfaceConfig > & getMortarInterfaces(bool on_displaced) const
Return the per-interface configuration map (AutomaticMortarGeneration object plus the associated user...
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...
std::unordered_map< MortarKey, MortarInterfaceConfig > _mortar_interfaces
Map from primary-secondary (in that order) boundary ID pair to the configuration of the undisplaced m...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:54
const std::set< SubdomainID > & getMortarSubdomainIDs() const
Returns the mortar covered subdomains.
void update()
Builds mortar segment meshes for each mortar interface.
std::pair< BoundaryID, BoundaryID > MortarKey
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
std::set< SubdomainID > _mortar_subdomain_coverage
A set containing the subdomain ids covered by all the mortar interfaces in this MortarInterfaceWareho...
std::unordered_map< MortarKey, MortarInterfaceConfig > _displaced_mortar_interfaces
Map from primary-secondary (in that order) boundary ID pair to the configuration of the displaced mor...
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...
bool hasObjects() const
Returns whether we have any active AutomaticMortarGeneration objects.
void meshChanged()
Invalidates cached MSM node/element ID offsets on all mortar interfaces so they are recomputed on the...
bool hasDisplacedObjects() const
Returns whether any of the AutomaticMortarGeneration objects are running on a displaced mesh...
std::set< BoundaryID > _mortar_boundary_coverage
A set containing the boundary ids covered by all the mortar interfaces in this MortarInterfaceWarehou...
std::unique_ptr< AutomaticMortarGeneration > amg
MortarInterfaceWarehouse(const libMesh::ParallelObject &other)