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 "MooseTypes.h"
13 #include "MooseHashing.h"
14 
15 #include "libmesh/parallel_object.h"
16 
17 #include <unordered_map>
18 #include <set>
19 
20 class SubProblem;
23 
25 {
26 public:
28 
43  void createMortarInterface(const std::pair<BoundaryID, BoundaryID> & boundary_key,
44  const std::pair<SubdomainID, SubdomainID> & subdomain_key,
45  SubProblem & subproblem,
46  bool on_displaced,
47  bool periodic,
48  const bool debug,
49  const bool correct_edge_dropping,
50  const Real minimum_projection_angle);
51 
57  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & boundary_key,
58  const std::pair<SubdomainID, SubdomainID> & /*subdomain_key*/,
59  bool on_displaced) const;
60 
66  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & boundary_key,
67  const std::pair<SubdomainID, SubdomainID> & /*subdomain_key*/,
68  bool on_displaced);
69 
73  const std::unordered_map<std::pair<BoundaryID, BoundaryID>,
74  std::unique_ptr<AutomaticMortarGeneration>> &
75  getMortarInterfaces(bool on_displaced) const
76  {
77  if (on_displaced)
79  else
80  return _mortar_interfaces;
81  }
82 
86  const std::set<SubdomainID> & getMortarSubdomainIDs() const { return _mortar_subdomain_coverage; }
87 
91  const std::set<BoundaryID> & getMortarBoundaryIDs() const { return _mortar_boundary_coverage; }
92 
96  void update();
97 
101  bool hasDisplacedObjects() const { return _displaced_mortar_interfaces.size(); }
102 
106  bool hasObjects() const { return _mortar_interfaces.size(); }
107 
112  const std::set<SubdomainID> & getHigherDimSubdomainIDs(SubdomainID lower_d_subdomain_id) const;
113 
119 
125 
129  bool initialized() const { return _mortar_initd; }
130 
131 private:
135  void update(AutomaticMortarGeneration & amg);
136 
137  typedef std::pair<BoundaryID, BoundaryID> MortarKey;
138 
141  std::unordered_map<MortarKey, std::unique_ptr<AutomaticMortarGeneration>> _mortar_interfaces;
142 
145  std::unordered_map<MortarKey, std::unique_ptr<AutomaticMortarGeneration>>
147 
150  std::set<SubdomainID> _mortar_subdomain_coverage;
151 
154  std::set<BoundaryID> _mortar_boundary_coverage;
155 
157  std::unordered_map<MortarKey, bool> _periodic_map;
158 
160  std::unordered_map<MortarKey, bool> _displaced_periodic_map;
161 
163  std::unordered_map<MortarKey, bool> _debug_flag_map;
164 
166  std::unordered_map<MortarKey, bool> _displaced_debug_flag_map;
167 
170  std::unordered_map<SubdomainID, std::set<SubdomainID>> _lower_d_sub_to_higher_d_subs;
171 
174  std::set<MortarExecutorInterface *> _mei_objs;
175 
178 };
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)
Create mortar generation object.
const std::unordered_map< std::pair< BoundaryID, BoundaryID >, std::unique_ptr< AutomaticMortarGeneration > > & getMortarInterfaces(bool on_displaced) const
Return all automatic mortar generation objects on either the displaced or undisplaced mesh...
std::unordered_map< MortarKey, std::unique_ptr< AutomaticMortarGeneration > > _displaced_mortar_interfaces
Map from primary-secondary (in that order) boundary ID pair to the corresponding displaced AutomaticM...
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...
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 ...
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...
bool _mortar_initd
Whether we have performed any mortar mesh construction.
const std::set< BoundaryID > & getMortarBoundaryIDs() const
Returns the mortar covered boundaries.
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
void notifyWhenMortarSetup(MortarExecutorInterface *mei)
Adds mei to the container of objects that will have their mortarSetup method called as soon as the mo...
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< SubdomainID, std::set< SubdomainID > > _lower_d_sub_to_higher_d_subs
Map from lower dimensional subdomain ids to corresponding higher simensional subdomain ids (e...
const std::set< SubdomainID > & getMortarSubdomainIDs() const
Returns the mortar covered subdomains.
std::unordered_map< MortarKey, std::unique_ptr< 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.
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...
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...
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.
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...
MortarInterfaceWarehouse(const libMesh::ParallelObject &other)