https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
14class Assembly;
15
25{
26public:
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
114protected:
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};
Builds mapping between two aligned subdomains/boundaries.
Builds mapping between two aligned subdomains/boundaries.
void buildCoupledElemQpIndexMap(Assembly &assembly)
Builds the map used for getting the coupled quadrature point index.
std::map< dof_id_type, dof_id_type > _coupled_elem_ids
Map of element ID to coupled element ID.
const bool _require_same_translation
Flag that alignment requires that pairings have same translation vector.
bool _meshes_are_coincident
Flag that meshes are coincident.
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...
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.
std::map< dof_id_type, std::vector< unsigned int > > _coupled_elem_qp_indices
Map of element ID to vector of coupled quadrature points.
void buildMapping()
Builds the mapping using the extracted mesh information.
bool hasCoupledElemID(const dof_id_type &elem_id) const
Returns true if the element ID has a coupled element ID.
const dof_id_type & getCoupledElemID(const dof_id_type &elem_id) const
Gets the coupled element ID for a given element ID.
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.
const dof_id_type & getCoupledNodeID(const dof_id_type &node_id) const
Gets the coupled node ID for a given node ID.
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 meshesAreCoincident() const
Returns true if the primary and secondary meshes are coincident.
bool _meshes_have_same_translation
Flag that each pairing has the same translation vector.
MeshBase & mesh