https://mooseframework.inl.gov
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MeshAlignment Class Reference

Builds mapping between two aligned subdomains/boundaries. More...

#include <MeshAlignment.h>

Inheritance diagram for MeshAlignment:
[legend]

Public Member Functions

 MeshAlignment (const MooseMesh &mesh)
 Constructor. More...
 
void initialize (const std::vector< dof_id_type > &primary_elem_ids, const std::vector< std::tuple< dof_id_type, unsigned short int >> &secondary_boundary_info)
 Extracts mesh information and builds the mapping. More...
 
void initialize (const std::vector< std::tuple< dof_id_type, unsigned short int >> &primary_boundary_info, const std::vector< std::tuple< dof_id_type, unsigned short int >> &secondary_boundary_info)
 Extracts mesh information and builds the mapping. More...
 
void buildCoupledElemQpIndexMap (Assembly &assembly)
 Builds the map used for getting the coupled quadrature point index. More...
 
bool meshesAreCoincident () const
 Returns true if the primary and secondary meshes are coincident. More...
 
bool hasCoupledElemID (const dof_id_type &elem_id) const
 Returns true if the element ID has a coupled element ID. More...
 
const dof_id_typegetCoupledElemID (const dof_id_type &elem_id) const
 Gets the coupled element ID for a given element ID. More...
 
bool hasCoupledNodeID (const dof_id_type &node_id) const
 Returns true if the node ID has a coupled node ID. More...
 
const dof_id_typegetCoupledNodeID (const dof_id_type &node_id) const
 Gets the coupled node ID for a given node ID. More...
 
unsigned int getCoupledElemQpIndex (const dof_id_type &elem_id, const unsigned int &qp) const
 Gets the quadrature point index on the coupled element corresponding to the quadrature point index on the provided primary element. More...
 
const std::vector< dof_id_type > & getPrimaryElemIDs () const
 Returns the list of element IDs on the primary boundary. More...
 
const std::vector< dof_id_type > & getSecondaryElemIDs () const
 Returns the list of element IDs on the secondary boundary. More...
 
bool meshesAreAligned () const
 Returns true if the primary and secondary meshes are aligned. More...
 

Protected Member Functions

void buildMapping ()
 Builds the mapping using the extracted mesh information. More...
 
std::map< dof_id_type, std::vector< Point > > getLocalQuadraturePointMap (Assembly &assembly, const std::vector< dof_id_type > &elem_ids, const std::vector< unsigned short int > &side_ids) const
 Gets the local quadrature point map for the primary or secondary side. More...
 
void extractFrom1DElements (const std::vector< dof_id_type > &elem_ids, std::vector< Point > &elem_points, std::vector< dof_id_type > &node_ids, std::vector< Point > &node_points) const
 Extracts mesh information from 1D elements. More...
 
void extractFromBoundaryInfo (const std::vector< std::tuple< dof_id_type, unsigned short int >> &boundary_info, std::vector< dof_id_type > &elem_ids, std::vector< unsigned short int > &side_ids, std::vector< Point > &side_points, std::vector< dof_id_type > &node_ids, std::vector< Point > &node_points) const
 Extracts mesh information from boundary info. More...
 

Protected Attributes

std::map< dof_id_type, dof_id_type_coupled_elem_ids
 Map of element ID to coupled element ID. More...
 
std::map< dof_id_type, dof_id_type_coupled_node_ids
 Map of node ID to coupled node ID. More...
 
std::map< dof_id_type, std::vector< unsigned int > > _coupled_elem_qp_indices
 Map of element ID to vector of coupled quadrature points. More...
 
bool _meshes_are_coincident
 Flag that meshes are coincident. More...
 
const MooseMesh_mesh
 Mesh. More...
 
std::vector< dof_id_type_primary_elem_ids
 List of primary element IDs. More...
 
std::vector< dof_id_type_secondary_elem_ids
 List of secondary element IDs. More...
 
std::vector< Point > _primary_elem_points
 List of primary element points. More...
 
std::vector< Point > _secondary_elem_points
 List of secondary element points. More...
 
std::vector< unsigned short int_primary_side_ids
 List of primary side IDs (if any) More...
 
std::vector< unsigned short int_secondary_side_ids
 List of secondary side IDs (if any) More...
 
std::vector< dof_id_type_primary_node_ids
 List of primary node IDs. More...
 
std::vector< dof_id_type_secondary_node_ids
 List of secondary node IDs. More...
 
std::vector< Point > _primary_node_points
 List of primary node points. More...
 
std::vector< Point > _secondary_node_points
 List of secondary node points. More...
 
bool _meshes_are_aligned
 Flag that meshes are aligned. More...
 

Detailed Description

Builds mapping between two aligned subdomains/boundaries.

This class handles cases where there is a 1:1 mapping between elements on the primary and secondary meshes:

Definition at line 24 of file MeshAlignment.h.

Constructor & Destructor Documentation

◆ MeshAlignment()

MeshAlignment::MeshAlignment ( const MooseMesh mesh)

Constructor.

Parameters
mesh[in]mesh Mesh

Definition at line 16 of file MeshAlignment.C.

18 {
19 }
bool _meshes_are_coincident
Flag that meshes are coincident.
MeshAlignmentBase(const MooseMesh &mesh)
Constructor.

Member Function Documentation

◆ buildCoupledElemQpIndexMap()

void MeshAlignment::buildCoupledElemQpIndexMap ( Assembly assembly)

Builds the map used for getting the coupled quadrature point index.

This method needs the assembly object, so it needs to be called from an object that has assembly access (components do not).

Parameters
assemblyThe assembly object

Definition at line 128 of file MeshAlignment.C.

Referenced by FlowChannelHeatStructureCouplerUserObject::FlowChannelHeatStructureCouplerUserObject(), and HeatFluxFromHeatStructureBaseUserObject::HeatFluxFromHeatStructureBaseUserObject().

129 {
130  // get local quadrature point maps on each side
131  std::map<dof_id_type, std::vector<Point>> primary_qp_map =
133  std::map<dof_id_type, std::vector<Point>> secondary_qp_map =
135 
136  // build mapping
137  for (const auto & primary_elem_id : _primary_elem_ids)
138  {
139  const Elem * primary_elem = _mesh.queryElemPtr(primary_elem_id);
140  // The PID check is needed to exclude ghost elements, since those don't
141  // necessarily have a coupled element on this processor:
142  if (primary_elem && primary_elem->processor_id() == _mesh.processor_id())
143  {
144  std::vector<Point> & primary_qps = primary_qp_map[primary_elem_id];
145 
146  const dof_id_type secondary_elem_id = getCoupledElemID(primary_elem_id);
147  std::vector<Point> & secondary_qps = secondary_qp_map[secondary_elem_id];
148 
149  mooseAssert(primary_qps.size() == secondary_qps.size(),
150  "The numbers of quadrature points for each element must be the same");
151 
152  _coupled_elem_qp_indices[primary_elem_id].resize(primary_qps.size());
153  KDTree kd_tree_qp(secondary_qps, _mesh.getMaxLeafSize());
154  for (std::size_t i = 0; i < primary_qps.size(); i++)
155  {
156  unsigned int patch_size = 1;
157  std::vector<std::size_t> return_index(patch_size);
158  kd_tree_qp.neighborSearch(primary_qps[i], patch_size, return_index);
159  _coupled_elem_qp_indices[primary_elem_id][i] = return_index[0];
160  }
161  }
162  }
163 }
std::map< dof_id_type, std::vector< Point > > getLocalQuadraturePointMap(Assembly &assembly, const std::vector< dof_id_type > &elem_ids, const std::vector< unsigned short int > &side_ids) const
Gets the local quadrature point map for the primary or secondary side.
const MooseMesh & _mesh
Mesh.
std::vector< dof_id_type > _secondary_elem_ids
List of secondary element IDs.
std::vector< unsigned short int > _secondary_side_ids
List of secondary side IDs (if any)
virtual Elem * queryElemPtr(const dof_id_type i)
const dof_id_type & getCoupledElemID(const dof_id_type &elem_id) const
Gets the coupled element ID for a given element ID.
unsigned int getMaxLeafSize() const
std::map< dof_id_type, std::vector< unsigned int > > _coupled_elem_qp_indices
Map of element ID to vector of coupled quadrature points.
std::vector< unsigned short int > _primary_side_ids
List of primary side IDs (if any)
std::vector< dof_id_type > _primary_elem_ids
List of primary element IDs.
processor_id_type processor_id() const
uint8_t dof_id_type

◆ buildMapping()

void MeshAlignment::buildMapping ( )
protected

Builds the mapping using the extracted mesh information.

Definition at line 63 of file MeshAlignment.C.

Referenced by initialize().

64 {
66  std::vector<unsigned int> primary_elem_pairing_count(_primary_elem_ids.size(), 0);
67 
68  // Build the element mapping
69  if (_primary_elem_points.size() > 0 && _secondary_elem_points.size() > 0)
70  {
71  // find the primary elements that are nearest to the secondary elements
73  for (std::size_t i_secondary = 0; i_secondary < _secondary_elem_points.size(); i_secondary++)
74  {
75  unsigned int patch_size = 1;
76  std::vector<std::size_t> return_index(patch_size);
77  kd_tree.neighborSearch(_secondary_elem_points[i_secondary], patch_size, return_index);
78  const std::size_t i_primary = return_index[0];
79 
80  // Flip flag if any pair of points are not coincident
82  _primary_elem_points[i_primary]))
83  _meshes_are_coincident = false;
84 
85  const auto primary_elem_id = _primary_elem_ids[i_primary];
86  const auto secondary_elem_id = _secondary_elem_ids[i_secondary];
87 
88  _coupled_elem_ids.insert({primary_elem_id, secondary_elem_id});
89  _coupled_elem_ids.insert({secondary_elem_id, primary_elem_id});
90 
91  primary_elem_pairing_count[i_primary]++;
92  }
93  }
94 
95  // Check if meshes are aligned: all primary boundary elements have exactly one pairing
96  _meshes_are_aligned = true;
97  for (std::size_t i_primary = 0; i_primary < _primary_elem_ids.size(); i_primary++)
98  if (primary_elem_pairing_count[i_primary] != 1)
99  _meshes_are_aligned = false;
100 
101  // Build the node mapping
102  if (_primary_node_points.size() > 0 && _secondary_node_points.size() > 0)
103  {
104  // find the primary nodes that are nearest to the secondary nodes
106  for (std::size_t i_secondary = 0; i_secondary < _secondary_node_points.size(); i_secondary++)
107  {
108  unsigned int patch_size = 1;
109  std::vector<std::size_t> return_index(patch_size);
110  kd_tree.neighborSearch(_secondary_node_points[i_secondary], patch_size, return_index);
111  const std::size_t i_primary = return_index[0];
112 
113  // Flip flag if any pair of points are not coincident
115  _primary_node_points[i_primary]))
116  _meshes_are_coincident = false;
117 
118  const auto primary_node_id = _primary_node_ids[i_primary];
119  const auto secondary_node_id = _secondary_node_ids[i_secondary];
120 
121  _coupled_node_ids.insert({primary_node_id, secondary_node_id});
122  _coupled_node_ids.insert({secondary_node_id, primary_node_id});
123  }
124  }
125 }
std::vector< Point > _secondary_elem_points
List of secondary element points.
std::map< dof_id_type, dof_id_type > _coupled_node_ids
Map of node ID to coupled node ID.
const MooseMesh & _mesh
Mesh.
bool _meshes_are_aligned
Flag that meshes are aligned.
std::vector< dof_id_type > _secondary_elem_ids
List of secondary element IDs.
std::vector< dof_id_type > _secondary_node_ids
List of secondary node IDs.
unsigned int getMaxLeafSize() const
std::vector< dof_id_type > _primary_node_ids
List of primary node IDs.
std::vector< Point > _primary_elem_points
List of primary element points.
std::vector< Point > _primary_node_points
List of primary node points.
bool absolute_fuzzy_equals(const T &var1, const T2 &var2, const Real tol=TOLERANCE *TOLERANCE)
std::vector< dof_id_type > _primary_elem_ids
List of primary element IDs.
std::map< dof_id_type, dof_id_type > _coupled_elem_ids
Map of element ID to coupled element ID.
bool _meshes_are_coincident
Flag that meshes are coincident.
std::vector< Point > _secondary_node_points
List of secondary node points.

◆ extractFrom1DElements()

void MeshAlignmentBase::extractFrom1DElements ( const std::vector< dof_id_type > &  elem_ids,
std::vector< Point > &  elem_points,
std::vector< dof_id_type > &  node_ids,
std::vector< Point > &  node_points 
) const
protectedinherited

Extracts mesh information from 1D elements.

Parameters
[in]elem_idsVector of element IDs
[out]elem_pointsVector of element centroids
[out]node_idsVector of node IDs
[out]node_pointsVector of node points

Definition at line 20 of file MeshAlignmentBase.C.

Referenced by MeshAlignment1D3D::initialize(), and initialize().

24 {
25  elem_points.clear();
26  node_ids.clear();
27  node_points.clear();
28 
29  for (const auto & elem_id : elem_ids)
30  {
31  const Elem * elem = _mesh.elemPtr(elem_id);
32  elem_points.push_back(elem->vertex_average());
33 
34  for (const auto j : elem->node_index_range())
35  {
36  const Node & node = elem->node_ref(j);
37  const auto node_id = node.id();
38  if (std::find(node_ids.begin(), node_ids.end(), node_id) == node_ids.end())
39  {
40  node_ids.push_back(node_id);
41  node_points.push_back(node);
42  }
43  }
44  }
45 }
virtual Elem * elemPtr(const dof_id_type i)
const MooseMesh & _mesh
Mesh.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")

◆ extractFromBoundaryInfo()

void MeshAlignmentBase::extractFromBoundaryInfo ( const std::vector< std::tuple< dof_id_type, unsigned short int >> &  boundary_info,
std::vector< dof_id_type > &  elem_ids,
std::vector< unsigned short int > &  side_ids,
std::vector< Point > &  side_points,
std::vector< dof_id_type > &  node_ids,
std::vector< Point > &  node_points 
) const
protectedinherited

Extracts mesh information from boundary info.

Parameters
[in]boundary_infoVector of tuples of element ID and side ID on boundary
[out]elem_idsVector of element IDs
[out]side_idsVector of side IDs
[out]side_pointsVector of side centroids
[out]node_idsVector of node IDs
[out]node_pointsVector of node points

Definition at line 48 of file MeshAlignmentBase.C.

Referenced by MeshAlignment2D2D::initialize(), MeshAlignment1D3D::initialize(), MeshAlignment2D3D::initialize(), and initialize().

55 {
56  elem_ids.clear();
57  side_ids.clear();
58  side_points.clear();
59  node_ids.clear();
60  node_points.clear();
61 
62  for (const auto & elem_id_and_side : boundary_info)
63  {
64  auto elem_id = std::get<0>(elem_id_and_side);
65  elem_ids.push_back(elem_id);
66 
67  auto side = std::get<1>(elem_id_and_side);
68  side_ids.push_back(side);
69 
70  const Elem * elem = _mesh.elemPtr(elem_id);
71  const Elem * side_elem = elem->build_side_ptr(side).release();
72  const Point side_center = side_elem->vertex_average();
73  side_points.push_back(side_center);
74 
75  for (const auto j : side_elem->node_index_range())
76  {
77  const Node & node = side_elem->node_ref(j);
78  const auto node_id = node.id();
79  if (std::find(node_ids.begin(), node_ids.end(), node_id) == node_ids.end())
80  {
81  node_ids.push_back(node_id);
82  node_points.push_back(node);
83  }
84  }
85  delete side_elem;
86  }
87 }
virtual Elem * elemPtr(const dof_id_type i)
const MooseMesh & _mesh
Mesh.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")

◆ getCoupledElemID()

const dof_id_type & MeshAlignment::getCoupledElemID ( const dof_id_type elem_id) const

Gets the coupled element ID for a given element ID.

Parameters
[in]elem_idElement ID for which to find the coupled element ID

Definition at line 206 of file MeshAlignment.C.

Referenced by buildCoupledElemQpIndexMap(), FlowChannelHeatStructureCouplerUserObject::execute(), HeatFluxFromHeatStructureBaseUserObject::execute(), FlowChannelHeatStructureCouplerUserObject::getNearestElem(), HeatFluxFromHeatStructureBaseUserObject::getNearestElem(), HeatStructure2DCouplerBase::setupMesh(), and HeatTransferFromHeatStructure1Phase::setupMesh().

207 {
208  mooseAssert(hasCoupledElemID(elem_id), "The element ID has no coupled element.");
209  return _coupled_elem_ids.find(elem_id)->second;
210 }
std::map< dof_id_type, dof_id_type > _coupled_elem_ids
Map of element ID to coupled element ID.
bool hasCoupledElemID(const dof_id_type &elem_id) const
Returns true if the element ID has a coupled element ID.

◆ getCoupledElemQpIndex()

unsigned int MeshAlignment::getCoupledElemQpIndex ( const dof_id_type elem_id,
const unsigned int qp 
) const

Gets the quadrature point index on the coupled element corresponding to the quadrature point index on the provided primary element.

Only local elements on the primary mesh may be queried.

Parameters
[in]elem_idElement ID for which to find the coupled quadrature point
[in]qpQuadrature point index on the given element

Definition at line 226 of file MeshAlignment.C.

Referenced by FlowChannelHeatStructureCouplerUserObject::execute(), and HeatFluxFromHeatStructureBaseUserObject::execute().

227 {
228  auto it = _coupled_elem_qp_indices.find(elem_id);
229  mooseAssert(it != _coupled_elem_qp_indices.end(),
230  "The element ID has no coupled quadrature point indices.");
231  mooseAssert(qp < it->second.size(), "The quadrature index does not exist in the map.");
232  return it->second[qp];
233 }
std::map< dof_id_type, std::vector< unsigned int > > _coupled_elem_qp_indices
Map of element ID to vector of coupled quadrature points.

◆ getCoupledNodeID()

const dof_id_type & MeshAlignment::getCoupledNodeID ( const dof_id_type node_id) const

Gets the coupled node ID for a given node ID.

Parameters
[in]node_idNode ID for which to find the coupled node ID

Definition at line 219 of file MeshAlignment.C.

Referenced by HeatStructure2DCouplerBCBase::computeCoupledTemperature(), and MeshAlignmentVariableTransferMaterial::computeProperties().

220 {
221  mooseAssert(hasCoupledNodeID(node_id), "The node ID has no coupled node.");
222  return _coupled_node_ids.find(node_id)->second;
223 }
std::map< dof_id_type, dof_id_type > _coupled_node_ids
Map of node ID to coupled node ID.
bool hasCoupledNodeID(const dof_id_type &node_id) const
Returns true if the node ID has a coupled node ID.

◆ getLocalQuadraturePointMap()

std::map< dof_id_type, std::vector< Point > > MeshAlignment::getLocalQuadraturePointMap ( Assembly assembly,
const std::vector< dof_id_type > &  elem_ids,
const std::vector< unsigned short int > &  side_ids 
) const
protected

Gets the local quadrature point map for the primary or secondary side.

Parameters
[in]assemblyAssembly
[in]elem_idsVector of element IDs
[in]side_idsVector of side IDs (if any)

Definition at line 166 of file MeshAlignment.C.

Referenced by buildCoupledElemQpIndexMap().

169 {
170  std::map<dof_id_type, std::vector<Point>> elem_id_to_qps;
171  for (unsigned int i = 0; i < elem_ids.size(); i++)
172  {
173  const auto elem_id = elem_ids[i];
174  const Elem * elem = _mesh.queryElemPtr(elem_id);
175  if (elem)
176  {
177  assembly.setCurrentSubdomainID(elem->subdomain_id());
178 
179  MooseArray<Point> q_points;
180  if (side_ids.size() > 0)
181  {
182  assembly.reinit(elem, side_ids[i]);
183  q_points = assembly.qPointsFace();
184  }
185  else
186  {
187  assembly.reinit(elem);
188  q_points = assembly.qPoints();
189  }
190 
191  for (std::size_t i = 0; i < q_points.size(); i++)
192  elem_id_to_qps[elem_id].push_back(q_points[i]);
193  }
194  }
195 
196  return elem_id_to_qps;
197 }
const MooseMesh & _mesh
Mesh.
const MooseArray< Point > & qPoints() const
void reinit(const Elem *elem)
virtual Elem * queryElemPtr(const dof_id_type i)
unsigned int size() const
void setCurrentSubdomainID(SubdomainID i)
const MooseArray< Point > & qPointsFace() const

◆ getPrimaryElemIDs()

const std::vector<dof_id_type>& MeshAlignmentBase::getPrimaryElemIDs ( ) const
inlineinherited

Returns the list of element IDs on the primary boundary.

Definition at line 34 of file MeshAlignmentBase.h.

Referenced by HeatStructure2DCouplerBase::setupMesh(), and HSCoupler2D2DRadiation::setupMesh().

34 { return _primary_elem_ids; }
std::vector< dof_id_type > _primary_elem_ids
List of primary element IDs.

◆ getSecondaryElemIDs()

const std::vector<dof_id_type>& MeshAlignmentBase::getSecondaryElemIDs ( ) const
inlineinherited

Returns the list of element IDs on the secondary boundary.

Definition at line 39 of file MeshAlignmentBase.h.

Referenced by HSCoupler2D3D::setupMesh().

39 { return _secondary_elem_ids; }
std::vector< dof_id_type > _secondary_elem_ids
List of secondary element IDs.

◆ hasCoupledElemID()

bool MeshAlignment::hasCoupledElemID ( const dof_id_type elem_id) const

Returns true if the element ID has a coupled element ID.

Parameters
[in]elem_idElement ID for which to find the coupled element ID

Definition at line 200 of file MeshAlignment.C.

Referenced by getCoupledElemID(), HeatStructure2DCouplerBase::setupMesh(), and HeatTransferFromHeatStructure1Phase::setupMesh().

201 {
202  return _coupled_elem_ids.find(elem_id) != _coupled_elem_ids.end();
203 }
std::map< dof_id_type, dof_id_type > _coupled_elem_ids
Map of element ID to coupled element ID.

◆ hasCoupledNodeID()

bool MeshAlignment::hasCoupledNodeID ( const dof_id_type node_id) const

Returns true if the node ID has a coupled node ID.

Parameters
[in]node_idNode ID for which to find the coupled node ID

Definition at line 213 of file MeshAlignment.C.

Referenced by HeatStructure2DCouplerBCBase::computeCoupledTemperature(), and getCoupledNodeID().

214 {
215  return _coupled_node_ids.find(node_id) != _coupled_node_ids.end();
216 }
std::map< dof_id_type, dof_id_type > _coupled_node_ids
Map of node ID to coupled node ID.

◆ initialize() [1/2]

void MeshAlignment::initialize ( const std::vector< dof_id_type > &  primary_elem_ids,
const std::vector< std::tuple< dof_id_type, unsigned short int >> &  secondary_boundary_info 
)

Extracts mesh information and builds the mapping.

This version is for 1D elements coupled to a 2D boundary.

Parameters
primary_elem_ids[in]List of primary element IDs
secondary_boundary_info[in]List of tuples (elem_id, side_id) of the secondary side

Definition at line 22 of file MeshAlignment.C.

Referenced by HeatStructure2DCouplerBase::setupMesh(), and HeatTransferFromHeatStructure1Phase::setupMesh().

25 {
26  _primary_elem_ids = primary_elem_ids;
29 
30  extractFromBoundaryInfo(secondary_boundary_info,
36 
37  buildMapping();
38 }
void extractFrom1DElements(const std::vector< dof_id_type > &elem_ids, std::vector< Point > &elem_points, std::vector< dof_id_type > &node_ids, std::vector< Point > &node_points) const
Extracts mesh information from 1D elements.
void buildMapping()
Builds the mapping using the extracted mesh information.
Definition: MeshAlignment.C:63
std::vector< Point > _secondary_elem_points
List of secondary element points.
std::vector< dof_id_type > _secondary_elem_ids
List of secondary element IDs.
std::vector< dof_id_type > _secondary_node_ids
List of secondary node IDs.
std::vector< unsigned short int > _secondary_side_ids
List of secondary side IDs (if any)
std::vector< dof_id_type > _primary_node_ids
List of primary node IDs.
std::vector< Point > _primary_elem_points
List of primary element points.
std::vector< Point > _primary_node_points
List of primary node points.
void extractFromBoundaryInfo(const std::vector< std::tuple< dof_id_type, unsigned short int >> &boundary_info, std::vector< dof_id_type > &elem_ids, std::vector< unsigned short int > &side_ids, std::vector< Point > &side_points, std::vector< dof_id_type > &node_ids, std::vector< Point > &node_points) const
Extracts mesh information from boundary info.
std::vector< dof_id_type > _primary_elem_ids
List of primary element IDs.
std::vector< Point > _secondary_node_points
List of secondary node points.

◆ initialize() [2/2]

void MeshAlignment::initialize ( const std::vector< std::tuple< dof_id_type, unsigned short int >> &  primary_boundary_info,
const std::vector< std::tuple< dof_id_type, unsigned short int >> &  secondary_boundary_info 
)

Extracts mesh information and builds the mapping.

This version is for a 2D boundary coupled to another 2D boundary.

Parameters
primary_boundary_info[in]List of tuples (elem_id, side_id) of the primary side
secondary_boundary_info[in]List of tuples (elem_id, side_id) of the secondary side

Definition at line 41 of file MeshAlignment.C.

44 {
45  extractFromBoundaryInfo(primary_boundary_info,
51 
52  extractFromBoundaryInfo(secondary_boundary_info,
58 
59  buildMapping();
60 }
void buildMapping()
Builds the mapping using the extracted mesh information.
Definition: MeshAlignment.C:63
std::vector< Point > _secondary_elem_points
List of secondary element points.
std::vector< dof_id_type > _secondary_elem_ids
List of secondary element IDs.
std::vector< dof_id_type > _secondary_node_ids
List of secondary node IDs.
std::vector< unsigned short int > _secondary_side_ids
List of secondary side IDs (if any)
std::vector< dof_id_type > _primary_node_ids
List of primary node IDs.
std::vector< Point > _primary_elem_points
List of primary element points.
std::vector< Point > _primary_node_points
List of primary node points.
std::vector< unsigned short int > _primary_side_ids
List of primary side IDs (if any)
void extractFromBoundaryInfo(const std::vector< std::tuple< dof_id_type, unsigned short int >> &boundary_info, std::vector< dof_id_type > &elem_ids, std::vector< unsigned short int > &side_ids, std::vector< Point > &side_points, std::vector< dof_id_type > &node_ids, std::vector< Point > &node_points) const
Extracts mesh information from boundary info.
std::vector< dof_id_type > _primary_elem_ids
List of primary element IDs.
std::vector< Point > _secondary_node_points
List of secondary node points.

◆ meshesAreAligned()

bool MeshAlignmentBase::meshesAreAligned ( ) const
inlineinherited

◆ meshesAreCoincident()

bool MeshAlignment::meshesAreCoincident ( ) const
inline

Returns true if the primary and secondary meshes are coincident.

Definition at line 71 of file MeshAlignment.h.

71 { return _meshes_are_coincident; }
bool _meshes_are_coincident
Flag that meshes are coincident.

Member Data Documentation

◆ _coupled_elem_ids

std::map<dof_id_type, dof_id_type> MeshAlignment::_coupled_elem_ids
protected

Map of element ID to coupled element ID.

Definition at line 131 of file MeshAlignment.h.

Referenced by buildMapping(), getCoupledElemID(), and hasCoupledElemID().

◆ _coupled_elem_qp_indices

std::map<dof_id_type, std::vector<unsigned int> > MeshAlignment::_coupled_elem_qp_indices
protected

Map of element ID to vector of coupled quadrature points.

Definition at line 135 of file MeshAlignment.h.

Referenced by buildCoupledElemQpIndexMap(), and getCoupledElemQpIndex().

◆ _coupled_node_ids

std::map<dof_id_type, dof_id_type> MeshAlignment::_coupled_node_ids
protected

Map of node ID to coupled node ID.

Definition at line 133 of file MeshAlignment.h.

Referenced by buildMapping(), getCoupledNodeID(), and hasCoupledNodeID().

◆ _mesh

const MooseMesh& MeshAlignmentBase::_mesh
protectedinherited

◆ _meshes_are_aligned

bool MeshAlignmentBase::_meshes_are_aligned
protectedinherited

Flag that meshes are aligned.

Definition at line 105 of file MeshAlignmentBase.h.

Referenced by buildMapping(), MeshAlignmentOneToMany::checkAlignment(), and MeshAlignmentBase::meshesAreAligned().

◆ _meshes_are_coincident

bool MeshAlignment::_meshes_are_coincident
protected

Flag that meshes are coincident.

Definition at line 138 of file MeshAlignment.h.

Referenced by buildMapping(), and meshesAreCoincident().

◆ _primary_elem_ids

std::vector<dof_id_type> MeshAlignmentBase::_primary_elem_ids
protectedinherited

◆ _primary_elem_points

std::vector<Point> MeshAlignmentBase::_primary_elem_points
protectedinherited

◆ _primary_node_ids

std::vector<dof_id_type> MeshAlignmentBase::_primary_node_ids
protectedinherited

◆ _primary_node_points

std::vector<Point> MeshAlignmentBase::_primary_node_points
protectedinherited

◆ _primary_side_ids

std::vector<unsigned short int> MeshAlignmentBase::_primary_side_ids
protectedinherited

◆ _secondary_elem_ids

std::vector<dof_id_type> MeshAlignmentBase::_secondary_elem_ids
protectedinherited

◆ _secondary_elem_points

std::vector<Point> MeshAlignmentBase::_secondary_elem_points
protectedinherited

◆ _secondary_node_ids

std::vector<dof_id_type> MeshAlignmentBase::_secondary_node_ids
protectedinherited

◆ _secondary_node_points

std::vector<Point> MeshAlignmentBase::_secondary_node_points
protectedinherited

◆ _secondary_side_ids

std::vector<unsigned short int> MeshAlignmentBase::_secondary_side_ids
protectedinherited

The documentation for this class was generated from the following files: