Builds mapping between two aligned subdomains/boundaries. More...
#include <MeshAlignment.h>
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_type & | getCoupledElemID (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_type & | getCoupledNodeID (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... | |
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.
MeshAlignment::MeshAlignment | ( | const MooseMesh & | mesh | ) |
Constructor.
mesh[in] | mesh Mesh |
Definition at line 16 of file MeshAlignment.C.
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).
assembly | The assembly object |
Definition at line 128 of file MeshAlignment.C.
Referenced by FlowChannelHeatStructureCouplerUserObject::FlowChannelHeatStructureCouplerUserObject(), and HeatFluxFromHeatStructureBaseUserObject::HeatFluxFromHeatStructureBaseUserObject().
|
protected |
Builds the mapping using the extracted mesh information.
Definition at line 63 of file MeshAlignment.C.
Referenced by initialize().
|
protectedinherited |
Extracts mesh information from 1D elements.
[in] | elem_ids | Vector of element IDs |
[out] | elem_points | Vector of element centroids |
[out] | node_ids | Vector of node IDs |
[out] | node_points | Vector of node points |
Definition at line 20 of file MeshAlignmentBase.C.
Referenced by MeshAlignment1D3D::initialize(), and initialize().
|
protectedinherited |
Extracts mesh information from boundary info.
[in] | boundary_info | Vector of tuples of element ID and side ID on boundary |
[out] | elem_ids | Vector of element IDs |
[out] | side_ids | Vector of side IDs |
[out] | side_points | Vector of side centroids |
[out] | node_ids | Vector of node IDs |
[out] | node_points | Vector of node points |
Definition at line 48 of file MeshAlignmentBase.C.
Referenced by MeshAlignment2D2D::initialize(), MeshAlignment1D3D::initialize(), MeshAlignment2D3D::initialize(), and initialize().
const dof_id_type & MeshAlignment::getCoupledElemID | ( | const dof_id_type & | elem_id | ) | const |
Gets the coupled element ID for a given element ID.
[in] | elem_id | Element 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().
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.
[in] | elem_id | Element ID for which to find the coupled quadrature point |
[in] | qp | Quadrature point index on the given element |
Definition at line 226 of file MeshAlignment.C.
Referenced by FlowChannelHeatStructureCouplerUserObject::execute(), and HeatFluxFromHeatStructureBaseUserObject::execute().
const dof_id_type & MeshAlignment::getCoupledNodeID | ( | const dof_id_type & | node_id | ) | const |
Gets the coupled node ID for a given node ID.
[in] | node_id | Node ID for which to find the coupled node ID |
Definition at line 219 of file MeshAlignment.C.
Referenced by HeatStructure2DCouplerBCBase::computeCoupledTemperature(), and MeshAlignmentVariableTransferMaterial::computeProperties().
|
protected |
Gets the local quadrature point map for the primary or secondary side.
[in] | assembly | Assembly |
[in] | elem_ids | Vector of element IDs |
[in] | side_ids | Vector of side IDs (if any) |
Definition at line 166 of file MeshAlignment.C.
Referenced by buildCoupledElemQpIndexMap().
|
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().
|
inlineinherited |
Returns the list of element IDs on the secondary boundary.
Definition at line 39 of file MeshAlignmentBase.h.
Referenced by HSCoupler2D3D::setupMesh().
bool MeshAlignment::hasCoupledElemID | ( | const dof_id_type & | elem_id | ) | const |
Returns true if the element ID has a coupled element ID.
[in] | elem_id | Element 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().
bool MeshAlignment::hasCoupledNodeID | ( | const dof_id_type & | node_id | ) | const |
Returns true if the node ID has a coupled node ID.
[in] | node_id | Node ID for which to find the coupled node ID |
Definition at line 213 of file MeshAlignment.C.
Referenced by HeatStructure2DCouplerBCBase::computeCoupledTemperature(), and getCoupledNodeID().
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.
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().
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.
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.
|
inlineinherited |
Returns true if the primary and secondary meshes are aligned.
Definition at line 44 of file MeshAlignmentBase.h.
Referenced by HeatStructure2DCoupler::check(), HeatStructure2DRadiationCouplerRZ::check(), HSCoupler2D3D::check(), HSCoupler2D2DRadiation::check(), HeatTransferFromHeatStructure1Phase::check(), HeatStructure2DCouplerBase::setupMesh(), HSCoupler2D3D::setupMesh(), and HSCoupler2D2DRadiation::setupMesh().
|
inline |
Returns true if the primary and secondary meshes are coincident.
Definition at line 71 of file MeshAlignment.h.
|
protected |
Map of element ID to coupled element ID.
Definition at line 131 of file MeshAlignment.h.
Referenced by buildMapping(), getCoupledElemID(), and hasCoupledElemID().
|
protected |
Map of element ID to vector of coupled quadrature points.
Definition at line 135 of file MeshAlignment.h.
Referenced by buildCoupledElemQpIndexMap(), and getCoupledElemQpIndex().
|
protected |
Map of node ID to coupled node ID.
Definition at line 133 of file MeshAlignment.h.
Referenced by buildMapping(), getCoupledNodeID(), and hasCoupledNodeID().
|
protectedinherited |
Mesh.
Definition at line 79 of file MeshAlignmentBase.h.
Referenced by MeshAlignment1D3D::buildCoupledElemQpIndexMap(), buildCoupledElemQpIndexMap(), MeshAlignment2D3D::buildCoupledElemQpIndexMapSecondary(), MeshAlignmentOneToMany::buildMapping(), buildMapping(), MeshAlignmentBase::extractFrom1DElements(), MeshAlignmentBase::extractFromBoundaryInfo(), and getLocalQuadraturePointMap().
|
protectedinherited |
Flag that meshes are aligned.
Definition at line 105 of file MeshAlignmentBase.h.
Referenced by buildMapping(), MeshAlignmentOneToMany::checkAlignment(), and MeshAlignmentBase::meshesAreAligned().
|
protected |
Flag that meshes are coincident.
Definition at line 138 of file MeshAlignment.h.
Referenced by buildMapping(), and meshesAreCoincident().
|
protectedinherited |
List of primary element IDs.
Definition at line 82 of file MeshAlignmentBase.h.
Referenced by MeshAlignment1D3D::buildCoupledElemQpIndexMap(), buildCoupledElemQpIndexMap(), MeshAlignment2D3D::buildCoupledElemQpIndexMapSecondary(), MeshAlignmentOneToMany::buildMapping(), buildMapping(), MeshAlignmentOneToMany::checkAlignment(), MeshAlignmentBase::getPrimaryElemIDs(), MeshAlignment2D2D::initialize(), MeshAlignment1D3D::initialize(), MeshAlignment2D3D::initialize(), and initialize().
|
protectedinherited |
List of primary element points.
Definition at line 86 of file MeshAlignmentBase.h.
Referenced by MeshAlignmentOneToMany::buildMapping(), buildMapping(), MeshAlignmentOneToMany::checkAlignment(), MeshAlignment2D2D::initialize(), MeshAlignment1D3D::initialize(), MeshAlignment2D3D::initialize(), and initialize().
|
protectedinherited |
List of primary node IDs.
Definition at line 96 of file MeshAlignmentBase.h.
Referenced by buildMapping(), MeshAlignment2D2D::initialize(), MeshAlignment1D3D::initialize(), MeshAlignment2D3D::initialize(), and initialize().
|
protectedinherited |
List of primary node points.
Definition at line 100 of file MeshAlignmentBase.h.
Referenced by buildMapping(), MeshAlignment2D2D::initialize(), MeshAlignment1D3D::initialize(), MeshAlignment2D3D::initialize(), and initialize().
|
protectedinherited |
List of primary side IDs (if any)
Definition at line 91 of file MeshAlignmentBase.h.
Referenced by buildCoupledElemQpIndexMap(), MeshAlignment2D3D::buildCoupledElemQpIndexMapSecondary(), MeshAlignment2D2D::initialize(), MeshAlignment2D3D::initialize(), and initialize().
|
protectedinherited |
List of secondary element IDs.
Definition at line 84 of file MeshAlignmentBase.h.
Referenced by MeshAlignment1D3D::buildCoupledElemQpIndexMap(), buildCoupledElemQpIndexMap(), MeshAlignment2D3D::buildCoupledElemQpIndexMapSecondary(), MeshAlignmentOneToMany::buildMapping(), buildMapping(), MeshAlignmentOneToMany::checkAlignment(), MeshAlignmentBase::getSecondaryElemIDs(), MeshAlignment2D2D::initialize(), MeshAlignment1D3D::initialize(), MeshAlignment2D3D::initialize(), and initialize().
|
protectedinherited |
List of secondary element points.
Definition at line 88 of file MeshAlignmentBase.h.
Referenced by MeshAlignmentOneToMany::buildMapping(), buildMapping(), MeshAlignmentOneToMany::checkAlignment(), MeshAlignment2D2D::initialize(), MeshAlignment1D3D::initialize(), MeshAlignment2D3D::initialize(), and initialize().
|
protectedinherited |
List of secondary node IDs.
Definition at line 98 of file MeshAlignmentBase.h.
Referenced by buildMapping(), MeshAlignment2D2D::initialize(), MeshAlignment1D3D::initialize(), MeshAlignment2D3D::initialize(), and initialize().
|
protectedinherited |
List of secondary node points.
Definition at line 102 of file MeshAlignmentBase.h.
Referenced by buildMapping(), MeshAlignment2D2D::initialize(), MeshAlignment1D3D::initialize(), MeshAlignment2D3D::initialize(), and initialize().
|
protectedinherited |
List of secondary side IDs (if any)
Definition at line 93 of file MeshAlignmentBase.h.
Referenced by MeshAlignment1D3D::buildCoupledElemQpIndexMap(), buildCoupledElemQpIndexMap(), MeshAlignment2D3D::buildCoupledElemQpIndexMapSecondary(), MeshAlignment2D2D::initialize(), MeshAlignment1D3D::initialize(), MeshAlignment2D3D::initialize(), and initialize().