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:
34  MeshAlignment(const MooseMesh & mesh, bool require_same_translation = false);
35 
44  void initialize(
45  const std::vector<dof_id_type> & primary_elem_ids,
46  const std::vector<std::tuple<dof_id_type, unsigned short int>> & secondary_boundary_info);
47 
56  void initialize(
57  const std::vector<std::tuple<dof_id_type, unsigned short int>> & primary_boundary_info,
58  const std::vector<std::tuple<dof_id_type, unsigned short int>> & secondary_boundary_info);
59 
68  void buildCoupledElemQpIndexMap(Assembly & assembly);
69 
74 
80  bool hasCoupledElemID(const dof_id_type & elem_id) const;
81 
87  const dof_id_type & getCoupledElemID(const dof_id_type & elem_id) const;
88 
94  bool hasCoupledNodeID(const dof_id_type & node_id) const;
95 
101  const dof_id_type & getCoupledNodeID(const dof_id_type & node_id) const;
102 
112  unsigned int getCoupledElemQpIndex(const dof_id_type & elem_id, const unsigned int & qp) const;
113 
114 protected:
118  void buildMapping();
119 
127  std::map<dof_id_type, std::vector<Point>>
129  const std::vector<dof_id_type> & elem_ids,
130  const std::vector<unsigned short int> & side_ids) const;
131 
133  std::map<dof_id_type, dof_id_type> _coupled_elem_ids;
135  std::map<dof_id_type, dof_id_type> _coupled_node_ids;
137  std::map<dof_id_type, std::vector<unsigned int>> _coupled_elem_qp_indices;
138 
145 };
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.
bool _meshes_have_same_translation
Flag that each pairing has the same translation vector.
void buildMapping()
Builds the mapping using the extracted mesh information.
Definition: MeshAlignment.C:66
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:25
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.
const bool _require_same_translation
Flag that alignment requires that pairings have same translation vector.
MeshAlignment(const MooseMesh &mesh, bool require_same_translation=false)
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:73
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.