https://mooseframework.inl.gov
MeshAlignment.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 
12 #include "MeshAlignmentBase.h"
13 
14 class Assembly;
15 
25 {
26 public:
32  MeshAlignment(const MooseMesh & mesh);
33 
42  void initialize(
43  const std::vector<dof_id_type> & primary_elem_ids,
44  const std::vector<std::tuple<dof_id_type, unsigned short int>> & secondary_boundary_info);
45 
54  void initialize(
55  const std::vector<std::tuple<dof_id_type, unsigned short int>> & primary_boundary_info,
56  const std::vector<std::tuple<dof_id_type, unsigned short int>> & secondary_boundary_info);
57 
66  void buildCoupledElemQpIndexMap(Assembly & assembly);
67 
72 
78  bool hasCoupledElemID(const dof_id_type & elem_id) const;
79 
85  const dof_id_type & getCoupledElemID(const dof_id_type & elem_id) const;
86 
92  bool hasCoupledNodeID(const dof_id_type & node_id) const;
93 
99  const dof_id_type & getCoupledNodeID(const dof_id_type & node_id) const;
100 
110  unsigned int getCoupledElemQpIndex(const dof_id_type & elem_id, const unsigned int & qp) const;
111 
112 protected:
116  void buildMapping();
117 
125  std::map<dof_id_type, std::vector<Point>>
127  const std::vector<dof_id_type> & elem_ids,
128  const std::vector<unsigned short int> & side_ids) const;
129 
131  std::map<dof_id_type, dof_id_type> _coupled_elem_ids;
133  std::map<dof_id_type, dof_id_type> _coupled_node_ids;
135  std::map<dof_id_type, std::vector<unsigned int>> _coupled_elem_qp_indices;
136 
139 };
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.
void buildMapping()
Builds the mapping using the extracted mesh information.
Definition: MeshAlignment.C:63
Builds mapping between two aligned subdomains/boundaries.
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.
MeshBase & mesh
Builds mapping between two aligned subdomains/boundaries.
Definition: MeshAlignment.h:24
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.
Definition: MeshAlignment.C:22
const dof_id_type & getCoupledNodeID(const dof_id_type &node_id) const
Gets the coupled node ID for a given node ID.
const dof_id_type & getCoupledElemID(const dof_id_type &elem_id) const
Gets the coupled element ID for a given element ID.
MeshAlignment(const MooseMesh &mesh)
Constructor.
Definition: MeshAlignment.C:16
void buildCoupledElemQpIndexMap(Assembly &assembly)
Builds the map used for getting the coupled quadrature point index.
bool meshesAreCoincident() const
Returns true if the primary and secondary meshes are coincident.
Definition: MeshAlignment.h:71
std::map< dof_id_type, std::vector< unsigned int > > _coupled_elem_qp_indices
Map of element ID to vector of coupled quadrature points.
std::map< dof_id_type, dof_id_type > _coupled_elem_ids
Map of element ID to coupled element ID.
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...
bool _meshes_are_coincident
Flag that meshes are coincident.
uint8_t dof_id_type
bool hasCoupledElemID(const dof_id_type &elem_id) const
Returns true if the element ID has a coupled element ID.