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, bool require_same_translation=false)
 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...
 
const bool _require_same_translation
 Flag that alignment requires that pairings have same translation vector. More...
 
bool _meshes_are_coincident
 Flag that meshes are coincident. More...
 
bool _meshes_have_same_translation
 Flag that each pairing has the same translation vector. 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,
bool  require_same_translation = false 
)

Constructor.

Parameters
mesh[in]mesh Mesh
[in]require_same_translation.If true, mesh alignment requires the same translation. Else it just requires that all primary elements have exactly one pairing.

Definition at line 16 of file MeshAlignment.C.

17  : MeshAlignmentBase(mesh),
18  _require_same_translation(require_same_translation),
21 {
22 }
bool _meshes_have_same_translation
Flag that each pairing has the same translation vector.
const bool _require_same_translation
Flag that alignment requires that pairings have same translation vector.
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 152 of file MeshAlignment.C.

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

153 {
154  // get local quadrature point maps on each side
155  std::map<dof_id_type, std::vector<Point>> primary_qp_map =
157  std::map<dof_id_type, std::vector<Point>> secondary_qp_map =
159 
160  // build mapping
161  for (const auto & primary_elem_id : _primary_elem_ids)
162  {
163  const Elem * primary_elem = _mesh.queryElemPtr(primary_elem_id);
164  // The PID check is needed to exclude ghost elements, since those don't
165  // necessarily have a coupled element on this processor:
166  if (primary_elem && primary_elem->processor_id() == _mesh.processor_id())
167  {
168  std::vector<Point> & primary_qps = primary_qp_map[primary_elem_id];
169 
170  const dof_id_type secondary_elem_id = getCoupledElemID(primary_elem_id);
171  std::vector<Point> & secondary_qps = secondary_qp_map[secondary_elem_id];
172 
173  mooseAssert(primary_qps.size() == secondary_qps.size(),
174  "The numbers of quadrature points for each element must be the same");
175 
176  _coupled_elem_qp_indices[primary_elem_id].resize(primary_qps.size());
177  KDTree kd_tree_qp(secondary_qps, _mesh.getMaxLeafSize());
178  for (std::size_t i = 0; i < primary_qps.size(); i++)
179  {
180  unsigned int patch_size = 1;
181  std::vector<std::size_t> return_index(patch_size);
182  kd_tree_qp.neighborSearch(primary_qps[i], patch_size, return_index);
183  _coupled_elem_qp_indices[primary_elem_id][i] = return_index[0];
184  }
185  }
186  }
187 }
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 66 of file MeshAlignment.C.

Referenced by initialize().

67 {
69  std::vector<unsigned int> primary_elem_pairing_count(_primary_elem_ids.size(), 0);
70 
71  // Build the element mapping
72  if (_primary_elem_points.size() > 0 && _secondary_elem_points.size() > 0)
73  {
74  // find the primary elements that are nearest to the secondary elements
76  for (std::size_t i_secondary = 0; i_secondary < _secondary_elem_points.size(); i_secondary++)
77  {
78  unsigned int patch_size = 1;
79  std::vector<std::size_t> return_index(patch_size);
80  kd_tree.neighborSearch(_secondary_elem_points[i_secondary], patch_size, return_index);
81  const std::size_t i_primary = return_index[0];
82 
83  // Flip flag if any pair of points are not coincident
85  _primary_elem_points[i_primary]))
86  _meshes_are_coincident = false;
87 
88  const auto primary_elem_id = _primary_elem_ids[i_primary];
89  const auto secondary_elem_id = _secondary_elem_ids[i_secondary];
90 
91  _coupled_elem_ids.insert({primary_elem_id, secondary_elem_id});
92  _coupled_elem_ids.insert({secondary_elem_id, primary_elem_id});
93 
94  primary_elem_pairing_count[i_primary]++;
95  }
96  }
97 
98  // Build the node mapping
99  Point reference_translation_vector;
101  if (_primary_node_points.size() > 0 && _secondary_node_points.size() > 0)
102  {
103  // find the primary nodes that are nearest to the secondary nodes
105  for (std::size_t i_secondary = 0; i_secondary < _secondary_node_points.size(); i_secondary++)
106  {
107  unsigned int patch_size = 1;
108  std::vector<std::size_t> return_index(patch_size);
109  kd_tree.neighborSearch(_secondary_node_points[i_secondary], patch_size, return_index);
110  const std::size_t i_primary = return_index[0];
111 
112  const Point translation_vector =
113  _primary_node_points[i_primary] - _secondary_node_points[i_secondary];
114 
115  if (i_secondary == 0)
116  reference_translation_vector = translation_vector;
117  else
118  {
120  (reference_translation_vector - translation_vector).norm(), 0))
122  }
123 
124  const auto primary_node_id = _primary_node_ids[i_primary];
125  const auto secondary_node_id = _secondary_node_ids[i_secondary];
126 
127  _coupled_node_ids.insert({primary_node_id, secondary_node_id});
128  _coupled_node_ids.insert({secondary_node_id, primary_node_id});
129  }
130 
132  MooseUtils::absoluteFuzzyEqual(reference_translation_vector.norm(), 0))
133  _meshes_are_coincident = true;
134  else
135  _meshes_are_coincident = false;
136 
137  // Check if meshes are aligned
140  else
141  {
142  // Else require that all primary boundary elements have exactly one pairing
143  _meshes_are_aligned = true;
144  for (std::size_t i_primary = 0; i_primary < _primary_elem_ids.size(); i_primary++)
145  if (primary_elem_pairing_count[i_primary] != 1)
146  _meshes_are_aligned = false;
147  }
148  }
149 }
bool _meshes_have_same_translation
Flag that each pairing has the same translation vector.
std::vector< Point > _secondary_elem_points
List of secondary element points.
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
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.
const bool _require_same_translation
Flag that alignment requires that pairings have same translation vector.
unsigned int getMaxLeafSize() const
std::vector< dof_id_type > _primary_node_ids
List of primary node IDs.
auto norm(const T &a) -> decltype(std::abs(a))
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 230 of file MeshAlignment.C.

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

231 {
232  mooseAssert(hasCoupledElemID(elem_id), "The element ID has no coupled element.");
233  return _coupled_elem_ids.find(elem_id)->second;
234 }
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 250 of file MeshAlignment.C.

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

251 {
252  auto it = _coupled_elem_qp_indices.find(elem_id);
253  mooseAssert(it != _coupled_elem_qp_indices.end(),
254  "The element ID has no coupled quadrature point indices.");
255  mooseAssert(qp < it->second.size(), "The quadrature index does not exist in the map.");
256  return it->second[qp];
257 }
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 243 of file MeshAlignment.C.

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

244 {
245  mooseAssert(hasCoupledNodeID(node_id), "The node ID has no coupled node.");
246  return _coupled_node_ids.find(node_id)->second;
247 }
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 190 of file MeshAlignment.C.

Referenced by buildCoupledElemQpIndexMap().

193 {
194  std::map<dof_id_type, std::vector<Point>> elem_id_to_qps;
195  for (unsigned int i = 0; i < elem_ids.size(); i++)
196  {
197  const auto elem_id = elem_ids[i];
198  const Elem * elem = _mesh.queryElemPtr(elem_id);
199  if (elem)
200  {
201  assembly.setCurrentSubdomainID(elem->subdomain_id());
202 
203  MooseArray<Point> q_points;
204  if (side_ids.size() > 0)
205  {
206  assembly.reinit(elem, side_ids[i]);
207  q_points = assembly.qPointsFace();
208  }
209  else
210  {
211  assembly.reinit(elem);
212  q_points = assembly.qPoints();
213  }
214 
215  for (std::size_t i = 0; i < q_points.size(); i++)
216  elem_id_to_qps[elem_id].push_back(q_points[i]);
217  }
218  }
219 
220  return elem_id_to_qps;
221 }
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(), HSCoupler2D2DRadiation::setupMesh(), and HeatTransferFromHeatStructure1Phase::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 224 of file MeshAlignment.C.

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

225 {
226  return _coupled_elem_ids.find(elem_id) != _coupled_elem_ids.end();
227 }
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 237 of file MeshAlignment.C.

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

238 {
239  return _coupled_node_ids.find(node_id) != _coupled_node_ids.end();
240 }
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 25 of file MeshAlignment.C.

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

28 {
29  _primary_elem_ids = primary_elem_ids;
32 
33  extractFromBoundaryInfo(secondary_boundary_info,
39 
40  buildMapping();
41 }
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:66
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 44 of file MeshAlignment.C.

47 {
48  extractFromBoundaryInfo(primary_boundary_info,
54 
55  extractFromBoundaryInfo(secondary_boundary_info,
61 
62  buildMapping();
63 }
void buildMapping()
Builds the mapping using the extracted mesh information.
Definition: MeshAlignment.C:66
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 73 of file MeshAlignment.h.

73 { 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 133 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 137 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 135 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 142 of file MeshAlignment.h.

Referenced by buildMapping(), and meshesAreCoincident().

◆ _meshes_have_same_translation

bool MeshAlignment::_meshes_have_same_translation
protected

Flag that each pairing has the same translation vector.

Definition at line 144 of file MeshAlignment.h.

Referenced by buildMapping().

◆ _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

◆ _require_same_translation

const bool MeshAlignment::_require_same_translation
protected

Flag that alignment requires that pairings have same translation vector.

Definition at line 140 of file MeshAlignment.h.

Referenced by buildMapping().

◆ _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: