www.mooseframework.org
MortarData.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
13 #include "MooseHashing.h"
14 
15 #include "libmesh/parallel_object.h"
16 
17 #include <unordered_map>
18 #include <set>
19 
20 class SubProblem;
22 
24 {
25 public:
26  MortarData(const libMesh::ParallelObject & other);
27 
42  void createMortarInterface(const std::pair<BoundaryID, BoundaryID> & boundary_key,
43  const std::pair<SubdomainID, SubdomainID> & subdomain_key,
44  SubProblem & subproblem,
45  bool on_displaced,
46  bool periodic,
47  const bool debug,
48  const bool correct_edge_dropping,
49  const Real minimum_projection_angle);
50 
56  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & boundary_key,
57  const std::pair<SubdomainID, SubdomainID> & /*subdomain_key*/,
58  bool on_displaced) const;
59 
65  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & boundary_key,
66  const std::pair<SubdomainID, SubdomainID> & /*subdomain_key*/,
67  bool on_displaced);
68 
72  const std::unordered_map<std::pair<BoundaryID, BoundaryID>, AutomaticMortarGeneration> &
73  getMortarInterfaces(bool on_displaced) const
74  {
75  if (on_displaced)
77  else
78  return _mortar_interfaces;
79  }
80 
84  const std::set<SubdomainID> & getMortarSubdomainIDs() const { return _mortar_subdomain_coverage; }
85 
89  const std::set<BoundaryID> & getMortarBoundaryIDs() const { return _mortar_boundary_coverage; }
90 
94  void update();
95 
99  bool hasDisplacedObjects() const { return _displaced_mortar_interfaces.size(); }
100 
104  bool hasObjects() const { return _mortar_interfaces.size(); }
105 
110  const std::set<SubdomainID> & getHigherDimSubdomainIDs(SubdomainID lower_d_subdomain_id) const;
111 
117 
123 
127  bool initialized() const { return _mortar_initd; }
128 
129 private:
133  void update(AutomaticMortarGeneration & amg);
134 
135  typedef std::pair<BoundaryID, BoundaryID> MortarKey;
136 
139  std::unordered_map<MortarKey, AutomaticMortarGeneration> _mortar_interfaces;
140 
143  std::unordered_map<MortarKey, AutomaticMortarGeneration> _displaced_mortar_interfaces;
144 
147  std::set<SubdomainID> _mortar_subdomain_coverage;
148 
151  std::set<BoundaryID> _mortar_boundary_coverage;
152 
154  std::unordered_map<MortarKey, bool> _periodic_map;
155 
157  std::unordered_map<MortarKey, bool> _displaced_periodic_map;
158 
160  std::unordered_map<MortarKey, bool> _debug_flag_map;
161 
163  std::unordered_map<MortarKey, bool> _displaced_debug_flag_map;
164 
167  std::unordered_map<SubdomainID, std::set<SubdomainID>> _lower_d_sub_to_higher_d_subs;
168 
171  std::set<MortarExecutorInterface *> _mei_objs;
172 
175 };
const std::set< BoundaryID > & getMortarBoundaryIDs() const
Returns the mortar covered boundaries.
Definition: MortarData.h:89
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...
Definition: MortarData.C:116
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...
Definition: MortarData.C:194
std::unordered_map< MortarKey, AutomaticMortarGeneration > _displaced_mortar_interfaces
Map from primary-secondary (in that order) boundary ID pair to the corresponding displaced AutomaticM...
Definition: MortarData.h:143
bool initialized() const
Definition: MortarData.h:127
MortarData(const libMesh::ParallelObject &other)
Definition: MortarData.C:16
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...
Definition: MortarData.h:160
const std::unordered_map< std::pair< BoundaryID, BoundaryID >, AutomaticMortarGeneration > & getMortarInterfaces(bool on_displaced) const
Return all automatic mortar generation objects on either the displaced or undisplaced mesh...
Definition: MortarData.h:73
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...
Definition: MortarData.h:163
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
bool hasObjects() const
Returns whether we have any active AutomaticMortarGeneration objects.
Definition: MortarData.h:104
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.
Definition: MortarData.C:22
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...
Definition: MortarData.h:167
std::unordered_map< MortarKey, bool > _displaced_periodic_map
Map from displaced AMG key to whether the displaced AMG object is enforcing periodic constraints...
Definition: MortarData.h:157
const std::set< SubdomainID > & getMortarSubdomainIDs() const
Returns the mortar covered subdomains.
Definition: MortarData.h:84
std::unordered_map< MortarKey, bool > _periodic_map
Map from undisplaced AMG key to whether the undisplaced AMG object is enforcing periodic constraints...
Definition: MortarData.h:154
subdomain_id_type SubdomainID
void notifyWhenMortarSetup(MortarExecutorInterface *mei)
Adds mei to the container of objects that will have their mortarSetup method called as soon as the mo...
Definition: MortarData.C:204
std::unordered_map< MortarKey, AutomaticMortarGeneration > _mortar_interfaces
Map from primary-secondary (in that order) boundary ID pair to the corresponding undisplaced Automati...
Definition: MortarData.h:139
void update()
Builds mortar segment meshes for each mortar interface.
Definition: MortarData.C:149
void dontNotifyWhenMortarSetup(MortarExecutorInterface *mei)
Removes mei from the container of objects that will have their mortarSetup method called as soon as t...
Definition: MortarData.C:210
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:75
std::pair< BoundaryID, BoundaryID > MortarKey
Definition: MortarData.h:135
bool hasDisplacedObjects() const
Returns whether any of the AutomaticMortarGeneration objects are running on a displaced mesh...
Definition: MortarData.h:99
std::set< BoundaryID > _mortar_boundary_coverage
A set containing the boundary ids covered by all the mortar interfaces in this MortarData object...
Definition: MortarData.h:151
std::set< MortarExecutorInterface * > _mei_objs
A container of objects for whom the mortarSetup method will be called after the mortar mesh has been ...
Definition: MortarData.h:171
std::set< SubdomainID > _mortar_subdomain_coverage
A set containing the subdomain ids covered by all the mortar interfaces in this MortarData object...
Definition: MortarData.h:147
bool _mortar_initd
Whether we have performed any mortar mesh construction.
Definition: MortarData.h:174