https://mooseframework.inl.gov
MooseMesh.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 "MooseObject.h"
13 #include "BndNode.h"
14 #include "BndElement.h"
15 #include "Restartable.h"
16 #include "MooseEnum.h"
17 #include "PerfGraphInterface.h"
18 #include "MooseHashing.h"
19 #include "MooseApp.h"
20 #include "FaceInfo.h"
21 #include "ElemInfo.h"
22 
23 #include <memory> //std::unique_ptr
24 #include <unordered_map>
25 #include <unordered_set>
26 
27 // libMesh
28 #include "libmesh/elem_range.h"
29 #include "libmesh/mesh_base.h"
30 #include "libmesh/replicated_mesh.h"
31 #include "libmesh/distributed_mesh.h"
32 #include "libmesh/node_range.h"
33 #include "libmesh/nanoflann.hpp"
34 #include "libmesh/vector_value.h"
35 #include "libmesh/point.h"
36 #include "libmesh/partitioner.h"
37 
38 class Assembly;
40 class MooseVariableBase;
42 class MooseUnits;
43 
44 // libMesh forward declarations
45 namespace libMesh
46 {
47 class ExodusII_IO;
48 class QBase;
49 class PeriodicBoundaries;
50 class Partitioner;
51 class GhostingFunctor;
52 class BoundingBox;
53 }
54 // Useful typedefs
56 
57 // List of supported geometrical elements
58 const std::string LIST_GEOM_ELEM = "EDGE EDGE2 EDGE3 EDGE4 "
59  "QUAD QUAD4 QUAD8 QUAD9 "
60  "TRI TRI3 TRI6 TRI7 "
61  "HEX HEX8 HEX20 HEX27 "
62  "TET TET4 TET10 TET14 "
63  "PRISM PRISM6 PRISM15 PRISM18 "
64  "PYRAMID PYRAMID5 PYRAMID13 PYRAMID14";
65 
69 class QpMap
70 {
71 public:
72  QpMap() : _distance(std::numeric_limits<Real>::max()) {}
73 
75  unsigned int _from;
76 
78  unsigned int _to;
79 
82 };
83 
88 class MooseMesh : public MooseObject, public Restartable, public PerfGraphInterface
89 {
90 public:
95 
97  MooseMesh(const MooseMesh & other_mesh);
98  MooseMesh() = delete;
99  MooseMesh & operator=(const MooseMesh & other_mesh) = delete;
100 
101  virtual ~MooseMesh();
102 
103  // The type of libMesh::MeshBase that will be used
104  enum class ParallelType
105  {
106  DEFAULT,
107  REPLICATED,
109  };
110 
114  virtual MooseMesh & clone() const;
115 
121  virtual std::unique_ptr<MooseMesh> safeClone() const = 0;
122 
127 
133  std::unique_ptr<MeshBase> buildMeshBaseObject(unsigned int dim = libMesh::invalid_uint);
134 
142  template <typename T>
143  std::unique_ptr<T> buildTypedMesh(unsigned int dim = libMesh::invalid_uint);
144 
149  void setMeshBase(std::unique_ptr<MeshBase> mesh_base);
150 
152  static MooseEnum partitioning();
153 
155  static MooseEnum elemTypes();
156 
163  virtual void init();
164 
170  virtual void buildMesh() = 0;
171 
177  virtual unsigned int dimension() const;
178 
182  virtual unsigned int spatialDimension() const { return _mesh->spatial_dimension(); }
183 
189  virtual unsigned int effectiveSpatialDimension() const;
190 
194  unsigned int getBlocksMaxDimension(const std::vector<SubdomainName> & blocks) const;
195 
200  std::vector<BoundaryID> getBoundaryIDs(const Elem * const elem,
201  const unsigned short int side) const;
202 
209  const Elem * getLowerDElem(const Elem *, unsigned short int) const;
210 
214  unsigned int getHigherDSide(const Elem * elem) const;
215 
223  const std::set<BoundaryID> & getBoundaryIDs() const;
224 
231  void buildNodeList();
232  void buildBndElemList();
233 
238  const std::map<dof_id_type, std::vector<dof_id_type>> & nodeToElemMap();
239 
247  const std::map<dof_id_type, std::vector<dof_id_type>> & nodeToActiveSemilocalElemMap();
248 
253  struct bnd_node_iterator;
254  struct const_bnd_node_iterator;
255 
256  struct bnd_elem_iterator;
257  struct const_bnd_elem_iterator;
258 
262  virtual bnd_node_iterator bndNodesBegin();
263  virtual bnd_node_iterator bndNodesEnd();
264 
268  virtual bnd_elem_iterator bndElemsBegin();
269  virtual bnd_elem_iterator bndElemsEnd();
270 
275 
282  void buildSideList(std::vector<dof_id_type> & el,
283  std::vector<unsigned short int> & sl,
284  std::vector<boundary_id_type> & il);
288  std::vector<std::tuple<dof_id_type, unsigned short int, boundary_id_type>> buildSideList();
289 
294  std::vector<std::tuple<dof_id_type, unsigned short int, boundary_id_type>>
295  buildActiveSideList() const;
296 
300  unsigned int sideWithBoundaryID(const Elem * const elem, const BoundaryID boundary_id) const;
301 
305  MeshBase::node_iterator localNodesBegin();
306  MeshBase::node_iterator localNodesEnd();
307  MeshBase::const_node_iterator localNodesBegin() const;
308  MeshBase::const_node_iterator localNodesEnd() const;
309 
313  MeshBase::element_iterator activeLocalElementsBegin();
314  const MeshBase::element_iterator activeLocalElementsEnd();
315  MeshBase::const_element_iterator activeLocalElementsBegin() const;
316  const MeshBase::const_element_iterator activeLocalElementsEnd() const;
317 
321  virtual dof_id_type nNodes() const;
322  virtual dof_id_type nElem() const;
323 
324  virtual dof_id_type nLocalNodes() const { return _mesh->n_local_nodes(); }
325  virtual dof_id_type nActiveElem() const { return _mesh->n_active_elem(); }
326  virtual dof_id_type nActiveLocalElem() const { return _mesh->n_active_local_elem(); }
327  virtual SubdomainID nSubdomains() const { return _mesh->n_subdomains(); }
328  virtual unsigned int nPartitions() const { return _mesh->n_partitions(); }
329  virtual bool skipPartitioning() const { return _mesh->skip_partitioning(); }
330  virtual bool skipNoncriticalPartitioning() const;
331 
337  virtual dof_id_type maxNodeId() const;
338  virtual dof_id_type maxElemId() const;
339 
346  virtual const Node & node(const dof_id_type i) const;
347  virtual Node & node(const dof_id_type i);
348  virtual const Node & nodeRef(const dof_id_type i) const;
349  virtual Node & nodeRef(const dof_id_type i);
350  virtual const Node * nodePtr(const dof_id_type i) const;
351  virtual Node * nodePtr(const dof_id_type i);
352  virtual const Node * queryNodePtr(const dof_id_type i) const;
353  virtual Node * queryNodePtr(const dof_id_type i);
354 
361  virtual Elem * elem(const dof_id_type i);
362  virtual const Elem * elem(const dof_id_type i) const;
363  virtual Elem * elemPtr(const dof_id_type i);
364  virtual const Elem * elemPtr(const dof_id_type i) const;
365  virtual Elem * queryElemPtr(const dof_id_type i);
366  virtual const Elem * queryElemPtr(const dof_id_type i) const;
367 
371  bool prepared() const;
372  virtual void prepared(bool state);
373 
379  void needsPrepareForUse();
380 
386  void meshChanged();
387 
393  virtual void onMeshChanged();
394 
398  void cacheChangedLists();
399 
407 
415 
422  const std::vector<const Elem *> & coarsenedElementChildren(const Elem * elem) const;
423 
428  void updateActiveSemiLocalNodeRange(std::set<dof_id_type> & ghosted_elems);
429 
435  bool isSemiLocal(Node * const node) const;
436 
438 
451 
455  const std::unordered_map<boundary_id_type, std::unordered_set<dof_id_type>> &
456  getBoundariesToElems() const;
457 
461  const std::unordered_map<boundary_id_type, std::unordered_set<dof_id_type>> &
463 
469  std::unordered_set<dof_id_type> getBoundaryActiveSemiLocalElemIds(BoundaryID bid) const;
470 
480  std::unordered_set<dof_id_type> getBoundaryActiveNeighborElemIds(BoundaryID bid) const;
481 
490  const std::set<SubdomainID> & blk_group) const;
491 
496  const std::set<SubdomainID> & meshSubdomains() const;
497 
502  const std::set<BoundaryID> & meshBoundaryIds() const;
503 
508  const std::set<BoundaryID> & meshSidesetIds() const;
509 
514  const std::set<BoundaryID> & meshNodesetIds() const;
515 
520  void setBoundaryToNormalMap(std::unique_ptr<std::map<BoundaryID, RealVectorValue>> boundary_map);
521 
522  // DEPRECATED METHOD
523  void setBoundaryToNormalMap(std::map<BoundaryID, RealVectorValue> * boundary_map);
524 
529  void setMeshBoundaryIDs(std::set<BoundaryID> boundary_IDs);
530 
536 
553  bool prepare(const MeshBase * mesh_to_clone);
554 
558  void update();
559 
563  unsigned int uniformRefineLevel() const;
564 
568  void setUniformRefineLevel(unsigned int, bool deletion = true);
569 
581 
586 
590  void addGhostedBoundary(BoundaryID boundary_id);
591 
596  void setGhostedBoundaryInflation(const std::vector<Real> & inflation);
597 
601  const std::set<unsigned int> & getGhostedBoundaries() const;
602 
606  const std::vector<Real> & getGhostedBoundaryInflation() const;
607 
611  void ghostGhostedBoundaries();
612 
616  void needGhostGhostedBoundaries(bool needghost) { _need_ghost_ghosted_boundaries = needghost; }
617 
621  unsigned int getPatchSize() const;
622 
626  unsigned int getGhostingPatchSize() const { return _ghosting_patch_size; }
627 
631  unsigned int getMaxLeafSize() const { return _max_leaf_size; }
632 
636  void setPatchUpdateStrategy(Moose::PatchUpdateType patch_update_strategy);
637 
642 
649  libMesh::BoundingBox getInflatedProcessorBoundingBox(Real inflation_multiplier = 0.01) const;
650 
654  operator libMesh::MeshBase &();
655  operator const libMesh::MeshBase &() const;
656 
660  MeshBase & getMesh();
661  MeshBase & getMesh(const std::string & name);
662  const MeshBase & getMesh() const;
663  const MeshBase & getMesh(const std::string & name) const;
664  const MeshBase * getMeshPtr() const;
665 
669  void printInfo(std::ostream & os = libMesh::out, const unsigned int verbosity = 0) const;
670 
674  const std::set<SubdomainID> & getNodeBlockIds(const Node & node) const;
675 
680  const std::vector<dof_id_type> & getNodeList(boundary_id_type nodeset_id) const;
681 
687  const Node * addUniqueNode(const Point & p, Real tol = 1e-6);
688 
702  Node * addQuadratureNode(const Elem * elem,
703  const unsigned short int side,
704  const unsigned int qp,
705  BoundaryID bid,
706  const Point & point);
707 
715  Node * getQuadratureNode(const Elem * elem, const unsigned short int side, const unsigned int qp);
716 
721  void clearQuadratureNodes();
722 
729  BoundaryID getBoundaryID(const BoundaryName & boundary_name) const;
730 
737  std::vector<BoundaryID> getBoundaryIDs(const std::vector<BoundaryName> & boundary_name,
738  bool generate_unknown = false) const;
739 
746  SubdomainID getSubdomainID(const SubdomainName & subdomain_name) const;
747 
754  std::vector<SubdomainID>
755  getSubdomainIDs(const std::vector<SubdomainName> & subdomain_names) const;
756  std::set<SubdomainID> getSubdomainIDs(const std::set<SubdomainName> & subdomain_names) const;
757 
761  void setSubdomainName(SubdomainID subdomain_id, const SubdomainName & name);
762 
766  static void
767  setSubdomainName(MeshBase & mesh, SubdomainID subdomain_id, const SubdomainName & name);
768 
772  const std::string & getSubdomainName(SubdomainID subdomain_id) const;
773 
780  std::vector<SubdomainName>
781  getSubdomainNames(const std::vector<SubdomainID> & subdomain_ids) const;
782 
786  void setBoundaryName(BoundaryID boundary_id, BoundaryName name);
787 
791  const std::string & getBoundaryName(BoundaryID boundary_id);
792 
798  void buildPeriodicNodeMap(std::multimap<dof_id_type, dof_id_type> & periodic_node_map,
799  unsigned int var_number,
800  libMesh::PeriodicBoundaries * pbs) const;
801 
805  void buildPeriodicNodeSets(std::map<BoundaryID, std::set<dof_id_type>> & periodic_node_sets,
806  unsigned int var_number,
807  libMesh::PeriodicBoundaries * pbs) const;
808 
812  Real dimensionWidth(unsigned int component) const;
813 
815 
818  virtual Real getMinInDimension(unsigned int component) const;
819  virtual Real getMaxInDimension(unsigned int component) const;
821 
832  bool detectOrthogonalDimRanges(Real tol = 1e-6);
833 
838  void addPeriodicVariable(unsigned int var_num, BoundaryID primary, BoundaryID secondary);
839 
845  bool isTranslatedPeriodic(unsigned int nonlinear_var_num, unsigned int component) const;
846 
854  RealVectorValue minPeriodicVector(unsigned int nonlinear_var_num, Point p, Point q) const;
855 
863  Real minPeriodicDistance(unsigned int nonlinear_var_num, Point p, Point q) const;
864 
871  const std::pair<BoundaryID, BoundaryID> * getPairedBoundaryMapping(unsigned int component);
872 
880 
890  const std::vector<std::vector<QpMap>> &
891  getRefinementMap(const Elem & elem, int parent_side, int child, int child_side);
892 
900  const std::vector<std::pair<unsigned int, QpMap>> & getCoarseningMap(const Elem & elem,
901  int input_side);
902 
907  void
908  changeBoundaryId(const boundary_id_type old_id, const boundary_id_type new_id, bool delete_prev);
909 
914  static void changeBoundaryId(MeshBase & mesh,
915  const boundary_id_type old_id,
916  const boundary_id_type new_id,
917  bool delete_prev);
918 
925  const std::set<BoundaryID> & getSubdomainBoundaryIds(const SubdomainID subdomain_id) const;
926 
933  std::set<BoundaryID> getSubdomainInterfaceBoundaryIds(const SubdomainID subdomain_id) const;
934 
941  std::set<SubdomainID> getBoundaryConnectedBlocks(const BoundaryID bid) const;
942 
949  std::set<SubdomainID> getBoundaryConnectedSecondaryBlocks(const BoundaryID bid) const;
950 
957  std::set<SubdomainID> getInterfaceConnectedBlocks(const BoundaryID bid) const;
958 
965  const std::set<SubdomainID> & getBlockConnectedBlocks(const SubdomainID subdomain_id) const;
966 
970  bool isBoundaryNode(dof_id_type node_id) const;
971 
976  bool isBoundaryNode(dof_id_type node_id, BoundaryID bnd_id) const;
977 
981  bool isBoundaryElem(dof_id_type elem_id) const;
982 
987  bool isBoundaryElem(dof_id_type elem_id, BoundaryID bnd_id) const;
988 
996  void errorIfDistributedMesh(std::string name) const;
997 
1001  virtual bool isDistributedMesh() const { return _use_distributed_mesh; }
1002 
1007 
1011  void setParallelType(ParallelType parallel_type);
1012 
1017 
1018  /*
1019  * Set/Get the partitioner name
1020  */
1021  const MooseEnum & partitionerName() const { return _partitioner_name; }
1022 
1027 
1031  void allowRecovery(bool allow) { _allow_recovery = allow; }
1032 
1036  static void setPartitioner(MeshBase & mesh_base,
1037  MooseEnum & partitioner,
1038  bool use_distributed_mesh,
1039  const InputParameters & params,
1040  MooseObject & context_obj);
1041 
1045  void setCustomPartitioner(libMesh::Partitioner * partitioner);
1046 
1048 
1051  bool isCustomPartitionerRequested() const;
1052  void setIsCustomPartitionerRequested(bool cpr);
1054 
1057 
1059  bool hasSecondOrderElements();
1060 
1065  virtual std::unique_ptr<libMesh::PointLocatorBase> getPointLocator() const;
1066 
1071  virtual std::string getFileName() const { return ""; }
1072 
1074  using PeriodicNodeInfo = std::pair<const Node *, BoundaryID>;
1075 
1079  void needsRemoteElemDeletion(bool need_delete) { _need_delete = need_delete; }
1080 
1084  bool needsRemoteElemDeletion() const { return _need_delete; }
1085 
1089  void allowRemoteElementRemoval(bool allow_removal);
1090 
1095 
1099  void deleteRemoteElements();
1100 
1104  bool hasMeshBase() const { return _mesh.get() != nullptr; }
1105 
1109  bool hasElementID(const std::string & id_name) const;
1110 
1114  unsigned int getElementIDIndex(const std::string & id_name) const;
1115 
1119  dof_id_type maxElementID(unsigned int elem_id_index) const { return _max_ids[elem_id_index]; }
1120 
1124  dof_id_type minElementID(unsigned int elem_id_index) const { return _min_ids[elem_id_index]; }
1125 
1129  bool areElemIDsIdentical(const std::string & id_name1, const std::string & id_name2) const;
1130 
1134  std::set<dof_id_type> getAllElemIDs(unsigned int elem_id_index) const;
1135 
1140  std::set<dof_id_type> getElemIDsOnBlocks(unsigned int elem_id_index,
1141  const std::set<SubdomainID> & blks) const;
1142 
1143  std::unordered_map<dof_id_type, std::set<dof_id_type>>
1144  getElemIDMapping(const std::string & from_id_name, const std::string & to_id_name) const;
1145 
1147  unsigned int nFace() const { return _face_info.size(); }
1148 
1150  const std::vector<const FaceInfo *> & faceInfo() const;
1151 
1153  struct face_info_iterator;
1154  struct const_face_info_iterator;
1155 
1160  face_info_iterator ownedFaceInfoBegin();
1161  face_info_iterator ownedFaceInfoEnd();
1162 
1164  struct elem_info_iterator;
1165  struct const_elem_info_iterator;
1166 
1171  elem_info_iterator ownedElemInfoBegin();
1172  elem_info_iterator ownedElemInfoEnd();
1173 
1175  const FaceInfo * faceInfo(const Elem * elem, unsigned int side) const;
1176 
1178  const ElemInfo & elemInfo(const dof_id_type id) const;
1179 
1181  const std::vector<const ElemInfo *> & elemInfoVector() const { return _elem_info; }
1182 
1184  const std::vector<FaceInfo> & allFaceInfo() const;
1186 
1190  void cacheFaceInfoVariableOwnership() const;
1191 
1196  void cacheFVElementalDoFs() const;
1197 
1203  void computeFiniteVolumeCoords() const;
1204 
1208  void isDisplaced(bool is_displaced) { _is_displaced = is_displaced; }
1209 
1213  bool isDisplaced() const { return _is_displaced; }
1214 
1218  const std::map<boundary_id_type, std::vector<dof_id_type>> & nodeSetNodes() const;
1219 
1225 
1231 
1235  const std::map<SubdomainID, Moose::CoordinateSystemType> & getCoordSystem() const;
1236 
1240  void setCoordSystem(const std::vector<SubdomainName> & blocks, const MultiMooseEnum & coord_sys);
1241 
1246  void setAxisymmetricCoordAxis(const MooseEnum & rz_coord_axis);
1247 
1262  void setGeneralAxisymmetricCoordAxes(const std::vector<SubdomainName> & blocks,
1263  const std::vector<std::pair<Point, RealVectorValue>> & axes);
1264 
1270  const std::pair<Point, RealVectorValue> &
1271  getGeneralAxisymmetricCoordAxis(SubdomainID subdomain_id) const;
1272 
1276  bool usingGeneralAxisymmetricCoordAxes() const;
1277 
1282  unsigned int getAxisymmetricRadialCoord() const;
1283 
1289  void checkCoordinateSystems();
1290 
1294  void setCoordData(const MooseMesh & other_mesh);
1295 
1300 
1305 
1311 
1315  const MooseUnits & lengthUnit() const;
1316 
1321  const std::unordered_map<std::pair<const Elem *, unsigned short int>, const Elem *> &
1322  getLowerDElemMap() const;
1323 
1327  bool isSplit() const { return _is_split; }
1328 
1335  void buildFiniteVolumeInfo() const;
1336 
1342  void setupFiniteVolumeMeshData() const;
1343 
1347  void doingPRefinement(bool doing_p_refinement) { _doing_p_refinement = doing_p_refinement; }
1348 
1352  [[nodiscard]] bool doingPRefinement() const { return _doing_p_refinement; }
1353 
1357  unsigned int maxPLevel() const { return _max_p_level; }
1358 
1362  unsigned int maxHLevel() const { return _max_h_level; }
1363 
1368  const std::vector<QpMap> & getPRefinementMap(const Elem & elem) const;
1373  const std::vector<QpMap> & getPRefinementSideMap(const Elem & elem) const;
1378  const std::vector<QpMap> & getPCoarseningMap(const Elem & elem) const;
1383  const std::vector<QpMap> & getPCoarseningSideMap(const Elem & elem) const;
1384 
1386 
1392  bool isLowerD(const SubdomainID subdomain_id) const;
1393 
1398  bool hasLowerD() const { return _has_lower_d; }
1399 
1403  const std::set<SubdomainID> & interiorLowerDBlocks() const { return _lower_d_interior_blocks; }
1407  const std::set<SubdomainID> & boundaryLowerDBlocks() const { return _lower_d_boundary_blocks; }
1410 
1411 protected:
1413  std::vector<std::unique_ptr<libMesh::GhostingFunctor>> _ghosting_functors;
1414 
1416  std::vector<std::shared_ptr<RelationshipManager>> _relationship_managers;
1417 
1420 
1424 
1431 
1433  std::unique_ptr<libMesh::MeshBase> _mesh;
1434 
1438 
1440  std::unique_ptr<libMesh::Partitioner> _custom_partitioner;
1442 
1444  enum
1445  {
1446  X = 0,
1447  Y,
1449  };
1450  enum
1451  {
1452  MIN = 0,
1454  };
1455 
1458 
1461 
1464 
1467 
1470 
1472  bool _moose_mesh_prepared = false;
1473 
1475  std::unique_ptr<ConstElemPointerRange> _refined_elements;
1476 
1478  std::unique_ptr<ConstElemPointerRange> _coarsened_elements;
1479 
1485  std::map<const Elem *, std::vector<const Elem *>> _coarsened_element_children;
1486 
1488  std::set<Node *> _semilocal_node_list;
1489 
1494  std::unique_ptr<libMesh::ConstElemRange> _active_local_elem_range;
1495 
1496  std::unique_ptr<SemiLocalNodeRange> _active_semilocal_node_range;
1497  std::unique_ptr<libMesh::NodeRange> _active_node_range;
1498  std::unique_ptr<libMesh::ConstNodeRange> _local_node_range;
1499  std::unique_ptr<libMesh::StoredRange<MooseMesh::const_bnd_node_iterator, const BndNode *>>
1501  std::unique_ptr<libMesh::StoredRange<MooseMesh::const_bnd_elem_iterator, const BndElement *>>
1503 
1505  std::map<dof_id_type, std::vector<dof_id_type>> _node_to_elem_map;
1507 
1509  std::map<dof_id_type, std::vector<dof_id_type>> _node_to_active_semilocal_elem_map;
1511 
1516  std::set<SubdomainID> _mesh_subdomains;
1517 
1519 
1524  std::set<BoundaryID> _mesh_boundary_ids;
1525  std::set<BoundaryID> _mesh_sideset_ids;
1526  std::set<BoundaryID> _mesh_nodeset_ids;
1528 
1530  std::unique_ptr<std::map<BoundaryID, RealVectorValue>> _boundary_to_normal_map;
1531 
1533  std::vector<BndNode *> _bnd_nodes;
1534  typedef std::vector<BndNode *>::iterator bnd_node_iterator_imp;
1535  typedef std::vector<BndNode *>::const_iterator const_bnd_node_iterator_imp;
1537  std::map<boundary_id_type, std::set<dof_id_type>> _bnd_node_ids;
1538 
1540  std::vector<BndElement *> _bnd_elems;
1541  typedef std::vector<BndElement *>::iterator bnd_elem_iterator_imp;
1542  typedef std::vector<BndElement *>::const_iterator const_bnd_elem_iterator_imp;
1543 
1545  std::unordered_map<boundary_id_type, std::unordered_set<dof_id_type>> _bnd_elem_ids;
1546 
1547  std::map<dof_id_type, Node *> _quadrature_nodes;
1548  std::map<dof_id_type, std::map<unsigned int, std::map<dof_id_type, Node *>>>
1550  std::vector<BndNode> _extra_bnd_nodes;
1551 
1553  std::map<dof_id_type, std::set<SubdomainID>> _block_node_list;
1554 
1556  std::map<boundary_id_type, std::vector<dof_id_type>> _node_set_nodes;
1557 
1558  std::set<unsigned int> _ghosted_boundaries;
1560 
1562  unsigned int _patch_size;
1563 
1565  unsigned int _ghosting_patch_size;
1566 
1567  // The maximum number of points in each leaf of the KDTree used in the nearest neighbor search.
1568  unsigned int _max_leaf_size;
1569 
1572 
1574  std::vector<Node *> _node_map;
1575 
1578 
1580  std::vector<std::vector<Real>> _bounds;
1581 
1583  std::vector<std::pair<BoundaryID, BoundaryID>> _paired_boundary;
1584 
1586  const bool _is_split;
1587 
1588  void cacheInfo();
1589  void freeBndNodes();
1590  void freeBndElems();
1591  void setPartitionerHelper(MeshBase * mesh = nullptr);
1592 
1593 private:
1596  mutable std::unordered_map<dof_id_type, ElemInfo> _elem_to_elem_info;
1597 
1600  mutable std::vector<const ElemInfo *> _elem_info;
1601 
1604  mutable std::vector<FaceInfo> _all_face_info;
1605 
1608  mutable std::vector<const FaceInfo *> _face_info;
1609 
1611  mutable std::unordered_map<std::pair<const Elem *, unsigned int>, FaceInfo *>
1613 
1614  // true if the _face_info member needs to be rebuilt/updated.
1615  mutable bool _finite_volume_info_dirty = true;
1616 
1617  // True if we have cached elemental dofs ids for the linear finite volume variables.
1618  // This happens in the first system which has a linear finite volume variable, considering
1619  // that currently we only support one variable per linear system.
1621 
1626  std::map<unsigned int, std::vector<bool>> _periodic_dim;
1627 
1632 
1634  std::vector<Node *> _extreme_nodes;
1635 
1641  void detectPairedSidesets();
1642 
1654  void buildRefinementMap(const Elem & elem,
1655  libMesh::QBase & qrule,
1656  libMesh::QBase & qrule_face,
1657  int parent_side,
1658  int child,
1659  int child_side);
1660 
1670  void buildCoarseningMap(const Elem & elem,
1671  libMesh::QBase & qrule,
1672  libMesh::QBase & qrule_face,
1673  int input_side);
1674 
1683  void mapPoints(const std::vector<Point> & from,
1684  const std::vector<Point> & to,
1685  std::vector<QpMap> & qp_map);
1686 
1709  void findAdaptivityQpMaps(const Elem * template_elem,
1710  libMesh::QBase & qrule,
1711  libMesh::QBase & qrule_face,
1712  std::vector<std::vector<QpMap>> & refinement_map,
1713  std::vector<std::pair<unsigned int, QpMap>> & coarsen_map,
1714  int parent_side,
1715  int child,
1716  int child_side);
1717 
1719 
1720  const std::vector<QpMap> & getPRefinementMapHelper(
1721  const Elem & elem,
1722  const std::map<std::pair<libMesh::ElemType, unsigned int>, std::vector<QpMap>> &) const;
1723  const std::vector<QpMap> & getPCoarseningMapHelper(
1724  const Elem & elem,
1725  const std::map<std::pair<libMesh::ElemType, unsigned int>, std::vector<QpMap>> &) const;
1726 
1731  void updateCoordTransform();
1732 
1738 
1752  std::map<std::pair<int, libMesh::ElemType>, std::vector<std::vector<QpMap>>>
1754 
1755  std::map<std::pair<libMesh::ElemType, unsigned int>, std::vector<QpMap>>
1757  std::map<std::pair<libMesh::ElemType, unsigned int>, std::vector<QpMap>>
1759 
1761  std::map<libMesh::ElemType, std::map<std::pair<int, int>, std::vector<std::vector<QpMap>>>>
1763 
1778  std::map<std::pair<int, libMesh::ElemType>, std::vector<std::pair<unsigned int, QpMap>>>
1780 
1781  std::map<std::pair<libMesh::ElemType, unsigned int>, std::vector<QpMap>>
1783  std::map<std::pair<libMesh::ElemType, unsigned int>, std::vector<QpMap>>
1785 
1787  {
1789  std::set<SubdomainID> neighbor_subs;
1790 
1793  std::set<BoundaryID> boundary_ids;
1794 
1797  };
1798 
1800  std::unordered_map<SubdomainID, SubdomainData> _sub_to_data;
1801 
1803  std::unordered_map<SubdomainID, std::set<BoundaryID>> _neighbor_subdomain_boundary_ids;
1804 
1806  std::set<SubdomainID> _lower_d_interior_blocks;
1808  std::set<SubdomainID> _lower_d_boundary_blocks;
1810  std::unordered_map<std::pair<const Elem *, unsigned short int>, const Elem *>
1812  std::unordered_map<const Elem *, unsigned short int> _lower_d_elem_to_higher_d_elem_side;
1813 
1817 
1820 
1823 
1826 
1829 
1832 
1838 
1840  std::vector<std::unordered_map<SubdomainID, std::set<dof_id_type>>> _block_id_mapping;
1842  std::vector<dof_id_type> _max_ids;
1844  std::vector<dof_id_type> _min_ids;
1846  std::vector<std::vector<bool>> _id_identical_flag;
1847 
1850 
1852  void buildElemIDInfo();
1853 
1855  void buildLowerDMesh();
1856 
1858  std::map<SubdomainID, Moose::CoordinateSystemType> & _coord_sys;
1859 
1861  unsigned int _rz_coord_axis;
1862 
1864  std::unordered_map<SubdomainID, std::pair<Point, RealVectorValue>> _subdomain_id_to_rz_coord_axis;
1865 
1868  std::unique_ptr<MooseAppCoordTransform> _coord_transform;
1869 
1872 
1874  std::vector<SubdomainName> _provided_coord_blocks;
1875 
1879  unsigned int _max_p_level;
1881  unsigned int _max_h_level;
1882 
1883  template <typename T>
1884  struct MeshType;
1885 };
1886 
1887 inline MooseAppCoordTransform &
1889 {
1890  mooseAssert(_coord_transform, "The coordinate transformation object is null.");
1891  return *_coord_transform;
1892 }
1893 
1894 template <>
1895 struct MooseMesh::MeshType<libMesh::ReplicatedMesh>
1896 {
1898 };
1899 
1900 template <>
1901 struct MooseMesh::MeshType<libMesh::DistributedMesh>
1902 {
1904 };
1905 
1910  : variant_filter_iterator<MeshBase::Predicate, const FaceInfo *>
1911 {
1912  // Templated forwarding ctor -- forwards to appropriate variant_filter_iterator ctor
1913  template <typename PredType, typename IterType>
1914  face_info_iterator(const IterType & d, const IterType & e, const PredType & p)
1915  : variant_filter_iterator<MeshBase::Predicate, const FaceInfo *>(d, e, p)
1916  {
1917  }
1918 };
1919 
1925  const FaceInfo * const,
1926  const FaceInfo * const &,
1927  const FaceInfo * const *>
1928 {
1929  // Templated forwarding ctor -- forwards to appropriate variant_filter_iterator ctor
1930  template <typename PredType, typename IterType>
1931  const_face_info_iterator(const IterType & d, const IterType & e, const PredType & p)
1932  : variant_filter_iterator<MeshBase::Predicate,
1933  const FaceInfo * const,
1934  const FaceInfo * const &,
1935  const FaceInfo * const *>(d, e, p)
1936  {
1937  }
1938 
1939  // The conversion-to-const ctor. Takes a regular iterator and calls the appropriate
1940  // variant_filter_iterator copy constructor. Note that this one is *not* templated!
1942  : variant_filter_iterator<MeshBase::Predicate,
1943  const FaceInfo * const,
1944  const FaceInfo * const &,
1945  const FaceInfo * const *>(rhs)
1946  {
1947  }
1948 };
1949 
1954  : variant_filter_iterator<MeshBase::Predicate, const ElemInfo *>
1955 {
1956  // Templated forwarding ctor -- forwards to appropriate variant_filter_iterator ctor
1957  template <typename PredType, typename IterType>
1958  elem_info_iterator(const IterType & d, const IterType & e, const PredType & p)
1959  : variant_filter_iterator<MeshBase::Predicate, const ElemInfo *>(d, e, p)
1960  {
1961  }
1962 };
1963 
1969  const ElemInfo * const,
1970  const ElemInfo * const &,
1971  const ElemInfo * const *>
1972 {
1973  // Templated forwarding ctor -- forwards to appropriate variant_filter_iterator ctor
1974  template <typename PredType, typename IterType>
1975  const_elem_info_iterator(const IterType & d, const IterType & e, const PredType & p)
1976  : variant_filter_iterator<MeshBase::Predicate,
1977  const ElemInfo * const,
1978  const ElemInfo * const &,
1979  const ElemInfo * const *>(d, e, p)
1980  {
1981  }
1982 
1983  // The conversion-to-const ctor. Takes a regular iterator and calls the appropriate
1984  // variant_filter_iterator copy constructor. Note that this one is *not* templated!
1986  : variant_filter_iterator<MeshBase::Predicate,
1987  const ElemInfo * const,
1988  const ElemInfo * const &,
1989  const ElemInfo * const *>(rhs)
1990  {
1991  }
1992 };
1993 
1997 struct MooseMesh::bnd_node_iterator : variant_filter_iterator<MeshBase::Predicate, BndNode *>
1998 {
1999  // Templated forwarding ctor -- forwards to appropriate variant_filter_iterator ctor
2000  template <typename PredType, typename IterType>
2001  bnd_node_iterator(const IterType & d, const IterType & e, const PredType & p)
2002  : variant_filter_iterator<MeshBase::Predicate, BndNode *>(d, e, p)
2003  {
2004  }
2005 };
2006 
2012  BndNode * const,
2013  BndNode * const &,
2014  BndNode * const *>
2015 {
2016  // Templated forwarding ctor -- forwards to appropriate variant_filter_iterator ctor
2017  template <typename PredType, typename IterType>
2018  const_bnd_node_iterator(const IterType & d, const IterType & e, const PredType & p)
2019  : variant_filter_iterator<MeshBase::Predicate,
2020  BndNode * const,
2021  BndNode * const &,
2022  BndNode * const *>(d, e, p)
2023  {
2024  }
2025 
2026  // The conversion-to-const ctor. Takes a regular iterator and calls the appropriate
2027  // variant_filter_iterator copy constructor. Note that this one is *not* templated!
2029  : variant_filter_iterator<MeshBase::Predicate,
2030  BndNode * const,
2031  BndNode * const &,
2032  BndNode * const *>(rhs)
2033  {
2034  }
2035 };
2036 
2040 struct MooseMesh::bnd_elem_iterator : variant_filter_iterator<MeshBase::Predicate, BndElement *>
2041 {
2042  // Templated forwarding ctor -- forwards to appropriate variant_filter_iterator ctor
2043  template <typename PredType, typename IterType>
2044  bnd_elem_iterator(const IterType & d, const IterType & e, const PredType & p)
2045  : variant_filter_iterator<MeshBase::Predicate, BndElement *>(d, e, p)
2046  {
2047  }
2048 };
2049 
2055  BndElement * const,
2056  BndElement * const &,
2057  BndElement * const *>
2058 {
2059  // Templated forwarding ctor -- forwards to appropriate variant_filter_iterator ctor
2060  template <typename PredType, typename IterType>
2061  const_bnd_elem_iterator(const IterType & d, const IterType & e, const PredType & p)
2062  : variant_filter_iterator<MeshBase::Predicate,
2063  BndElement * const,
2064  BndElement * const &,
2065  BndElement * const *>(d, e, p)
2066  {
2067  }
2068 
2069  // The conversion-to-const ctor. Takes a regular iterator and calls the appropriate
2070  // variant_filter_iterator copy constructor. Note that this one is *not* templated!
2072  : variant_filter_iterator<MeshBase::Predicate,
2073  BndElement * const,
2074  BndElement * const &,
2075  BndElement * const *>(rhs)
2076  {
2077  }
2078 };
2079 
2087 
2088 template <typename T>
2089 std::unique_ptr<T>
2091 {
2092  // If the requested mesh type to build doesn't match our current value for _use_distributed_mesh,
2093  // then we need to make sure to make our state consistent because other objects, like the periodic
2094  // boundary condition action, will be querying isDistributedMesh()
2095  if (_use_distributed_mesh != std::is_same<T, libMesh::DistributedMesh>::value)
2096  {
2097  if (getMeshPtr())
2098  mooseError("A MooseMesh object is being asked to build a libMesh mesh that is a different "
2099  "parallel type than the libMesh mesh that it wraps. This is not allowed. Please "
2100  "create another MooseMesh object to wrap the new libMesh mesh");
2102  }
2103 
2104  if (dim == libMesh::invalid_uint)
2105  {
2106  if (isParamValid("dim"))
2107  dim = getParam<MooseEnum>("dim");
2108  else
2109  // Legacy selection of the default for the 'dim' parameter
2110  dim = 1;
2111  }
2112 
2113  auto mesh = std::make_unique<T>(_communicator, dim);
2114 
2115  if (!getParam<bool>("allow_renumbering"))
2116  mesh->allow_renumbering(false);
2117 
2118  mesh->allow_remote_element_removal(_allow_remote_element_removal);
2120 
2122  {
2123  // Check of partitioner is supplied (not allowed if custom partitioner is used)
2124  if (!parameters().isParamSetByAddParam("partitioner"))
2125  mooseError("If partitioner block is provided, partitioner keyword cannot be used!");
2126  // Set custom partitioner
2127  if (!_custom_partitioner.get())
2128  mooseError("Custom partitioner requested but not set!");
2129  mesh->partitioner() = _custom_partitioner->clone();
2130  }
2131  else
2132  setPartitionerHelper(mesh.get());
2133 
2134  return mesh;
2135 }
2136 
2137 inline bool
2139 {
2141 }
2142 
2143 inline void
2145 {
2146  _parallel_type = parallel_type;
2148 }
2149 
2150 inline bool
2151 MooseMesh::hasElementID(const std::string & id_name) const
2152 {
2153  return getMesh().has_elem_integer(id_name);
2154 }
2155 
2156 inline unsigned int
2157 MooseMesh::getElementIDIndex(const std::string & id_name) const
2158 {
2159  if (!hasElementID(id_name))
2160  mooseError("Mesh does not have element ID for ", id_name);
2161  return getMesh().get_elem_integer_index(id_name);
2162 }
2163 
2164 inline bool
2165 MooseMesh::areElemIDsIdentical(const std::string & id_name1, const std::string & id_name2) const
2166 {
2167  auto id1 = getElementIDIndex(id_name1);
2168  auto id2 = getElementIDIndex(id_name2);
2169  return _id_identical_flag[id1][id2];
2170 }
2171 
2172 inline const std::vector<const FaceInfo *> &
2174 {
2175  return _face_info;
2176 }
2177 
2178 inline const std::vector<FaceInfo> &
2180 {
2181  return _all_face_info;
2182 }
2183 
2184 inline const std::map<boundary_id_type, std::vector<dof_id_type>> &
2186 {
2187  return _node_set_nodes;
2188 }
2189 
2190 inline const std::unordered_map<std::pair<const Elem *, unsigned short int>, const Elem *> &
2192 {
2194 }
2195 
2196 inline bool
2197 MooseMesh::isLowerD(const SubdomainID subdomain_id) const
2198 {
2199  return libmesh_map_find(_sub_to_data, subdomain_id).is_lower_d;
2200 }
ParallelType _parallel_type
Can be set to DISTRIBUTED, REPLICATED, or DEFAULT.
Definition: MooseMesh.h:1423
static InputParameters validParams()
Typical "Moose-style" constructor and copy constructor.
Definition: MooseMesh.C:83
virtual std::string getFileName() const
Returns the name of the mesh file read to produce this mesh if any or an empty string otherwise...
Definition: MooseMesh.h:1071
virtual bnd_node_iterator bndNodesEnd()
Definition: MooseMesh.C:1550
virtual bnd_elem_iterator bndElemsEnd()
Definition: MooseMesh.C:1566
std::vector< std::vector< Real > > _bounds
The bounds in each dimension of the mesh for regular orthogonal meshes.
Definition: MooseMesh.h:1580
const std::map< boundary_id_type, std::vector< dof_id_type > > & nodeSetNodes() const
Definition: MooseMesh.h:2185
std::set< Node * > _semilocal_node_list
Used for generating the semilocal node range.
Definition: MooseMesh.h:1488
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:1547
const std::vector< QpMap > & getPCoarseningSideMap(const Elem &elem) const
Get the map describing for each side quadrature point (qp) on the coarse level which qp on the previo...
Definition: MooseMesh.C:4365
virtual Real getMaxInDimension(unsigned int component) const
Definition: MooseMesh.C:2203
virtual unsigned int spatialDimension() const
Returns MeshBase::spatial_dimension.
Definition: MooseMesh.h:182
bool _node_to_elem_map_built
Definition: MooseMesh.h:1506
std::unique_ptr< libMesh::NodeRange > _active_node_range
Definition: MooseMesh.h:1497
std::vector< Node * > _extreme_nodes
A vector containing the nodes at the corners of a regular orthogonal mesh.
Definition: MooseMesh.h:1634
Node * addQuadratureNode(const Elem *elem, const unsigned short int side, const unsigned int qp, BoundaryID bid, const Point &point)
Adds a fictitious "QuadratureNode".
Definition: MooseMesh.C:1607
std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > buildSideList()
As above, but uses the non-deprecated std::tuple interface.
Definition: MooseMesh.C:3004
const_bnd_elem_iterator(const bnd_elem_iterator &rhs)
Definition: MooseMesh.h:2071
bool isFiniteVolumeInfoDirty() const
Definition: MooseMesh.h:1304
const std::set< BoundaryID > & meshNodesetIds() const
Returns a read-only reference to the set of nodesets currently present in the Mesh.
Definition: MooseMesh.C:3184
void buildElemIDInfo()
Build extra data for faster access to the information of extra element integers.
Definition: MooseMesh.C:1056
std::vector< FaceInfo > _all_face_info
FaceInfo object storing information for face based loops.
Definition: MooseMesh.h:1604
std::vector< const FaceInfo * > _face_info
Holds only those FaceInfo objects that have processor_id equal to this process&#39;s id, e.g.
Definition: MooseMesh.h:1608
bool allowRemoteElementRemoval() const
Whether we are allow remote element removal.
Definition: MooseMesh.h:1094
bool getConstructNodeListFromSideList()
Return construct node list from side list boolean.
Definition: MooseMesh.h:1409
virtual Real getMinInDimension(unsigned int component) const
Returns the min or max of the requested dimension respectively.
Definition: MooseMesh.C:2194
libMesh::ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:1235
virtual void onMeshChanged()
Declares a callback function that is executed at the conclusion of meshChanged(). ...
Definition: MooseMesh.C:905
bool prepared() const
Setter/getter for whether the mesh is prepared.
Definition: MooseMesh.C:3132
void needsPrepareForUse()
If this method is called, we will call libMesh&#39;s prepare_for_use method when we call Moose&#39;s prepare ...
Definition: MooseMesh.C:3160
const std::set< BoundaryID > & getBoundaryIDs() const
Returns a const reference to a set of all user-specified boundary IDs.
Definition: MooseMesh.C:2972
bool _is_nemesis
True if a Nemesis Mesh was read in.
Definition: MooseMesh.h:1469
std::vector< SubdomainName > _provided_coord_blocks
Set for holding user-provided coordinate system type block names.
Definition: MooseMesh.h:1874
virtual MooseMesh & clone() const
Clone method.
Definition: MooseMesh.C:2817
void allowRecovery(bool allow)
Set whether or not this mesh is allowed to read a recovery file.
Definition: MooseMesh.h:1031
const std::vector< QpMap > & getPCoarseningMapHelper(const Elem &elem, const std::map< std::pair< libMesh::ElemType, unsigned int >, std::vector< QpMap >> &) const
Definition: MooseMesh.C:4337
const std::string LIST_GEOM_ELEM
Definition: MooseMesh.h:58
bool isCustomPartitionerRequested() const
Setter and getter for _custom_partitioner_requested.
Definition: MooseMesh.C:3700
bool _need_ghost_ghosted_boundaries
A parallel mesh generator such as DistributedRectilinearMeshGenerator already make everything ready...
Definition: MooseMesh.h:1837
A class for creating restricted objects.
Definition: Restartable.h:28
bool isDisplaced() const
whether this mesh is a displaced mesh
Definition: MooseMesh.h:1213
unsigned int _uniform_refine_level
The level of uniform refinement requested (set to zero if AMR is disabled)
Definition: MooseMesh.h:1457
const std::vector< QpMap > & getPRefinementMapHelper(const Elem &elem, const std::map< std::pair< libMesh::ElemType, unsigned int >, std::vector< QpMap >> &) const
Definition: MooseMesh.C:4326
std::vector< dof_id_type > _min_ids
Minimum integer ID for each extra element integer.
Definition: MooseMesh.h:1844
std::unordered_set< dof_id_type > getBoundaryActiveSemiLocalElemIds(BoundaryID bid) const
Return all ids of elements which have a side which is part of a sideset.
Definition: MooseMesh.C:1328
const std::set< SubdomainID > & interiorLowerDBlocks() const
Definition: MooseMesh.h:1403
const MooseUnits & lengthUnit() const
Definition: MooseMesh.C:4299
void checkDuplicateSubdomainNames()
Loop through all subdomain IDs and check if there is name duplication used for the subdomains with sa...
Definition: MooseMesh.C:4306
const unsigned int invalid_uint
const std::set< BoundaryID > & getSubdomainBoundaryIds(const SubdomainID subdomain_id) const
Get the list of boundary ids associated with the given subdomain id.
Definition: MooseMesh.C:3492
unsigned int _max_leaf_size
Definition: MooseMesh.h:1568
The definition of the const_bnd_elem_iterator struct.
Definition: MooseMesh.h:2054
RealVectorValue _half_range
A convenience vector used to hold values in each dimension representing half of the range...
Definition: MooseMesh.h:1631
Keeps track of stuff related to assembling.
Definition: Assembly.h:101
const_bnd_elem_iterator(const IterType &d, const IterType &e, const PredType &p)
Definition: MooseMesh.h:2061
std::map< libMesh::ElemType, std::map< std::pair< int, int >, std::vector< std::vector< QpMap > > > > _elem_type_to_child_side_refinement_map
Holds mappings for "internal" child sides to parent volume. The second key is (child, child_side).
Definition: MooseMesh.h:1762
void setCoordData(const MooseMesh &other_mesh)
Set the coordinate system data to that of other_mesh.
Definition: MooseMesh.C:4291
virtual ~MooseMesh()
Definition: MooseMesh.C:367
void freeBndElems()
Definition: MooseMesh.C:393
const std::unordered_map< std::pair< const Elem *, unsigned short int >, const Elem * > & getLowerDElemMap() const
This function attempts to return the map from a high-order element side to its corresponding lower-d ...
Definition: MooseMesh.h:2191
bool _finite_volume_info_dirty
Definition: MooseMesh.h:1615
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:3108
elem_info_iterator(const IterType &d, const IterType &e, const PredType &p)
Definition: MooseMesh.h:1958
const_bnd_node_iterator(const MooseMesh::bnd_node_iterator &rhs)
Definition: MooseMesh.h:2028
char ** blocks
The definition of the bnd_elem_iterator struct.
Definition: MooseMesh.h:2040
std::map< SubdomainID, Moose::CoordinateSystemType > & _coord_sys
Type of coordinate system per subdomain.
Definition: MooseMesh.h:1858
const std::vector< const ElemInfo * > & elemInfoVector() const
Accessor for the element info objects owned by this process.
Definition: MooseMesh.h:1181
bool isBoundaryNode(dof_id_type node_id) const
Returns true if the requested node is in the list of boundary nodes, false otherwise.
Definition: MooseMesh.C:3560
face_info_iterator ownedFaceInfoBegin()
Iterators to owned faceInfo objects.
Definition: MooseMesh.C:1507
const std::map< dof_id_type, std::vector< dof_id_type > > & nodeToActiveSemilocalElemMap()
If not already created, creates a map from every node to all active semilocal elements to which they ...
Definition: MooseMesh.C:1203
std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > buildActiveSideList() const
Calls BoundaryInfo::build_active_side_list.
Definition: MooseMesh.C:3010
static void setPartitioner(MeshBase &mesh_base, MooseEnum &partitioner, bool use_distributed_mesh, const InputParameters &params, MooseObject &context_obj)
Method for setting the partitioner on the passed in mesh_base object.
Definition: MooseMesh.C:3635
void buildLowerDMesh()
Build lower-d mesh for all sides.
Definition: MooseMesh.C:655
const std::set< BoundaryID > & meshSidesetIds() const
Returns a read-only reference to the set of sidesets currently present in the Mesh.
Definition: MooseMesh.C:3178
void setParallelType(ParallelType parallel_type)
Allow to change parallel type.
Definition: MooseMesh.h:2144
std::unordered_map< const Elem *, unsigned short int > _lower_d_elem_to_higher_d_elem_side
Definition: MooseMesh.h:1812
void cacheFVElementalDoFs() const
Cache the DoF indices for FV variables on each element.
Definition: MooseMesh.C:4014
void cacheFaceInfoVariableOwnership() const
Cache if variables live on the elements connected by the FaceInfo objects.
Definition: MooseMesh.C:3936
bool _custom_partitioner_requested
Definition: MooseMesh.h:1441
const std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > & getBoundariesToElems() const
Returns a map of boundaries to ids of elements on the boundary.
Definition: MooseMesh.C:1314
Moose::CoordinateSystemType getUniqueCoordSystem() const
Get the coordinate system from the mesh, it must be the same in all subdomains otherwise this will er...
Definition: MooseMesh.C:4154
std::map< dof_id_type, std::vector< dof_id_type > > _node_to_elem_map
A map of all of the current nodes to the elements that they are connected to.
Definition: MooseMesh.h:1505
MooseMesh()=delete
const_face_info_iterator(const MooseMesh::face_info_iterator &rhs)
Definition: MooseMesh.h:1941
const_bnd_node_iterator(const IterType &d, const IterType &e, const PredType &p)
Definition: MooseMesh.h:2018
bool isSemiLocal(Node *const node) const
Returns true if the node is semi-local.
Definition: MooseMesh.C:989
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > ConstBndElemRange
Definition: MooseMesh.h:2086
const Elem * getLowerDElem(const Elem *, unsigned short int) const
Returns a const pointer to a lower dimensional element that corresponds to a side of a higher dimensi...
Definition: MooseMesh.C:1698
std::unique_ptr< libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > > _bnd_elem_range
Definition: MooseMesh.h:1502
RealVectorValue minPeriodicVector(unsigned int nonlinear_var_num, Point p, Point q) const
This function returns the minimum vector between two points on the mesh taking into account periodici...
Definition: MooseMesh.C:2257
const std::vector< std::pair< unsigned int, QpMap > > & getCoarseningMap(const Elem &elem, int input_side)
Get the coarsening map for a given element type.
Definition: MooseMesh.C:2574
std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > _bnd_elem_ids
Map of set of elem IDs connected to each boundary.
Definition: MooseMesh.h:1545
bool _is_changed
true if mesh is changed (i.e. after adaptivity step)
Definition: MooseMesh.h:1466
bool _doing_p_refinement
Whether we have p-refinement (as opposed to h-refinement)
Definition: MooseMesh.h:1877
void determineUseDistributedMesh()
Determine whether to use a distributed mesh.
Definition: MooseMesh.C:2823
const std::vector< std::vector< QpMap > > & getRefinementMap(const Elem &elem, int parent_side, int child, int child_side)
Get the refinement map for a given element type.
Definition: MooseMesh.C:2510
const std::string & getBoundaryName(BoundaryID boundary_id)
Return the name of the boundary given the id.
Definition: MooseMesh.C:1787
void cacheChangedLists()
Cache information about what elements were refined and coarsened in the previous step.
Definition: MooseMesh.C:910
bool isTranslatedPeriodic(unsigned int nonlinear_var_num, unsigned int component) const
Returns whether this generated mesh is periodic in the given dimension for the given variable...
Definition: MooseMesh.C:2246
std::set< SubdomainID > neighbor_subs
Neighboring subdomain ids.
Definition: MooseMesh.h:1789
unsigned int getGhostingPatchSize() const
Getter for the ghosting_patch_size parameter.
Definition: MooseMesh.h:626
std::vector< BndNode * >::iterator bnd_node_iterator_imp
Definition: MooseMesh.h:1534
const_face_info_iterator(const IterType &d, const IterType &e, const PredType &p)
Definition: MooseMesh.h:1931
The definition of the bnd_node_iterator struct.
Definition: MooseMesh.h:1997
face_info_iterator(const IterType &d, const IterType &e, const PredType &p)
Definition: MooseMesh.h:1914
std::vector< const ElemInfo * > _elem_info
Holds only those ElemInfo objects that have processor_id equal to this process&#39;s id, e.g.
Definition: MooseMesh.h:1600
MeshBase & mesh
void buildHRefinementAndCoarseningMaps(Assembly *assembly)
Definition: MooseMesh.C:2306
bool usingGeneralAxisymmetricCoordAxes() const
Returns true if general axisymmetric coordinate axes are being used.
Definition: MooseMesh.C:4248
std::map< std::pair< int, libMesh::ElemType >, std::vector< std::vector< QpMap > > > _elem_type_to_refinement_map
Holds mappings for volume to volume and parent side to child side Map key:
Definition: MooseMesh.h:1753
const std::set< SubdomainID > & getBlockConnectedBlocks(const SubdomainID subdomain_id) const
Get the list of subdomains neighboring a given subdomain.
Definition: MooseMesh.C:3549
virtual const Node * queryNodePtr(const dof_id_type i) const
Definition: MooseMesh.C:857
libMesh::StoredRange< std::set< Node * >::iterator, Node * > SemiLocalNodeRange
Definition: MooseMesh.h:55
std::unordered_map< std::pair< const Elem *, unsigned short int >, const Elem * > _higher_d_elem_side_to_lower_d_elem
Holds a map from a high-order element side to its corresponding lower-d element.
Definition: MooseMesh.h:1811
Helper object for holding qp mapping info.
Definition: MooseMesh.h:69
bool _has_lower_d
Whether there are any lower-dimensional blocks that are manifolds of higher-dimensional block faces...
Definition: MooseMesh.h:1816
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const std::vector< Real > & getGhostedBoundaryInflation() const
Return a writable reference to the _ghosted_boundaries_inflation vector.
Definition: MooseMesh.C:3242
std::unique_ptr< ConstElemPointerRange > _refined_elements
The elements that were just refined.
Definition: MooseMesh.h:1475
dof_id_type maxElementID(unsigned int elem_id_index) const
Return the maximum element ID for an extra element integer with its accessing index.
Definition: MooseMesh.h:1119
std::vector< std::vector< bool > > _id_identical_flag
Flags to indicate whether or not any two extra element integers are the same.
Definition: MooseMesh.h:1846
virtual dof_id_type maxElemId() const
Definition: MooseMesh.C:3088
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:153
virtual bnd_elem_iterator bndElemsBegin()
Return iterators to the beginning/end of the boundary elements list.
Definition: MooseMesh.C:1558
The definition of the const_bnd_node_iterator struct.
Definition: MooseMesh.h:2011
void setUniformRefineLevel(unsigned int, bool deletion=true)
Set uniform refinement level.
Definition: MooseMesh.C:3217
MooseEnum _partitioner_name
The partitioner used on this mesh.
Definition: MooseMesh.h:1436
std::unique_ptr< libMesh::ConstElemRange > _active_local_elem_range
A range for use with threading.
Definition: MooseMesh.h:1494
std::map< dof_id_type, std::set< SubdomainID > > _block_node_list
list of nodes that belongs to a specified block (domain)
Definition: MooseMesh.h:1553
bool areElemIDsIdentical(const std::string &id_name1, const std::string &id_name2) const
Whether or not two extra element integers are identical.
Definition: MooseMesh.h:2165
bool _node_to_active_semilocal_elem_map_built
Definition: MooseMesh.h:1510
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_node_ids
Map of sets of node IDs in each boundary.
Definition: MooseMesh.h:1537
ConstElemPointerRange * refinedElementRange() const
Return a range that is suitable for threaded execution over elements that were just refined...
Definition: MooseMesh.C:928
virtual void init()
Initialize the Mesh object.
Definition: MooseMesh.C:2870
The definition of the const_face_info_iterator struct.
Definition: MooseMesh.h:1924
bool _skip_refine_when_use_split
Whether or not to skip uniform refinements when using a pre-split mesh.
Definition: MooseMesh.h:1460
unsigned int getHigherDSide(const Elem *elem) const
Returns the local side ID of the interior parent aligned with the lower dimensional element...
Definition: MooseMesh.C:1709
std::unordered_map< std::pair< const Elem *, unsigned int >, FaceInfo * > _elem_side_to_face_info
Map from elem-side pair to FaceInfo.
Definition: MooseMesh.h:1612
void detectPairedSidesets()
This routine detects paired sidesets of a regular orthogonal mesh (.i.e.
Definition: MooseMesh.C:1994
const std::set< SubdomainID > & getNodeBlockIds(const Node &node) const
Return list of blocks to which the given node belongs.
Definition: MooseMesh.C:1496
const Parallel::Communicator & _communicator
std::map< std::pair< libMesh::ElemType, unsigned int >, std::vector< QpMap > > _elem_type_to_p_coarsening_side_map
Definition: MooseMesh.h:1784
void setMeshBoundaryIDs(std::set< BoundaryID > boundary_IDs)
Sets the set of BoundaryIDs Is called by AddAllSideSetsByNormals.
Definition: MooseMesh.C:3190
std::map< boundary_id_type, std::vector< dof_id_type > > _node_set_nodes
list of nodes that belongs to a specified nodeset: indexing [nodeset_id] -> [array of node ids] ...
Definition: MooseMesh.h:1556
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
std::set< SubdomainID > _lower_d_boundary_blocks
Mesh blocks for boundary lower-d elements in different types.
Definition: MooseMesh.h:1808
bool _linear_finite_volume_dofs_cached
Definition: MooseMesh.h:1620
void markFiniteVolumeInfoDirty()
Mark the finite volume information as dirty.
Definition: MooseMesh.h:1299
void cacheInfo()
Definition: MooseMesh.C:1404
std::basic_ostream< charT, traits > * os
Definition: InfixIterator.h:33
void changeBoundaryId(const boundary_id_type old_id, const boundary_id_type new_id, bool delete_prev)
Change all the boundary IDs for a given side from old_id to new_id.
Definition: MooseMesh.C:2757
std::vector< std::unique_ptr< libMesh::GhostingFunctor > > _ghosting_functors
Deprecated (DO NOT USE)
Definition: MooseMesh.h:1413
std::set< Elem * > _ghost_elems_from_ghost_boundaries
Set of elements ghosted by ghostGhostedBoundaries.
Definition: MooseMesh.h:1831
virtual void buildMesh()=0
Must be overridden by child classes.
void setPartitionerHelper(MeshBase *mesh=nullptr)
Definition: MooseMesh.C:3623
void deleteRemoteElements()
Delete remote elements.
Definition: MooseMesh.C:3924
unsigned int _to
The qp to map to.
Definition: MooseMesh.h:78
libMesh::ConstNodeRange * getLocalNodeRange()
Definition: MooseMesh.C:1272
virtual const Node & nodeRef(const dof_id_type i) const
Definition: MooseMesh.C:831
bool _allow_recovery
Whether or not this Mesh is allowed to read a recovery file.
Definition: MooseMesh.h:1819
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
std::vector< SubdomainID > getSubdomainIDs(const std::vector< SubdomainName > &subdomain_names) const
Get the associated subdomainIDs for the subdomain names that are passed in.
Definition: MooseMesh.C:1734
void buildNodeListFromSideList()
Calls BoundaryInfo::build_node_list_from_side_list().
Definition: MooseMesh.C:2978
const std::string & getSubdomainName(SubdomainID subdomain_id) const
Return the name of a block given an id.
Definition: MooseMesh.C:1758
void setPatchUpdateStrategy(Moose::PatchUpdateType patch_update_strategy)
Set the patch size update strategy.
Definition: MooseMesh.C:3402
void buildFiniteVolumeInfo() const
Builds the face and elem info vectors that store meta-data needed for looping over and doing calculat...
Definition: MooseMesh.C:3734
std::unordered_map< SubdomainID, std::set< BoundaryID > > _neighbor_subdomain_boundary_ids
Holds a map from neighbor subomdain ids to the boundary ids that are attached to it.
Definition: MooseMesh.h:1803
const std::pair< Point, RealVectorValue > & getGeneralAxisymmetricCoordAxis(SubdomainID subdomain_id) const
Gets the general axisymmetric coordinate axis for a block.
Definition: MooseMesh.C:4238
auto max(const L &left, const R &right)
const std::set< BoundaryID > & meshBoundaryIds() const
Returns a read-only reference to the set of boundary IDs currently present in the Mesh...
Definition: MooseMesh.C:3172
std::set< SubdomainID > _lower_d_interior_blocks
Mesh blocks for interior lower-d elements in different types.
Definition: MooseMesh.h:1806
virtual Elem * queryElemPtr(const dof_id_type i)
Definition: MooseMesh.C:3120
bool isLowerD(const SubdomainID subdomain_id) const
Definition: MooseMesh.h:2197
elem_info_iterator ownedElemInfoBegin()
Iterators to owned faceInfo objects.
Definition: MooseMesh.C:1525
void setIsCustomPartitionerRequested(bool cpr)
Definition: MooseMesh.C:3722
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
std::set< BoundaryID > boundary_ids
The boundary ids that are attached.
Definition: MooseMesh.h:1793
unsigned int _max_h_level
Maximum h-refinement level of all elements.
Definition: MooseMesh.h:1881
virtual bnd_node_iterator bndNodesBegin()
Return iterators to the beginning/end of the boundary nodes list.
Definition: MooseMesh.C:1542
void mapPoints(const std::vector< Point > &from, const std::vector< Point > &to, std::vector< QpMap > &qp_map)
Find the closest points that map "from" to "to" and fill up "qp_map".
Definition: MooseMesh.C:2585
bnd_elem_iterator(const IterType &d, const IterType &e, const PredType &p)
Definition: MooseMesh.h:2044
bool is_lower_d
Whether this subdomain is a lower-dimensional manifold of a higher-dimensional subdomain.
Definition: MooseMesh.h:1796
void attachRelationshipManagers(Moose::RelationshipManagerType rm_type, bool attach_geometric_rm_final=false)
Attach the relationship managers of the given type Note: Geometric relationship managers that are sup...
Definition: MooseApp.C:3173
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.
Definition: MooseMesh.C:3612
const MeshBase * getMeshPtr() const
Definition: MooseMesh.C:3437
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:36
void updateCoordTransform()
Update the coordinate transformation object based on our coordinate system data.
Definition: MooseMesh.C:4254
const std::vector< const FaceInfo * > & faceInfo() const
Accessor for local FaceInfo objects.
Definition: MooseMesh.h:2173
dof_id_type minElementID(unsigned int elem_id_index) const
Return the minimum element ID for an extra element integer with its accessing index.
Definition: MooseMesh.h:1124
const std::vector< FaceInfo > & allFaceInfo() const
Accessor for all FaceInfo objects.
Definition: MooseMesh.h:2179
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:1428
bool isSplit() const
Definition: MooseMesh.h:1327
std::unique_ptr< std::map< BoundaryID, RealVectorValue > > _boundary_to_normal_map
The boundary to normal map - valid only when AddAllSideSetsByNormals is active.
Definition: MooseMesh.h:1530
std::vector< BndElement * >::const_iterator const_bnd_elem_iterator_imp
Definition: MooseMesh.h:1542
bool hasElementID(const std::string &id_name) const
Whether mesh has an extra element integer with a given name.
Definition: MooseMesh.h:2151
bool _built_from_other_mesh
Whether or not this mesh was built from another mesh.
Definition: MooseMesh.h:1419
virtual dof_id_type nLocalNodes() const
Definition: MooseMesh.h:324
bool _allow_remote_element_removal
Whether to allow removal of remote elements.
Definition: MooseMesh.h:1828
bnd_node_iterator(const IterType &d, const IterType &e, const PredType &p)
Definition: MooseMesh.h:2001
virtual bool skipNoncriticalPartitioning() const
Definition: MooseMesh.C:4371
SemiLocalNodeRange * getActiveSemiLocalNodeRange() const
Definition: MooseMesh.C:1263
int8_t boundary_id_type
std::unordered_set< dof_id_type > getBoundaryActiveNeighborElemIds(BoundaryID bid) const
Return all ids of neighbors of elements which have a side which is part of a sideset.
Definition: MooseMesh.C:1339
void setSubdomainName(SubdomainID subdomain_id, const SubdomainName &name)
This method sets the name for subdomain_id to name.
Definition: MooseMesh.C:1746
void clearQuadratureNodes()
Clear out any existing quadrature nodes.
Definition: MooseMesh.C:1677
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:3443
const std::map< SubdomainID, Moose::CoordinateSystemType > & getCoordSystem() const
Get the map from subdomain ID to coordinate system type, e.g.
Definition: MooseMesh.C:4176
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:1533
std::unique_ptr< T > buildTypedMesh(unsigned int dim=libMesh::invalid_uint)
Shortcut method to construct a unique pointer to a libMesh mesh instance.
Definition: MooseMesh.h:2090
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
The list of active geometric relationship managers (bound to the underlying MeshBase object)...
Definition: MooseMesh.h:1416
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh me...
Definition: MooseMesh.C:2923
unsigned int _from
The qp to map from.
Definition: MooseMesh.h:75
std::pair< const Node *, BoundaryID > PeriodicNodeInfo
Helper type for building periodic node maps.
Definition: MooseMesh.h:1074
virtual SubdomainID nSubdomains() const
Definition: MooseMesh.h:327
const_elem_info_iterator(const IterType &d, const IterType &e, const PredType &p)
Definition: MooseMesh.h:1975
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)
Method to construct a libMesh::MeshBase object that is normally set and used by the MooseMesh object ...
Definition: MooseMesh.C:2851
unsigned int getAxisymmetricRadialCoord() const
Returns the desired radial direction for RZ coordinate transformation.
Definition: MooseMesh.C:4263
bool isPartitionerForced() const
Tell the user if the partitioner was overriden for any reason.
Definition: MooseMesh.h:1026
const std::set< unsigned int > & getGhostedBoundaries() const
Return a writable reference to the set of ghosted boundary IDs.
Definition: MooseMesh.C:3236
bool _construct_node_list_from_side_list
Whether or not to allow generation of nodesets from sidesets.
Definition: MooseMesh.h:1822
boundary_id_type BoundaryID
unsigned int sideWithBoundaryID(const Elem *const elem, const BoundaryID boundary_id) const
Calls BoundaryInfo::side_with_boundary_id().
Definition: MooseMesh.C:3016
const std::vector< dof_id_type > & getNodeList(boundary_id_type nodeset_id) const
Return a writable reference to a vector of node IDs that belong to nodeset_id.
Definition: MooseMesh.C:3465
unsigned int getMaxLeafSize() const
Getter for the maximum leaf size parameter.
Definition: MooseMesh.h:631
virtual const Node * nodePtr(const dof_id_type i) const
Definition: MooseMesh.C:845
bool hasLowerD() const
Definition: MooseMesh.h:1398
std::vector< dof_id_type > _max_ids
Maximum integer ID for each extra element integer.
Definition: MooseMesh.h:1842
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
void update()
Calls buildNodeListFromSideList(), buildNodeList(), and buildBndElemList().
Definition: MooseMesh.C:616
const std::pair< BoundaryID, BoundaryID > * getPairedBoundaryMapping(unsigned int component)
This function attempts to return the paired boundary ids for the given component. ...
Definition: MooseMesh.C:2288
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
std::set< BoundaryID > _mesh_nodeset_ids
Definition: MooseMesh.h:1526
std::unique_ptr< MooseAppCoordTransform > _coord_transform
A coordinate transformation object that describes how to transform this problem&#39;s coordinate system i...
Definition: MooseMesh.h:1868
std::set< SubdomainID > getBoundaryConnectedBlocks(const BoundaryID bid) const
Get the list of subdomains associated with the given boundary.
Definition: MooseMesh.C:3516
void checkCoordinateSystems()
Performs a sanity check for every element in the mesh.
Definition: MooseMesh.C:4276
ParallelType getParallelType() const
Definition: MooseMesh.h:1016
std::map< std::pair< libMesh::ElemType, unsigned int >, std::vector< QpMap > > _elem_type_to_p_refinement_side_map
Definition: MooseMesh.h:1758
std::map< std::pair< libMesh::ElemType, unsigned int >, std::vector< QpMap > > _elem_type_to_p_coarsening_map
Definition: MooseMesh.h:1782
const bool _is_split
Whether or not we are using a (pre-)split mesh (automatically DistributedMesh)
Definition: MooseMesh.h:1586
void setCoordSystem(const std::vector< SubdomainName > &blocks, const MultiMooseEnum &coord_sys)
Set the coordinate system for the provided blocks to coord_sys.
Definition: MooseMesh.C:4076
std::unique_ptr< ConstElemPointerRange > _coarsened_elements
The elements that were just coarsened.
Definition: MooseMesh.h:1478
std::set< dof_id_type > getAllElemIDs(unsigned int elem_id_index) const
Return all the unique element IDs for an extra element integer with its index.
Definition: MooseMesh.C:1126
std::set< BoundaryID > _mesh_boundary_ids
A set of boundary IDs currently present in the mesh.
Definition: MooseMesh.h:1524
const Node * addUniqueNode(const Point &p, Real tol=1e-6)
Add a new node to the mesh.
Definition: MooseMesh.C:1573
std::vector< BndNode > _extra_bnd_nodes
Definition: MooseMesh.h:1550
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:84
bool _moose_mesh_prepared
True if prepare has been called on the mesh.
Definition: MooseMesh.h:1472
void buildRefinementMap(const Elem &elem, libMesh::QBase &qrule, libMesh::QBase &qrule_face, int parent_side, int child, int child_side)
Build the refinement map for a given element type.
Definition: MooseMesh.C:2467
The definition of the face_info_iterator struct.
Definition: MooseMesh.h:1909
unsigned int uniformRefineLevel() const
Returns the level of uniform refinement requested (zero if AMR is disabled).
Definition: MooseMesh.C:3211
std::vector< BndElement * > _bnd_elems
array of boundary elems
Definition: MooseMesh.h:1540
bool _coord_system_set
Whether the coordinate system has been set.
Definition: MooseMesh.h:1871
const std::set< SubdomainID > & boundaryLowerDBlocks() const
Definition: MooseMesh.h:1407
std::vector< SubdomainName > getSubdomainNames(const std::vector< SubdomainID > &subdomain_ids) const
Get the associated subdomainNames for the subdomain ids that are passed in.
Definition: MooseMesh.C:1764
MooseMesh & operator=(const MooseMesh &other_mesh)=delete
const std::vector< QpMap > & getPRefinementMap(const Elem &elem) const
Get the map describing for each volumetric quadrature point (qp) on the refined level which qp on the...
Definition: MooseMesh.C:4347
virtual dof_id_type nActiveLocalElem() const
Definition: MooseMesh.h:326
Real minPeriodicDistance(unsigned int nonlinear_var_num, Point p, Point q) const
This function returns the distance between two points on the mesh taking into account periodicity for...
Definition: MooseMesh.C:2282
bool hasSecondOrderElements()
check if the mesh has SECOND order elements
Definition: MooseMesh.C:3706
unsigned int getPatchSize() const
Getter for the patch_size parameter.
Definition: MooseMesh.C:3396
void buildRefinementAndCoarseningMaps(Assembly *assembly)
Create the refinement and coarsening maps necessary for projection of stateful material properties wh...
Definition: MooseMesh.C:2457
bool _parallel_type_overridden
Definition: MooseMesh.h:1430
bool isRegularOrthogonal()
Getter to query if the mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:1056
Interface for objects interacting with the PerfGraph.
MeshBase::element_iterator activeLocalElementsBegin()
Calls active_local_nodes_begin/end() on the underlying libMesh mesh object.
Definition: MooseMesh.C:3046
std::vector< Node * > _node_map
Vector of all the Nodes in the mesh for determining when to add a new point.
Definition: MooseMesh.h:1574
std::map< dof_id_type, std::map< unsigned int, std::map< dof_id_type, Node * > > > _elem_to_side_to_qp_to_quadrature_nodes
Definition: MooseMesh.h:1549
const std::vector< QpMap > & getPRefinementSideMap(const Elem &elem) const
Get the map describing for each side quadrature point (qp) on the refined level which qp on the previ...
Definition: MooseMesh.C:4353
std::unordered_map< dof_id_type, ElemInfo > _elem_to_elem_info
Map connecting elems with their corresponding ElemInfo, we use the element ID as the key...
Definition: MooseMesh.h:1596
bool skipRefineWhenUseSplit() const
Whether or not skip uniform refinements when using a pre-split mesh.
Definition: MooseMesh.h:585
std::vector< BndElement * >::iterator bnd_elem_iterator_imp
Definition: MooseMesh.h:1541
Node * getQuadratureNode(const Elem *elem, const unsigned short int side, const unsigned int qp)
Get a specified quadrature node.
Definition: MooseMesh.C:1659
void printInfo(std::ostream &os=libMesh::out, const unsigned int verbosity=0) const
Calls print_info() on the underlying Mesh.
Definition: MooseMesh.C:3457
libMesh::StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > ConstBndNodeRange
Some useful StoredRange typedefs.
Definition: MooseMesh.h:2084
virtual dof_id_type nNodes() const
Calls n_nodes/elem() on the underlying libMesh mesh object.
Definition: MooseMesh.C:3070
static MooseEnum partitioning()
returns MooseMesh partitioning options so other classes can use it
Definition: MooseMesh.C:3893
MooseAppCoordTransform & coordTransform()
Definition: MooseMesh.h:1888
void buildCoarseningMap(const Elem &elem, libMesh::QBase &qrule, libMesh::QBase &qrule_face, int input_side)
Build the coarsening map for a given element type.
Definition: MooseMesh.C:2546
const std::vector< const Elem * > & coarsenedElementChildren(const Elem *elem) const
Get the newly removed children element ids for an element that was just coarsened.
Definition: MooseMesh.C:940
std::unordered_map< dof_id_type, std::set< dof_id_type > > getElemIDMapping(const std::string &from_id_name, const std::string &to_id_name) const
Definition: MooseMesh.C:1097
std::map< std::pair< int, libMesh::ElemType >, std::vector< std::pair< unsigned int, QpMap > > > _elem_type_to_coarsening_map
Holds mappings for volume to volume and parent side to child side Map key:
Definition: MooseMesh.h:1779
void setBoundaryName(BoundaryID boundary_id, BoundaryName name)
This method sets the boundary name of the boundary based on the id parameter.
Definition: MooseMesh.C:1775
Moose::PatchUpdateType _patch_update_strategy
The patch update strategy.
Definition: MooseMesh.h:1571
Physical unit management class with runtime unit string parsing, unit checking, unit conversion...
Definition: Units.h:32
void addPeriodicVariable(unsigned int var_num, BoundaryID primary, BoundaryID secondary)
For "regular orthogonal" meshes, determine if variable var_num is periodic with respect to the primar...
Definition: MooseMesh.C:2212
std::set< BoundaryID > _mesh_sideset_ids
Definition: MooseMesh.h:1525
void setGeneralAxisymmetricCoordAxes(const std::vector< SubdomainName > &blocks, const std::vector< std::pair< Point, RealVectorValue >> &axes)
Sets the general coordinate axes for axisymmetric blocks.
Definition: MooseMesh.C:4190
void setBoundaryToNormalMap(std::unique_ptr< std::map< BoundaryID, RealVectorValue >> boundary_map)
Sets the mapping between BoundaryID and normal vector Is called by AddAllSideSetsByNormals.
Definition: MooseMesh.C:3196
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool _partitioner_overridden
Definition: MooseMesh.h:1437
bool detectOrthogonalDimRanges(Real tol=1e-6)
This routine determines whether the Mesh is a regular orthogonal mesh (i.e.
Definition: MooseMesh.C:1920
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
void updateActiveSemiLocalNodeRange(std::set< dof_id_type > &ghosted_elems)
Clears the "semi-local" node list and rebuilds it.
Definition: MooseMesh.C:948
void isDisplaced(bool is_displaced)
Set whether this mesh is a displaced mesh.
Definition: MooseMesh.h:1208
CoordinateSystemType
Definition: MooseTypes.h:809
std::set< dof_id_type > getElemIDsOnBlocks(unsigned int elem_id_index, const std::set< SubdomainID > &blks) const
Return all the unique element IDs for an extra element integer with its index on a set of subdomains...
Definition: MooseMesh.C:1136
unsigned int getBlocksMaxDimension(const std::vector< SubdomainName > &blocks) const
Returns the maximum element dimension on the given blocks.
Definition: MooseMesh.C:2944
virtual std::unique_ptr< MooseMesh > safeClone() const =0
A safer version of the clone() method that hands back an allocated object wrapped in a smart pointer...
bool _is_displaced
Whether this mesh is displaced.
Definition: MooseMesh.h:1849
bool hasMeshBase() const
Whether mesh base object was constructed or not.
Definition: MooseMesh.h:1104
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:1433
libMesh::NodeRange * getActiveNodeRange()
Definition: MooseMesh.C:1249
virtual unsigned int nPartitions() const
Definition: MooseMesh.h:328
void setGhostedBoundaryInflation(const std::vector< Real > &inflation)
This sets the inflation amount for the bounding box for each partition for use in ghosting boundaries...
Definition: MooseMesh.C:3230
void freeBndNodes()
Definition: MooseMesh.C:375
The definition of the elem_info_iterator struct.
Definition: MooseMesh.h:1953
Real dimensionWidth(unsigned int component) const
Returns the width of the requested dimension.
Definition: MooseMesh.C:2188
PatchUpdateType
Type of patch update strategy for modeling node-face constraints or contact.
Definition: MooseTypes.h:952
bool _skip_deletion_repartition_after_refine
Whether or not skip remote deletion and repartition after uniform refinements.
Definition: MooseMesh.h:1463
std::set< SubdomainID > getBoundaryConnectedSecondaryBlocks(const BoundaryID bid) const
Get the list of subdomains associated with the given boundary of its secondary side.
Definition: MooseMesh.C:3527
bool _need_delete
Whether we need to delete remote elements after init&#39;ing the EquationSystems.
Definition: MooseMesh.h:1825
std::map< std::pair< libMesh::ElemType, unsigned int >, std::vector< QpMap > > _elem_type_to_p_refinement_map
Definition: MooseMesh.h:1756
void setAxisymmetricCoordAxis(const MooseEnum &rz_coord_axis)
For axisymmetric simulations, set the symmetry coordinate axis.
Definition: MooseMesh.C:4182
std::set< BoundaryID > getSubdomainInterfaceBoundaryIds(const SubdomainID subdomain_id) const
Get the list of boundaries that contact the given subdomain.
Definition: MooseMesh.C:3503
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:817
unsigned int maxPLevel() const
Returns the maximum p-refinement level of all elements.
Definition: MooseMesh.h:1357
libMesh::BoundingBox getInflatedProcessorBoundingBox(Real inflation_multiplier=0.01) const
Get a (slightly inflated) processor bounding box.
Definition: MooseMesh.C:3414
std::map< unsigned int, std::vector< bool > > _periodic_dim
A map of vectors indicating which dimensions are periodic in a regular orthogonal mesh for the specif...
Definition: MooseMesh.h:1626
void setMeshBase(std::unique_ptr< MeshBase > mesh_base)
Method to set the mesh_base object.
Definition: MooseMesh.C:2863
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
void buildBndElemList()
Definition: MooseMesh.C:1152
std::set< SubdomainID > getInterfaceConnectedBlocks(const BoundaryID bid) const
Get the list of subdomains contacting the given boundary.
Definition: MooseMesh.C:3538
bool isParallelTypeForced() const
Tell the user if the distribution was overriden for any reason.
Definition: MooseMesh.h:1006
std::vector< Real > _ghosted_boundaries_inflation
Definition: MooseMesh.h:1559
std::vector< std::unordered_map< SubdomainID, std::set< dof_id_type > > > _block_id_mapping
Unique element integer IDs for each subdomain and each extra element integers.
Definition: MooseMesh.h:1840
void needGhostGhostedBoundaries(bool needghost)
Whether or not we want to ghost ghosted boundaries.
Definition: MooseMesh.h:616
const InputParameters & parameters() const
Get the parameters of the object.
void findAdaptivityQpMaps(const Elem *template_elem, libMesh::QBase &qrule, libMesh::QBase &qrule_face, std::vector< std::vector< QpMap >> &refinement_map, std::vector< std::pair< unsigned int, QpMap >> &coarsen_map, int parent_side, int child, int child_side)
Given an elem type, get maps that tell us what qp&#39;s are closest to each other between a parent and it...
Definition: MooseMesh.C:2616
bool needsRemoteElemDeletion() const
Whether we need to delete remote elements.
Definition: MooseMesh.h:1084
std::vector< BndNode * >::const_iterator const_bnd_node_iterator_imp
Definition: MooseMesh.h:1535
unsigned int _patch_size
The number of nodes to consider in the NearestNode neighborhood.
Definition: MooseMesh.h:1562
bool skipDeletionRepartitionAfterRefine() const
Return a flag indicating whether or not we should skip remote deletion and repartition after uniform ...
Definition: MooseMesh.h:2138
elem_info_iterator ownedElemInfoEnd()
Definition: MooseMesh.C:1533
void buildPeriodicNodeSets(std::map< BoundaryID, std::set< dof_id_type >> &periodic_node_sets, unsigned int var_number, libMesh::PeriodicBoundaries *pbs) const
This routine builds a datastructure of node ids organized by periodic boundary ids.
Definition: MooseMesh.C:1893
virtual std::unique_ptr< libMesh::PointLocatorBase > getPointLocator() const
Proxy function to get a (sub)PointLocator from either the underlying libMesh mesh (default)...
Definition: MooseMesh.C:3728
void addGhostedBoundary(BoundaryID boundary_id)
This will add the boundary ids to be ghosted to this processor.
Definition: MooseMesh.C:3224
virtual dof_id_type maxNodeId() const
Calls max_node/elem_id() on the underlying libMesh mesh object.
Definition: MooseMesh.C:3082
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:3094
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
Definition: MooseMesh.C:1300
virtual dof_id_type nActiveElem() const
Definition: MooseMesh.h:325
const_elem_info_iterator(const MooseMesh::elem_info_iterator &rhs)
Definition: MooseMesh.h:1985
face_info_iterator ownedFaceInfoEnd()
Definition: MooseMesh.C:1516
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
std::unordered_map< SubdomainID, std::pair< Point, RealVectorValue > > _subdomain_id_to_rz_coord_axis
Map of subdomain ID to general axisymmetric axis.
Definition: MooseMesh.h:1864
const MooseEnum & partitionerName() const
Definition: MooseMesh.h:1021
Class used for caching additional information for elements such as the volume and centroid...
Definition: ElemInfo.h:25
MeshBase::node_iterator localNodesEnd()
Definition: MooseMesh.C:3028
const RealVectorValue & getNormalByBoundaryID(BoundaryID id) const
Returns the normal vector associated with a given BoundaryID.
Definition: MooseMesh.C:2807
void doingPRefinement(bool doing_p_refinement)
Indicate whether the kind of adaptivity we&#39;re doing is p-refinement.
Definition: MooseMesh.h:1347
std::set< SubdomainID > _mesh_subdomains
A set of subdomain IDs currently present in the mesh.
Definition: MooseMesh.h:1516
ConstElemPointerRange * coarsenedElementRange() const
Return a range that is suitable for threaded execution over elements that were just coarsened...
Definition: MooseMesh.C:934
const Moose::PatchUpdateType & getPatchUpdateStrategy() const
Get the current patch update strategy.
Definition: MooseMesh.C:3408
bool doingPRefinement() const
Query whether we have p-refinement.
Definition: MooseMesh.h:1352
std::vector< std::pair< BoundaryID, BoundaryID > > _paired_boundary
A vector holding the paired boundaries for a regular orthogonal mesh.
Definition: MooseMesh.h:1583
virtual bool skipPartitioning() const
Definition: MooseMesh.h:329
unsigned int maxHLevel() const
Returns the maximum h-refinement level of all elements.
Definition: MooseMesh.h:1362
void ghostGhostedBoundaries()
Actually do the ghosting of boundaries that need to be ghosted to this processor. ...
Definition: MooseMesh.C:3309
std::set< unsigned int > _ghosted_boundaries
Definition: MooseMesh.h:1558
MeshBase::node_iterator localNodesBegin()
Calls local_nodes_begin/end() on the underlying libMesh mesh object.
Definition: MooseMesh.C:3022
unsigned int _rz_coord_axis
Storage for RZ axis selection.
Definition: MooseMesh.h:1861
void computeFiniteVolumeCoords() const
Compute the face coordinate value for all FaceInfo and ElemInfo objects.
Definition: MooseMesh.C:3872
bool _distribution_overridden
Definition: MooseMesh.h:1429
void buildNodeList()
Calls BoundaryInfo::build_node_list()/build_side_list() and makes separate copies of Nodes/Elems in t...
Definition: MooseMesh.C:1022
std::unordered_map< SubdomainID, SubdomainData > _sub_to_data
Holds a map from subdomain ids to associated data.
Definition: MooseMesh.h:1800
std::unique_ptr< libMesh::Partitioner > _custom_partitioner
The custom partitioner.
Definition: MooseMesh.h:1440
bool isBoundaryElem(dof_id_type elem_id) const
Returns true if the requested element is in the list of boundary elements, false otherwise.
Definition: MooseMesh.C:3586
unsigned int getElementIDIndex(const std::string &id_name) const
Return the accessing integer for an extra element integer with its name.
Definition: MooseMesh.h:2157
void needsRemoteElemDeletion(bool need_delete)
Set whether we need to delete remote elements.
Definition: MooseMesh.h:1079
std::map< const Elem *, std::vector< const Elem * > > _coarsened_element_children
Map of Parent elements to child elements for elements that were just coarsened.
Definition: MooseMesh.h:1485
virtual bool isDistributedMesh() const
Returns the final Mesh distribution type.
Definition: MooseMesh.h:1001
const std::vector< QpMap > & getPCoarseningMap(const Elem &elem) const
Get the map describing for each volumetric quadrature point (qp) on the coarse level which qp on the ...
Definition: MooseMesh.C:4359
OStreamProxy out(std::cout)
void buildPeriodicNodeMap(std::multimap< dof_id_type, dof_id_type > &periodic_node_map, unsigned int var_number, libMesh::PeriodicBoundaries *pbs) const
This routine builds a multimap of boundary ids to matching boundary ids across all periodic boundarie...
Definition: MooseMesh.C:1808
unsigned int _ghosting_patch_size
The number of nearest neighbors to consider for ghosting purposes when iteration patch update strateg...
Definition: MooseMesh.h:1565
const std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > & getBoundariesToActiveSemiLocalElemIds() const
Returns a map of boundaries to ids of elements on the boundary.
Definition: MooseMesh.C:1322
const MeshBase::element_iterator activeLocalElementsEnd()
Definition: MooseMesh.C:3052
std::unique_ptr< libMesh::ConstNodeRange > _local_node_range
Definition: MooseMesh.h:1498
QpMap()
Definition: MooseMesh.h:72
libMesh::StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
Definition: MooseMesh.C:1286
The definition of the const_elem_info_iterator struct.
Definition: MooseMesh.h:1968
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:1577
std::map< dof_id_type, std::vector< dof_id_type > > _node_to_active_semilocal_elem_map
A map of all of the current nodes to the active elements that they are connected to.
Definition: MooseMesh.h:1509
bool prepare(const MeshBase *mesh_to_clone)
Calls prepare_for_use() if the underlying MeshBase object isn&#39;t prepared, then communicates various b...
Definition: MooseMesh.C:406
const ElemInfo & elemInfo(const dof_id_type id) const
Accessor for the elemInfo object for a given element ID.
Definition: MooseMesh.C:3866
void setCustomPartitioner(libMesh::Partitioner *partitioner)
Setter for custom partitioner.
Definition: MooseMesh.C:3694
Real _distance
The distance between them.
Definition: MooseMesh.h:81
unsigned int nFace() const
accessors for the FaceInfo objects
Definition: MooseMesh.h:1147
static MooseEnum elemTypes()
returns MooseMesh element type options
Definition: MooseMesh.C:3901
void meshChanged()
Declares that the MooseMesh has changed, invalidates cached data and rebuilds caches.
Definition: MooseMesh.C:879
void buildPRefinementAndCoarseningMaps(Assembly *assembly)
Definition: MooseMesh.C:2363
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
Definition: MooseMesh.C:1689
std::unique_ptr< libMesh::StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > > _bnd_node_range
Definition: MooseMesh.h:1500
uint8_t dof_id_type
virtual dof_id_type nElem() const
Definition: MooseMesh.C:3076
const std::map< dof_id_type, std::vector< dof_id_type > > & nodeToElemMap()
If not already created, creates a map from every node to all elements to which they are connected...
Definition: MooseMesh.C:1175
bool isBoundaryFullyExternalToSubdomains(BoundaryID bid, const std::set< SubdomainID > &blk_group) const
Returns whether a boundary (given by its id) is not crossing through a group of blocks, by which we mean that elements on both sides of the boundary are in those blocks.
Definition: MooseMesh.C:1370
std::unique_ptr< SemiLocalNodeRange > _active_semilocal_node_range
Definition: MooseMesh.h:1496
const std::set< SubdomainID > & meshSubdomains() const
Returns a read-only reference to the set of subdomains currently present in the Mesh.
Definition: MooseMesh.C:3166
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.
Definition: MooseMesh.C:1728
unsigned int _max_p_level
Maximum p-refinement level of all elements.
Definition: MooseMesh.h:1879
ParallelType
void setupFiniteVolumeMeshData() const
Sets up the additional data needed for finite volume computations.
Definition: MooseMesh.C:4067
virtual unsigned int effectiveSpatialDimension() const
Returns the effective spatial dimension determined by the coordinates actually used by the mesh...
Definition: MooseMesh.C:2929