https://mooseframework.inl.gov
MeshAlignmentOneToMany.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 
20 {
21 public:
28 
35  bool hasCoupledPrimaryElemID(const dof_id_type & secondary_elem_id) const;
36 
43  dof_id_type getCoupledPrimaryElemID(const dof_id_type & secondary_elem_id) const;
44 
51  bool hasCoupledSecondaryElemIDs(const dof_id_type & primary_elem_id) const;
52 
59  const std::vector<dof_id_type> &
60  getCoupledSecondaryElemIDs(const dof_id_type & primary_elem_id) const;
61 
65  unsigned int getPrimaryNumberOfQuadraturePoints() const { return _n_qp_primary; }
66 
70  unsigned int getSecondaryNumberOfQuadraturePoints() const { return _n_qp_secondary; }
71 
82  unsigned int getCoupledPrimaryElemQpIndex(const dof_id_type & secondary_elem_id,
83  const unsigned int & secondary_qp) const;
84 
88  unsigned int getMaxCouplingSize() const { return _max_coupling_size; }
89 
90 protected:
94  void buildMapping();
95 
102  void checkAlignment(const Point & axis_point, const RealVectorValue & axis_direction);
103 
105  std::map<dof_id_type, std::vector<dof_id_type>> _primary_elem_id_to_secondary_elem_ids;
107  std::map<dof_id_type, dof_id_type> _secondary_elem_id_to_primary_elem_id;
109  std::map<dof_id_type, std::vector<unsigned int>> _secondary_elem_id_to_qp_indices;
110 
112  unsigned int _n_qp_primary;
114  unsigned int _n_qp_secondary;
115 
117  unsigned long _max_coupling_size;
118 };
Builds mapping between two aligned subdomains/boundaries.
bool hasCoupledPrimaryElemID(const dof_id_type &secondary_elem_id) const
Returns true if the given secondary element ID has a coupled primary element.
Builds mapping between a 1D/2D boundary and a 3D boundary.
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.
unsigned long _max_coupling_size
The maximum number of secondary elements coupled to any primary element.
MeshBase & mesh
unsigned int getSecondaryNumberOfQuadraturePoints() const
Gets the number of quadrature points for faces on the secondary boundary.
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...
void buildMapping()
Builds the mapping using the extracted mesh information.
unsigned int _n_qp_primary
Number of quadrature points for faces on the primary boundary.
unsigned int _n_qp_secondary
Number of quadrature points for faces on the secondary boundary.
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.
unsigned int getPrimaryNumberOfQuadraturePoints() const
Gets the number of quadrature points for faces on the primary boundary.
dof_id_type getCoupledPrimaryElemID(const dof_id_type &secondary_elem_id) const
Gets the coupled primary element ID for a given secondary 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.
unsigned int getMaxCouplingSize() const
Gets the maximum number of secondary elements coupled to any primary element.
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.
MeshAlignmentOneToMany(const MooseMesh &mesh)
Constructor.
void checkAlignment(const Point &axis_point, const RealVectorValue &axis_direction)
Checks the alignment and sets _mesh_alignment accordingly.
bool hasCoupledSecondaryElemIDs(const dof_id_type &primary_elem_id) const
Returns true if the given primary element ID has coupled secondary elements.
uint8_t dof_id_type