29 unsigned int patch_size = 1;
30 std::vector<std::size_t> return_index(patch_size);
32 const std::size_t i_primary = return_index[0];
43 it->second.push_back(secondary_elem_id);
58 const RealVectorValue & axis_direction)
69 const auto primary_ax_coord = axis_direction * (primary_elem_point - axis_point);
74 for (
const auto secondary_elem_id : secondary_elem_ids)
80 const auto secondary_ax_coord = axis_direction * (secondary_elem_point - axis_point);
81 if (!MooseUtils::absoluteFuzzyEqual(secondary_ax_coord, primary_ax_coord))
102 "The element ID has no coupled elements.");
113const std::vector<dof_id_type> &
117 "The element ID has no coupled elements.");
123 const unsigned int & secondary_qp)
const
127 "The element ID has no coupled quadrature point indices.");
128 mooseAssert(secondary_qp < it->second.size(),
"The quadrature index does not exist in the map.");
129 return it->second[secondary_qp];
void neighborSearch(const Point &query_point, unsigned int patch_size, std::vector< std::size_t > &return_index)
Builds mapping between two aligned subdomains/boundaries.
bool _meshes_are_aligned
Flag that meshes are aligned.
const MooseMesh & _mesh
Mesh.
std::vector< dof_id_type > _primary_elem_ids
List of primary element IDs.
std::vector< Point > _primary_elem_points
List of primary element points.
std::vector< Point > _secondary_elem_points
List of secondary element points.
std::vector< dof_id_type > _secondary_elem_ids
List of secondary element IDs.
void checkAlignment(const Point &axis_point, const RealVectorValue &axis_direction)
Checks the alignment and sets _mesh_alignment accordingly.
void buildMapping()
Builds the mapping using the extracted mesh information.
unsigned int getCoupledPrimaryElemQpIndex(const dof_id_type &secondary_elem_id, const unsigned int &secondary_qp) const
Gets the quadrature point index on the primary element corresponding to the quadrature point index on...
bool hasCoupledSecondaryElemIDs(const dof_id_type &primary_elem_id) const
Returns true if the given primary element ID has coupled secondary elements.
std::map< dof_id_type, std::vector< unsigned int > > _secondary_elem_id_to_qp_indices
Map of secondary element ID to vector of coupled quadrature points.
std::map< dof_id_type, std::vector< dof_id_type > > _primary_elem_id_to_secondary_elem_ids
Map of primary element ID to coupled secondary element IDs.
dof_id_type getCoupledPrimaryElemID(const dof_id_type &secondary_elem_id) const
Gets the coupled primary element ID for a given secondary element ID.
unsigned long _max_coupling_size
The maximum number of secondary elements coupled to any primary element.
MeshAlignmentOneToMany(const MooseMesh &mesh)
Constructor.
const std::vector< dof_id_type > & getCoupledSecondaryElemIDs(const dof_id_type &primary_elem_id) const
Gets the coupled secondary element IDs for a given primary element ID.
std::map< dof_id_type, dof_id_type > _secondary_elem_id_to_primary_elem_id
Map of secondary element ID to coupled primary element ID.
bool hasCoupledPrimaryElemID(const dof_id_type &secondary_elem_id) const
Returns true if the given secondary element ID has a coupled primary element.
unsigned int getMaxLeafSize() const