www.mooseframework.org
Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
MooseMesh Class Referenceabstract

MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and storing more state. More...

#include <MooseMesh.h>

Inheritance diagram for MooseMesh:
[legend]

Classes

struct  bnd_elem_iterator
 The definition of the bnd_elem_iterator struct. More...
 
struct  bnd_node_iterator
 The definition of the bnd_node_iterator struct. More...
 
struct  const_bnd_elem_iterator
 The definition of the const_bnd_elem_iterator struct. More...
 
struct  const_bnd_node_iterator
 The definition of the const_bnd_node_iterator struct. More...
 
class  MortarInterface
 

Public Types

enum  ParallelType { ParallelType::DEFAULT, ParallelType::REPLICATED, ParallelType::DISTRIBUTED }
 
using PeriodicNodeInfo = std::pair< const Node *, BoundaryID >
 Helper type for building periodic node maps. More...
 

Public Member Functions

 MooseMesh (const InputParameters &parameters)
 Typical "Moose-style" constructor and copy constructor. More...
 
 MooseMesh (const MooseMesh &other_mesh)
 
virtual ~MooseMesh ()
 
virtual MooseMeshclone () const
 Clone method. More...
 
virtual std::unique_ptr< MooseMeshsafeClone () const =0
 A safer version of the clone() method that hands back an allocated object wrapped in a smart pointer. More...
 
std::unique_ptr< MeshBase > buildMeshBaseObject (ParallelType override_type=ParallelType::DEFAULT)
 Method to construct a libMesh::MeshBase object that is normally set and used by the MooseMesh object during the "init()" phase. More...
 
void setMeshBase (std::unique_ptr< MeshBase > mesh_base)
 Method to set the mesh_base object. More...
 
virtual void init ()
 Initialize the Mesh object. More...
 
virtual void buildMesh ()=0
 Must be overridden by child classes. More...
 
virtual unsigned int dimension () const
 Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh mesh object. More...
 
virtual unsigned int effectiveSpatialDimension () const
 Returns the effective spatial dimension determined by the coordinates actually used by the mesh. More...
 
std::vector< BoundaryIDgetBoundaryIDs (const Elem *const elem, const unsigned short int side) const
 Returns a vector of boundary IDs for the requested element on the requested side. More...
 
const std::set< BoundaryID > & getBoundaryIDs () const
 Returns a const reference to a set of all user-specified boundary IDs. More...
 
void buildNodeList ()
 Calls BoundaryInfo::build_node_list()/build_side_list() and makes separate copies of Nodes/Elems in those lists. More...
 
void buildBndElemList ()
 
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. More...
 
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 are connected. More...
 
virtual bnd_node_iterator bndNodesBegin ()
 Return iterators to the beginning/end of the boundary nodes list. More...
 
virtual bnd_node_iterator bndNodesEnd ()
 
virtual bnd_elem_iterator bndElemsBegin ()
 Return iterators to the beginning/end of the boundary elements list. More...
 
virtual bnd_elem_iterator bndElemsEnd ()
 
void buildNodeListFromSideList ()
 Calls BoundaryInfo::build_node_list_from_side_list(). More...
 
void buildSideList (std::vector< dof_id_type > &el, std::vector< unsigned short int > &sl, std::vector< boundary_id_type > &il)
 Calls BoundaryInfo::build_side_list(). More...
 
std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > buildSideList ()
 As above, but uses the non-deprecated std::tuple interface. More...
 
unsigned int sideWithBoundaryID (const Elem *const elem, const BoundaryID boundary_id) const
 Calls BoundaryInfo::side_with_boundary_id(). More...
 
MeshBase::const_node_iterator localNodesBegin ()
 Calls local_nodes_begin/end() on the underlying libMesh mesh object. More...
 
MeshBase::const_node_iterator localNodesEnd ()
 
MeshBase::const_element_iterator activeLocalElementsBegin ()
 Calls active_local_nodes_begin/end() on the underlying libMesh mesh object. More...
 
const MeshBase::const_element_iterator activeLocalElementsEnd ()
 
virtual dof_id_type nNodes () const
 Calls n_nodes/elem() on the underlying libMesh mesh object. More...
 
virtual dof_id_type nElem () const
 
virtual dof_id_type maxNodeId () const
 Calls max_node/elem_id() on the underlying libMesh mesh object. More...
 
virtual dof_id_type maxElemId () const
 
virtual const Node & node (const dof_id_type i) const
 Various accessors (pointers/references) for Node "i". More...
 
virtual Node & node (const dof_id_type i)
 
virtual const Node & nodeRef (const dof_id_type i) const
 
virtual Node & nodeRef (const dof_id_type i)
 
virtual const Node * nodePtr (const dof_id_type i) const
 
virtual Node * nodePtr (const dof_id_type i)
 
virtual const Node * queryNodePtr (const dof_id_type i) const
 
virtual Node * queryNodePtr (const dof_id_type i)
 
virtual Elem * elem (const dof_id_type i)
 Various accessors (pointers/references) for Elem "i". More...
 
virtual const Elem * elem (const dof_id_type i) const
 
virtual Elem * elemPtr (const dof_id_type i)
 
virtual const Elem * elemPtr (const dof_id_type i) const
 
virtual Elem * queryElemPtr (const dof_id_type i)
 
virtual const Elem * queryElemPtr (const dof_id_type i) const
 
bool prepared () const
 Setter/getter for the _is_prepared flag. More...
 
virtual void prepared (bool state)
 
void needsPrepareForUse ()
 If this method is called, we will call libMesh's prepare_for_use method when we call Moose's prepare method. More...
 
void meshChanged ()
 Declares that the MooseMesh has changed, invalidates cached data and rebuilds caches. More...
 
virtual void onMeshChanged ()
 Declares a callback function that is executed at the conclusion of meshChanged(). More...
 
void cacheChangedLists ()
 Cache information about what elements were refined and coarsened in the previous step. More...
 
ConstElemPointerRangerefinedElementRange () const
 Return a range that is suitable for threaded execution over elements that were just refined. More...
 
ConstElemPointerRangecoarsenedElementRange () const
 Return a range that is suitable for threaded execution over elements that were just coarsened. More...
 
const std::vector< const Elem * > & coarsenedElementChildren (const Elem *elem) const
 Get the newly removed children element ids for an element that was just coarsened. More...
 
void updateActiveSemiLocalNodeRange (std::set< dof_id_type > &ghosted_elems)
 Clears the "semi-local" node list and rebuilds it. More...
 
bool isSemiLocal (Node *node)
 Returns true if the node is semi-local. More...
 
ConstElemRange * getActiveLocalElementRange ()
 Return pointers to range objects for various types of ranges (local nodes, boundary elems, etc.). More...
 
NodeRange * getActiveNodeRange ()
 
SemiLocalNodeRangegetActiveSemiLocalNodeRange () const
 
ConstNodeRange * getLocalNodeRange ()
 
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange ()
 
StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange ()
 
const std::set< SubdomainID > & meshSubdomains () const
 Returns a read-only reference to the set of subdomains currently present in the Mesh. More...
 
const std::set< BoundaryID > & meshBoundaryIds () const
 Returns a read-only reference to the set of boundary IDs currently present in the Mesh. More...
 
const std::set< BoundaryID > & meshSidesetIds () const
 Returns a read-only reference to the set of sidesets currently present in the Mesh. More...
 
const std::set< BoundaryID > & meshNodesetIds () const
 Returns a read-only reference to the set of nodesets currently present in the Mesh. More...
 
void setBoundaryToNormalMap (std::unique_ptr< std::map< BoundaryID, RealVectorValue >> boundary_map)
 Sets the mapping between BoundaryID and normal vector Is called by AddAllSideSetsByNormals. More...
 
void setBoundaryToNormalMap (std::map< BoundaryID, RealVectorValue > *boundary_map)
 
void setMeshBoundaryIDs (std::set< BoundaryID > boundary_IDs)
 Sets the set of BoundaryIDs Is called by AddAllSideSetsByNormals. More...
 
const RealVectorValue & getNormalByBoundaryID (BoundaryID id) const
 Returns the normal vector associated with a given BoundaryID. More...
 
void prepare (bool force=false)
 Calls prepare_for_use() if force=true on the underlying Mesh object, then communicates various boundary information on parallel meshes. More...
 
void update ()
 Calls buildNodeListFromSideList(), buildNodeList(), and buildBndElemList(). More...
 
unsigned int uniformRefineLevel () const
 Returns the level of uniform refinement requested (zero if AMR is disabled). More...
 
void setUniformRefineLevel (unsigned int)
 Set uniform refinement level. More...
 
void addGhostedBoundary (BoundaryID boundary_id)
 This will add the boundary ids to be ghosted to this processor. More...
 
void setGhostedBoundaryInflation (const std::vector< Real > &inflation)
 This sets the inflation amount for the bounding box for each partition for use in ghosting boundaries. More...
 
const std::set< unsigned int > & getGhostedBoundaries () const
 Return a writable reference to the set of ghosted boundary IDs. More...
 
const std::vector< Real > & getGhostedBoundaryInflation () const
 Return a writable reference to the _ghosted_boundaries_inflation vector. More...
 
void ghostGhostedBoundaries ()
 Actually do the ghosting of boundaries that need to be ghosted to this processor. More...
 
unsigned int getPatchSize () const
 Getter for the patch_size parameter. More...
 
unsigned int getGhostingPatchSize () const
 Getter for the ghosting_patch_size parameter. More...
 
unsigned int getMaxLeafSize () const
 Getter for the maximum leaf size parameter. More...
 
void setPatchUpdateStrategy (Moose::PatchUpdateType patch_update_strategy)
 Set the patch size update strategy. More...
 
const Moose::PatchUpdateTypegetPatchUpdateStrategy () const
 Get the current patch update strategy. More...
 
BoundingBox getInflatedProcessorBoundingBox (Real inflation_multiplier=0.01) const
 Get a (slightly inflated) processor bounding box. More...
 
 operator libMesh::MeshBase & ()
 Implicit conversion operator from MooseMesh -> libMesh::MeshBase. More...
 
 operator const libMesh::MeshBase & () const
 
MeshBase & getMesh ()
 Accessor for the underlying libMesh Mesh object. More...
 
const MeshBase & getMesh () const
 
virtual ExodusII_IO * exReader () const
 Not implemented – always returns NULL. More...
 
void printInfo (std::ostream &os=libMesh::out) const
 Calls print_info() on the underlying Mesh. More...
 
const std::set< SubdomainID > & getNodeBlockIds (const Node &node) const
 Return list of blocks to which the given node belongs. More...
 
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. More...
 
const Node * addUniqueNode (const Point &p, Real tol=1e-6)
 Add a new node to the mesh. More...
 
Node * addQuadratureNode (const Elem *elem, const unsigned short int side, const unsigned int qp, BoundaryID bid, const Point &point)
 Adds a fictitious "QuadratureNode". More...
 
Node * getQuadratureNode (const Elem *elem, const unsigned short int side, const unsigned int qp)
 Get a specified quadrature node. More...
 
void clearQuadratureNodes ()
 Clear out any existing quadrature nodes. More...
 
BoundaryID getBoundaryID (const BoundaryName &boundary_name) const
 Get the associated BoundaryID for the boundary name. More...
 
std::vector< BoundaryIDgetBoundaryIDs (const std::vector< BoundaryName > &boundary_name, bool generate_unknown=false) const
 Get the associated BoundaryID for the boundary names that are passed in. More...
 
SubdomainID getSubdomainID (const SubdomainName &subdomain_name) const
 Get the associated subdomain ID for the subdomain name. More...
 
std::vector< SubdomainIDgetSubdomainIDs (const std::vector< SubdomainName > &subdomain_name) const
 Get the associated subdomainIDs for the subdomain names that are passed in. More...
 
void setSubdomainName (SubdomainID subdomain_id, SubdomainName name)
 This method returns a writable reference to a subdomain name based on the id parameter. More...
 
const std::string & getSubdomainName (SubdomainID subdomain_id)
 Return the name of a block given an id. More...
 
void setBoundaryName (BoundaryID boundary_id, BoundaryName name)
 This method returns a writable reference to a boundary name based on the id parameter. More...
 
const std::string & getBoundaryName (BoundaryID boundary_id)
 Return the name of the boundary given the id. More...
 
void buildPeriodicNodeMap (std::multimap< dof_id_type, dof_id_type > &periodic_node_map, unsigned int var_number, PeriodicBoundaries *pbs) const
 This routine builds a multimap of boundary ids to matching boundary ids across all periodic boundaries in the system. More...
 
void buildPeriodicNodeSets (std::map< BoundaryID, std::set< dof_id_type >> &periodic_node_sets, unsigned int var_number, PeriodicBoundaries *pbs) const
 This routine builds a datastructure of node ids organized by periodic boundary ids. More...
 
Real dimensionWidth (unsigned int component) const
 Returns the width of the requested dimension. More...
 
bool detectOrthogonalDimRanges (Real tol=1e-6)
 This routine determines whether the Mesh is a regular orthogonal mesh (i.e. More...
 
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 primary and secondary BoundaryIDs, record this fact in the _periodic_dim data structure. More...
 
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. More...
 
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 periodicity for the given variable number. More...
 
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 the given variable number. More...
 
const std::pair< BoundaryID, BoundaryID > * getPairedBoundaryMapping (unsigned int component)
 This function attempts to return the paired boundary ids for the given component. More...
 
void buildRefinementAndCoarseningMaps (Assembly *assembly)
 Create the refinement and coarsening maps necessary for projection of stateful material properties when using adaptivity. More...
 
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. More...
 
const std::vector< std::pair< unsigned int, QpMap > > & getCoarseningMap (const Elem &elem, int input_side)
 Get the coarsening map for a given element type. More...
 
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. More...
 
const std::set< BoundaryID > & getSubdomainBoundaryIds (SubdomainID subdomain_id) const
 Get the list of boundary ids associated with the given subdomain id. More...
 
bool isBoundaryNode (dof_id_type node_id) const
 Returns true if the requested node is in the list of boundary nodes, false otherwise. More...
 
bool isBoundaryNode (dof_id_type node_id, BoundaryID bnd_id) const
 Returns true if the requested node is in the list of boundary nodes for the specified boundary, false otherwise. More...
 
bool isBoundaryElem (dof_id_type elem_id) const
 Returns true if the requested element is in the list of boundary elements, false otherwise. More...
 
bool isBoundaryElem (dof_id_type elem_id, BoundaryID bnd_id) const
 Returns true if the requested element is in the list of boundary elements for the specified boundary, false otherwise. More...
 
void errorIfDistributedMesh (std::string name) const
 Generate a unified error message if the underlying libMesh mesh is a DistributedMesh. More...
 
bool isDistributedMesh () const
 Returns the final Mesh distribution type. More...
 
bool isParallelTypeForced () const
 Tell the user if the distribution was overriden for any reason. More...
 
const MooseEnumpartitionerName () const
 
bool isPartitionerForced () const
 Tell the user if the partitioner was overriden for any reason. More...
 
void allowRecovery (bool allow)
 Set whether or not this mesh is allowed to read a recovery file. More...
 
void addMortarInterface (const std::string &name, BoundaryName master, BoundaryName slave, SubdomainName domain_id)
 
std::vector< std::unique_ptr< MooseMesh::MortarInterface > > & getMortarInterfaces ()
 
MooseMesh::MortarInterfacegetMortarInterfaceByName (const std::string name)
 
MooseMesh::MortarInterfacegetMortarInterface (BoundaryID master, BoundaryID slave)
 
void setCustomPartitioner (Partitioner *partitioner)
 Setter for custom partitioner. More...
 
bool isRegularOrthogonal ()
 Getter to query if the mesh was detected to be regular and orthogonal. More...
 
bool hasSecondOrderElements ()
 check if the mesh has SECOND order elements More...
 
virtual std::unique_ptr< PointLocatorBase > getPointLocator () const
 Proxy function to get a (sub)PointLocator from either the underlying libMesh mesh (default), or to allow derived meshes to return a custom point locator. More...
 
virtual std::string getFileName () const
 Returns the name of the mesh file read to produce this mesh if any or an empty string otherwise. More...
 
const std::string & type () const
 Get the type of this object. More...
 
const std::string & name () const
 Get the name of the object. More...
 
const InputParametersparameters () const
 Get the parameters of the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 
template<typename T >
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 Verifies that the requested parameter exists and is not NULL and returns it to the caller. More...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp () const
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled () const
 Return the enabled status of the object. More...
 
template<typename... Args>
void paramError (const std::string &param, Args... args)
 Emits an error prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void paramWarning (const std::string &param, Args... args)
 Emits a warning prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void paramInfo (const std::string &param, Args... args)
 Emits an informational message prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void mooseError (Args &&... args) const
 
template<typename... Args>
void mooseWarning (Args &&... args) const
 
template<typename... Args>
void mooseDeprecated (Args &&... args) const
 
template<typename... Args>
void mooseInfo (Args &&... args) const
 
virtual Real getMinInDimension (unsigned int component) const
 Returns the min or max of the requested dimension respectively. More...
 
virtual Real getMaxInDimension (unsigned int component) const
 
bool isCustomPartitionerRequested () const
 Setter and getter for _custom_partitioner_requested. More...
 
void setIsCustomPartitionerRequested (bool cpr)
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Protected Types

enum  { X = 0, Y, Z }
 Convenience enums. More...
 
enum  { MIN = 0, MAX }
 
typedef std::vector< BndNode * >::iterator bnd_node_iterator_imp
 
typedef std::vector< BndNode * >::const_iterator const_bnd_node_iterator_imp
 
typedef std::vector< BndElement * >::iterator bnd_elem_iterator_imp
 
typedef std::vector< BndElement * >::const_iterator const_bnd_elem_iterator_imp
 

Protected Member Functions

void cacheInfo ()
 
void freeBndNodes ()
 
void freeBndElems ()
 
template<typename T >
T & declareRestartableData (std::string data_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, void *context)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, const T &init_value, void *context)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRecoverableData (std::string data_name)
 Declare a piece of data as "recoverable". More...
 
template<typename T >
T & declareRecoverableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithObjectName (std::string data_name, std::string object_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithObjectNameWithContext (std::string data_name, std::string object_name, void *context)
 Declare a piece of data as "restartable". More...
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level)
 Call to register a named section for timing. More...
 

Protected Attributes

std::vector< std::unique_ptr< GhostingFunctor > > _ghosting_functors
 Deprecated (DO NOT USE) More...
 
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
 The list of active geometric relationship managers (bound to the underlying MeshBase object). More...
 
ParallelType _parallel_type
 Can be set to DISTRIBUTED, REPLICATED, or DEFAULT. More...
 
bool _use_distributed_mesh
 False by default. More...
 
bool _distribution_overridden
 
bool _parallel_type_overridden
 
std::unique_ptr< libMesh::MeshBase > _mesh
 Pointer to underlying libMesh mesh object. More...
 
MooseEnum _partitioner_name
 The partitioner used on this mesh. More...
 
bool _partitioner_overridden
 
std::unique_ptr< Partitioner > _custom_partitioner
 The custom partitioner. More...
 
bool _custom_partitioner_requested
 
unsigned int _uniform_refine_level
 The level of uniform refinement requested (set to zero if AMR is disabled) More...
 
bool _is_changed
 true if mesh is changed (i.e. after adaptivity step) More...
 
bool _is_nemesis
 True if a Nemesis Mesh was read in. More...
 
bool _is_prepared
 True if prepare has been called on the mesh. More...
 
bool _needs_prepare_for_use
 True if prepare_for_use should be called when Mesh is prepared. More...
 
std::unique_ptr< ConstElemPointerRange_refined_elements
 The elements that were just refined. More...
 
std::unique_ptr< ConstElemPointerRange_coarsened_elements
 The elements that were just coarsened. More...
 
std::map< const Elem *, std::vector< const Elem * > > _coarsened_element_children
 Map of Parent elements to child elements for elements that were just coarsened. More...
 
std::set< Node * > _semilocal_node_list
 Used for generating the semilocal node range. More...
 
std::unique_ptr< ConstElemRange > _active_local_elem_range
 A range for use with threading. More...
 
std::unique_ptr< SemiLocalNodeRange_active_semilocal_node_range
 
std::unique_ptr< NodeRange > _active_node_range
 
std::unique_ptr< ConstNodeRange > _local_node_range
 
std::unique_ptr< StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > > _bnd_node_range
 
std::unique_ptr< StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > > _bnd_elem_range
 
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. More...
 
bool _node_to_elem_map_built
 
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. More...
 
bool _node_to_active_semilocal_elem_map_built
 
std::set< SubdomainID_mesh_subdomains
 A set of subdomain IDs currently present in the mesh. More...
 
std::unique_ptr< std::map< BoundaryID, RealVectorValue > > _boundary_to_normal_map
 The boundary to normal map - valid only when AddAllSideSetsByNormals is active. More...
 
std::vector< BndNode * > _bnd_nodes
 array of boundary nodes More...
 
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_node_ids
 Map of sets of node IDs in each boundary. More...
 
std::vector< BndElement * > _bnd_elems
 array of boundary elems More...
 
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_elem_ids
 Map of set of elem IDs connected to each boundary. More...
 
std::map< dof_id_type, Node * > _quadrature_nodes
 
std::map< dof_id_type, std::map< unsigned int, std::map< dof_id_type, Node * > > > _elem_to_side_to_qp_to_quadrature_nodes
 
std::vector< BndNode_extra_bnd_nodes
 
std::map< dof_id_type, std::set< SubdomainID > > _block_node_list
 list of nodes that belongs to a specified block (domain) More...
 
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] More...
 
std::set< unsigned int > _ghosted_boundaries
 
std::vector< Real > _ghosted_boundaries_inflation
 
unsigned int _patch_size
 The number of nodes to consider in the NearestNode neighborhood. More...
 
unsigned int _ghosting_patch_size
 The number of nearest neighbors to consider for ghosting purposes when iteration patch update strategy is used. More...
 
unsigned int _max_leaf_size
 
Moose::PatchUpdateType _patch_update_strategy
 The patch update strategy. More...
 
std::vector< Node * > _node_map
 Vector of all the Nodes in the mesh for determining when to add a new point. More...
 
bool _regular_orthogonal_mesh
 Boolean indicating whether this mesh was detected to be regular and orthogonal. More...
 
std::vector< std::vector< Real > > _bounds
 The bounds in each dimension of the mesh for regular orthogonal meshes. More...
 
std::vector< std::pair< BoundaryID, BoundaryID > > _paired_boundary
 A vector holding the paired boundaries for a regular orthogonal mesh. More...
 
std::map< std::string, MortarInterface * > _mortar_interface_by_name
 Mortar interfaces mapped through their names. More...
 
std::vector< std::unique_ptr< MortarInterface > > _mortar_interface
 
std::map< std::pair< BoundaryID, BoundaryID >, MortarInterface * > _mortar_interface_by_ids
 Mortar interfaces mapped though master, slave IDs pairs. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. More...
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const std::string & _type
 The type of this object (the Class name) More...
 
const std::string & _name
 The name of this object, reference to value stored in InputParameters. More...
 
const bool & _enabled
 Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects. More...
 
const InputParameters_pg_params
 Params. More...
 
PerfGraph_perf_graph
 The performance graph to add to. More...
 
std::string _prefix
 A prefix to use for all sections. More...
 
std::set< BoundaryID_mesh_boundary_ids
 A set of boundary IDs currently present in the mesh. More...
 
std::set< BoundaryID_mesh_sideset_ids
 
std::set< BoundaryID_mesh_nodeset_ids
 

Private Member Functions

void detectPairedSidesets ()
 This routine detects paired sidesets of a regular orthogonal mesh (.i.e. More...
 
void buildRefinementMap (const Elem &elem, QBase &qrule, QBase &qrule_face, int parent_side, int child, int child_side)
 Build the refinement map for a given element type. More...
 
void buildCoarseningMap (const Elem &elem, QBase &qrule, QBase &qrule_face, int input_side)
 Build the coarsening map for a given element type. More...
 
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". More...
 
void findAdaptivityQpMaps (const Elem *template_elem, QBase &qrule, 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's are closest to each other between a parent and it's children. More...
 

Private Attributes

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 specified variable numbers. More...
 
RealVectorValue _half_range
 A convenience vector used to hold values in each dimension representing half of the range. More...
 
std::vector< Node * > _extreme_nodes
 A vector containing the nodes at the corners of a regular orthogonal mesh. More...
 
std::map< std::pair< int, ElemType >, std::vector< std::vector< QpMap > > > _elem_type_to_refinement_map
 Holds mappings for volume to volume and parent side to child side. More...
 
std::map< 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). More...
 
std::map< std::pair< int, 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. More...
 
std::map< SubdomainID, std::set< BoundaryID > > _subdomain_boundary_ids
 Holds a map from subomdain ids to the boundary ids that are attached to it. More...
 
bool _allow_recovery
 Whether or not this Mesh is allowed to read a recovery file. More...
 
bool _construct_node_list_from_side_list
 Whether or not to allow generation of nodesets from sidesets. More...
 
PerfID _prepare_timer
 Timers. More...
 
PerfID _update_timer
 
PerfID _mesh_changed_timer
 
PerfID _cache_changed_lists_timer
 
PerfID _update_active_semi_local_node_range_timer
 
PerfID _build_node_list_timer
 
PerfID _build_bnd_elem_list_timer
 
PerfID _node_to_elem_map_timer
 
PerfID _node_to_active_semilocal_elem_map_timer
 
PerfID _get_active_local_element_range_timer
 
PerfID _get_active_node_range_timer
 
PerfID _get_local_node_range_timer
 
PerfID _get_boundary_node_range_timer
 
PerfID _get_boundary_element_range_timer
 
PerfID _cache_info_timer
 
PerfID _build_periodic_node_map_timer
 
PerfID _build_periodic_node_sets_timer
 
PerfID _detect_orthogonal_dim_ranges_timer
 
PerfID _detect_paired_sidesets_timer
 
PerfID _build_refinement_map_timer
 
PerfID _build_coarsening_map_timer
 
PerfID _find_adaptivity_qp_maps_timer
 
PerfID _build_refinement_and_coarsening_maps_timer
 
PerfID _change_boundary_id_timer
 
PerfID _init_timer
 
PerfID _read_recovered_mesh_timer
 
PerfID _ghost_ghosted_boundaries_timer
 
PerfID _add_mortar_interface_timer
 

Detailed Description

MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and storing more state.

Definition at line 73 of file MooseMesh.h.

Member Typedef Documentation

◆ bnd_elem_iterator_imp

typedef std::vector<BndElement *>::iterator MooseMesh::bnd_elem_iterator_imp
protected

Definition at line 980 of file MooseMesh.h.

◆ bnd_node_iterator_imp

typedef std::vector<BndNode *>::iterator MooseMesh::bnd_node_iterator_imp
protected

Definition at line 973 of file MooseMesh.h.

◆ const_bnd_elem_iterator_imp

typedef std::vector<BndElement *>::const_iterator MooseMesh::const_bnd_elem_iterator_imp
protected

Definition at line 981 of file MooseMesh.h.

◆ const_bnd_node_iterator_imp

typedef std::vector<BndNode *>::const_iterator MooseMesh::const_bnd_node_iterator_imp
protected

Definition at line 974 of file MooseMesh.h.

◆ PeriodicNodeInfo

using MooseMesh::PeriodicNodeInfo = std::pair<const Node *, BoundaryID>

Helper type for building periodic node maps.

Definition at line 855 of file MooseMesh.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected

Convenience enums.

Enumerator

Definition at line 887 of file MooseMesh.h.

888  {
889  X = 0,
890  Y,
891  Z
892  };

◆ anonymous enum

anonymous enum
protected
Enumerator
MIN 
MAX 

Definition at line 893 of file MooseMesh.h.

894  {
895  MIN = 0,
896  MAX
897  };

◆ ParallelType

Enumerator
DEFAULT 
REPLICATED 
DISTRIBUTED 

Definition at line 85 of file MooseMesh.h.

86  {
87  DEFAULT,
88  REPLICATED,
89  DISTRIBUTED
90  };

Constructor & Destructor Documentation

◆ MooseMesh() [1/2]

MooseMesh::MooseMesh ( const InputParameters parameters)

Typical "Moose-style" constructor and copy constructor.

Definition at line 152 of file MooseMesh.C.

154  Restartable(this, "Mesh"),
155  PerfGraphInterface(this),
156  _parallel_type(getParam<MooseEnum>("parallel_type").getEnum<MooseMesh::ParallelType>()),
157  _use_distributed_mesh(false),
160  _partitioner_name(getParam<MooseEnum>("partitioner")),
164  _is_nemesis(getParam<bool>("nemesis")),
165  _is_prepared(false),
166  _needs_prepare_for_use(false),
169  _patch_size(getParam<unsigned int>("patch_size")),
170  _ghosting_patch_size(isParamValid("ghosting_patch_size")
171  ? getParam<unsigned int>("ghosting_patch_size")
172  : 5 * _patch_size),
173  _max_leaf_size(getParam<unsigned int>("max_leaf_size")),
175  getParam<MooseEnum>("patch_update_strategy").getEnum<Moose::PatchUpdateType>()),
177  _allow_recovery(true),
178  _construct_node_list_from_side_list(getParam<bool>("construct_node_list_from_side_list")),
179  _prepare_timer(registerTimedSection("prepare", 2)),
180  _update_timer(registerTimedSection("update", 3)),
181  _mesh_changed_timer(registerTimedSection("meshChanged", 3)),
182  _cache_changed_lists_timer(registerTimedSection("cacheChangedLists", 5)),
184  registerTimedSection("updateActiveSemiLocalNodeRange", 5)),
185  _build_node_list_timer(registerTimedSection("buildNodeList", 5)),
186  _build_bnd_elem_list_timer(registerTimedSection("buildBndElemList", 5)),
187  _node_to_elem_map_timer(registerTimedSection("nodeToElemMap", 5)),
189  registerTimedSection("nodeToActiveSemilocalElemMap", 5)),
190  _get_active_local_element_range_timer(registerTimedSection("getActiveLocalElementRange", 5)),
191  _get_active_node_range_timer(registerTimedSection("getActiveNodeRange", 5)),
192  _get_local_node_range_timer(registerTimedSection("getLocalNodeRange", 5)),
193  _get_boundary_node_range_timer(registerTimedSection("getBoundaryNodeRange", 5)),
194  _get_boundary_element_range_timer(registerTimedSection("getBoundaryElementRange", 5)),
195  _cache_info_timer(registerTimedSection("cacheInfo", 3)),
196  _build_periodic_node_map_timer(registerTimedSection("buildPeriodicNodeMap", 5)),
197  _build_periodic_node_sets_timer(registerTimedSection("buildPeriodicNodeSets", 5)),
198  _detect_orthogonal_dim_ranges_timer(registerTimedSection("detectOrthogonalDimRanges", 5)),
199  _detect_paired_sidesets_timer(registerTimedSection("detectPairedSidesets", 5)),
200  _build_refinement_map_timer(registerTimedSection("buildRefinementMap", 5)),
201  _build_coarsening_map_timer(registerTimedSection("buildCoarseningMap", 5)),
202  _find_adaptivity_qp_maps_timer(registerTimedSection("findAdaptivityQpMaps", 5)),
204  registerTimedSection("buildRefinementAndCoarseningMaps", 5)),
205  _change_boundary_id_timer(registerTimedSection("changeBoundaryId", 6)),
206  _init_timer(registerTimedSection("init", 2)),
207  _read_recovered_mesh_timer(registerTimedSection("readRecoveredMesh", 2)),
208  _ghost_ghosted_boundaries_timer(registerTimedSection("GhostGhostedBoundaries", 3)),
209  _add_mortar_interface_timer(registerTimedSection("addMortarInterface", 5))
210 {
211  if (isParamValid("ghosting_patch_size") && (_patch_update_strategy != Moose::Iteration))
212  mooseError("Ghosting patch size parameter has to be set in the mesh block "
213  "only when 'iteration' patch update strategy is used.");
214 }
ParallelType _parallel_type
Can be set to DISTRIBUTED, REPLICATED, or DEFAULT.
Definition: MooseMesh.h:866
PerfID _build_refinement_map_timer
Definition: MooseMesh.h:1167
PerfID registerTimedSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
bool _node_to_elem_map_built
Definition: MooseMesh.h:945
PerfID _build_coarsening_map_timer
Definition: MooseMesh.h:1168
bool _is_nemesis
True if a Nemesis Mesh was read in.
Definition: MooseMesh.h:906
unsigned int _uniform_refine_level
The level of uniform refinement requested (set to zero if AMR is disabled)
Definition: MooseMesh.h:900
unsigned int _max_leaf_size
Definition: MooseMesh.h:1006
PerfID _add_mortar_interface_timer
Definition: MooseMesh.h:1175
PerfID _build_node_list_timer
Definition: MooseMesh.h:1153
bool _is_prepared
True if prepare has been called on the mesh.
Definition: MooseMesh.h:909
bool _custom_partitioner_requested
Definition: MooseMesh.h:884
MooseObject(const InputParameters &parameters)
Definition: MooseObject.C:48
MooseEnum _partitioner_name
The partitioner used on this mesh.
Definition: MooseMesh.h:879
bool _node_to_active_semilocal_elem_map_built
Definition: MooseMesh.h:949
PerfID _get_boundary_node_range_timer
Definition: MooseMesh.h:1160
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
bool _allow_recovery
Whether or not this Mesh is allowed to read a recovery file.
Definition: MooseMesh.h:1142
PerfID _detect_paired_sidesets_timer
Definition: MooseMesh.h:1166
PerfID _cache_changed_lists_timer
Definition: MooseMesh.h:1151
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:871
PerfID _find_adaptivity_qp_maps_timer
Definition: MooseMesh.h:1169
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
PerfID _build_periodic_node_sets_timer
Definition: MooseMesh.h:1164
PerfID _update_timer
Definition: MooseMesh.h:1149
bool _construct_node_list_from_side_list
Whether or not to allow generation of nodesets from sidesets.
Definition: MooseMesh.h:1145
PerfID _init_timer
Definition: MooseMesh.h:1172
PerfID _read_recovered_mesh_timer
Definition: MooseMesh.h:1173
PerfID _mesh_changed_timer
Definition: MooseMesh.h:1150
PerfID _prepare_timer
Timers.
Definition: MooseMesh.h:1148
PerfID _cache_info_timer
Definition: MooseMesh.h:1162
bool _parallel_type_overridden
Definition: MooseMesh.h:873
PerfID _build_periodic_node_map_timer
Definition: MooseMesh.h:1163
PerfID _get_local_node_range_timer
Definition: MooseMesh.h:1159
Restartable(const MooseObject *moose_object, const std::string &system_name)
Class constructor.
Definition: Restartable.C:17
PerfID _change_boundary_id_timer
Definition: MooseMesh.h:1171
Moose::PatchUpdateType _patch_update_strategy
The patch update strategy.
Definition: MooseMesh.h:1009
PerfID _build_refinement_and_coarsening_maps_timer
Definition: MooseMesh.h:1170
bool _partitioner_overridden
Definition: MooseMesh.h:880
PerfID _get_boundary_element_range_timer
Definition: MooseMesh.h:1161
PerfID _build_bnd_elem_list_timer
Definition: MooseMesh.h:1154
unsigned int _patch_size
The number of nodes to consider in the NearestNode neighborhood.
Definition: MooseMesh.h:1000
PerfID _ghost_ghosted_boundaries_timer
Definition: MooseMesh.h:1174
PerfID _update_active_semi_local_node_range_timer
Definition: MooseMesh.h:1152
PerfGraphInterface(const MooseObject *moose_object)
For objects that are MooseObjects with a default prefix of type()
PerfID _node_to_active_semilocal_elem_map_timer
Definition: MooseMesh.h:1156
bool _distribution_overridden
Definition: MooseMesh.h:872
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:86
unsigned int _ghosting_patch_size
The number of nearest neighbors to consider for ghosting purposes when iteration patch update strateg...
Definition: MooseMesh.h:1003
bool _needs_prepare_for_use
True if prepare_for_use should be called when Mesh is prepared.
Definition: MooseMesh.h:912
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:1015
PerfID _detect_orthogonal_dim_ranges_timer
Definition: MooseMesh.h:1165
PerfID _get_active_local_element_range_timer
Definition: MooseMesh.h:1157
PerfID _get_active_node_range_timer
Definition: MooseMesh.h:1158
PerfID _node_to_elem_map_timer
Definition: MooseMesh.h:1155

◆ MooseMesh() [2/2]

MooseMesh::MooseMesh ( const MooseMesh other_mesh)

Definition at line 216 of file MooseMesh.C.

217  : MooseObject(other_mesh._pars),
218  Restartable(this, "Mesh"),
219  PerfGraphInterface(this, "CopiedMesh"),
220  _parallel_type(other_mesh._parallel_type),
223  _mesh(other_mesh.getMesh().clone()),
227  _is_nemesis(false),
228  _is_prepared(false),
229  _needs_prepare_for_use(false),
231  _patch_size(other_mesh._patch_size),
233  _max_leaf_size(other_mesh._max_leaf_size),
237  _prepare_timer(registerTimedSection("prepare", 2)),
238  _update_timer(registerTimedSection("update", 2)),
239  _mesh_changed_timer(registerTimedSection("meshChanged", 3)),
240  _cache_changed_lists_timer(registerTimedSection("cacheChangedLists", 5)),
242  registerTimedSection("updateActiveSemiLocalNodeRange", 5)),
243  _build_node_list_timer(registerTimedSection("buildNodeList", 5)),
244  _build_bnd_elem_list_timer(registerTimedSection("buildBndElemList", 5)),
245  _node_to_elem_map_timer(registerTimedSection("nodeToElemMap", 5)),
247  registerTimedSection("nodeToActiveSemilocalElemMap", 5)),
248  _get_active_local_element_range_timer(registerTimedSection("getActiveLocalElementRange", 5)),
249  _get_active_node_range_timer(registerTimedSection("getActiveNodeRange", 5)),
250  _get_local_node_range_timer(registerTimedSection("getLocalNodeRange", 5)),
251  _get_boundary_node_range_timer(registerTimedSection("getBoundaryNodeRange", 5)),
252  _get_boundary_element_range_timer(registerTimedSection("getBoundaryElementRange", 5)),
253  _cache_info_timer(registerTimedSection("cacheInfo", 3)),
254  _build_periodic_node_map_timer(registerTimedSection("buildPeriodicNodeMap", 5)),
255  _build_periodic_node_sets_timer(registerTimedSection("buildPeriodicNodeSets", 5)),
256  _detect_orthogonal_dim_ranges_timer(registerTimedSection("detectOrthogonalDimRanges", 5)),
257  _detect_paired_sidesets_timer(registerTimedSection("detectPairedSidesets", 5)),
258  _build_refinement_map_timer(registerTimedSection("buildRefinementMap", 5)),
259  _build_coarsening_map_timer(registerTimedSection("buildCoarseningMap", 5)),
260  _find_adaptivity_qp_maps_timer(registerTimedSection("findAdaptivityQpMaps", 5)),
262  registerTimedSection("buildRefinementAndCoarseningMaps", 5)),
263  _change_boundary_id_timer(registerTimedSection("changeBoundaryId", 5)),
264  _init_timer(registerTimedSection("init", 2)),
265  _read_recovered_mesh_timer(registerTimedSection("readRecoveredMesh", 2)),
266  _ghost_ghosted_boundaries_timer(registerTimedSection("GhostGhostedBoundaries", 3)),
267  _add_mortar_interface_timer(registerTimedSection("addMortarInterface", 5))
268 {
269  // Note: this calls BoundaryInfo::operator= without changing the
270  // ownership semantics of either Mesh's BoundaryInfo object.
271  getMesh().get_boundary_info() = other_mesh.getMesh().get_boundary_info();
272 
273  const std::set<SubdomainID> & subdomains = other_mesh.meshSubdomains();
274  for (const auto & sbd_id : subdomains)
275  setSubdomainName(sbd_id, other_mesh.getMesh().subdomain_name(sbd_id));
276 
277  // Get references to BoundaryInfo objects to make the code below cleaner...
278  const BoundaryInfo & other_boundary_info = other_mesh.getMesh().get_boundary_info();
279  BoundaryInfo & boundary_info = getMesh().get_boundary_info();
280 
281  // Use the other BoundaryInfo object to build the list of side boundary ids
282  std::vector<BoundaryID> side_boundaries;
283  other_boundary_info.build_side_boundary_ids(side_boundaries);
284 
285  // Assign those boundary ids in our BoundaryInfo object
286  for (const auto & side_bnd_id : side_boundaries)
287  boundary_info.sideset_name(side_bnd_id) = other_boundary_info.get_sideset_name(side_bnd_id);
288 
289  // Do the same thing for node boundary ids
290  std::vector<BoundaryID> node_boundaries;
291  other_boundary_info.build_node_boundary_ids(node_boundaries);
292 
293  for (const auto & node_bnd_id : node_boundaries)
294  boundary_info.nodeset_name(node_bnd_id) = other_boundary_info.get_nodeset_name(node_bnd_id);
295 
296  _bounds.resize(other_mesh._bounds.size());
297  for (std::size_t i = 0; i < _bounds.size(); ++i)
298  {
299  _bounds[i].resize(other_mesh._bounds[i].size());
300  for (std::size_t j = 0; j < _bounds[i].size(); ++j)
301  _bounds[i][j] = other_mesh._bounds[i][j];
302  }
303 }
ParallelType _parallel_type
Can be set to DISTRIBUTED, REPLICATED, or DEFAULT.
Definition: MooseMesh.h:866
PerfID _build_refinement_map_timer
Definition: MooseMesh.h:1167
std::vector< std::vector< Real > > _bounds
The bounds in each dimension of the mesh for regular orthogonal meshes.
Definition: MooseMesh.h:1018
PerfID registerTimedSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
bool _node_to_elem_map_built
Definition: MooseMesh.h:945
PerfID _build_coarsening_map_timer
Definition: MooseMesh.h:1168
bool _is_nemesis
True if a Nemesis Mesh was read in.
Definition: MooseMesh.h:906
unsigned int _uniform_refine_level
The level of uniform refinement requested (set to zero if AMR is disabled)
Definition: MooseMesh.h:900
unsigned int _max_leaf_size
Definition: MooseMesh.h:1006
PerfID _add_mortar_interface_timer
Definition: MooseMesh.h:1175
PerfID _build_node_list_timer
Definition: MooseMesh.h:1153
bool _is_prepared
True if prepare has been called on the mesh.
Definition: MooseMesh.h:909
MooseObject(const InputParameters &parameters)
Definition: MooseObject.C:48
MooseEnum _partitioner_name
The partitioner used on this mesh.
Definition: MooseMesh.h:879
PerfID _get_boundary_node_range_timer
Definition: MooseMesh.h:1160
PerfID _detect_paired_sidesets_timer
Definition: MooseMesh.h:1166
PerfID _cache_changed_lists_timer
Definition: MooseMesh.h:1151
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:871
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
void setSubdomainName(SubdomainID subdomain_id, SubdomainName name)
This method returns a writable reference to a subdomain name based on the id parameter.
Definition: MooseMesh.C:1113
PerfID _find_adaptivity_qp_maps_timer
Definition: MooseMesh.h:1169
PerfID _build_periodic_node_sets_timer
Definition: MooseMesh.h:1164
PerfID _update_timer
Definition: MooseMesh.h:1149
bool _construct_node_list_from_side_list
Whether or not to allow generation of nodesets from sidesets.
Definition: MooseMesh.h:1145
PerfID _init_timer
Definition: MooseMesh.h:1172
PerfID _read_recovered_mesh_timer
Definition: MooseMesh.h:1173
PerfID _mesh_changed_timer
Definition: MooseMesh.h:1150
PerfID _prepare_timer
Timers.
Definition: MooseMesh.h:1148
PerfID _cache_info_timer
Definition: MooseMesh.h:1162
unsigned int uniformRefineLevel() const
Returns the level of uniform refinement requested (zero if AMR is disabled).
Definition: MooseMesh.C:2356
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:171
PerfID _build_periodic_node_map_timer
Definition: MooseMesh.h:1163
PerfID _get_local_node_range_timer
Definition: MooseMesh.h:1159
Restartable(const MooseObject *moose_object, const std::string &system_name)
Class constructor.
Definition: Restartable.C:17
PerfID _change_boundary_id_timer
Definition: MooseMesh.h:1171
Moose::PatchUpdateType _patch_update_strategy
The patch update strategy.
Definition: MooseMesh.h:1009
PerfID _build_refinement_and_coarsening_maps_timer
Definition: MooseMesh.h:1170
bool _partitioner_overridden
Definition: MooseMesh.h:880
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:876
PerfID _get_boundary_element_range_timer
Definition: MooseMesh.h:1161
PerfID _build_bnd_elem_list_timer
Definition: MooseMesh.h:1154
unsigned int _patch_size
The number of nodes to consider in the NearestNode neighborhood.
Definition: MooseMesh.h:1000
PerfID _ghost_ghosted_boundaries_timer
Definition: MooseMesh.h:1174
PerfID _update_active_semi_local_node_range_timer
Definition: MooseMesh.h:1152
PerfGraphInterface(const MooseObject *moose_object)
For objects that are MooseObjects with a default prefix of type()
PerfID _node_to_active_semilocal_elem_map_timer
Definition: MooseMesh.h:1156
bool _distribution_overridden
Definition: MooseMesh.h:872
unsigned int _ghosting_patch_size
The number of nearest neighbors to consider for ghosting purposes when iteration patch update strateg...
Definition: MooseMesh.h:1003
bool _needs_prepare_for_use
True if prepare_for_use should be called when Mesh is prepared.
Definition: MooseMesh.h:912
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:1015
PerfID _detect_orthogonal_dim_ranges_timer
Definition: MooseMesh.h:1165
PerfID _get_active_local_element_range_timer
Definition: MooseMesh.h:1157
PerfID _get_active_node_range_timer
Definition: MooseMesh.h:1158
const std::set< SubdomainID > & meshSubdomains() const
Returns a read-only reference to the set of subdomains currently present in the Mesh.
Definition: MooseMesh.C:2311
PerfID _node_to_elem_map_timer
Definition: MooseMesh.h:1155

◆ ~MooseMesh()

MooseMesh::~MooseMesh ( )
virtual

Definition at line 305 of file MooseMesh.C.

306 {
307  freeBndNodes();
308  freeBndElems();
310 }
void freeBndElems()
Definition: MooseMesh.C:331
void clearQuadratureNodes()
Clear out any existing quadrature nodes.
Definition: MooseMesh.C:990
void freeBndNodes()
Definition: MooseMesh.C:313

Member Function Documentation

◆ activeLocalElementsBegin()

MeshBase::const_element_iterator MooseMesh::activeLocalElementsBegin ( )

Calls active_local_nodes_begin/end() on the underlying libMesh mesh object.

Definition at line 2212 of file MooseMesh.C.

Referenced by FEProblemBase::checkDisplacementOrders(), hasSecondOrderElements(), and TopResidualDebugOutput::printTopResiduals().

2213 {
2214  return getMesh().active_local_elements_begin();
2215 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ activeLocalElementsEnd()

const MeshBase::const_element_iterator MooseMesh::activeLocalElementsEnd ( )

Definition at line 2218 of file MooseMesh.C.

Referenced by FEProblemBase::checkDisplacementOrders(), hasSecondOrderElements(), and TopResidualDebugOutput::printTopResiduals().

2219 {
2220  return getMesh().active_local_elements_end();
2221 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ addGhostedBoundary()

void MooseMesh::addGhostedBoundary ( BoundaryID  boundary_id)

This will add the boundary ids to be ghosted to this processor.

Definition at line 2368 of file MooseMesh.C.

Referenced by FEProblemBase::addGhostedBoundary(), and SetupMeshAction::setupMesh().

2369 {
2370  _ghosted_boundaries.insert(boundary_id);
2371 }
std::set< unsigned int > _ghosted_boundaries
Definition: MooseMesh.h:996

◆ addMortarInterface()

void MooseMesh::addMortarInterface ( const std::string &  name,
BoundaryName  master,
BoundaryName  slave,
SubdomainName  domain_id 
)

Definition at line 2753 of file MooseMesh.C.

2757 {
2758  TIME_SECTION(_add_mortar_interface_timer);
2759 
2760  SubdomainID domain_id = getSubdomainID(domain_name);
2761  boundary_id_type master_id = getBoundaryID(master);
2762  boundary_id_type slave_id = getBoundaryID(slave);
2763 
2764  std::unique_ptr<MortarInterface> iface = libmesh_make_unique<MortarInterface>();
2765 
2766  iface->_id = domain_id;
2767  iface->_master = master;
2768  iface->_slave = slave;
2769  iface->_name = name;
2770 
2771  for (auto & elem : as_range(_mesh->level_elements_begin(0), _mesh->level_elements_end(0)))
2772  {
2773  if (elem->subdomain_id() == domain_id)
2774  iface->_elems.push_back(elem);
2775  }
2776 
2777  setSubdomainName(iface->_id, name);
2778 
2779  _mortar_interface.push_back(std::move(iface));
2781  _mortar_interface_by_ids[std::pair<BoundaryID, BoundaryID>(master_id, slave_id)] =
2782  _mortar_interface.back().get();
2783 }
std::map< std::pair< BoundaryID, BoundaryID >, MortarInterface * > _mortar_interface_by_ids
Mortar interfaces mapped though master, slave IDs pairs.
Definition: MooseMesh.h:1027
PerfID _add_mortar_interface_timer
Definition: MooseMesh.h:1175
subdomain_id_type SubdomainID
Definition: MooseTypes.h:124
std::vector< std::unique_ptr< MortarInterface > > _mortar_interface
Definition: MooseMesh.h:1025
void setSubdomainName(SubdomainID subdomain_id, SubdomainName name)
This method returns a writable reference to a subdomain name based on the id parameter.
Definition: MooseMesh.C:1113
std::map< std::string, MortarInterface * > _mortar_interface_by_name
Mortar interfaces mapped through their names.
Definition: MooseMesh.h:1024
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:876
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
Definition: MooseMesh.C:1002
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.
Definition: MooseMesh.C:1070

◆ addPeriodicVariable()

void MooseMesh::addPeriodicVariable ( unsigned int  var_num,
BoundaryID  primary,
BoundaryID  secondary 
)

For "regular orthogonal" meshes, determine if variable var_num is periodic with respect to the primary and secondary BoundaryIDs, record this fact in the _periodic_dim data structure.

Definition at line 1479 of file MooseMesh.C.

Referenced by AddPeriodicBCAction::setPeriodicVars().

1480 {
1482  return;
1483 
1484  _periodic_dim[var_num].resize(dimension());
1485 
1486  _half_range = Point(dimensionWidth(0) / 2.0, dimensionWidth(1) / 2.0, dimensionWidth(2) / 2.0);
1487 
1488  for (unsigned int component = 0; component < dimension(); ++component)
1489  {
1490  const std::pair<BoundaryID, BoundaryID> * boundary_ids = getPairedBoundaryMapping(component);
1491 
1492  if (boundary_ids != nullptr &&
1493  ((boundary_ids->first == primary && boundary_ids->second == secondary) ||
1494  (boundary_ids->first == secondary && boundary_ids->second == primary)))
1495  _periodic_dim[var_num][component] = true;
1496  }
1497 }
RealVectorValue _half_range
A convenience vector used to hold values in each dimension representing half of the range...
Definition: MooseMesh.h:1043
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:2128
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:1542
Real dimensionWidth(unsigned int component) const
Returns the width of the requested dimension.
Definition: MooseMesh.C:1455
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:1038
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:1015

◆ addQuadratureNode()

Node * MooseMesh::addQuadratureNode ( const Elem *  elem,
const unsigned short int  side,
const unsigned int  qp,
BoundaryID  bid,
const Point &  point 
)

Adds a fictitious "QuadratureNode".

This doesn't actually add it to the libMesh mesh... we just keep track of these here in MooseMesh.

QuadratureNodes are fictitious "Nodes" that are located at quadrature points. This is useful for using the geometric search system to do searches based on quadrature point locations....

Parameters
elemThe element
sideThe side number on which we want to add a quadrature node
qpThe number of the quadrature point
bidThe boundary ID for the point to be added with
pointThe physical location of the point

Definition at line 920 of file MooseMesh.C.

Referenced by GeometricSearchData::generateMortarNodes(), and GeometricSearchData::generateQuadratureNodes().

925 {
926  Node * qnode;
927 
928  if (_elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side].find(qp) ==
930  {
931  // Create a new node id starting from the max node id and counting down. This will be the least
932  // likely to collide with an existing node id.
933  // Note that we are using numeric_limits<unsigned>::max even
934  // though max_id is stored as a dof_id_type. I tried this with
935  // numeric_limits<dof_id_type>::max and it broke several tests in
936  // MOOSE. So, this is some kind of a magic number that we will
937  // just continue to use...
938  dof_id_type max_id = std::numeric_limits<unsigned int>::max() - 100;
939  dof_id_type new_id = max_id - _quadrature_nodes.size();
940 
941  if (new_id <= getMesh().max_node_id())
942  mooseError("Quadrature node id collides with existing node id!");
943 
944  qnode = new Node(point, new_id);
945 
946  // Keep track of this new node in two different ways for easy lookup
947  _quadrature_nodes[new_id] = qnode;
948  _elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side][qp] = qnode;
949 
950  if (elem->active())
951  {
952  _node_to_elem_map[new_id].push_back(elem->id());
953  _node_to_active_semilocal_elem_map[new_id].push_back(elem->id());
954  }
955  }
956  else
957  qnode = _elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side][qp];
958 
959  BndNode * bnode = new BndNode(qnode, bid);
960  _bnd_nodes.push_back(bnode);
961  _bnd_node_ids[bid].insert(qnode->id());
962 
963  _extra_bnd_nodes.push_back(*bnode);
964 
965  // Do this so the range will be regenerated next time it is accessed
966  _bnd_node_range.reset();
967 
968  return qnode;
969 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:985
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:944
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:976
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:972
std::vector< BndNode > _extra_bnd_nodes
Definition: MooseMesh.h:988
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:987
std::unique_ptr< StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > > _bnd_node_range
Definition: MooseMesh.h:939
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248
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:948

◆ addUniqueNode()

const Node * MooseMesh::addUniqueNode ( const Point &  p,
Real  tol = 1e-6 
)

Add a new node to the mesh.

If there is already a node located at the point passed then the node will not be added. In either case a reference to the node at that location will be returned

Looping through the mesh nodes each time we add a point is very slow. To speed things up we keep a local data structure

Definition at line 886 of file MooseMesh.C.

887 {
892  if (getMesh().n_nodes() != _node_map.size())
893  {
894  _node_map.clear();
895  _node_map.reserve(getMesh().n_nodes());
896  for (const auto & node : getMesh().node_ptr_range())
897  _node_map.push_back(node);
898  }
899 
900  Node * node = nullptr;
901  for (unsigned int i = 0; i < _node_map.size(); ++i)
902  {
903  if (p.relative_fuzzy_equals(*_node_map[i], tol))
904  {
905  node = _node_map[i];
906  break;
907  }
908  }
909  if (node == nullptr)
910  {
911  node = getMesh().add_node(new Node(p));
912  _node_map.push_back(node);
913  }
914 
915  mooseAssert(node != nullptr, "Node is NULL");
916  return node;
917 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
std::vector< Node * > _node_map
Vector of all the Nodes in the mesh for determining when to add a new point.
Definition: MooseMesh.h:1012
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:423

◆ allowRecovery()

void MooseMesh::allowRecovery ( bool  allow)
inline

Set whether or not this mesh is allowed to read a recovery file.

Definition at line 795 of file MooseMesh.h.

795 { _allow_recovery = allow; }
bool _allow_recovery
Whether or not this Mesh is allowed to read a recovery file.
Definition: MooseMesh.h:1142

◆ bndElemsBegin()

MooseMesh::bnd_elem_iterator MooseMesh::bndElemsBegin ( )
virtual

Return iterators to the beginning/end of the boundary elements list.

Definition at line 871 of file MooseMesh.C.

Referenced by getBoundaryElementRange(), and MeshSideSet::modify().

872 {
873  Predicates::NotNull<bnd_elem_iterator_imp> p;
874  return bnd_elem_iterator(_bnd_elems.begin(), _bnd_elems.end(), p);
875 }
std::vector< BndElement * > _bnd_elems
array of boundary elems
Definition: MooseMesh.h:979

◆ bndElemsEnd()

MooseMesh::bnd_elem_iterator MooseMesh::bndElemsEnd ( )
virtual

Definition at line 879 of file MooseMesh.C.

Referenced by getBoundaryElementRange(), and MeshSideSet::modify().

880 {
881  Predicates::NotNull<bnd_elem_iterator_imp> p;
882  return bnd_elem_iterator(_bnd_elems.end(), _bnd_elems.end(), p);
883 }
std::vector< BndElement * > _bnd_elems
array of boundary elems
Definition: MooseMesh.h:979

◆ bndNodesBegin()

MooseMesh::bnd_node_iterator MooseMesh::bndNodesBegin ( )
virtual

Return iterators to the beginning/end of the boundary nodes list.

Definition at line 855 of file MooseMesh.C.

Referenced by getBoundaryNodeRange().

856 {
857  Predicates::NotNull<bnd_node_iterator_imp> p;
858  return bnd_node_iterator(_bnd_nodes.begin(), _bnd_nodes.end(), p);
859 }
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:972

◆ bndNodesEnd()

MooseMesh::bnd_node_iterator MooseMesh::bndNodesEnd ( )
virtual

Definition at line 863 of file MooseMesh.C.

Referenced by getBoundaryNodeRange().

864 {
865  Predicates::NotNull<bnd_node_iterator_imp> p;
866  return bnd_node_iterator(_bnd_nodes.end(), _bnd_nodes.end(), p);
867 }
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:972

◆ buildBndElemList()

void MooseMesh::buildBndElemList ( )

Definition at line 668 of file MooseMesh.C.

Referenced by MeshSideSet::modify(), and update().

669 {
670  TIME_SECTION(_build_bnd_elem_list_timer);
671 
672  freeBndElems();
673 
674  auto bc_tuples = getMesh().get_boundary_info().build_active_side_list();
675 
676  int n = bc_tuples.size();
677  _bnd_elems.clear();
678  _bnd_elems.reserve(n);
679  for (const auto & t : bc_tuples)
680  {
681  auto elem_id = std::get<0>(t);
682  auto side_id = std::get<1>(t);
683  auto bc_id = std::get<2>(t);
684 
685  _bnd_elems.push_back(new BndElement(getMesh().elem_ptr(elem_id), side_id, bc_id));
686  _bnd_elem_ids[bc_id].insert(elem_id);
687  }
688 }
void freeBndElems()
Definition: MooseMesh.C:331
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_elem_ids
Map of set of elem IDs connected to each boundary.
Definition: MooseMesh.h:983
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
std::vector< BndElement * > _bnd_elems
array of boundary elems
Definition: MooseMesh.h:979
PetscInt n
PerfID _build_bnd_elem_list_timer
Definition: MooseMesh.h:1154

◆ buildCoarseningMap()

void MooseMesh::buildCoarseningMap ( const Elem &  elem,
QBase &  qrule,
QBase &  qrule_face,
int  input_side 
)
private

Build the coarsening map for a given element type.

This will tell you what quadrature points to copy from and to for stateful material properties on newly created elements from Adaptivity.

Parameters
elemThe element that represents the element type you need the coarsening map for.
qruleThe quadrature rule in use.
qrule_faceThe current face quadrature rule
input_sideThe side to map

TODO: When running with parallel mesh + stateful adaptivty we will need to make sure that each processor has a complete map. This may require parallel communication. This is likely to happen when running on a mixed element mesh.

Definition at line 1698 of file MooseMesh.C.

Referenced by buildRefinementAndCoarseningMaps().

1699 {
1700  TIME_SECTION(_build_coarsening_map_timer);
1701 
1702  std::pair<int, ElemType> the_pair(input_side, elem.type());
1703 
1704  if (_elem_type_to_coarsening_map.find(the_pair) != _elem_type_to_coarsening_map.end())
1705  mooseError("Already built a qp coarsening map!");
1706 
1707  std::vector<std::vector<QpMap>> refinement_map;
1708  std::vector<std::pair<unsigned int, QpMap>> & coarsen_map =
1709  _elem_type_to_coarsening_map[the_pair];
1710 
1711  // The -1 here is for a specific child. We don't do that for coarsening maps
1712  // Also note that we're always mapping the same side to the same side (which is guaranteed by
1713  // libMesh).
1715  &elem, qrule, qrule_face, refinement_map, coarsen_map, input_side, -1, input_side);
1716 
1723 }
PerfID _build_coarsening_map_timer
Definition: MooseMesh.h:1168
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< std::pair< int, 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.
Definition: MooseMesh.h:1136
void findAdaptivityQpMaps(const Elem *template_elem, QBase &qrule, 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:1768
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248

◆ buildMesh()

virtual void MooseMesh::buildMesh ( )
pure virtual

Must be overridden by child classes.

This is where the Mesh object is actually created and filled in.

Implemented in PatternedMesh, StitchedMesh, ConcentricCircleMesh, MeshGeneratorMesh, AnnularMesh, DistributedGeneratedMesh, GeneratedMesh, RinglebMesh, SpiralAnnularMesh, ImageMesh, FileMesh, and TiledMesh.

Referenced by init().

◆ buildMeshBaseObject()

std::unique_ptr< MeshBase > MooseMesh::buildMeshBaseObject ( ParallelType  override_type = ParallelType::DEFAULT)

Method to construct a libMesh::MeshBase object that is normally set and used by the MooseMesh object during the "init()" phase.

Definition at line 1964 of file MooseMesh.C.

Referenced by init().

1965 {
1966  switch (_parallel_type)
1967  {
1968  case ParallelType::DEFAULT:
1969  // The user did not specify 'parallel_type = XYZ' in the input file,
1970  // so we allow the --distributed-mesh command line arg to possibly turn
1971  // on DistributedMesh. If the command line arg is not present, we pick ReplicatedMesh.
1973  _use_distributed_mesh = true;
1974  break;
1978  break;
1980  _use_distributed_mesh = true;
1981  break;
1982  }
1983 
1984  // If the user specifies 'nemesis = true' in the Mesh block, or they are using --use-split,
1985  // we must use DistributedMesh.
1986  if (_is_nemesis || _app.isUseSplit())
1987  _use_distributed_mesh = true;
1988 
1989  unsigned dim = getParam<MooseEnum>("dim");
1990 
1991  std::unique_ptr<MeshBase> mesh;
1993  {
1994  if (override_type == ParallelType::REPLICATED)
1995  mooseError("The requested override_type of \"Replicated\" may not be used when MOOSE is "
1996  "running with a DistributedMesh");
1997 
1998  mesh = libmesh_make_unique<DistributedMesh>(_communicator, dim);
1999  if (_partitioner_name != "default" && _partitioner_name != "parmetis")
2000  {
2001  _partitioner_name = "parmetis";
2002  _partitioner_overridden = true;
2003  }
2004  }
2005  else
2006  {
2007  if (override_type == ParallelType::DISTRIBUTED)
2008  mooseError("The requested override_type of \"Distributed\" may not be used when MOOSE is "
2009  "running with a ReplicatedMesh");
2010 
2011  mesh = libmesh_make_unique<ReplicatedMesh>(_communicator, dim);
2012  }
2013 
2014  if (!getParam<bool>("allow_renumbering"))
2015  mesh->allow_renumbering(false);
2016 
2017  return mesh;
2018 }
ParallelType _parallel_type
Can be set to DISTRIBUTED, REPLICATED, or DEFAULT.
Definition: MooseMesh.h:866
bool _is_nemesis
True if a Nemesis Mesh was read in.
Definition: MooseMesh.h:906
MooseEnum _partitioner_name
The partitioner used on this mesh.
Definition: MooseMesh.h:879
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
bool getDistributedMeshOnCommandLine() const
Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibilit...
Definition: MooseApp.h:317
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:871
bool isUseSplit() const
Whether or not we are running with pre-split (distributed mesh)
Definition: MooseApp.C:871
bool _parallel_type_overridden
Definition: MooseMesh.h:873
bool _partitioner_overridden
Definition: MooseMesh.h:880
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:174

◆ buildNodeList()

void MooseMesh::buildNodeList ( )

Calls BoundaryInfo::build_node_list()/build_side_list() and makes separate copies of Nodes/Elems in those lists.

Allocates memory which is cleaned up in the freeBndNodes()/freeBndElems() functions.

Definition at line 634 of file MooseMesh.C.

Referenced by update().

635 {
636  TIME_SECTION(_build_node_list_timer);
637 
638  freeBndNodes();
639 
640  auto bc_tuples = getMesh().get_boundary_info().build_node_list();
641 
642  int n = bc_tuples.size();
643  _bnd_nodes.clear();
644  _bnd_nodes.reserve(n);
645  for (const auto & t : bc_tuples)
646  {
647  auto node_id = std::get<0>(t);
648  auto bc_id = std::get<1>(t);
649 
650  _bnd_nodes.push_back(new BndNode(getMesh().node_ptr(node_id), bc_id));
651  _node_set_nodes[bc_id].push_back(node_id);
652  _bnd_node_ids[bc_id].insert(node_id);
653  }
654 
655  _bnd_nodes.reserve(_bnd_nodes.size() + _extra_bnd_nodes.size());
656  for (unsigned int i = 0; i < _extra_bnd_nodes.size(); i++)
657  {
658  BndNode * bnode = new BndNode(_extra_bnd_nodes[i]._node, _extra_bnd_nodes[i]._bnd_id);
659  _bnd_nodes.push_back(bnode);
660  _bnd_node_ids[std::get<1>(bc_tuples[i])].insert(_extra_bnd_nodes[i]._node->id());
661  }
662 
663  // This sort is here so that boundary conditions are always applied in the same order
664  std::sort(_bnd_nodes.begin(), _bnd_nodes.end(), BndNodeCompare());
665 }
Helper class for sorting Boundary Nodes so that we always get the same order of application for bound...
Definition: MooseMesh.C:610
PerfID _build_node_list_timer
Definition: MooseMesh.h:1153
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:976
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:994
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:972
std::vector< BndNode > _extra_bnd_nodes
Definition: MooseMesh.h:988
PetscInt n
void freeBndNodes()
Definition: MooseMesh.C:313

◆ buildNodeListFromSideList()

void MooseMesh::buildNodeListFromSideList ( )

Calls BoundaryInfo::build_node_list_from_side_list().

Definition at line 2162 of file MooseMesh.C.

Referenced by prepare(), and update().

2163 {
2165  getMesh().get_boundary_info().build_node_list_from_side_list();
2166 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
bool _construct_node_list_from_side_list
Whether or not to allow generation of nodesets from sidesets.
Definition: MooseMesh.h:1145

◆ buildPeriodicNodeMap()

void MooseMesh::buildPeriodicNodeMap ( std::multimap< dof_id_type, dof_id_type > &  periodic_node_map,
unsigned int  var_number,
PeriodicBoundaries *  pbs 
) const

This routine builds a multimap of boundary ids to matching boundary ids across all periodic boundaries in the system.

Definition at line 1166 of file MooseMesh.C.

1169 {
1170  TIME_SECTION(_build_periodic_node_map_timer);
1171 
1172  // clear existing map
1173  periodic_node_map.clear();
1174 
1175  // get periodic nodes
1176  std::vector<PeriodicNodeInfo> periodic_nodes;
1177  for (const auto & t : getMesh().get_boundary_info().build_node_list())
1178  {
1179  // unfortunately libMesh does not give us a pointer, so we have to look it up ourselves
1180  auto node = _mesh->node_ptr(std::get<0>(t));
1181  mooseAssert(node != nullptr,
1182  "libMesh::BoundaryInfo::build_node_list() returned an ID for a non-existing node");
1183  auto bc_id = std::get<1>(t);
1184  periodic_nodes.emplace_back(node, bc_id);
1185  }
1186 
1187  // sort by boundary id
1188  std::sort(periodic_nodes.begin(),
1189  periodic_nodes.end(),
1190  [](const PeriodicNodeInfo & a, const PeriodicNodeInfo & b) -> bool {
1191  return a.second > b.second;
1192  });
1193 
1194  // build kd-tree
1195  using KDTreeType = nanoflann::KDTreeSingleIndexAdaptor<
1196  nanoflann::L2_Simple_Adaptor<Real, PointListAdaptor<PeriodicNodeInfo>>,
1198  LIBMESH_DIM>;
1199  const unsigned int max_leaf_size = 20; // slightly affects runtime
1200  auto point_list =
1201  PointListAdaptor<PeriodicNodeInfo>(periodic_nodes.begin(), periodic_nodes.end());
1202  auto kd_tree = libmesh_make_unique<KDTreeType>(
1203  LIBMESH_DIM, point_list, nanoflann::KDTreeSingleIndexAdaptorParams(max_leaf_size));
1204  mooseAssert(kd_tree != nullptr, "KDTree was not properly initialized.");
1205  kd_tree->buildIndex();
1206 
1207  // data structures for kd-tree search
1208  nanoflann::SearchParams search_params;
1209  std::vector<std::pair<std::size_t, Real>> ret_matches;
1210 
1211  // iterate over periodic nodes (boundary ids are in contiguous blocks)
1212  PeriodicBoundaryBase * periodic = nullptr;
1213  BoundaryID current_bc_id = BoundaryInfo::invalid_id;
1214  for (auto & pair : periodic_nodes)
1215  {
1216  // entering a new block of boundary IDs
1217  if (pair.second != current_bc_id)
1218  {
1219  current_bc_id = pair.second;
1220  periodic = pbs->boundary(current_bc_id);
1221  if (periodic && !periodic->is_my_variable(var_number))
1222  periodic = nullptr;
1223  }
1224 
1225  // variable is not periodic at this node, skip
1226  if (!periodic)
1227  continue;
1228 
1229  // clear result buffer
1230  ret_matches.clear();
1231 
1232  // id of the current node
1233  const auto id = pair.first->id();
1234 
1235  // position where we expect a periodic partner for the current node and boundary
1236  Point search_point = periodic->get_corresponding_pos(*pair.first);
1237 
1238  // search at the expected point
1239  kd_tree->radiusSearch(&(search_point)(0), libMesh::TOLERANCE, ret_matches, search_params);
1240  for (auto & match_pair : ret_matches)
1241  {
1242  const auto & match = periodic_nodes[match_pair.first];
1243  // add matched node if the boundary id is the corresponding id in the periodic pair
1244  if (match.second == periodic->pairedboundary)
1245  periodic_node_map.emplace(id, match.first->id());
1246  }
1247  }
1248 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
std::pair< const Node *, BoundaryID > PeriodicNodeInfo
Helper type for building periodic node maps.
Definition: MooseMesh.h:855
PerfID _build_periodic_node_map_timer
Definition: MooseMesh.h:1163
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:876
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:423
boundary_id_type BoundaryID
Definition: MooseTypes.h:122

◆ buildPeriodicNodeSets()

void MooseMesh::buildPeriodicNodeSets ( std::map< BoundaryID, std::set< dof_id_type >> &  periodic_node_sets,
unsigned int  var_number,
PeriodicBoundaries *  pbs 
) const

This routine builds a datastructure of node ids organized by periodic boundary ids.

Definition at line 1251 of file MooseMesh.C.

1254 {
1255  TIME_SECTION(_build_periodic_node_sets_timer);
1256 
1257  periodic_node_sets.clear();
1258 
1259  // Loop over all the boundary nodes adding the periodic nodes to the appropriate set
1260  for (const auto & t : getMesh().get_boundary_info().build_node_list())
1261  {
1262  auto node_id = std::get<0>(t);
1263  auto bc_id = std::get<1>(t);
1264 
1265  // Is this current node on a known periodic boundary?
1266  if (periodic_node_sets.find(bc_id) != periodic_node_sets.end())
1267  periodic_node_sets[bc_id].insert(node_id);
1268  else // This still might be a periodic node but we just haven't seen this boundary_id yet
1269  {
1270  const PeriodicBoundaryBase * periodic = pbs->boundary(bc_id);
1271  if (periodic && periodic->is_my_variable(var_number))
1272  periodic_node_sets[bc_id].insert(node_id);
1273  }
1274  }
1275 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
PerfID _build_periodic_node_sets_timer
Definition: MooseMesh.h:1164

◆ buildRefinementAndCoarseningMaps()

void MooseMesh::buildRefinementAndCoarseningMaps ( Assembly assembly)

Create the refinement and coarsening maps necessary for projection of stateful material properties when using adaptivity.

Parameters
assemblyPointer to the Assembly object for this Mesh.

Definition at line 1560 of file MooseMesh.C.

Referenced by FEProblemBase::initialSetup().

1561 {
1563 
1564  std::map<ElemType, Elem *> canonical_elems;
1565 
1566  // First, loop over all elements and find a canonical element for each type
1567  // Doing it this way guarantees that this is going to work in parallel
1568  for (const auto & elem : getMesh().element_ptr_range()) // TODO: Thread this
1569  {
1570  ElemType type = elem->type();
1571 
1572  if (canonical_elems.find(type) ==
1573  canonical_elems.end()) // If we haven't seen this type of elem before save it
1574  canonical_elems[type] = elem;
1575  else
1576  {
1577  Elem * stored = canonical_elems[type];
1578  if (elem->id() < stored->id()) // Arbitrarily keep the one with a lower id
1579  canonical_elems[type] = elem;
1580  }
1581  }
1582  // Now build the maps using these templates
1583  // Note: This MUST be done NOT threaded!
1584  for (const auto & can_it : canonical_elems)
1585  {
1586  Elem * elem = can_it.second;
1587 
1588  // Need to do this just once to get the right qrules put in place
1589  assembly->setCurrentSubdomainID(elem->subdomain_id());
1590  assembly->reinit(elem);
1591  assembly->reinit(elem, 0);
1592  QBase * qrule = assembly->qRule();
1593  QBase * qrule_face = assembly->qRuleFace();
1594 
1595  // Volume to volume projection for refinement
1596  buildRefinementMap(*elem, *qrule, *qrule_face, -1, -1, -1);
1597 
1598  // Volume to volume projection for coarsening
1599  buildCoarseningMap(*elem, *qrule, *qrule_face, -1);
1600 
1601  // Map the sides of children
1602  for (unsigned int side = 0; side < elem->n_sides(); side++)
1603  {
1604  // Side to side for sides that match parent's sides
1605  buildRefinementMap(*elem, *qrule, *qrule_face, side, -1, side);
1606  buildCoarseningMap(*elem, *qrule, *qrule_face, side);
1607  }
1608 
1609  // Child side to parent volume mapping for "internal" child sides
1610  for (unsigned int child = 0; child < elem->n_children(); ++child)
1611  for (unsigned int side = 0; side < elem->n_sides();
1612  ++side) // Assume children have the same number of sides!
1613  if (!elem->is_child_on_side(child, side)) // Otherwise we already computed that map
1614  buildRefinementMap(*elem, *qrule, *qrule_face, -1, child, side);
1615  }
1616 }
QBase *& qRuleFace()
Returns the reference to the current quadrature being used on a current face.
Definition: Assembly.h:278
QBase *& qRule()
Returns the reference to the current quadrature being used.
Definition: Assembly.h:217
void reinit(const Elem *elem)
Reinitialize objects (JxW, q_points, ...) for an elements.
Definition: Assembly.C:1475
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
void buildCoarseningMap(const Elem &elem, QBase &qrule, QBase &qrule_face, int input_side)
Build the coarsening map for a given element type.
Definition: MooseMesh.C:1698
void setCurrentSubdomainID(SubdomainID i)
set the current subdomain ID
Definition: Assembly.h:330
PerfID _build_refinement_and_coarsening_maps_timer
Definition: MooseMesh.h:1170
void buildRefinementMap(const Elem &elem, QBase &qrule, QBase &qrule_face, int parent_side, int child, int child_side)
Build the refinement map for a given element type.
Definition: MooseMesh.C:1619
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248

◆ buildRefinementMap()

void MooseMesh::buildRefinementMap ( const Elem &  elem,
QBase &  qrule,
QBase &  qrule_face,
int  parent_side,
int  child,
int  child_side 
)
private

Build the refinement map for a given element type.

This will tell you what quadrature points to copy from and to for stateful material properties on newly created elements from Adaptivity.

Parameters
elemThe element that represents the element type you need the refinement map for.
qruleThe quadrature rule in use.
qrule_faceThe current face quadrature rule
parent_sideThe side of the parent to map (-1 if not mapping parent sides)
childThe child number (-1 if not mapping child internal sides)
child_sideThe side number of the child (-1 if not mapping sides)

Definition at line 1619 of file MooseMesh.C.

Referenced by buildRefinementAndCoarseningMaps().

1625 {
1626  TIME_SECTION(_build_refinement_map_timer);
1627 
1628  if (child == -1) // Doing volume mapping or parent side mapping
1629  {
1630  mooseAssert(parent_side == child_side,
1631  "Parent side must match child_side if not passing a specific child!");
1632 
1633  std::pair<int, ElemType> the_pair(parent_side, elem.type());
1634 
1635  if (_elem_type_to_refinement_map.find(the_pair) != _elem_type_to_refinement_map.end())
1636  mooseError("Already built a qp refinement map!");
1637 
1638  std::vector<std::pair<unsigned int, QpMap>> coarsen_map;
1639  std::vector<std::vector<QpMap>> & refinement_map = _elem_type_to_refinement_map[the_pair];
1641  &elem, qrule, qrule_face, refinement_map, coarsen_map, parent_side, child, child_side);
1642  }
1643  else // Need to map a child side to parent volume qps
1644  {
1645  std::pair<int, int> child_pair(child, child_side);
1646 
1647  if (_elem_type_to_child_side_refinement_map.find(elem.type()) !=
1649  _elem_type_to_child_side_refinement_map[elem.type()].find(child_pair) !=
1651  mooseError("Already built a qp refinement map!");
1652 
1653  std::vector<std::pair<unsigned int, QpMap>> coarsen_map;
1654  std::vector<std::vector<QpMap>> & refinement_map =
1655  _elem_type_to_child_side_refinement_map[elem.type()][child_pair];
1657  &elem, qrule, qrule_face, refinement_map, coarsen_map, parent_side, child, child_side);
1658  }
1659 }
PerfID _build_refinement_map_timer
Definition: MooseMesh.h:1167
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< 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:1132
void findAdaptivityQpMaps(const Elem *template_elem, QBase &qrule, 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:1768
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248
std::map< std::pair< int, ElemType >, std::vector< std::vector< QpMap > > > _elem_type_to_refinement_map
Holds mappings for volume to volume and parent side to child side.
Definition: MooseMesh.h:1128

◆ buildSideList() [1/2]

void MooseMesh::buildSideList ( std::vector< dof_id_type > &  el,
std::vector< unsigned short int > &  sl,
std::vector< boundary_id_type > &  il 
)

Calls BoundaryInfo::build_side_list().

Fills in the three passed vectors with list logical (element, side, id) tuples. This function will eventually be deprecated in favor of the one below, which returns a single std::vector of (elem-id, side-id, bc-id) tuples instead.

Definition at line 2169 of file MooseMesh.C.

Referenced by PenetrationLocator::detectPenetration().

2172 {
2173 #ifdef LIBMESH_ENABLE_DEPRECATED
2174  mooseDeprecated("The version of MooseMesh::buildSideList() taking three arguments is "
2175  "deprecated, call the version that returns a vector of tuples instead.");
2176  getMesh().get_boundary_info().build_side_list(el, sl, il);
2177 #else
2178  libmesh_ignore(el);
2179  libmesh_ignore(sl);
2180  libmesh_ignore(il);
2181  mooseError("The version of MooseMesh::buildSideList() taking three "
2182  "arguments is not available in your version of libmesh, call the "
2183  "version that returns a vector of tuples instead.");
2184 #endif
2185 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:158

◆ buildSideList() [2/2]

std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > MooseMesh::buildSideList ( )

As above, but uses the non-deprecated std::tuple interface.

Definition at line 2188 of file MooseMesh.C.

2189 {
2190  return getMesh().get_boundary_info().build_side_list();
2191 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ cacheChangedLists()

void MooseMesh::cacheChangedLists ( )

Cache information about what elements were refined and coarsened in the previous step.

Definition at line 522 of file MooseMesh.C.

Referenced by FEProblemBase::meshChangedHelper().

523 {
524  TIME_SECTION(_cache_changed_lists_timer);
525 
526  ConstElemRange elem_range(getMesh().local_elements_begin(), getMesh().local_elements_end(), 1);
527  CacheChangedListsThread cclt(*this);
528  Threads::parallel_reduce(elem_range, cclt);
529 
531 
532  _refined_elements = libmesh_make_unique<ConstElemPointerRange>(cclt._refined_elements.begin(),
533  cclt._refined_elements.end());
534  _coarsened_elements = libmesh_make_unique<ConstElemPointerRange>(cclt._coarsened_elements.begin(),
535  cclt._coarsened_elements.end());
536  _coarsened_element_children = cclt._coarsened_element_children;
537 }
std::unique_ptr< ConstElemPointerRange > _refined_elements
The elements that were just refined.
Definition: MooseMesh.h:915
PerfID _cache_changed_lists_timer
Definition: MooseMesh.h:1151
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
std::unique_ptr< ConstElemPointerRange > _coarsened_elements
The elements that were just coarsened.
Definition: MooseMesh.h:918
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:925

◆ cacheInfo()

void MooseMesh::cacheInfo ( )
protected

Definition at line 815 of file MooseMesh.C.

Referenced by update().

816 {
817  TIME_SECTION(_cache_info_timer);
818 
819  // TODO: Thread this!
820  for (const auto & elem : getMesh().element_ptr_range())
821  {
822  SubdomainID subdomain_id = elem->subdomain_id();
823 
824  for (unsigned int side = 0; side < elem->n_sides(); side++)
825  {
826  std::vector<BoundaryID> boundaryids = getBoundaryIDs(elem, side);
827 
828  std::set<BoundaryID> & subdomain_set = _subdomain_boundary_ids[subdomain_id];
829 
830  subdomain_set.insert(boundaryids.begin(), boundaryids.end());
831  }
832 
833  for (unsigned int nd = 0; nd < elem->n_nodes(); ++nd)
834  {
835  Node & node = *elem->node_ptr(nd);
836  _block_node_list[node.id()].insert(elem->subdomain_id());
837  }
838  }
839 }
const std::set< BoundaryID > & getBoundaryIDs() const
Returns a const reference to a set of all user-specified boundary IDs.
Definition: MooseMesh.C:2156
subdomain_id_type SubdomainID
Definition: MooseTypes.h:124
std::map< dof_id_type, std::set< SubdomainID > > _block_node_list
list of nodes that belongs to a specified block (domain)
Definition: MooseMesh.h:991
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
PerfID _cache_info_timer
Definition: MooseMesh.h:1162
std::map< SubdomainID, std::set< BoundaryID > > _subdomain_boundary_ids
Holds a map from subomdain ids to the boundary ids that are attached to it.
Definition: MooseMesh.h:1139
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:423
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248

◆ changeBoundaryId()

void MooseMesh::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.

If delete_prev is true, also actually remove the side with old_id from the BoundaryInfo object.

Definition at line 1906 of file MooseMesh.C.

Referenced by MeshExtruder::changeID().

1909 {
1910  TIME_SECTION(_change_boundary_id_timer);
1911 
1912  // Get a reference to our BoundaryInfo object, we will use it several times below...
1913  BoundaryInfo & boundary_info = getMesh().get_boundary_info();
1914 
1915  // Container to catch ids passed back from BoundaryInfo
1916  std::vector<boundary_id_type> old_ids;
1917 
1918  // Only level-0 elements store BCs. Loop over them.
1919  for (auto & elem : as_range(getMesh().level_elements_begin(0), getMesh().level_elements_end(0)))
1920  {
1921  unsigned int n_sides = elem->n_sides();
1922  for (unsigned int s = 0; s != n_sides; ++s)
1923  {
1924  boundary_info.boundary_ids(elem, s, old_ids);
1925  if (std::find(old_ids.begin(), old_ids.end(), old_id) != old_ids.end())
1926  {
1927  std::vector<boundary_id_type> new_ids(old_ids);
1928  std::replace(new_ids.begin(), new_ids.end(), old_id, new_id);
1929  if (delete_prev)
1930  {
1931  boundary_info.remove_side(elem, s);
1932  boundary_info.add_side(elem, s, new_ids);
1933  }
1934  else
1935  boundary_info.add_side(elem, s, new_ids);
1936  }
1937  }
1938  }
1939 
1940  // Remove any remaining references to the old ID from the
1941  // BoundaryInfo object. This prevents things like empty sidesets
1942  // from showing up when printing information, etc.
1943  if (delete_prev)
1944  boundary_info.remove_id(old_id);
1945 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
PerfID _change_boundary_id_timer
Definition: MooseMesh.h:1171
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248

◆ clearQuadratureNodes()

void MooseMesh::clearQuadratureNodes ( )

Clear out any existing quadrature nodes.

Most likely called before re-adding them.

Definition at line 990 of file MooseMesh.C.

Referenced by GeometricSearchData::reinit(), and ~MooseMesh().

991 {
992  // Delete all the quadrature nodes
993  for (auto & it : _quadrature_nodes)
994  delete it.second;
995 
996  _quadrature_nodes.clear();
998  _extra_bnd_nodes.clear();
999 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:985
std::vector< BndNode > _extra_bnd_nodes
Definition: MooseMesh.h:988
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:987

◆ clone()

MooseMesh & MooseMesh::clone ( ) const
virtual

Clone method.

Allocates memory you are responsible to clean up.

Definition at line 1958 of file MooseMesh.C.

Referenced by TiledMesh::buildMesh().

1959 {
1960  mooseError("MooseMesh::clone() is no longer supported, use MooseMesh::safeClone() instead.");
1961 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144

◆ coarsenedElementChildren()

const std::vector< const Elem * > & MooseMesh::coarsenedElementChildren ( const Elem *  elem) const

Get the newly removed children element ids for an element that was just coarsened.

Parameters
elemPointer to the parent element that was coarsened to.
Returns
The child element ids in Elem::child() order.

Definition at line 552 of file MooseMesh.C.

Referenced by ProjectMaterialProperties::onBoundary(), and ProjectMaterialProperties::onElement().

553 {
554  auto elem_to_child_pair = _coarsened_element_children.find(elem);
555  mooseAssert(elem_to_child_pair != _coarsened_element_children.end(), "Missing element in map");
556  return elem_to_child_pair->second;
557 }
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248
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:925

◆ coarsenedElementRange()

ConstElemPointerRange * MooseMesh::coarsenedElementRange ( ) const

Return a range that is suitable for threaded execution over elements that were just coarsened.

Note that these are the Parent elements that are now set to be INACTIVE. Their children are the elements that were just removed. Use coarsenedElementChildren() to get the element IDs for the children that were just removed for a particular parent element.

Definition at line 546 of file MooseMesh.C.

Referenced by FEProblemBase::meshChangedHelper().

547 {
548  return _coarsened_elements.get();
549 }
std::unique_ptr< ConstElemPointerRange > _coarsened_elements
The elements that were just coarsened.
Definition: MooseMesh.h:918

◆ declareRecoverableData() [1/2]

template<typename T >
T & Restartable::declareRecoverableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "recoverable".

This means that in the event of a recovery this piece of data will be restored back to its previous value.

Note - this data will NOT be restored on Restart!

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 269 of file Restartable.h.

270 {
271  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
272 
273  registerRecoverableDataOnApp(full_name);
274 
275  return declareRestartableDataWithContext<T>(data_name, nullptr);
276 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:194
std::string _restartable_name
The name of the object.
Definition: Restartable.h:191
void registerRecoverableDataOnApp(std::string name)
Helper function for actually registering the restartable data.
Definition: Restartable.C:54

◆ declareRecoverableData() [2/2]

template<typename T >
T & Restartable::declareRecoverableData ( std::string  data_name,
const T &  init_value 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

Note - this data will NOT be restored on Restart!

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data

Definition at line 280 of file Restartable.h.

281 {
282  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
283 
284  registerRecoverableDataOnApp(full_name);
285 
286  return declareRestartableDataWithContext<T>(data_name, init_value, nullptr);
287 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:194
std::string _restartable_name
The name of the object.
Definition: Restartable.h:191
void registerRecoverableDataOnApp(std::string name)
Helper function for actually registering the restartable data.
Definition: Restartable.C:54

◆ declareRestartableData() [1/2]

template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 202 of file Restartable.h.

203 {
204  return declareRestartableDataWithContext<T>(data_name, nullptr);
205 }

◆ declareRestartableData() [2/2]

template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name,
const T &  init_value 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data

Definition at line 209 of file Restartable.h.

210 {
211  return declareRestartableDataWithContext<T>(data_name, init_value, nullptr);
212 }

◆ declareRestartableDataWithContext() [1/2]

template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
contextContext pointer that will be passed to the load and store functions

Definition at line 216 of file Restartable.h.

217 {
218  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
219  auto data_ptr = libmesh_make_unique<RestartableData<T>>(full_name, context);
220  T & restartable_data_ref = data_ptr->get();
221 
222  registerRestartableDataOnApp(full_name, std::move(data_ptr), _restartable_tid);
223 
224  return restartable_data_ref;
225 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:194
std::string _restartable_name
The name of the object.
Definition: Restartable.h:191
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:197
void registerRestartableDataOnApp(std::string name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid)
Helper function for actually registering the restartable data.
Definition: Restartable.C:46

◆ declareRestartableDataWithContext() [2/2]

template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
const T &  init_value,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data
contextContext pointer that will be passed to the load and store functions

Definition at line 229 of file Restartable.h.

232 {
233  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
234  auto data_ptr = libmesh_make_unique<RestartableData<T>>(full_name, context);
235  data_ptr->set() = init_value;
236 
237  T & restartable_data_ref = data_ptr->get();
238  registerRestartableDataOnApp(full_name, std::move(data_ptr), _restartable_tid);
239 
240  return restartable_data_ref;
241 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:194
std::string _restartable_name
The name of the object.
Definition: Restartable.h:191
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:197
void registerRestartableDataOnApp(std::string name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid)
Helper function for actually registering the restartable data.
Definition: Restartable.C:46

◆ declareRestartableDataWithObjectName()

template<typename T >
T & Restartable::declareRestartableDataWithObjectName ( std::string  data_name,
std::string  object_name 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
object_nameA supplied name for the object that is declaring this data.

Definition at line 245 of file Restartable.h.

246 {
247  return declareRestartableDataWithObjectNameWithContext<T>(data_name, object_name, nullptr);
248 }

◆ declareRestartableDataWithObjectNameWithContext()

template<typename T >
T & Restartable::declareRestartableDataWithObjectNameWithContext ( std::string  data_name,
std::string  object_name,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
object_nameA supplied name for the object that is declaring this data.
contextContext pointer that will be passed to the load and store functions

Definition at line 252 of file Restartable.h.

255 {
256  std::string old_name = _restartable_name;
257 
258  _restartable_name = object_name;
259 
260  T & value = declareRestartableDataWithContext<T>(data_name, context);
261 
262  _restartable_name = old_name;
263 
264  return value;
265 }
std::string _restartable_name
The name of the object.
Definition: Restartable.h:191

◆ detectOrthogonalDimRanges()

bool MooseMesh::detectOrthogonalDimRanges ( Real  tol = 1e-6)

This routine determines whether the Mesh is a regular orthogonal mesh (i.e.

square in 2D, cubic in 3D). If it is, then we can use a number of convenience functions when periodic boundary conditions are applied. This routine populates the _range vector which is necessary for these convenience functions.

Note: This routine can potentially identify meshes with concave faces that still "fit" in the convex hull of the corresponding regular orthogonal mesh. This case is highly unlikely in practice and if a user does this, well.... release the kicker!

Definition at line 1278 of file MooseMesh.C.

Referenced by AddPeriodicBCAction::autoTranslationBoundaries(), and prepare().

1279 {
1281 
1283  return true;
1284 
1285  std::vector<Real> min(3, std::numeric_limits<Real>::max());
1286  std::vector<Real> max(3, std::numeric_limits<Real>::min());
1287  unsigned int dim = getMesh().mesh_dimension();
1288 
1289  // Find the bounding box of our mesh
1290  for (const auto & node : getMesh().node_ptr_range())
1291  // Check all coordinates, we don't know if this mesh might be lying in a higher dim even if the
1292  // mesh dimension is lower.
1293  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
1294  {
1295  if ((*node)(i) < min[i])
1296  min[i] = (*node)(i);
1297  if ((*node)(i) > max[i])
1298  max[i] = (*node)(i);
1299  }
1300 
1301  this->comm().max(max);
1302  this->comm().min(min);
1303 
1304  _extreme_nodes.resize(8); // 2^LIBMESH_DIM
1305  // Now make sure that there are actual nodes at all of the extremes
1306  std::vector<bool> extreme_matches(8, false);
1307  std::vector<unsigned int> comp_map(3);
1308  for (const auto & node : getMesh().node_ptr_range())
1309  {
1310  // See if the current node is located at one of the extremes
1311  unsigned int coord_match = 0;
1312 
1313  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
1314  {
1315  if (std::abs((*node)(i)-min[i]) < tol)
1316  {
1317  comp_map[i] = MIN;
1318  ++coord_match;
1319  }
1320  else if (std::abs((*node)(i)-max[i]) < tol)
1321  {
1322  comp_map[i] = MAX;
1323  ++coord_match;
1324  }
1325  }
1326 
1327  if (coord_match == LIBMESH_DIM) // Found a coordinate at one of the extremes
1328  {
1329  _extreme_nodes[comp_map[X] * 4 + comp_map[Y] * 2 + comp_map[Z]] = node;
1330  extreme_matches[comp_map[X] * 4 + comp_map[Y] * 2 + comp_map[Z]] = true;
1331  }
1332  }
1333 
1334  // See if we matched all of the extremes for the mesh dimension
1335  this->comm().max(extreme_matches);
1336  if (std::count(extreme_matches.begin(), extreme_matches.end(), true) == (1 << dim))
1337  _regular_orthogonal_mesh = true;
1338 
1339  // Set the bounds
1340  _bounds.resize(LIBMESH_DIM);
1341  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
1342  {
1343  _bounds[i].resize(2);
1344  _bounds[i][MIN] = min[i];
1345  _bounds[i][MAX] = max[i];
1346  }
1347 
1348  return _regular_orthogonal_mesh;
1349 }
std::vector< std::vector< Real > > _bounds
The bounds in each dimension of the mesh for regular orthogonal meshes.
Definition: MooseMesh.h:1018
std::vector< Node * > _extreme_nodes
A vector containing the nodes at the corners of a regular orthogonal mesh.
Definition: MooseMesh.h:1046
MetaPhysicL::DualNumber< T, D > abs(const MetaPhysicL::DualNumber< T, D > &in)
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
MPI_Comm comm
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:423
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:1015
PerfID _detect_orthogonal_dim_ranges_timer
Definition: MooseMesh.h:1165

◆ detectPairedSidesets()

void MooseMesh::detectPairedSidesets ( )
private

This routine detects paired sidesets of a regular orthogonal mesh (.i.e.

parallel sidesets "across" from one and other). The _paired_boundary datastructure is populated with this information.

Definition at line 1352 of file MooseMesh.C.

Referenced by getPairedBoundaryMapping().

1353 {
1354  TIME_SECTION(_detect_paired_sidesets_timer);
1355 
1356  // Loop over level-0 elements (since boundary condition information
1357  // is only directly stored for them) and find sidesets with normals
1358  // that point in the -x, +x, -y, +y, and -z, +z direction. If there
1359  // is a unique sideset id for each direction, then the paired
1360  // sidesets consist of (-x,+x), (-y,+y), (-z,+z). If there are
1361  // multiple sideset ids for a given direction, then we can't pick a
1362  // single pair for that direction. In that case, we'll just return
1363  // as was done in the original algorithm.
1364 
1365  // Points used for direction comparison
1366  const Point minus_x(-1, 0, 0), plus_x(1, 0, 0), minus_y(0, -1, 0), plus_y(0, 1, 0),
1367  minus_z(0, 0, -1), plus_z(0, 0, 1);
1368 
1369  // we need to test all element dimensions from dim down to 1
1370  const unsigned int dim = getMesh().mesh_dimension();
1371 
1372  // boundary id sets for elements of different dimensions
1373  std::vector<std::set<BoundaryID>> minus_x_ids(dim), plus_x_ids(dim), minus_y_ids(dim),
1374  plus_y_ids(dim), minus_z_ids(dim), plus_z_ids(dim);
1375 
1376  std::vector<std::unique_ptr<FEBase>> fe_faces(dim);
1377  std::vector<std::unique_ptr<QGauss>> qfaces(dim);
1378  for (unsigned side_dim = 0; side_dim < dim; ++side_dim)
1379  {
1380  // Face is assumed to be flat, therefore normal is assumed to be
1381  // constant over the face, therefore only compute it at 1 qp.
1382  qfaces[side_dim] = std::unique_ptr<QGauss>(new QGauss(side_dim, CONSTANT));
1383 
1384  // A first-order Lagrange FE for the face.
1385  fe_faces[side_dim] = FEBase::build(side_dim + 1, FEType(FIRST, LAGRANGE));
1386  fe_faces[side_dim]->attach_quadrature_rule(qfaces[side_dim].get());
1387  }
1388 
1389  // We need this to get boundary ids for each boundary face we encounter.
1390  BoundaryInfo & boundary_info = getMesh().get_boundary_info();
1391  std::vector<boundary_id_type> face_ids;
1392 
1393  for (auto & elem : as_range(getMesh().level_elements_begin(0), getMesh().level_elements_end(0)))
1394  {
1395  // dimension of the current element and its normals
1396  unsigned int side_dim = elem->dim() - 1;
1397  const std::vector<Point> & normals = fe_faces[side_dim]->get_normals();
1398 
1399  // loop over element sides
1400  for (unsigned int s = 0; s < elem->n_sides(); s++)
1401  {
1402  // If side is on the boundary
1403  if (elem->neighbor_ptr(s) == nullptr)
1404  {
1405  std::unique_ptr<Elem> side = elem->build_side_ptr(s);
1406 
1407  fe_faces[side_dim]->reinit(elem, s);
1408 
1409  // Get the boundary ID(s) for this side. If there is more
1410  // than 1 boundary id, then we already can't determine a
1411  // unique pairing of sides in this direction, but we'll just
1412  // keep going to keep the logic simple.
1413  boundary_info.boundary_ids(elem, s, face_ids);
1414 
1415  // x-direction faces
1416  if (normals[0].absolute_fuzzy_equals(minus_x))
1417  minus_x_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1418  else if (normals[0].absolute_fuzzy_equals(plus_x))
1419  plus_x_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1420 
1421  // y-direction faces
1422  else if (normals[0].absolute_fuzzy_equals(minus_y))
1423  minus_y_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1424  else if (normals[0].absolute_fuzzy_equals(plus_y))
1425  plus_y_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1426 
1427  // z-direction faces
1428  else if (normals[0].absolute_fuzzy_equals(minus_z))
1429  minus_z_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1430  else if (normals[0].absolute_fuzzy_equals(plus_z))
1431  plus_z_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1432  }
1433  }
1434  }
1435 
1436  for (unsigned side_dim = 0; side_dim < dim; ++side_dim)
1437  {
1438  // If unique pairings were found, fill up the _paired_boundary data
1439  // structure with that information.
1440  if (minus_x_ids[side_dim].size() == 1 && plus_x_ids[side_dim].size() == 1)
1441  _paired_boundary.emplace_back(
1442  std::make_pair(*(minus_x_ids[side_dim].begin()), *(plus_x_ids[side_dim].begin())));
1443 
1444  if (minus_y_ids[side_dim].size() == 1 && plus_y_ids[side_dim].size() == 1)
1445  _paired_boundary.emplace_back(
1446  std::make_pair(*(minus_y_ids[side_dim].begin()), *(plus_y_ids[side_dim].begin())));
1447 
1448  if (minus_z_ids[side_dim].size() == 1 && plus_z_ids[side_dim].size() == 1)
1449  _paired_boundary.emplace_back(
1450  std::make_pair(*(minus_z_ids[side_dim].begin()), *(plus_z_ids[side_dim].begin())));
1451  }
1452 }
PerfID _detect_paired_sidesets_timer
Definition: MooseMesh.h:1166
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248
std::vector< std::pair< BoundaryID, BoundaryID > > _paired_boundary
A vector holding the paired boundaries for a regular orthogonal mesh.
Definition: MooseMesh.h:1021

◆ dimension()

unsigned int MooseMesh::dimension ( ) const
virtual

Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh mesh object.

Definition at line 2128 of file MooseMesh.C.

Referenced by addPeriodicVariable(), AddPeriodicBCAction::autoTranslationBoundaries(), FunctionPeriodicBoundary::FunctionPeriodicBoundary(), getPairedBoundaryMapping(), isTranslatedPeriodic(), minPeriodicVector(), AddExtraNodeset::modify(), MooseVariableFE< Real >::MooseVariableFE(), PenetrationLocator::PenetrationLocator(), AddSideSetsBase::setup(), SolutionFunction::SolutionFunction(), and Moose::PetscSupport::storePetscOptions().

2129 {
2130  return getMesh().mesh_dimension();
2131 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ dimensionWidth()

Real MooseMesh::dimensionWidth ( unsigned int  component) const

Returns the width of the requested dimension.

Definition at line 1455 of file MooseMesh.C.

Referenced by addPeriodicVariable(), AddPeriodicBCAction::autoTranslationBoundaries(), and effectiveSpatialDimension().

1456 {
1457  return getMaxInDimension(component) - getMinInDimension(component);
1458 }
virtual Real getMaxInDimension(unsigned int component) const
Definition: MooseMesh.C:1470
virtual Real getMinInDimension(unsigned int component) const
Returns the min or max of the requested dimension respectively.
Definition: MooseMesh.C:1461

◆ effectiveSpatialDimension()

unsigned int MooseMesh::effectiveSpatialDimension ( ) const
virtual

Returns the effective spatial dimension determined by the coordinates actually used by the mesh.

This means that a 1D mesh that has non-zero z or y coordinates is actually a 2D or 3D mesh, respectively. Likewise a 2D mesh that has non-zero z coordinates is actually 3D mesh.

Definition at line 2134 of file MooseMesh.C.

Referenced by Exodus::setOutputDimensionInExodusWriter().

2135 {
2136  const Real abs_zero = 1e-12;
2137 
2138  // See if the mesh is completely containd in the z and y planes to calculate effective spatial dim
2139  for (unsigned int dim = LIBMESH_DIM; dim >= 1; --dim)
2140  if (dimensionWidth(dim - 1) >= abs_zero)
2141  return dim;
2142 
2143  // If we get here, we have a 1D mesh on the x-axis.
2144  return 1;
2145 }
Real dimensionWidth(unsigned int component) const
Returns the width of the requested dimension.
Definition: MooseMesh.C:1455

◆ elem() [1/2]

Elem * MooseMesh::elem ( const dof_id_type  i)
virtual

Various accessors (pointers/references) for Elem "i".

If the requested elem is a remote element on a distributed mesh, only the query accessors are valid to call, and they return NULL.

Definition at line 2248 of file MooseMesh.C.

Referenced by addMortarInterface(), addQuadratureNode(), buildCoarseningMap(), AnnularMesh::buildMesh(), RinglebMesh::buildMesh(), SpiralAnnularMesh::buildMesh(), ConcentricCircleMesh::buildMesh(), buildRefinementAndCoarseningMaps(), buildRefinementMap(), cacheInfo(), changeBoundaryId(), coarsenedElementChildren(), detectPairedSidesets(), findAdaptivityQpMaps(), getBoundaryIDs(), getCoarseningMap(), getQuadratureNode(), getRefinementMap(), ghostGhostedBoundaries(), nodeToActiveSemilocalElemMap(), nodeToElemMap(), prepare(), sideWithBoundaryID(), and updateActiveSemiLocalNodeRange().

2249 {
2250  mooseDeprecated("MooseMesh::elem() is deprecated, please use MooseMesh::elemPtr() instead");
2251  return elemPtr(i);
2252 }
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:2262
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:158

◆ elem() [2/2]

const Elem * MooseMesh::elem ( const dof_id_type  i) const
virtual

Definition at line 2255 of file MooseMesh.C.

2256 {
2257  mooseDeprecated("MooseMesh::elem() is deprecated, please use MooseMesh::elemPtr() instead");
2258  return elemPtr(i);
2259 }
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:2262
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:158

◆ elemPtr() [1/2]

Elem * MooseMesh::elemPtr ( const dof_id_type  i)
virtual

◆ elemPtr() [2/2]

const Elem * MooseMesh::elemPtr ( const dof_id_type  i) const
virtual

Definition at line 2268 of file MooseMesh.C.

2269 {
2270  return getMesh().elem_ptr(i);
2271 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ enabled()

virtual bool MooseObject::enabled ( ) const
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 96 of file MooseObject.h.

Referenced by EigenKernel::enabled().

96 { return _enabled; }
const bool & _enabled
Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:183

◆ errorIfDistributedMesh()

void MooseMesh::errorIfDistributedMesh ( std::string  name) const

Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.

Clients of MooseMesh can use this function to throw an error if they know they don't work with DistributedMesh.

See, for example, the NodalVariableValue class.

Definition at line 2680 of file MooseMesh.C.

Referenced by FEProblemBase::checkProblemIntegrity(), ElementsAlongLine::ElementsAlongLine(), ElementsAlongPlane::ElementsAlongPlane(), IntersectionPointsAlongLine::IntersectionPointsAlongLine(), BreakMeshByBlock::modify(), SideSetsFromPoints::modify(), SideSetsFromNormals::modify(), MeshSideSet::modify(), AddAllSideSetsByNormals::modify(), ParsedAddSideset::modify(), AddSideSetsFromBoundingBox::modify(), MultiAppInterpolationTransfer::MultiAppInterpolationTransfer(), MultiAppUserObjectTransfer::MultiAppUserObjectTransfer(), NodeElemConstraint::NodeElemConstraint(), NonlocalIntegratedBC::NonlocalIntegratedBC(), NonlocalKernel::NonlocalKernel(), PatternedMesh::PatternedMesh(), StitchedMesh::StitchedMesh(), and TiledMesh::TiledMesh().

2681 {
2683  mooseError("Cannot use ",
2684  name,
2685  " with DistributedMesh!\n",
2686  "Consider specifying parallel_type = 'replicated' in your input file\n",
2687  "to prevent it from being run with DistributedMesh.");
2688 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:871
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ exReader()

ExodusII_IO * MooseMesh::exReader ( ) const
virtual

Not implemented – always returns NULL.

Reimplemented in FileMesh.

Definition at line 2576 of file MooseMesh.C.

Referenced by FEProblemBase::initialSetup().

2577 {
2578  // TODO: Implement or remove
2579  return nullptr;
2580 }

◆ findAdaptivityQpMaps()

void MooseMesh::findAdaptivityQpMaps ( const Elem *  template_elem,
QBase &  qrule,
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 
)
private

Given an elem type, get maps that tell us what qp's are closest to each other between a parent and it's children.

This is mainly used for mapping stateful material properties during adaptivity.

There are 3 cases here:

  1. Volume to volume (parent_side = -1, child = -1, child_side = -1)
  2. Parent side to child side (parent_side = 0+, child = -1, child_side = 0+)
  3. Child side to parent volume (parent_side = -1, child = 0+, child_side = 0+)

Case 3 only happens under refinement (need to invent data at internal child sides).

Parameters
template_elemAn element of the type that we need to find the maps for
qruleThe quadrature rule that we need to find the maps for
qrule_faceThe face quadrature rule that we need to find the maps for
refinement_mapThe map to use when an element gets split
coarsen_mapThe map to use when an element is coarsened.
parent_side- the id of the parent's side
child- the id of the child element
child_side- The id of the child's side

Definition at line 1768 of file MooseMesh.C.

Referenced by buildCoarseningMap(), and buildRefinementMap().

1776 {
1777  TIME_SECTION(_find_adaptivity_qp_maps_timer);
1778 
1779  ReplicatedMesh mesh(_communicator);
1780  mesh.skip_partitioning(true);
1781 
1782  unsigned int dim = template_elem->dim();
1783  mesh.set_mesh_dimension(dim);
1784 
1785  for (unsigned int i = 0; i < template_elem->n_nodes(); ++i)
1786  mesh.add_point(template_elem->point(i));
1787 
1788  Elem * elem = mesh.add_elem(Elem::build(template_elem->type()).release());
1789 
1790  for (unsigned int i = 0; i < template_elem->n_nodes(); ++i)
1791  elem->set_node(i) = mesh.node_ptr(i);
1792 
1793  std::unique_ptr<FEBase> fe(FEBase::build(dim, FEType()));
1794  fe->get_phi();
1795  const std::vector<Point> & q_points_volume = fe->get_xyz();
1796 
1797  std::unique_ptr<FEBase> fe_face(FEBase::build(dim, FEType()));
1798  fe_face->get_phi();
1799  const std::vector<Point> & q_points_face = fe_face->get_xyz();
1800 
1801  fe->attach_quadrature_rule(&qrule);
1802  fe_face->attach_quadrature_rule(&qrule_face);
1803 
1804  // The current q_points
1805  const std::vector<Point> * q_points;
1806 
1807  if (parent_side != -1)
1808  {
1809  fe_face->reinit(elem, parent_side);
1810  q_points = &q_points_face;
1811  }
1812  else
1813  {
1814  fe->reinit(elem);
1815  q_points = &q_points_volume;
1816  }
1817 
1818  std::vector<Point> parent_ref_points;
1819 
1820  FEInterface::inverse_map(elem->dim(), FEType(), elem, *q_points, parent_ref_points);
1821  MeshRefinement mesh_refinement(mesh);
1822  mesh_refinement.uniformly_refine(1);
1823 
1824  std::map<unsigned int, std::vector<Point>> child_to_ref_points;
1825 
1826  unsigned int n_children = elem->n_children();
1827 
1828  refinement_map.resize(n_children);
1829 
1830  std::vector<unsigned int> children;
1831 
1832  if (child != -1) // Passed in a child explicitly
1833  children.push_back(child);
1834  else
1835  {
1836  children.resize(n_children);
1837  for (unsigned int child = 0; child < n_children; ++child)
1838  children[child] = child;
1839  }
1840 
1841  for (unsigned int i = 0; i < children.size(); ++i)
1842  {
1843  unsigned int child = children[i];
1844 
1845  if ((parent_side != -1 && !elem->is_child_on_side(child, parent_side)))
1846  continue;
1847 
1848  const Elem * child_elem = elem->child_ptr(child);
1849 
1850  if (child_side != -1)
1851  {
1852  fe_face->reinit(child_elem, child_side);
1853  q_points = &q_points_face;
1854  }
1855  else
1856  {
1857  fe->reinit(child_elem);
1858  q_points = &q_points_volume;
1859  }
1860 
1861  std::vector<Point> child_ref_points;
1862 
1863  FEInterface::inverse_map(elem->dim(), FEType(), elem, *q_points, child_ref_points);
1864  child_to_ref_points[child] = child_ref_points;
1865 
1866  std::vector<QpMap> & qp_map = refinement_map[child];
1867 
1868  // Find the closest parent_qp to each child_qp
1869  mapPoints(child_ref_points, parent_ref_points, qp_map);
1870  }
1871 
1872  coarsen_map.resize(parent_ref_points.size());
1873 
1874  // For each parent qp find the closest child qp
1875  for (unsigned int child = 0; child < n_children; child++)
1876  {
1877  if (parent_side != -1 && !elem->is_child_on_side(child, child_side))
1878  continue;
1879 
1880  std::vector<Point> & child_ref_points = child_to_ref_points[child];
1881 
1882  std::vector<QpMap> qp_map;
1883 
1884  // Find all of the closest points from parent_qp to _THIS_ child's qp
1885  mapPoints(parent_ref_points, child_ref_points, qp_map);
1886 
1887  // Check those to see if they are closer than what we currently have for each point
1888  for (unsigned int parent_qp = 0; parent_qp < parent_ref_points.size(); ++parent_qp)
1889  {
1890  std::pair<unsigned int, QpMap> & child_and_map = coarsen_map[parent_qp];
1891  unsigned int & closest_child = child_and_map.first;
1892  QpMap & closest_map = child_and_map.second;
1893 
1894  QpMap & current_map = qp_map[parent_qp];
1895 
1896  if (current_map._distance < closest_map._distance)
1897  {
1898  closest_child = child;
1899  closest_map = current_map;
1900  }
1901  }
1902  }
1903 }
Helper object for holding qp mapping info.
Definition: MooseMesh.h:54
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:1737
PerfID _find_adaptivity_qp_maps_timer
Definition: MooseMesh.h:1169
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248
Real _distance
The distance between them.
Definition: MooseMesh.h:66

◆ freeBndElems()

void MooseMesh::freeBndElems ( )
protected

Definition at line 331 of file MooseMesh.C.

Referenced by buildBndElemList(), and ~MooseMesh().

332 {
333  // free memory
334  for (auto & belem : _bnd_elems)
335  delete belem;
336 
337  for (auto & it : _bnd_elem_ids)
338  it.second.clear();
339 
340  _bnd_elem_ids.clear();
341 }
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_elem_ids
Map of set of elem IDs connected to each boundary.
Definition: MooseMesh.h:983
std::vector< BndElement * > _bnd_elems
array of boundary elems
Definition: MooseMesh.h:979

◆ freeBndNodes()

void MooseMesh::freeBndNodes ( )
protected

Definition at line 313 of file MooseMesh.C.

Referenced by buildNodeList(), and ~MooseMesh().

314 {
315  // free memory
316  for (auto & bnode : _bnd_nodes)
317  delete bnode;
318 
319  for (auto & it : _node_set_nodes)
320  it.second.clear();
321 
322  _node_set_nodes.clear();
323 
324  for (auto & it : _bnd_node_ids)
325  it.second.clear();
326 
327  _bnd_node_ids.clear();
328 }
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:976
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:994
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:972

◆ getActiveLocalElementRange()

ConstElemRange * MooseMesh::getActiveLocalElementRange ( )

Return pointers to range objects for various types of ranges (local nodes, boundary elems, etc.).

Definition at line 738 of file MooseMesh.C.

Referenced by NonlinearSystemBase::computeDamping(), AuxiliarySystem::computeElementalVars(), FEProblemBase::computeIndicators(), NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianInternal(), FEProblemBase::computeMarkers(), NonlinearSystemBase::computeResidualInternal(), FEProblemBase::computeUserObjects(), FEProblemBase::createQRules(), LayeredBase::getBounds(), NonlinearSystemBase::init(), FEProblemBase::initialSetup(), meshChanged(), DOFMapOutput::output(), FEProblemBase::projectSolution(), NonlinearSystemBase::setVariableGlobalDoFs(), PicardSolve::solve(), TransientMultiApp::solveStep(), updateActiveSemiLocalNodeRange(), Adaptivity::updateErrorVectors(), and SystemBase::zeroVariables().

739 {
741  {
743 
744  _active_local_elem_range = libmesh_make_unique<ConstElemRange>(
745  getMesh().active_local_elements_begin(), getMesh().active_local_elements_end(), GRAIN_SIZE);
746  }
747 
748  return _active_local_elem_range.get();
749 }
static const int GRAIN_SIZE
Definition: MooseMesh.C:58
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
std::unique_ptr< ConstElemRange > _active_local_elem_range
A range for use with threading.
Definition: MooseMesh.h:934
PerfID _get_active_local_element_range_timer
Definition: MooseMesh.h:1157

◆ getActiveNodeRange()

NodeRange * MooseMesh::getActiveNodeRange ( )

Definition at line 752 of file MooseMesh.C.

Referenced by meshChanged().

753 {
754  if (!_active_node_range)
755  {
756  TIME_SECTION(_get_active_node_range_timer);
757 
758  _active_node_range = libmesh_make_unique<NodeRange>(
759  getMesh().active_nodes_begin(), getMesh().active_nodes_end(), GRAIN_SIZE);
760  }
761 
762  return _active_node_range.get();
763 }
std::unique_ptr< NodeRange > _active_node_range
Definition: MooseMesh.h:937
static const int GRAIN_SIZE
Definition: MooseMesh.C:58
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
PerfID _get_active_node_range_timer
Definition: MooseMesh.h:1158

◆ getActiveSemiLocalNodeRange()

SemiLocalNodeRange * MooseMesh::getActiveSemiLocalNodeRange ( ) const

Definition at line 766 of file MooseMesh.C.

767 {
768  mooseAssert(_active_semilocal_node_range,
769  "_active_semilocal_node_range has not been created yet!");
770 
771  return _active_semilocal_node_range.get();
772 }
std::unique_ptr< SemiLocalNodeRange > _active_semilocal_node_range
Definition: MooseMesh.h:936

◆ getBoundaryElementRange()

ConstBndElemRange * MooseMesh::getBoundaryElementRange ( )

Definition at line 802 of file MooseMesh.C.

Referenced by AuxiliarySystem::computeElementalVars(), DMMooseGetEmbedding_Private(), GeometricSearchData::generateQuadratureNodes(), MultiAppNearestNodeTransfer::getLocalEntities(), meshChanged(), and GeometricSearchData::updateQuadratureNodes().

803 {
804  if (!_bnd_elem_range)
805  {
806  TIME_SECTION(_get_boundary_element_range_timer);
808  libmesh_make_unique<ConstBndElemRange>(bndElemsBegin(), bndElemsEnd(), GRAIN_SIZE);
809  }
810 
811  return _bnd_elem_range.get();
812 }
virtual bnd_elem_iterator bndElemsEnd()
Definition: MooseMesh.C:879
virtual bnd_elem_iterator bndElemsBegin()
Return iterators to the beginning/end of the boundary elements list.
Definition: MooseMesh.C:871
std::unique_ptr< StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > > _bnd_elem_range
Definition: MooseMesh.h:941
static const int GRAIN_SIZE
Definition: MooseMesh.C:58
PerfID _get_boundary_element_range_timer
Definition: MooseMesh.h:1161

◆ getBoundaryID()

BoundaryID MooseMesh::getBoundaryID ( const BoundaryName &  boundary_name) const

Get the associated BoundaryID for the boundary name.

Returns
param boundary_name The name of the boundary.
the boundary id from the passed boundary name.

Definition at line 1002 of file MooseMesh.C.

Referenced by AddPeriodicBCAction::act(), addMortarInterface(), ConstraintWarehouse::addObject(), TiledMesh::buildMesh(), StitchedMesh::buildMesh(), PatternedMesh::buildMesh(), DMSetUp_Moose_Pre(), MultiAppNearestNodeTransfer::getLocalEntities(), GeometricSearchData::getMortarNearestNodeLocator(), GeometricSearchData::getMortarPenetrationLocator(), MultiAppNearestNodeTransfer::getNearestNode(), GeometricSearchData::getNearestNodeLocator(), GeometricSearchData::getPenetrationLocator(), GeometricSearchData::getQuadratureNearestNodeLocator(), GeometricSearchData::getQuadraturePenetrationLocator(), LinearNodalConstraint::LinearNodalConstraint(), BreakBoundaryOnSubdomain::modify(), MeshSideSet::modify(), NodalScalarKernel::NodalScalarKernel(), GeometricSearchData::reinitMortarNodes(), SetupMeshAction::setupMesh(), and EqualValueBoundaryConstraint::updateConstrainedNodes().

1003 {
1004  if (boundary_name == "ANY_BOUNDARY_ID")
1005  mooseError("Please use getBoundaryIDs() when passing \"ANY_BOUNDARY_ID\"");
1006 
1008  std::istringstream ss(boundary_name);
1009 
1010  if (!(ss >> id))
1011  id = getMesh().get_boundary_info().get_id_by_name(boundary_name);
1012 
1013  return id;
1014 }
const BoundaryID INVALID_BOUNDARY_ID
Definition: MooseTypes.C:18
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
boundary_id_type BoundaryID
Definition: MooseTypes.h:122

◆ getBoundaryIDs() [1/3]

std::vector< BoundaryID > MooseMesh::getBoundaryIDs ( const Elem *const  elem,
const unsigned short int  side 
) const

Returns a vector of boundary IDs for the requested element on the requested side.

Definition at line 2148 of file MooseMesh.C.

Referenced by MeshExtruder::changeID(), NonlinearSystemBase::computeJacobianInternal(), BreakMeshByBlockBase::findFreeBoundaryId(), BoundaryRestrictable::hasBoundary(), BoundaryRestrictable::initializeBoundaryRestrictable(), BoundaryRestrictable::meshBoundaryIDs(), BreakBoundaryOnSubdomain::modify(), SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), SideSetsBetweenSubdomains::modify(), AddExtraNodeset::modify(), ElementDeleterBase::modify(), ParsedAddSideset::modify(), SideSetsAroundSubdomain::modify(), BoundingBoxNodeSet::modify(), and AddSideSetsFromBoundingBox::modify().

2149 {
2150  std::vector<BoundaryID> ids;
2151  getMesh().get_boundary_info().boundary_ids(elem, side, ids);
2152  return ids;
2153 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248

◆ getBoundaryIDs() [2/3]

const std::set< BoundaryID > & MooseMesh::getBoundaryIDs ( ) const

Returns a const reference to a set of all user-specified boundary IDs.

On a distributed mesh this will only include boundary IDs which exist on local or ghosted elements; a copy and a call to _communicator.set_union() will be necessary to get the global ID set.

Definition at line 2156 of file MooseMesh.C.

Referenced by cacheInfo().

2157 {
2158  return getMesh().get_boundary_info().get_boundary_ids();
2159 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ getBoundaryIDs() [3/3]

std::vector< BoundaryID > MooseMesh::getBoundaryIDs ( const std::vector< BoundaryName > &  boundary_name,
bool  generate_unknown = false 
) const

Get the associated BoundaryID for the boundary names that are passed in.

Returns
param boundary_name The names of the boundaries.
the boundary ids from the passed boundary names.

If the conversion from a name to a number fails, that means that this must be a named boundary. We will look in the complete map for this sideset and create a new name/ID pair if requested.

Definition at line 1017 of file MooseMesh.C.

1019 {
1020  const BoundaryInfo & boundary_info = getMesh().get_boundary_info();
1021  const std::map<BoundaryID, std::string> & sideset_map = boundary_info.get_sideset_name_map();
1022  const std::map<BoundaryID, std::string> & nodeset_map = boundary_info.get_nodeset_name_map();
1023 
1024  std::set<BoundaryID> boundary_ids = boundary_info.get_boundary_ids();
1025 
1026  // On a distributed mesh we may have boundary ids that only exist on
1027  // other processors.
1028  if (!this->getMesh().is_replicated())
1029  _communicator.set_union(boundary_ids);
1030 
1031  BoundaryID max_boundary_id = boundary_ids.empty() ? 0 : *(boundary_ids.rbegin());
1032 
1033  std::vector<BoundaryID> ids(boundary_name.size());
1034  for (unsigned int i = 0; i < boundary_name.size(); i++)
1035  {
1036  if (boundary_name[i] == "ANY_BOUNDARY_ID")
1037  {
1038  ids.assign(_mesh_boundary_ids.begin(), _mesh_boundary_ids.end());
1039  if (i)
1040  mooseWarning("You passed \"ANY_BOUNDARY_ID\" in addition to other boundary_names. This "
1041  "may be a logic error.");
1042  break;
1043  }
1044 
1045  BoundaryID id;
1046  std::istringstream ss(boundary_name[i]);
1047 
1048  if (!(ss >> id) || !ss.eof())
1049  {
1055  if (generate_unknown &&
1056  !MooseUtils::doesMapContainValue(sideset_map, std::string(boundary_name[i])) &&
1057  !MooseUtils::doesMapContainValue(nodeset_map, std::string(boundary_name[i])))
1058  id = ++max_boundary_id;
1059  else
1060  id = boundary_info.get_id_by_name(boundary_name[i]);
1061  }
1062 
1063  ids[i] = id;
1064  }
1065 
1066  return ids;
1067 }
void mooseWarning(Args &&... args) const
Definition: MooseObject.h:152
bool doesMapContainValue(const std::map< T1, T2 > &the_map, const T2 &value)
This routine is a simple helper function for searching a map by values instead of keys...
Definition: MooseUtils.h:208
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
std::set< BoundaryID > _mesh_boundary_ids
A set of boundary IDs currently present in the mesh.
Definition: MooseMesh.h:963
boundary_id_type BoundaryID
Definition: MooseTypes.h:122

◆ getBoundaryName()

const std::string & MooseMesh::getBoundaryName ( BoundaryID  boundary_id)

Return the name of the boundary given the id.

Definition at line 1141 of file MooseMesh.C.

Referenced by MaterialPropertyDebugOutput::printMaterialMap().

1142 {
1143  BoundaryInfo & boundary_info = getMesh().get_boundary_info();
1144 
1145  std::vector<BoundaryID> side_boundaries;
1146  boundary_info.build_side_boundary_ids(side_boundaries);
1147 
1148  // We need to figure out if this boundary is a sideset or nodeset
1149  if (std::find(side_boundaries.begin(), side_boundaries.end(), boundary_id) !=
1150  side_boundaries.end())
1151  return boundary_info.get_sideset_name(boundary_id);
1152  else
1153  return boundary_info.get_nodeset_name(boundary_id);
1154 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ getBoundaryNodeRange()

ConstBndNodeRange * MooseMesh::getBoundaryNodeRange ( )

Definition at line 789 of file MooseMesh.C.

Referenced by NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianInternal(), NonlinearSystemBase::computeNodalBCs(), AuxiliarySystem::computeNodalVars(), NonlinearSystemBase::computeResidualInternal(), DMMooseGetEmbedding_Private(), NearestNodeLocator::findNodes(), MultiAppNearestNodeTransfer::getLocalEntities(), MultiAppNearestNodeTransfer::getNearestNode(), meshChanged(), FEProblemBase::projectSolution(), NonlinearSystemBase::setInitialSolution(), and NearestNodeLocator::updatePatch().

790 {
791  if (!_bnd_node_range)
792  {
793  TIME_SECTION(_get_boundary_node_range_timer);
795  libmesh_make_unique<ConstBndNodeRange>(bndNodesBegin(), bndNodesEnd(), GRAIN_SIZE);
796  }
797 
798  return _bnd_node_range.get();
799 }
virtual bnd_node_iterator bndNodesEnd()
Definition: MooseMesh.C:863
PerfID _get_boundary_node_range_timer
Definition: MooseMesh.h:1160
virtual bnd_node_iterator bndNodesBegin()
Return iterators to the beginning/end of the boundary nodes list.
Definition: MooseMesh.C:855
static const int GRAIN_SIZE
Definition: MooseMesh.C:58
std::unique_ptr< StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > > _bnd_node_range
Definition: MooseMesh.h:939

◆ getCheckedPointerParam()

template<typename T >
T MooseObject::getCheckedPointerParam ( const std::string &  name,
const std::string &  error_string = "" 
) const
inlineinherited

Verifies that the requested parameter exists and is not NULL and returns it to the caller.

The template parameter must be a pointer or an error will be thrown.

Definition at line 77 of file MooseObject.h.

78  {
79  return parameters().getCheckedPointerParam<T>(name, error_string);
80  }
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller...
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ getCoarseningMap()

const std::vector< std::pair< unsigned int, QpMap > > & MooseMesh::getCoarseningMap ( const Elem &  elem,
int  input_side 
)

Get the coarsening map for a given element type.

This will tell you what quadrature points to copy from and to for stateful material properties on newly created elements from Adaptivity.

Parameters
elemThe element that represents the element type you need the coarsening map for.
input_sideThe side to map

Definition at line 1726 of file MooseMesh.C.

Referenced by ProjectMaterialProperties::onBoundary(), and ProjectMaterialProperties::onElement().

1727 {
1728  std::pair<int, ElemType> the_pair(input_side, elem.type());
1729 
1730  if (_elem_type_to_coarsening_map.find(the_pair) == _elem_type_to_coarsening_map.end())
1731  mooseError("Could not find a suitable qp refinement map!");
1732 
1733  return _elem_type_to_coarsening_map[the_pair];
1734 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< std::pair< int, 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.
Definition: MooseMesh.h:1136
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248

◆ getFileName()

virtual std::string MooseMesh::getFileName ( ) const
inlinevirtual

Returns the name of the mesh file read to produce this mesh if any or an empty string otherwise.

Reimplemented in FileMesh, and TiledMesh.

Definition at line 852 of file MooseMesh.h.

852 { return ""; }

◆ getGhostedBoundaries()

const std::set< unsigned int > & MooseMesh::getGhostedBoundaries ( ) const

Return a writable reference to the set of ghosted boundary IDs.

Definition at line 2380 of file MooseMesh.C.

2381 {
2382  return _ghosted_boundaries;
2383 }
std::set< unsigned int > _ghosted_boundaries
Definition: MooseMesh.h:996

◆ getGhostedBoundaryInflation()

const std::vector< Real > & MooseMesh::getGhostedBoundaryInflation ( ) const

Return a writable reference to the _ghosted_boundaries_inflation vector.

Definition at line 2386 of file MooseMesh.C.

Referenced by NearestNodeLocator::findNodes(), and NearestNodeLocator::updatePatch().

2387 {
2389 }
std::vector< Real > _ghosted_boundaries_inflation
Definition: MooseMesh.h:997

◆ getGhostingPatchSize()

unsigned int MooseMesh::getGhostingPatchSize ( ) const
inline

Getter for the ghosting_patch_size parameter.

Definition at line 465 of file MooseMesh.h.

Referenced by NearestNodeLocator::findNodes(), and NearestNodeLocator::updatePatch().

465 { return _ghosting_patch_size; };
unsigned int _ghosting_patch_size
The number of nearest neighbors to consider for ghosting purposes when iteration patch update strateg...
Definition: MooseMesh.h:1003

◆ getInflatedProcessorBoundingBox()

BoundingBox MooseMesh::getInflatedProcessorBoundingBox ( Real  inflation_multiplier = 0.01) const

Get a (slightly inflated) processor bounding box.

Parameters
inflation_multiplierThis amount will be multiplied by the length of the diagonal of the bounding box to find the amount to inflate the bounding box by in all directions.

Definition at line 2539 of file MooseMesh.C.

Referenced by PointSamplerBase::execute().

2540 {
2541  // Grab a bounding box to speed things up. Note that
2542  // local_bounding_box is *not* equivalent to processor_bounding_box
2543  // with processor_id() except in serial.
2544  BoundingBox bbox = MeshTools::create_local_bounding_box(getMesh());
2545 
2546  // Inflate the bbox just a bit to deal with roundoff
2547  // Adding 1% of the diagonal size in each direction on each end
2548  Real inflation_amount = inflation_multiplier * (bbox.max() - bbox.min()).norm();
2549  Point inflation(inflation_amount, inflation_amount, inflation_amount);
2550 
2551  bbox.first -= inflation; // min
2552  bbox.second += inflation; // max
2553 
2554  return bbox;
2555 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ getLocalNodeRange()

ConstNodeRange * MooseMesh::getLocalNodeRange ( )

Definition at line 775 of file MooseMesh.C.

Referenced by NonlinearSystemBase::computeDamping(), NonlinearSystemBase::computeJacobianInternal(), AuxiliarySystem::computeNodalVars(), NonlinearSystemBase::computeResidualInternal(), FEProblemBase::computeUserObjects(), NonlinearSystemBase::init(), and meshChanged().

776 {
777  if (!_local_node_range)
778  {
779  TIME_SECTION(_get_local_node_range_timer);
780 
781  _local_node_range = libmesh_make_unique<ConstNodeRange>(
782  getMesh().local_nodes_begin(), getMesh().local_nodes_end(), GRAIN_SIZE);
783  }
784 
785  return _local_node_range.get();
786 }
static const int GRAIN_SIZE
Definition: MooseMesh.C:58
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
PerfID _get_local_node_range_timer
Definition: MooseMesh.h:1159
std::unique_ptr< ConstNodeRange > _local_node_range
Definition: MooseMesh.h:938

◆ getMaxInDimension()

Real MooseMesh::getMaxInDimension ( unsigned int  component) const
virtual

Reimplemented in AnnularMesh, DistributedGeneratedMesh, and GeneratedMesh.

Definition at line 1470 of file MooseMesh.C.

Referenced by dimensionWidth(), AnnularMesh::getMaxInDimension(), GeneratedMesh::getMaxInDimension(), and DistributedGeneratedMesh::getMaxInDimension().

1471 {
1472  mooseAssert(_mesh, "The MeshBase has not been constructed");
1473  mooseAssert(component < _bounds.size(), "Requested dimension out of bounds");
1474 
1475  return _bounds[component][MAX];
1476 }
std::vector< std::vector< Real > > _bounds
The bounds in each dimension of the mesh for regular orthogonal meshes.
Definition: MooseMesh.h:1018
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:876

◆ getMaxLeafSize()

unsigned int MooseMesh::getMaxLeafSize ( ) const
inline

Getter for the maximum leaf size parameter.

Definition at line 470 of file MooseMesh.h.

Referenced by NearestNodeLocator::findNodes(), and NearestNodeLocator::updatePatch().

470 { return _max_leaf_size; };
unsigned int _max_leaf_size
Definition: MooseMesh.h:1006

◆ getMesh() [1/2]

MeshBase & MooseMesh::getMesh ( )

Accessor for the underlying libMesh Mesh object.

Definition at line 2562 of file MooseMesh.C.

Referenced by activeLocalElementsBegin(), activeLocalElementsEnd(), Adaptivity::adaptMesh(), BreakMeshByBlock::addInterfaceBoundary(), addQuadratureNode(), addUniqueNode(), GeometricRelationshipManager::attachGeometricFunctorHelper(), RelationshipManager::attachRelationshipManagers(), buildBndElemList(), TiledMesh::buildMesh(), FileMesh::buildMesh(), SpiralAnnularMesh::buildMesh(), DistributedGeneratedMesh::buildMesh(), AnnularMesh::buildMesh(), GeneratedMesh::buildMesh(), RinglebMesh::buildMesh(), ConcentricCircleMesh::buildMesh(), StitchedMesh::buildMesh(), PatternedMesh::buildMesh(), ImageMesh::buildMesh2D(), ImageMesh::buildMesh3D(), buildNodeList(), buildNodeListFromSideList(), buildPeriodicNodeMap(), buildPeriodicNodeSets(), buildRefinementAndCoarseningMaps(), buildSideList(), cacheChangedLists(), cacheInfo(), changeBoundaryId(), MeshExtruder::changeID(), FEProblemBase::checkCoordinateSystems(), FEProblemBase::checkProblemIntegrity(), NonlinearSystemBase::constraintJacobians(), NonlinearSystemBase::constraintResiduals(), detectOrthogonalDimRanges(), detectPairedSidesets(), dimension(), DumpObjectsProblem::dumpVariableHelper(), ElementalVariableValue::ElementalVariableValue(), elemPtr(), NodalNormalsCorner::execute(), MultiAppUserObjectTransfer::execute(), MultiAppInterpolationTransfer::execute(), NodalNormalsPreprocessor::execute(), CentroidMultiApp::fillPositions(), AddSideSetsBase::flood(), getActiveLocalElementRange(), getActiveNodeRange(), getBoundaryID(), getBoundaryIDs(), getBoundaryName(), FEProblemBase::getEvaluableElementRange(), getInflatedProcessorBoundingBox(), MultiAppNearestNodeTransfer::getLocalEntities(), getLocalNodeRange(), SubProblem::getMaterialPropertyBlockNames(), SubProblem::getMaterialPropertyBoundaryNames(), MultiAppNearestNodeTransfer::getNearestNode(), getNodeList(), getPointLocator(), getSubdomainID(), getSubdomainIDs(), getSubdomainName(), ghostGhostedBoundaries(), UpdateDisplacedMeshThread::init(), init(), VerifyElementUniqueID::initialize(), VerifyNodalUniqueID::initialize(), OversampleOutput::initOversample(), localNodesBegin(), localNodesEnd(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), maxElemId(), maxNodeId(), GeometryBase::meshChanged(), Nemesis::meshChanged(), BreakBoundaryOnSubdomain::modify(), BreakMeshByBlock::modify(), SideSetsBetweenSubdomains::modify(), SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), MeshSideSet::modify(), LowerDBlockFromSideset::modify(), SmoothMesh::modify(), AssignSubdomainID::modify(), AssignElementSubdomainID::modify(), ElementDeleterBase::modify(), AddAllSideSetsByNormals::modify(), ParsedAddSideset::modify(), SideSetsAroundSubdomain::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), ImageSubdomain::modify(), OrientedSubdomainBoundingBox::modify(), BoundingBoxNodeSet::modify(), SubdomainBoundingBox::modify(), AddSideSetsFromBoundingBox::modify(), MooseMesh(), nElem(), nNodes(), NodalPatchRecovery::NodalPatchRecovery(), NodalVariableValue::NodalVariableValue(), nodePtr(), nodeRef(), nodeToActiveSemilocalElemMap(), nodeToElemMap(), ComputeNodalUserObjectsThread::onNode(), XDA::output(), ConsoleUtils::outputMeshInformation(), prepare(), EqualValueEmbeddedConstraint::prepareSlaveToMasterMap(), printInfo(), queryElemPtr(), queryNodePtr(), FileMesh::read(), SubProblem::restrictionBoundaryCheckName(), SubProblem::restrictionSubdomainCheckName(), setBoundaryName(), NonlinearSystemBase::setConstraintSlaveValues(), XFEMInterface::setDisplacedMesh(), XFEMInterface::setMesh(), Exodus::setOutputDimensionInExodusWriter(), setSubdomainName(), ImageSampler::setupImageSampler(), SetupMeshAction::setupMesh(), sideWithBoundaryID(), MultiAppCopyTransfer::transfer(), DisplacedProblem::undisplaceMesh(), updateActiveSemiLocalNodeRange(), EqualValueBoundaryConstraint::updateConstrainedNodes(), Adaptivity::updateErrorVectors(), RandomData::updateGenerators(), and DisplacedProblem::updateMesh().

2563 {
2564  mooseAssert(_mesh, "Mesh hasn't been created");
2565  return *_mesh;
2566 }
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:876

◆ getMesh() [2/2]

const MeshBase & MooseMesh::getMesh ( ) const

Definition at line 2569 of file MooseMesh.C.

2570 {
2571  mooseAssert(_mesh, "Mesh hasn't been created");
2572  return *_mesh;
2573 }
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:876

◆ getMinInDimension()

Real MooseMesh::getMinInDimension ( unsigned int  component) const
virtual

Returns the min or max of the requested dimension respectively.

Reimplemented in AnnularMesh, DistributedGeneratedMesh, and GeneratedMesh.

Definition at line 1461 of file MooseMesh.C.

Referenced by dimensionWidth(), AnnularMesh::getMinInDimension(), GeneratedMesh::getMinInDimension(), and DistributedGeneratedMesh::getMinInDimension().

1462 {
1463  mooseAssert(_mesh, "The MeshBase has not been constructed");
1464  mooseAssert(component < _bounds.size(), "Requested dimension out of bounds");
1465 
1466  return _bounds[component][MIN];
1467 }
std::vector< std::vector< Real > > _bounds
The bounds in each dimension of the mesh for regular orthogonal meshes.
Definition: MooseMesh.h:1018
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:876

◆ getMooseApp()

MooseApp& MooseObject::getMooseApp ( ) const
inlineinherited

Get the MooseApp this object is associated with.

Definition at line 91 of file MooseObject.h.

Referenced by RestartableDataIO::createBackup(), RestartableDataIO::deserializeRestartableData(), ConsoleUtils::outputMeshInformation(), Resurrector::restartRestartableData(), and RestartableDataIO::restoreBackup().

91 { return _app; }
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:174

◆ getMortarInterface()

MooseMesh::MortarInterface * MooseMesh::getMortarInterface ( BoundaryID  master,
BoundaryID  slave 
)

Definition at line 2701 of file MooseMesh.C.

Referenced by GeometricSearchData::generateMortarNodes().

2702 {
2703  std::map<std::pair<BoundaryID, BoundaryID>, MortarInterface *>::iterator it =
2704  _mortar_interface_by_ids.find(std::pair<BoundaryID, BoundaryID>(master, slave));
2705  if (it != _mortar_interface_by_ids.end())
2706  return (*it).second;
2707  else
2708  mooseError(
2709  "Requesting non-existing mortar interface (master = ", master, ", slave = ", slave, ").");
2710 }
std::map< std::pair< BoundaryID, BoundaryID >, MortarInterface * > _mortar_interface_by_ids
Mortar interfaces mapped though master, slave IDs pairs.
Definition: MooseMesh.h:1027
void mooseError(Args &&... args) const
Definition: MooseObject.h:144

◆ getMortarInterfaceByName()

MooseMesh::MortarInterface * MooseMesh::getMortarInterfaceByName ( const std::string  name)

Definition at line 2691 of file MooseMesh.C.

2692 {
2693  std::map<std::string, MortarInterface *>::iterator it = _mortar_interface_by_name.find(name);
2694  if (it != _mortar_interface_by_name.end())
2695  return (*it).second;
2696  else
2697  mooseError("Requesting non-existent mortar interface '", name, "'.");
2698 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< std::string, MortarInterface * > _mortar_interface_by_name
Mortar interfaces mapped through their names.
Definition: MooseMesh.h:1024
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ getMortarInterfaces()

std::vector<std::unique_ptr<MooseMesh::MortarInterface> >& MooseMesh::getMortarInterfaces ( )
inline

◆ getNodeBlockIds()

const std::set< SubdomainID > & MooseMesh::getNodeBlockIds ( const Node &  node) const

Return list of blocks to which the given node belongs.

Definition at line 842 of file MooseMesh.C.

Referenced by BreakMeshByBlock::modify(), ComputeNodalUserObjectsThread::onNode(), ComputeNodalAuxVarsThread::onNode(), ComputeNodalKernelsThread::onNode(), ComputeNodalKernelJacobiansThread::onNode(), and TopResidualDebugOutput::printTopResiduals().

843 {
844  std::map<dof_id_type, std::set<SubdomainID>>::const_iterator it =
845  _block_node_list.find(node.id());
846 
847  if (it == _block_node_list.end())
848  mooseError("Unable to find node: ", node.id(), " in any block list.");
849 
850  return it->second;
851 }
std::map< dof_id_type, std::set< SubdomainID > > _block_node_list
list of nodes that belongs to a specified block (domain)
Definition: MooseMesh.h:991
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:423

◆ getNodeList()

const std::vector< dof_id_type > & MooseMesh::getNodeList ( boundary_id_type  nodeset_id) const

Return a writable reference to a vector of node IDs that belong to nodeset_id.

Definition at line 2589 of file MooseMesh.C.

Referenced by LinearNodalConstraint::LinearNodalConstraint(), GeometryBase::meshChanged(), NodalScalarKernel::NodalScalarKernel(), and EqualValueBoundaryConstraint::updateConstrainedNodes().

2590 {
2591  std::map<boundary_id_type, std::vector<dof_id_type>>::const_iterator it =
2592  _node_set_nodes.find(nodeset_id);
2593 
2594  if (it == _node_set_nodes.end())
2595  {
2596  // On a distributed mesh we might not know about a remote nodeset,
2597  // so we'll return an empty vector and hope the nodeset exists
2598  // elsewhere.
2599  if (!getMesh().is_serial())
2600  {
2601  static const std::vector<dof_id_type> empty_vec;
2602  return empty_vec;
2603  }
2604  // On a replicated mesh we should know about every nodeset and if
2605  // we're asked for one that doesn't exist then it must be a bug.
2606  else
2607  {
2608  mooseError("Unable to nodeset ID: ", nodeset_id, '.');
2609  }
2610  }
2611 
2612  return it->second;
2613 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
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:994
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ getNormalByBoundaryID()

const RealVectorValue & MooseMesh::getNormalByBoundaryID ( BoundaryID  id) const

Returns the normal vector associated with a given BoundaryID.

It's only valid to call this when AddAllSideSetsByNormals is active.

Definition at line 1948 of file MooseMesh.C.

1949 {
1950  mooseAssert(_boundary_to_normal_map.get() != nullptr, "Boundary To Normal Map not built!");
1951 
1952  // Note: Boundaries that are not in the map (existing boundaries) will default
1953  // construct a new RealVectorValue - (x,y,z)=(0, 0, 0)
1954  return (*_boundary_to_normal_map)[id];
1955 }
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:969

◆ getPairedBoundaryMapping()

const std::pair< BoundaryID, BoundaryID > * MooseMesh::getPairedBoundaryMapping ( unsigned int  component)

This function attempts to return the paired boundary ids for the given component.

For example, in a generated 2D mesh, passing 0 for the "x" component will return (3, 1).

Parameters
component- An integer representing the desired component (dimension)
Returns
std::pair pointer - The matching boundary pairs for the passed component

Definition at line 1542 of file MooseMesh.C.

Referenced by addPeriodicVariable(), and AddPeriodicBCAction::autoTranslationBoundaries().

1543 {
1545  mooseError("Trying to retrieve automatic paired mapping for a mesh that is not regular and "
1546  "orthogonal");
1547 
1548  mooseAssert(component < dimension(), "Requested dimension out of bounds");
1549 
1550  if (_paired_boundary.empty())
1552 
1553  if (component < _paired_boundary.size())
1554  return &_paired_boundary[component];
1555  else
1556  return nullptr;
1557 }
void detectPairedSidesets()
This routine detects paired sidesets of a regular orthogonal mesh (.i.e.
Definition: MooseMesh.C:1352
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:2128
std::vector< std::pair< BoundaryID, BoundaryID > > _paired_boundary
A vector holding the paired boundaries for a regular orthogonal mesh.
Definition: MooseMesh.h:1021
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:1015

◆ getParam()

template<typename T >
const T & MooseObject::getParam ( const std::string &  name) const
inherited

Retrieve a parameter for the object.

Parameters
nameThe name of the parameter
Returns
The value of the parameter

Definition at line 188 of file MooseObject.h.

Referenced by FEProblemBase::addMaterialHelper(), ConstraintWarehouse::addObject(), BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromXandY(), MultiApp::createApp(), DerivativeParsedMaterial::DerivativeParsedMaterial(), EigenKernel::EigenKernel(), FEProblemBase::FEProblemBase(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), SideSetsBetweenSubdomainsGenerator::generate(), ExtraNodesetGenerator::generate(), MeshExtruderGenerator::generate(), SideSetsAroundSubdomainGenerator::generate(), GenericConstantRankTwoTensor::GenericConstantRankTwoTensor(), TimeSequenceStepper::init(), AttribThread::initFrom(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), Console::initialSetup(), AdvancedOutput::initialSetup(), SideSetsBetweenSubdomains::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), SideSetsAroundSubdomain::modify(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedGenerateSideset::ParsedGenerateSideset(), ParsedMaterial::ParsedMaterial(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshGenerator::ParsedSubdomainMeshGenerator(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), TimePeriod::TimePeriod(), and VectorOfPostprocessors::VectorOfPostprocessors().

189 {
190  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
191 }
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:171
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ getPatchSize()

unsigned int MooseMesh::getPatchSize ( ) const

Getter for the patch_size parameter.

Definition at line 2521 of file MooseMesh.C.

Referenced by NearestNodeLocator::findNodes(), and NearestNodeLocator::updatePatch().

2522 {
2523  return _patch_size;
2524 }
unsigned int _patch_size
The number of nodes to consider in the NearestNode neighborhood.
Definition: MooseMesh.h:1000

◆ getPatchUpdateStrategy()

const Moose::PatchUpdateType & MooseMesh::getPatchUpdateStrategy ( ) const

Get the current patch update strategy.

Definition at line 2533 of file MooseMesh.C.

Referenced by FEProblemBase::possiblyRebuildGeomSearchPatches().

2534 {
2535  return _patch_update_strategy;
2536 }
Moose::PatchUpdateType _patch_update_strategy
The patch update strategy.
Definition: MooseMesh.h:1009

◆ getPointLocator()

std::unique_ptr< PointLocatorBase > MooseMesh::getPointLocator ( ) const
virtual

Proxy function to get a (sub)PointLocator from either the underlying libMesh mesh (default), or to allow derived meshes to return a custom point locator.

Definition at line 2747 of file MooseMesh.C.

Referenced by MultiAppVariableValueSamplePostprocessorTransfer::execute(), PointValue::execute(), MultiAppVariableValueSampleTransfer::execute(), IntersectionPointsAlongLine::execute(), ElementsAlongLine::execute(), FindValueOnLine::initialize(), PointSamplerBase::initialize(), and EqualValueEmbeddedConstraint::prepareSlaveToMasterMap().

2748 {
2749  return getMesh().sub_point_locator();
2750 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ getQuadratureNode()

Node * MooseMesh::getQuadratureNode ( const Elem *  elem,
const unsigned short int  side,
const unsigned int  qp 
)

Get a specified quadrature node.

Parameters
elemThe element the quadrature point is on
sideThe side the quadrature point is on
qpThe quadrature point number associated with the point

Definition at line 972 of file MooseMesh.C.

Referenced by GapValueAux::computeValue(), NearestNodeDistanceAux::computeValue(), PenetrationAux::computeValue(), MortarConstraint::reinit(), GeometricSearchData::updateMortarNodes(), and GeometricSearchData::updateQuadratureNodes().

975 {
976  mooseAssert(_elem_to_side_to_qp_to_quadrature_nodes.find(elem->id()) !=
978  "Elem has no quadrature nodes!");
979  mooseAssert(_elem_to_side_to_qp_to_quadrature_nodes[elem->id()].find(side) !=
981  "Side has no quadrature nodes!");
982  mooseAssert(_elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side].find(qp) !=
984  "qp not found on side!");
985 
986  return _elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side][qp];
987 }
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:987
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248

◆ getRefinementMap()

const std::vector< std::vector< QpMap > > & MooseMesh::getRefinementMap ( const Elem &  elem,
int  parent_side,
int  child,
int  child_side 
)

Get the refinement map for a given element type.

This will tell you what quadrature points to copy from and to for stateful material properties on newly created elements from Adaptivity.

Parameters
elemThe element that represents the element type you need the refinement map for.
parent_sideThe side of the parent to map (-1 if not mapping parent sides)
childThe child number (-1 if not mapping child internal sides)
child_sideThe side number of the child (-1 if not mapping sides)

TODO: When running with parallel mesh + stateful adaptivty we will need to make sure that each processor has a complete map. This may require parallel communication. This is likely to happen when running on a mixed element mesh.

Definition at line 1662 of file MooseMesh.C.

Referenced by ProjectMaterialProperties::onBoundary(), ProjectMaterialProperties::onElement(), and ProjectMaterialProperties::onInternalSide().

1663 {
1664  if (child == -1) // Doing volume mapping or parent side mapping
1665  {
1666  mooseAssert(parent_side == child_side,
1667  "Parent side must match child_side if not passing a specific child!");
1668 
1669  std::pair<int, ElemType> the_pair(parent_side, elem.type());
1670 
1671  if (_elem_type_to_refinement_map.find(the_pair) == _elem_type_to_refinement_map.end())
1672  mooseError("Could not find a suitable qp refinement map!");
1673 
1674  return _elem_type_to_refinement_map[the_pair];
1675  }
1676  else // Need to map a child side to parent volume qps
1677  {
1678  std::pair<int, int> child_pair(child, child_side);
1679 
1680  if (_elem_type_to_child_side_refinement_map.find(elem.type()) ==
1682  _elem_type_to_child_side_refinement_map[elem.type()].find(child_pair) ==
1684  mooseError("Could not find a suitable qp refinement map!");
1685 
1686  return _elem_type_to_child_side_refinement_map[elem.type()][child_pair];
1687  }
1688 
1695 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< 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:1132
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248
std::map< std::pair< int, ElemType >, std::vector< std::vector< QpMap > > > _elem_type_to_refinement_map
Holds mappings for volume to volume and parent side to child side.
Definition: MooseMesh.h:1128

◆ getSubdomainBoundaryIds()

const std::set< BoundaryID > & MooseMesh::getSubdomainBoundaryIds ( SubdomainID  subdomain_id) const

Get the list of boundary ids associated with the given subdomain id.

Parameters
subdomain_idThe subdomain ID you want to get the boundary ids for.
Returns
All boundary IDs connected to elements in the give

Definition at line 2616 of file MooseMesh.C.

Referenced by FEProblemBase::prepareMaterials().

2617 {
2618  std::map<SubdomainID, std::set<BoundaryID>>::const_iterator it =
2619  _subdomain_boundary_ids.find(subdomain_id);
2620 
2621  if (it == _subdomain_boundary_ids.end())
2622  mooseError("Unable to find subdomain ID: ", subdomain_id, '.');
2623 
2624  return it->second;
2625 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< SubdomainID, std::set< BoundaryID > > _subdomain_boundary_ids
Holds a map from subomdain ids to the boundary ids that are attached to it.
Definition: MooseMesh.h:1139

◆ getSubdomainID()

SubdomainID MooseMesh::getSubdomainID ( const SubdomainName &  subdomain_name) const

Get the associated subdomain ID for the subdomain name.

Parameters
subdomain_nameThe name of the subdomain
Returns
The subdomain id from the passed subdomain name.

Definition at line 1070 of file MooseMesh.C.

Referenced by addMortarInterface(), ConstraintWarehouse::addObject(), and FEProblemBase::setCoordSystem().

1071 {
1072  if (subdomain_name == "ANY_BLOCK_ID")
1073  mooseError("Please use getSubdomainIDs() when passing \"ANY_BLOCK_ID\"");
1074 
1076  std::istringstream ss(subdomain_name);
1077 
1078  if (!(ss >> id) || !ss.eof())
1079  id = getMesh().get_id_by_name(subdomain_name);
1080 
1081  return id;
1082 }
subdomain_id_type SubdomainID
Definition: MooseTypes.h:124
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
const SubdomainID INVALID_BLOCK_ID
Definition: MooseTypes.C:16
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ getSubdomainIDs()

std::vector< SubdomainID > MooseMesh::getSubdomainIDs ( const std::vector< SubdomainName > &  subdomain_name) const

Get the associated subdomainIDs for the subdomain names that are passed in.

Parameters
subdomain_nameThe names of the subdomains
Returns
The subdomain ids from the passed subdomain name.

Definition at line 1085 of file MooseMesh.C.

Referenced by BlockRestrictable::hasBlocks(), BlockRestrictable::initializeBlockRestrictable(), LayeredBase::LayeredBase(), SideSetsBetweenSubdomains::modify(), SideSetsAroundSubdomain::modify(), RenameBlock::modify(), and LibmeshPartitioner::prepare_blocks_for_subdomain_partitioner().

1086 {
1087  std::vector<SubdomainID> ids(subdomain_name.size());
1088 
1089  for (unsigned int i = 0; i < subdomain_name.size(); i++)
1090  {
1091  if (subdomain_name[i] == "ANY_BLOCK_ID")
1092  {
1093  ids.assign(_mesh_subdomains.begin(), _mesh_subdomains.end());
1094  if (i)
1095  mooseWarning("You passed \"ANY_BLOCK_ID\" in addition to other block names. This may be a "
1096  "logic error.");
1097  break;
1098  }
1099 
1101  std::istringstream ss(subdomain_name[i]);
1102 
1103  if (!(ss >> id) || !ss.eof())
1104  id = getMesh().get_id_by_name(subdomain_name[i]);
1105 
1106  ids[i] = id;
1107  }
1108 
1109  return ids;
1110 }
void mooseWarning(Args &&... args) const
Definition: MooseObject.h:152
subdomain_id_type SubdomainID
Definition: MooseTypes.h:124
const SubdomainID INVALID_BLOCK_ID
Definition: MooseTypes.C:16
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
std::set< SubdomainID > _mesh_subdomains
A set of subdomain IDs currently present in the mesh.
Definition: MooseMesh.h:955

◆ getSubdomainName()

const std::string & MooseMesh::getSubdomainName ( SubdomainID  subdomain_id)

Return the name of a block given an id.

Definition at line 1119 of file MooseMesh.C.

Referenced by BreakMeshByBlockBase::generateBoundaryName(), MaterialPropertyDebugOutput::printMaterialMap(), and TopResidualDebugOutput::printTopResiduals().

1120 {
1121  return getMesh().subdomain_name(subdomain_id);
1122 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ ghostGhostedBoundaries()

void MooseMesh::ghostGhostedBoundaries ( )

Actually do the ghosting of boundaries that need to be ghosted to this processor.

Definition at line 2450 of file MooseMesh.C.

Referenced by FEProblemBase::ghostGhostedBoundaries(), and SetupMeshAction::setupMesh().

2451 {
2452  // No need to do this if using a serial mesh
2453  if (!_use_distributed_mesh)
2454  return;
2455 
2456  TIME_SECTION(_ghost_ghosted_boundaries_timer);
2457 
2458  DistributedMesh & mesh = dynamic_cast<DistributedMesh &>(getMesh());
2459 
2460  // We would like to clear ghosted elements that were added by
2461  // previous invocations of this method; however we can't do so
2462  // simply without also clearing ghosted elements that were added by
2463  // other code; e.g. OversampleOutput. So for now we'll just
2464  // swallow the inefficiency that can come from leaving unnecessary
2465  // elements ghosted after AMR.
2466  // mesh.clear_extra_ghost_elems();
2467 
2468  std::set<const Elem *, CompareElemsByLevel> boundary_elems_to_ghost;
2469  std::set<Node *> connected_nodes_to_ghost;
2470 
2471  std::vector<const Elem *> family_tree;
2472 
2473  for (const auto & t : mesh.get_boundary_info().build_side_list())
2474  {
2475  auto elem_id = std::get<0>(t);
2476  auto bc_id = std::get<2>(t);
2477 
2478  if (_ghosted_boundaries.find(bc_id) != _ghosted_boundaries.end())
2479  {
2480  Elem * elem = mesh.elem_ptr(elem_id);
2481 
2482 #ifdef LIBMESH_ENABLE_AMR
2483  elem->family_tree(family_tree);
2484  Elem * parent = elem->parent();
2485  while (parent)
2486  {
2487  family_tree.push_back(parent);
2488  parent = parent->parent();
2489  }
2490 #else
2491  family_tree.clear();
2492  family_tree.push_back(elem);
2493 #endif
2494  for (const auto & felem : family_tree)
2495  {
2496  boundary_elems_to_ghost.insert(felem);
2497 
2498  // The entries of connected_nodes_to_ghost need to be
2499  // non-constant, so that they will work in things like
2500  // UpdateDisplacedMeshThread. The container returned by
2501  // family_tree contains const Elems even when the Elem
2502  // it is called on is non-const, so once that interface
2503  // gets fixed we can remove this const_cast.
2504  for (unsigned int n = 0; n < felem->n_nodes(); ++n)
2505  connected_nodes_to_ghost.insert(const_cast<Node *>(felem->node_ptr(n)));
2506  }
2507  }
2508  }
2509 
2510  mesh.comm().allgather_packed_range(&mesh,
2511  connected_nodes_to_ghost.begin(),
2512  connected_nodes_to_ghost.end(),
2513  extra_ghost_elem_inserter<Node>(mesh));
2514  mesh.comm().allgather_packed_range(&mesh,
2515  boundary_elems_to_ghost.begin(),
2516  boundary_elems_to_ghost.end(),
2517  extra_ghost_elem_inserter<Elem>(mesh));
2518 }
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:871
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
PetscInt n
PerfID _ghost_ghosted_boundaries_timer
Definition: MooseMesh.h:1174
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248
std::set< unsigned int > _ghosted_boundaries
Definition: MooseMesh.h:996

◆ hasSecondOrderElements()

bool MooseMesh::hasSecondOrderElements ( )

check if the mesh has SECOND order elements

Definition at line 2725 of file MooseMesh.C.

Referenced by Assembly::Assembly().

2726 {
2727  bool mesh_has_second_order_elements = false;
2728  for (auto it = activeLocalElementsBegin(), end = activeLocalElementsEnd(); it != end; ++it)
2729  if ((*it)->default_order() == SECOND)
2730  {
2731  mesh_has_second_order_elements = true;
2732  break;
2733  }
2734 
2735  // We checked our local elements, so take the max over all processors.
2736  comm().max(mesh_has_second_order_elements);
2737  return mesh_has_second_order_elements;
2738 }
MeshBase::const_element_iterator activeLocalElementsBegin()
Calls active_local_nodes_begin/end() on the underlying libMesh mesh object.
Definition: MooseMesh.C:2212
MPI_Comm comm
const MeshBase::const_element_iterator activeLocalElementsEnd()
Definition: MooseMesh.C:2218

◆ init()

void MooseMesh::init ( )
virtual

Initialize the Mesh object.

Most of the time this will turn around and call build_mesh so the child class can build the Mesh object.

However, during Recovery this will read the CPA file...

If the mesh base hasn't been constructed by the time init is called, just do it here. This can happen if somebody builds a mesh outside of the normal Action system. Forcing developers to create, construct the MeshBase, and then init separately is a bit much for casual use but it gives us the ability to run MeshGenerators in-between.

Definition at line 2027 of file MooseMesh.C.

Referenced by GridPartitioner::_do_partition().

2028 {
2035  if (!_mesh)
2037 
2039  mooseError("You cannot use the mesh splitter capability with DistributedMesh!");
2040 
2041  TIME_SECTION(_init_timer);
2042 
2044  {
2045  // Check of partitioner is supplied (not allowed if custom partitioner is used)
2046  if (!parameters().isParamSetByAddParam("partitioner"))
2047  mooseError("If partitioner block is provided, partitioner keyword cannot be used!");
2048  // Set custom partitioner
2049  if (!_custom_partitioner.get())
2050  mooseError("Custom partitioner requested but not set!");
2051  getMesh().partitioner().reset(_custom_partitioner.release());
2052  }
2053  else
2054  {
2055  // Set standard partitioner
2056  // Set the partitioner based on partitioner name
2057  switch (_partitioner_name)
2058  {
2059  case -3: // default
2060  // We'll use the default partitioner, but notify the user of which one is being used...
2062  _partitioner_name = "parmetis";
2063  else
2064  _partitioner_name = "metis";
2065  break;
2066 
2067  // No need to explicitily create the metis or parmetis partitioners,
2068  // They are the default for serial and parallel mesh respectively
2069  case -2: // metis
2070  case -1: // parmetis
2071  break;
2072 
2073  case 0: // linear
2074  getMesh().partitioner().reset(new LinearPartitioner);
2075  break;
2076  case 1: // centroid
2077  {
2078  if (!isParamValid("centroid_partitioner_direction"))
2079  mooseError("If using the centroid partitioner you _must_ specify "
2080  "centroid_partitioner_direction!");
2081 
2082  MooseEnum direction = getParam<MooseEnum>("centroid_partitioner_direction");
2083 
2084  if (direction == "x")
2085  getMesh().partitioner().reset(new CentroidPartitioner(CentroidPartitioner::X));
2086  else if (direction == "y")
2087  getMesh().partitioner().reset(new CentroidPartitioner(CentroidPartitioner::Y));
2088  else if (direction == "z")
2089  getMesh().partitioner().reset(new CentroidPartitioner(CentroidPartitioner::Z));
2090  else if (direction == "radial")
2091  getMesh().partitioner().reset(new CentroidPartitioner(CentroidPartitioner::RADIAL));
2092  break;
2093  }
2094  case 2: // hilbert_sfc
2095  getMesh().partitioner().reset(new HilbertSFCPartitioner);
2096  break;
2097  case 3: // morton_sfc
2098  getMesh().partitioner().reset(new MortonSFCPartitioner);
2099  break;
2100  }
2101  }
2102 
2104  {
2105  // Some partitioners are not idempotent. Some recovery data
2106  // files require partitioning to match mesh partitioning. This
2107  // means that, when recovering, we can't safely repartition.
2108  const bool skip_partitioning_later = getMesh().skip_partitioning();
2109  getMesh().skip_partitioning(true);
2110  const bool allow_renumbering_later = getMesh().allow_renumbering();
2111  getMesh().allow_renumbering(false);
2112 
2113  // For now, only read the recovery mesh on the Ultimate Master..
2114  // sub-apps need to just build their mesh like normal
2115  {
2116  TIME_SECTION(_read_recovered_mesh_timer);
2117  getMesh().read(_app.getRecoverFileBase() + "_mesh." + _app.getRecoverFileSuffix());
2118  }
2119 
2120  getMesh().allow_renumbering(allow_renumbering_later);
2121  getMesh().skip_partitioning(skip_partitioning_later);
2122  }
2123  else // Normally just build the mesh
2124  buildMesh();
2125 }
bool _custom_partitioner_requested
Definition: MooseMesh.h:884
std::string getRecoverFileBase()
The file_base for the recovery file.
Definition: MooseApp.h:357
MooseEnum _partitioner_name
The partitioner used on this mesh.
Definition: MooseMesh.h:879
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
virtual void buildMesh()=0
Must be overridden by child classes.
bool isSplitMesh() const
Whether or not this is a split mesh operation.
Definition: MooseApp.C:865
bool _allow_recovery
Whether or not this Mesh is allowed to read a recovery file.
Definition: MooseMesh.h:1142
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:871
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
PerfID _init_timer
Definition: MooseMesh.h:1172
PerfID _read_recovered_mesh_timer
Definition: MooseMesh.h:1173
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:32
std::unique_ptr< MeshBase > buildMeshBaseObject(ParallelType override_type=ParallelType::DEFAULT)
Method to construct a libMesh::MeshBase object that is normally set and used by the MooseMesh object ...
Definition: MooseMesh.C:1964
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:876
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:174
std::string getRecoverFileSuffix()
The suffix for the recovery file.
Definition: MooseApp.h:373
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:86
bool isUltimateMaster()
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:522
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:853
std::unique_ptr< Partitioner > _custom_partitioner
The custom partitioner.
Definition: MooseMesh.h:883

◆ isBoundaryElem() [1/2]

bool MooseMesh::isBoundaryElem ( dof_id_type  elem_id) const

Returns true if the requested element is in the list of boundary elements, false otherwise.

Definition at line 2654 of file MooseMesh.C.

2655 {
2656  bool found_elem = false;
2657  for (const auto & it : _bnd_elem_ids)
2658  {
2659  if (it.second.find(elem_id) != it.second.end())
2660  {
2661  found_elem = true;
2662  break;
2663  }
2664  }
2665  return found_elem;
2666 }
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_elem_ids
Map of set of elem IDs connected to each boundary.
Definition: MooseMesh.h:983

◆ isBoundaryElem() [2/2]

bool MooseMesh::isBoundaryElem ( dof_id_type  elem_id,
BoundaryID  bnd_id 
) const

Returns true if the requested element is in the list of boundary elements for the specified boundary, false otherwise.

Definition at line 2669 of file MooseMesh.C.

2670 {
2671  bool found_elem = false;
2672  std::map<boundary_id_type, std::set<dof_id_type>>::const_iterator it = _bnd_elem_ids.find(bnd_id);
2673  if (it != _bnd_elem_ids.end())
2674  if (it->second.find(elem_id) != it->second.end())
2675  found_elem = true;
2676  return found_elem;
2677 }
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_elem_ids
Map of set of elem IDs connected to each boundary.
Definition: MooseMesh.h:983

◆ isBoundaryNode() [1/2]

bool MooseMesh::isBoundaryNode ( dof_id_type  node_id) const

Returns true if the requested node is in the list of boundary nodes, false otherwise.

Definition at line 2628 of file MooseMesh.C.

Referenced by NodalNormalsPreprocessor::execute().

2629 {
2630  bool found_node = false;
2631  for (const auto & it : _bnd_node_ids)
2632  {
2633  if (it.second.find(node_id) != it.second.end())
2634  {
2635  found_node = true;
2636  break;
2637  }
2638  }
2639  return found_node;
2640 }
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:976

◆ isBoundaryNode() [2/2]

bool MooseMesh::isBoundaryNode ( dof_id_type  node_id,
BoundaryID  bnd_id 
) const

Returns true if the requested node is in the list of boundary nodes for the specified boundary, false otherwise.

Definition at line 2643 of file MooseMesh.C.

2644 {
2645  bool found_node = false;
2646  std::map<boundary_id_type, std::set<dof_id_type>>::const_iterator it = _bnd_node_ids.find(bnd_id);
2647  if (it != _bnd_node_ids.end())
2648  if (it->second.find(node_id) != it->second.end())
2649  found_node = true;
2650  return found_node;
2651 }
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:976

◆ isCustomPartitionerRequested()

bool MooseMesh::isCustomPartitionerRequested ( ) const

Setter and getter for _custom_partitioner_requested.

Definition at line 2719 of file MooseMesh.C.

2720 {
2722 }
bool _custom_partitioner_requested
Definition: MooseMesh.h:884

◆ isDistributedMesh()

bool MooseMesh::isDistributedMesh ( ) const
inline

◆ isParallelTypeForced()

bool MooseMesh::isParallelTypeForced ( ) const
inline

Tell the user if the distribution was overriden for any reason.

Definition at line 780 of file MooseMesh.h.

Referenced by ConsoleUtils::outputMeshInformation().

780 { return _parallel_type_overridden; }
bool _parallel_type_overridden
Definition: MooseMesh.h:873

◆ isParamValid()

bool MooseObject::isParamValid ( const std::string &  name) const
inlineinherited

Test if the supplied parameter is valid.

Parameters
nameThe name of the parameter to test

Definition at line 86 of file MooseObject.h.

Referenced by AdvancedOutput::AdvancedOutput(), BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), DistributedGeneratedMesh::buildMesh(), GeneratedMesh::buildMesh(), CartesianMeshGenerator::CartesianMeshGenerator(), LibmeshPartitioner::clone(), OversampleOutput::cloneMesh(), CSVReader::CSVReader(), MultiAppNearestNodeTransfer::execute(), Exodus::Exodus(), FEProblemBase::FEProblemBase(), FileOutput::FileOutput(), MultiApp::fillPositions(), FunctionDT::FunctionDT(), RenameBoundaryGenerator::generate(), BreakBoundaryOnSubdomainGenerator::generate(), ElementSubdomainIDGenerator::generate(), ExtraNodesetGenerator::generate(), LowerDBlockFromSidesetGenerator::generate(), MeshSideSetGenerator::generate(), RenameBlockGenerator::generate(), GeneratedMeshGenerator::generate(), ParsedSubdomainMeshGenerator::generate(), MeshExtruderGenerator::generate(), SubdomainBoundingBoxGenerator::generate(), MultiAppNearestNodeTransfer::getLocalEntities(), MeshGenerator::getMesh(), MultiAppNearestNodeTransfer::getNearestNode(), EigenExecutionerBase::init(), IterationAdaptiveDT::init(), init(), AdvancedOutput::initExecutionTypes(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), SolutionAux::initialSetup(), MooseParsedVectorFunction::initialSetup(), Console::initialSetup(), Receiver::initialSetup(), SolutionFunction::initialSetup(), MooseParsedGradFunction::initialSetup(), MooseParsedFunction::initialSetup(), AdvancedOutput::initialSetup(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), IterationAdaptiveDT::IterationAdaptiveDT(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), BreakBoundaryOnSubdomain::modify(), MeshExtruder::modify(), MeshSideSet::modify(), LowerDBlockFromSideset::modify(), AssignElementSubdomainID::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), SubdomainBoundingBox::modify(), MooseMesh(), EigenExecutionerBase::normalizeSolution(), Output::Output(), PetscOutput::PetscOutput(), Piecewise::Piecewise(), SolutionUserObject::readExodusII(), RenameBlock::RenameBlock(), RenameBlockGenerator::RenameBlockGenerator(), RenameBoundaryGenerator::RenameBoundaryGenerator(), SolutionUserObject::SolutionUserObject(), and TimePeriod::TimePeriod().

86 { return _pars.isParamValid(name); }
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:171
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ isPartitionerForced()

bool MooseMesh::isPartitionerForced ( ) const
inline

Tell the user if the partitioner was overriden for any reason.

Definition at line 790 of file MooseMesh.h.

Referenced by ConsoleUtils::outputMeshInformation().

790 { return _partitioner_overridden; }
bool _partitioner_overridden
Definition: MooseMesh.h:880

◆ isRegularOrthogonal()

bool MooseMesh::isRegularOrthogonal ( )
inline

Getter to query if the mesh was detected to be regular and orthogonal.

Definition at line 837 of file MooseMesh.h.

837 { return _regular_orthogonal_mesh; }
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:1015

◆ isSemiLocal()

bool MooseMesh::isSemiLocal ( Node *  node)

Returns true if the node is semi-local.

Parameters
nodeNode pointer
Returns
true is the node is semi-local, false otherwise

Definition at line 601 of file MooseMesh.C.

602 {
603  return _semilocal_node_list.find(node) != _semilocal_node_list.end();
604 }
std::set< Node * > _semilocal_node_list
Used for generating the semilocal node range.
Definition: MooseMesh.h:928
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:423

◆ isTranslatedPeriodic()

bool MooseMesh::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.

Parameters
nonlinear_var_num- The nonlinear variable number
component- An integer representing the desired component (dimension)

Definition at line 1500 of file MooseMesh.C.

Referenced by minPeriodicVector().

1501 {
1502  mooseAssert(component < dimension(), "Requested dimension out of bounds");
1503 
1504  if (_periodic_dim.find(nonlinear_var_num) != _periodic_dim.end())
1505  return _periodic_dim.at(nonlinear_var_num)[component];
1506  else
1507  return false;
1508 }
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:2128
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:1038

◆ localNodesBegin()

MeshBase::const_node_iterator MooseMesh::localNodesBegin ( )

Calls local_nodes_begin/end() on the underlying libMesh mesh object.

Definition at line 2200 of file MooseMesh.C.

Referenced by MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppNearestNodeTransfer::getNearestNode(), TopResidualDebugOutput::printTopResiduals(), and OversampleOutput::updateOversample().

2201 {
2202  return getMesh().local_nodes_begin();
2203 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ localNodesEnd()

MeshBase::const_node_iterator MooseMesh::localNodesEnd ( )

Definition at line 2206 of file MooseMesh.C.

Referenced by MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppNearestNodeTransfer::getNearestNode(), TopResidualDebugOutput::printTopResiduals(), and OversampleOutput::updateOversample().

2207 {
2208  return getMesh().local_nodes_end();
2209 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ mapPoints()

void MooseMesh::mapPoints ( const std::vector< Point > &  from,
const std::vector< Point > &  to,
std::vector< QpMap > &  qp_map 
)
private

Find the closest points that map "from" to "to" and fill up "qp_map".

Essentially, for each point in "from" find the closest point in "to".

Parameters
fromThe reference positions in the parent of the the points we're mapping from
toThe reference positions in the parent of the the points we're mapping to
qp_mapThis will be filled with QpMap objects holding the mappings.

Definition at line 1737 of file MooseMesh.C.

Referenced by findAdaptivityQpMaps().

1740 {
1741  unsigned int n_from = from.size();
1742  unsigned int n_to = to.size();
1743 
1744  qp_map.resize(n_from);
1745 
1746  for (unsigned int i = 0; i < n_from; ++i)
1747  {
1748  const Point & from_point = from[i];
1749 
1750  QpMap & current_map = qp_map[i];
1751 
1752  for (unsigned int j = 0; j < n_to; ++j)
1753  {
1754  const Point & to_point = to[j];
1755  Real distance = (from_point - to_point).norm();
1756 
1757  if (distance < current_map._distance)
1758  {
1759  current_map._distance = distance;
1760  current_map._from = i;
1761  current_map._to = j;
1762  }
1763  }
1764  }
1765 }
Helper object for holding qp mapping info.
Definition: MooseMesh.h:54
unsigned int _to
The qp to map to.
Definition: MooseMesh.h:63
unsigned int _from
The qp to map from.
Definition: MooseMesh.h:60
Real _distance
The distance between them.
Definition: MooseMesh.h:66

◆ maxElemId()

dof_id_type MooseMesh::maxElemId ( ) const
virtual

Definition at line 2242 of file MooseMesh.C.

Referenced by SolutionUserObject::pointValueGradientWrapper(), and SolutionUserObject::pointValueWrapper().

2243 {
2244  return getMesh().max_elem_id();
2245 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ maxNodeId()

dof_id_type MooseMesh::maxNodeId ( ) const
virtual

Calls max_node/elem_id() on the underlying libMesh mesh object.

This may be larger than n_nodes/elem() in cases where the id numbering is not contiguous.

Definition at line 2236 of file MooseMesh.C.

2237 {
2238  return getMesh().max_node_id();
2239 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ meshBoundaryIds()

const std::set< BoundaryID > & MooseMesh::meshBoundaryIds ( ) const

Returns a read-only reference to the set of boundary IDs currently present in the Mesh.

Definition at line 2317 of file MooseMesh.C.

Referenced by AddPeriodicBCAction::autoTranslationBoundaries(), BoundaryRestrictable::isBoundarySubset(), and AddAllSideSetsByNormals::modify().

2318 {
2319  return _mesh_boundary_ids;
2320 }
std::set< BoundaryID > _mesh_boundary_ids
A set of boundary IDs currently present in the mesh.
Definition: MooseMesh.h:963

◆ meshChanged()

void MooseMesh::meshChanged ( )

Declares that the MooseMesh has changed, invalidates cached data and rebuilds caches.

Sets a flag so that clients of the MooseMesh also know when it has changed.

Definition at line 491 of file MooseMesh.C.

Referenced by DisplacedProblem::init(), FEProblemBase::init(), FEProblemBase::initialSetup(), DisplacedProblem::meshChanged(), and FEProblemBase::meshChangedHelper().

492 {
493  TIME_SECTION(_mesh_changed_timer);
494 
495  update();
496 
497  // Delete all of the cached ranges
498  _active_local_elem_range.reset();
499  _active_node_range.reset();
501  _local_node_range.reset();
502  _bnd_node_range.reset();
503  _bnd_elem_range.reset();
504 
505  // Rebuild the ranges
511 
512  // Call the callback function onMeshChanged
513  onMeshChanged();
514 }
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:738
virtual void onMeshChanged()
Declares a callback function that is executed at the conclusion of meshChanged(). ...
Definition: MooseMesh.C:517
ConstNodeRange * getLocalNodeRange()
Definition: MooseMesh.C:775
std::unique_ptr< NodeRange > _active_node_range
Definition: MooseMesh.h:937
std::unique_ptr< StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > > _bnd_elem_range
Definition: MooseMesh.h:941
void update()
Calls buildNodeListFromSideList(), buildNodeList(), and buildBndElemList().
Definition: MooseMesh.C:404
PerfID _mesh_changed_timer
Definition: MooseMesh.h:1150
std::unique_ptr< StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > > _bnd_node_range
Definition: MooseMesh.h:939
NodeRange * getActiveNodeRange()
Definition: MooseMesh.C:752
std::unique_ptr< ConstElemRange > _active_local_elem_range
A range for use with threading.
Definition: MooseMesh.h:934
StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
Definition: MooseMesh.C:802
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
Definition: MooseMesh.C:789
std::unique_ptr< SemiLocalNodeRange > _active_semilocal_node_range
Definition: MooseMesh.h:936
std::unique_ptr< ConstNodeRange > _local_node_range
Definition: MooseMesh.h:938

◆ meshNodesetIds()

const std::set< BoundaryID > & MooseMesh::meshNodesetIds ( ) const

Returns a read-only reference to the set of nodesets currently present in the Mesh.

Definition at line 2329 of file MooseMesh.C.

Referenced by BoundaryRestrictable::initializeBoundaryRestrictable().

2330 {
2331  return _mesh_nodeset_ids;
2332 }
std::set< BoundaryID > _mesh_nodeset_ids
Definition: MooseMesh.h:965

◆ meshSidesetIds()

const std::set< BoundaryID > & MooseMesh::meshSidesetIds ( ) const

Returns a read-only reference to the set of sidesets currently present in the Mesh.

Definition at line 2323 of file MooseMesh.C.

Referenced by BoundaryRestrictable::initializeBoundaryRestrictable().

2324 {
2325  return _mesh_sideset_ids;
2326 }
std::set< BoundaryID > _mesh_sideset_ids
Definition: MooseMesh.h:964

◆ meshSubdomains()

const std::set< SubdomainID > & MooseMesh::meshSubdomains ( ) const

◆ minPeriodicDistance()

Real MooseMesh::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 the given variable number.

Parameters
nonlinear_var_num- The nonlinear variable number
p,q- The points for which to compute a minimum distance
Returns
Real - The L2 distance between p and q

Definition at line 1536 of file MooseMesh.C.

1537 {
1538  return minPeriodicVector(nonlinear_var_num, p, q).norm();
1539 }
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:1511

◆ minPeriodicVector()

RealVectorValue MooseMesh::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 periodicity for the given variable number.

Parameters
nonlinear_var_num- The nonlinear variable number
p,q- The points between which to compute a minimum vector
Returns
RealVectorValue - The vector pointing from p to q

Definition at line 1511 of file MooseMesh.C.

Referenced by minPeriodicDistance().

1512 {
1513  for (unsigned int i = 0; i < dimension(); ++i)
1514  {
1515  // check to see if we're closer in real or periodic space in x, y, and z
1516  if (isTranslatedPeriodic(nonlinear_var_num, i))
1517  {
1518  // Need to test order before differencing
1519  if (p(i) > q(i))
1520  {
1521  if (p(i) - q(i) > _half_range(i))
1522  p(i) -= _half_range(i) * 2;
1523  }
1524  else
1525  {
1526  if (q(i) - p(i) > _half_range(i))
1527  p(i) += _half_range(i) * 2;
1528  }
1529  }
1530  }
1531 
1532  return q - p;
1533 }
RealVectorValue _half_range
A convenience vector used to hold values in each dimension representing half of the range...
Definition: MooseMesh.h:1043
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:1500
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:2128

◆ mooseDeprecated()

template<typename... Args>
void MooseObject::mooseDeprecated ( Args &&...  args) const
inlineinherited

◆ mooseError()

template<typename... Args>
void MooseObject::mooseError ( Args &&...  args) const
inlineinherited

Definition at line 144 of file MooseObject.h.

Referenced by PetscExternalPartitioner::_do_partition(), GridPartitioner::_do_partition(), FEProblemBase::addConstraint(), FEProblemBase::addInitialCondition(), FEProblem::addLineSearch(), FEProblemBase::addLineSearch(), FEProblemBase::addOutput(), DiracKernel::addPointWithValidId(), FEProblemBase::addPostprocessor(), addQuadratureNode(), FEProblemBase::addVectorPostprocessor(), Output::advancedExecuteOn(), AnnularMesh::AnnularMesh(), AnnularMeshGenerator::AnnularMeshGenerator(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), DerivativeParsedMaterialHelper::assembleDerivatives(), Function::average(), Axisymmetric2D3DSolutionFunction::Axisymmetric2D3DSolutionFunction(), BicubicSplineFunction::BicubicSplineFunction(), BoundingValueElementDamper::BoundingValueElementDamper(), BoundingValueNodalDamper::BoundingValueNodalDamper(), BoundsAux::BoundsAux(), BreakMeshByBlockGenerator::BreakMeshByBlockGenerator(), BreakMeshByBlockGeneratorBase::BreakMeshByBlockGeneratorBase(), buildCoarseningMap(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), Piecewise::buildFromXY(), TiledMesh::buildMesh(), FileMesh::buildMesh(), SpiralAnnularMesh::buildMesh(), DistributedGeneratedMesh::buildMesh(), GeneratedMesh::buildMesh(), ImageMeshGenerator::buildMesh3D(), ImageMesh::buildMesh3D(), buildMeshBaseObject(), buildRefinementMap(), buildSideList(), CartesianMeshGenerator::CartesianMeshGenerator(), ChangeOverTimePostprocessor::ChangeOverTimePostprocessor(), EigenExecutionerBase::chebyshev(), SubProblem::checkBlockMatProps(), SubProblem::checkBoundaryMatProps(), FEProblemBase::checkCoordinateSystems(), FEProblemBase::checkDependMaterialsHelper(), FEProblemBase::checkDisplacementOrders(), Material::checkExecutionStage(), BreakMeshByBlockBase::checkInputParameter(), Steady::checkIntegrity(), EigenExecutionerBase::checkIntegrity(), ActuallyExplicitEuler::checkLinearConvergence(), FEProblemBase::checkProblemIntegrity(), Material::checkStatefulSanity(), FEProblemBase::checkUserObjects(), LibmeshPartitioner::clone(), clone(), ComparisonPostprocessor::comparisonIsTrue(), CompositeFunction::CompositeFunction(), ElementLpNormAux::compute(), ElementH1ErrorFunctionAux::compute(), NodalPatchRecovery::compute(), KernelBase::computeADOffDiagJacobian(), InterfaceKernel::computeElemNeighJacobian(), TimeSequenceStepperBase::computeFailedDT(), IterationAdaptiveDT::computeFailedDT(), TimeStepper::computeFailedDT(), HistogramVectorPostprocessor::computeHistogram(), EqualValueEmbeddedConstraint::computeQpJacobian(), EqualValueEmbeddedConstraint::computeQpOffDiagJacobian(), KernelValue::computeQpResidual(), FEProblemBase::computeResidualInternal(), FEProblemBase::computeResidualTag(), FEProblemBase::computeResidualType(), StatisticsVectorPostprocessor::computeStatValue(), Material::computeSubdomainProperties(), ExplicitEuler::computeTimeDerivatives(), ImplicitEuler::computeTimeDerivatives(), BDF2::computeTimeDerivatives(), NewmarkBeta::computeTimeDerivatives(), CrankNicolson::computeTimeDerivatives(), ActuallyExplicitEuler::computeTimeDerivatives(), LStableDirk2::computeTimeDerivatives(), LStableDirk3::computeTimeDerivatives(), ImplicitMidpoint::computeTimeDerivatives(), ExplicitTVDRK2::computeTimeDerivatives(), AStableDirk4::computeTimeDerivatives(), LStableDirk4::computeTimeDerivatives(), ExplicitRK2::computeTimeDerivatives(), PenetrationAux::computeValue(), ConcentricCircleMesh::ConcentricCircleMesh(), ConcentricCircleMeshGenerator::ConcentricCircleMeshGenerator(), TimeStepper::constrainStep(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), CoupledForce::CoupledForce(), DebugResidualAux::DebugResidualAux(), BicubicSplineFunction::derivative(), DerivativeSumMaterial::DerivativeSumMaterial(), DGKernel::DGKernel(), FEProblemBase::duplicateVariableCheck(), EigenProblem::EigenProblem(), Eigenvalues::Eigenvalues(), ElementalVariableValue::ElementalVariableValue(), ElementQualityAux::ElementQualityAux(), errorIfDistributedMesh(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), MultiAppPostprocessorTransfer::execute(), DiscreteElementUserObject::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), ElementQualityChecker::execute(), NodalValueSampler::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), FindValueOnLine::execute(), MultiAppNearestNodeTransfer::execute(), TimeExtremeValue::execute(), VectorPostprocessorComparison::execute(), LeastSquaresFit::execute(), LeastSquaresFitHistory::execute(), FEProblemBase::executeControls(), MultiAppVectorPostprocessorTransfer::executeFromMultiapp(), MultiAppVectorPostprocessorTransfer::executeToMultiapp(), Exodus::Exodus(), FileOutput::FileOutput(), CentroidMultiApp::fillPositions(), MultiApp::fillPositions(), VerifyNodalUniqueID::finalize(), VerifyElementUniqueID::finalize(), DiscreteElementUserObject::finalize(), ElementQualityChecker::finalize(), MemoryUsage::finalize(), PointSamplerBase::finalize(), Transfer::find_sys(), BreakMeshByBlockBase::findFreeBoundaryId(), BreakMeshByBlockGeneratorBase::findFreeBoundaryId(), FunctionDT::FunctionDT(), FunctionMaterialBase::FunctionMaterialBase(), ParsedMaterialHelper::functionParse(), FunctionScalarAux::FunctionScalarAux(), FunctionScalarIC::FunctionScalarIC(), GapValueAux::GapValueAux(), ElementSubdomainIDGenerator::generate(), ExtraNodesetGenerator::generate(), RenameBlockGenerator::generate(), RenameBoundaryGenerator::generate(), GeneratedMeshGenerator::generate(), MeshExtruderGenerator::generate(), SideSetsFromBoundingBoxGenerator::generate(), StackGenerator::generate(), SpiralAnnularMeshGenerator::generate(), PatternedMeshGenerator::generate(), BoundingBoxNodeSetGenerator::generate(), GeneratedMesh::GeneratedMesh(), GeneratedMeshGenerator::GeneratedMeshGenerator(), RandomICBase::generateRandom(), GenericConstantMaterial::GenericConstantMaterial(), GenericFunctionMaterial::GenericFunctionMaterial(), getBoundaryID(), MultiApp::getBoundingBox(), getCoarseningMap(), Control::getControllableParameterByName(), FEProblemBase::getCoordSystem(), PiecewiseConstant::getDirection(), FEProblemBase::getDistribution(), ElementGenerator::getElemType(), MultiApp::getExecutioner(), FEProblemBase::getFunction(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), SubProblem::getMatrixTagID(), AnnularMesh::getMaxInDimension(), DistributedGeneratedMesh::getMaxInDimension(), GeneratedMesh::getMaxInDimension(), FEProblemBase::getMaxQps(), FEProblemBase::getMaxShapeFunctions(), AnnularMesh::getMinInDimension(), DistributedGeneratedMesh::getMinInDimension(), GeneratedMesh::getMinInDimension(), getMortarInterface(), getMortarInterfaceByName(), getNodeBlockIds(), getNodeList(), FEProblemBase::getNonlinearSystem(), getPairedBoundaryMapping(), ImageMeshGenerator::GetPixelInfo(), ImageMesh::GetPixelInfo(), MaterialStdVectorAux::getRealValue(), getRefinementMap(), FEProblemBase::getSampler(), DisplacedProblem::getScalarVariable(), FEProblemBase::getScalarVariable(), DisplacedProblem::getStandardVariable(), FEProblemBase::getStandardVariable(), getSubdomainBoundaryIds(), getSubdomainID(), DisplacedProblem::getSystem(), FEProblemBase::getSystem(), FEProblemBase::getUserObject(), FEProblemBase::getUserObjectBase(), PerformanceData::getValue(), Residual::getValue(), PerfGraphData::getValue(), LineValueSampler::getValue(), FindValueOnLine::getValueAtPoint(), SubProblem::getVariableHelper(), SubProblem::getVectorTagID(), DisplacedProblem::getVectorVariable(), FEProblemBase::getVectorVariable(), MultiApp::globalAppToLocal(), MooseParsedVectorFunction::gradient(), AdvancedOutput::hasOutputHelper(), CrankNicolson::init(), CSVTimeSequenceStepper::init(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), Transient::init(), init(), FEProblemBase::init(), NumPicardIterations::initialize(), FullSolveMultiApp::initialSetup(), PiecewiseBase::initialSetup(), SolutionAux::initialSetup(), Axisymmetric2D3DSolutionFunction::initialSetup(), SolutionFunction::initialSetup(), Exodus::initialSetup(), SolutionUserObject::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initShowHideLists(), Material::initStatefulProperties(), Function::integral(), InterfaceKernel::InterfaceKernel(), InterfaceTimeKernel::InterfaceTimeKernel(), EigenExecutionerBase::inversePowerIteration(), InversePowerMethod::InversePowerMethod(), IterationAdaptiveDT::IterationAdaptiveDT(), LayeredSideIntegral::LayeredSideIntegral(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), LinearCombinationFunction::LinearCombinationFunction(), LinearCombinationPostprocessor::LinearCombinationPostprocessor(), LinearNodalConstraint::LinearNodalConstraint(), LineMaterialSamplerBase< Real >::LineMaterialSamplerBase(), LineSearch::lineSearch(), LineValueSampler::LineValueSampler(), MaterialRealTensorValueAux::MaterialRealTensorValueAux(), MaterialRealVectorValueAux::MaterialRealVectorValueAux(), MaterialStdVectorRealGradientAux::MaterialStdVectorRealGradientAux(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), Distribution::median(), SubProblem::meshChanged(), MeshExtruder::MeshExtruder(), MeshExtruderGenerator::MeshExtruderGenerator(), MeshSideSetGenerator::MeshSideSetGenerator(), SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), MeshExtruder::modify(), BreakMeshByBlockBase::modify(), AddExtraNodeset::modify(), AssignElementSubdomainID::modify(), SmoothMesh::modify(), AddAllSideSetsByNormals::modify(), ElementDeleterBase::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), ImageSubdomain::modify(), OrientedSubdomainBoundingBox::modify(), BoundingBoxNodeSet::modify(), AddSideSetsFromBoundingBox::modify(), SubdomainBoundingBox::modify(), MooseMesh(), MultiAppMeshFunctionTransfer::MultiAppMeshFunctionTransfer(), MultiAppPostprocessorTransfer::MultiAppPostprocessorTransfer(), NearestNodeDistanceAux::NearestNodeDistanceAux(), NearestNodeValueAux::NearestNodeValueAux(), RenameBlockGenerator::newBlockID(), RenameBlock::newBlockID(), RenameBlockGenerator::newBlockName(), RenameBlock::newBlockName(), NewmarkBeta::NewmarkBeta(), NodalConstraint::NodalConstraint(), NodalScalarKernel::NodalScalarKernel(), NodalVariableValue::NodalVariableValue(), NumDOFs::NumDOFs(), NumNonlinearIterations::NumNonlinearIterations(), NumVars::NumVars(), ElementSideNeighborLayers::operator()(), ElementPointNeighbors::operator()(), RelationshipManager::operator==(), XDA::output(), SolutionHistory::output(), Exodus::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), Console::outputVectorPostprocessors(), AdvancedOutput::outputVectorPostprocessors(), MooseObject::paramError(), PiecewiseBilinear::parse(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedGenerateSideset::ParsedGenerateSideset(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshGenerator::ParsedSubdomainMeshGenerator(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PetscExternalPartitioner::PetscExternalPartitioner(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), Piecewise::Piecewise(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), PiecewiseMulticonstant::PiecewiseMulticonstant(), PiecewiseMultiInterpolation::PiecewiseMultiInterpolation(), SolutionUserObject::pointValueGradientWrapper(), SolutionUserObject::pointValueWrapper(), LStableDirk2::postResidual(), LStableDirk3::postResidual(), ImplicitMidpoint::postResidual(), ExplicitTVDRK2::postResidual(), AStableDirk4::postResidual(), LStableDirk4::postResidual(), ExplicitRK2::postResidual(), Predictor::Predictor(), Transient::preExecute(), SolutionUserObject::readExodusII(), SolutionUserObject::readXda(), EqualValueEmbeddedConstraint::reinitConstraint(), RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm(), RenameBlock::RenameBlock(), RenameBlockGenerator::RenameBlockGenerator(), RenameBoundaryGenerator::RenameBoundaryGenerator(), RinglebMesh::RinglebMesh(), RinglebMeshGenerator::RinglebMeshGenerator(), ScalarComponentIC::ScalarComponentIC(), BicubicSplineFunction::secondDerivative(), FEProblemBase::setCoordSystem(), PiecewiseBase::setData(), EigenProblem::setEigenproblemType(), Sampler::setNumberOfRequiedRandomSeeds(), Exodus::setOutputDimensionInExodusWriter(), Split::setup(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), SideSetsFromBoundingBoxGenerator::SideSetsFromBoundingBoxGenerator(), SideSetsFromNormals::SideSetsFromNormals(), SideSetsFromNormalsGenerator::SideSetsFromNormalsGenerator(), SideSetsFromPoints::SideSetsFromPoints(), SideSetsFromPointsGenerator::SideSetsFromPointsGenerator(), SolutionTimeAdaptiveDT::SolutionTimeAdaptiveDT(), SolutionUserObject::SolutionUserObject(), PicardSolve::solve(), ActuallyExplicitEuler::solve(), FullSolveMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), SpiralAnnularMesh::SpiralAnnularMesh(), SpiralAnnularMeshGenerator::SpiralAnnularMeshGenerator(), StitchedMesh::StitchedMesh(), NodalUserObject::subdomainSetup(), GeneralUserObject::subdomainSetup(), Constraint::subdomainSetup(), Console::systemInfoFlags(), Terminator::Terminator(), TestSetupPostprocessorDataActionFunction::TestSetupPostprocessorDataActionFunction(), ThreadedGeneralUserObject::ThreadedGeneralUserObject(), ThreadedGeneralUserObject::threadJoin(), DiscreteElementUserObject::threadJoin(), GeneralUserObject::threadJoin(), TiledMeshGenerator::TiledMeshGenerator(), Function::timeDerivative(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), VectorPostprocessorVisualizationAux::timestepSetup(), MultiAppCopyTransfer::transfer(), MultiAppMeshFunctionTransfer::transferVariable(), FEProblemBase::uDotDotOldRequested(), FEProblemBase::uDotOldRequested(), EqualValueBoundaryConstraint::updateConstrainedNodes(), SolutionUserObject::updateExodusBracketingTimeIndices(), Axisymmetric2D3DSolutionFunction::value(), ValueRangeMarker::ValueRangeMarker(), ValueThresholdMarker::ValueThresholdMarker(), MultiAppTransfer::variableIntegrityCheck(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), VectorNodalBC::VectorNodalBC(), VectorOfPostprocessors::VectorOfPostprocessors(), VectorPostprocessorFunction::VectorPostprocessorFunction(), MooseParsedGradFunction::vectorValue(), MooseParsedFunction::vectorValue(), VolumeHistogram::VolumeHistogram(), VTKOutput::VTKOutput(), DOFMapOutput::writeStreamToFile(), and Console::writeStreamToFile().

144  {
145  std::ostringstream oss;
146  moose::internal::mooseStreamAll(oss, std::forward<Args>(args)...);
147  std::string msg = oss.str();
148  callMooseErrorRaw(msg, &_app);
149  }
void mooseStreamAll(std::ostringstream &ss)
All of the following are not meant to be called directly - they are called by the normal macros (moos...
Definition: MooseError.C:87
void callMooseErrorRaw(std::string &msg, MooseApp *app)
Definition: MooseObject.C:57
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:174

◆ mooseInfo()

template<typename... Args>
void MooseObject::mooseInfo ( Args &&...  args) const
inlineinherited

◆ mooseWarning()

template<typename... Args>
void MooseObject::mooseWarning ( Args &&...  args) const
inlineinherited

◆ name()

const std::string& MooseObject::name ( ) const
inlineinherited

Get the name of the object.

Returns
The name of the object

Definition at line 56 of file MooseObject.h.

Referenced by GridPartitioner::_do_partition(), FEProblemBase::addADJacobianMaterial(), FEProblemBase::addADResidualMaterial(), Executioner::addAttributeReporter(), DumpObjectsProblem::addAuxKernel(), FEProblemBase::addAuxKernel(), DumpObjectsProblem::addAuxScalarKernel(), FEProblemBase::addAuxScalarKernel(), DumpObjectsProblem::addBoundaryCondition(), FEProblemBase::addBoundaryCondition(), DumpObjectsProblem::addConstraint(), FEProblemBase::addConstraint(), FEProblemBase::addDamper(), DumpObjectsProblem::addDGKernel(), FEProblemBase::addDGKernel(), DumpObjectsProblem::addDiracKernel(), FEProblemBase::addDiracKernel(), FEProblemBase::addDistribution(), DumpObjectsProblem::addFunction(), FEProblemBase::addFunction(), FEProblemBase::addIndicator(), DumpObjectsProblem::addInitialCondition(), FEProblemBase::addInitialCondition(), DumpObjectsProblem::addInterfaceKernel(), FEProblemBase::addInterfaceKernel(), DumpObjectsProblem::addKernel(), FEProblemBase::addKernel(), FEProblemBase::addMarker(), DumpObjectsProblem::addMaterial(), FEProblemBase::addMaterial(), FEProblemBase::addMaterialHelper(), addMortarInterface(), FEProblemBase::addMultiApp(), DumpObjectsProblem::addNodalKernel(), FEProblemBase::addNodalKernel(), FEProblemBase::addPostprocessor(), FEProblemBase::addPredictor(), FEProblemBase::addSampler(), DumpObjectsProblem::addScalarKernel(), FEProblemBase::addScalarKernel(), FEProblemBase::addTimeIntegrator(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), FEProblemBase::addVectorPostprocessor(), Output::advancedExecuteOn(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), DerivativeParsedMaterialHelper::assembleDerivatives(), AStableDirk4::AStableDirk4(), Function::average(), MultiApp::backup(), BreakMeshByBlockGenerator::BreakMeshByBlockGenerator(), ChangeOverTimePostprocessor::ChangeOverTimePostprocessor(), FEProblemBase::checkDependMaterialsHelper(), Damper::checkMinDamping(), Material::checkStatefulSanity(), CompositeFunction::CompositeFunction(), Material::computeSubdomainProperties(), VectorPostprocessorVisualizationAux::computeValue(), AuxKernel::coupledCallback(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), MultiApp::createApp(), FEProblemBase::declareVectorPostprocessorVector(), DOFMapOutput::demangle(), DerivativeSumMaterial::DerivativeSumMaterial(), DGKernel::DGKernel(), DumpObjectsProblem::dumpObjectHelper(), ElementValueSampler::ElementValueSampler(), errorIfDistributedMesh(), AB2PredictorCorrector::estimateTimeError(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), StatisticsVectorPostprocessor::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppNearestNodeTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppVectorPostprocessorTransfer::execute(), HistogramVectorPostprocessor::execute(), MultiAppCopyTransfer::execute(), Exodus::Exodus(), FileOutput::FileOutput(), MultiApp::fillPositions(), PointSamplerBase::finalize(), DerivativeParsedMaterialHelper::findMatPropDerivative(), FunctionDT::FunctionDT(), GeneralUserObject::GeneralUserObject(), LowerDBlockFromSidesetGenerator::generate(), StitchedMeshGenerator::generate(), Material::getADMaterialProperty(), MultiApp::getBoundingBox(), MooseObject::getCheckedPointerParam(), Control::getControllableParameterByName(), Control::getControllableValue(), Control::getControllableValueByName(), DistributionInterface::getDistribution(), FEProblemBase::getDistribution(), DistributionInterface::getDistributionByName(), MultiApp::getExecutioner(), OutputWarehouse::getFileNumbers(), FEProblemBase::getFunction(), SolutionUserObject::getLocalVarIndex(), Marker::getMarkerValue(), FEProblemBase::getMaterial(), NodalPatchRecovery::getMaterialProperty(), AuxKernel::getMaterialProperty(), Material::getMaterialProperty(), SubProblem::getMaterialPropertyBlockNames(), SubProblem::getMaterialPropertyBoundaryNames(), NodalPatchRecovery::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOld(), Material::getMaterialPropertyOld(), NodalPatchRecovery::getMaterialPropertyOlder(), AuxKernel::getMaterialPropertyOlder(), Material::getMaterialPropertyOlder(), MeshGenerator::getMesh(), getMortarInterfaceByName(), OutputWarehouse::getOutput(), MooseObject::getParam(), GeneralUserObject::getPostprocessorValue(), AuxKernel::getPostprocessorValue(), FEProblemBase::getPostprocessorValue(), GeneralUserObject::getPostprocessorValueByName(), AuxKernel::getPostprocessorValueByName(), FEProblemBase::getPostprocessorValueOld(), FEProblemBase::getPostprocessorValueOlder(), FEProblemBase::getSampler(), AuxKernel::getScatterVectorPostprocessorValue(), FEProblemBase::getScatterVectorPostprocessorValue(), AuxKernel::getScatterVectorPostprocessorValueByName(), FEProblemBase::getScatterVectorPostprocessorValueOld(), Transient::getTimeStepperName(), AuxKernel::getUserObject(), InitialConditionBase::getUserObject(), FEProblemBase::getUserObject(), InitialConditionBase::getUserObjectBase(), AuxKernel::getUserObjectBase(), FEProblemBase::getUserObjectBase(), AuxKernel::getUserObjectByName(), InitialConditionBase::getUserObjectByName(), GeneralUserObject::getVectorPostprocessorValue(), AuxKernel::getVectorPostprocessorValue(), FEProblemBase::getVectorPostprocessorValue(), GeneralUserObject::getVectorPostprocessorValueByName(), AuxKernel::getVectorPostprocessorValueByName(), FEProblemBase::getVectorPostprocessorValueOld(), FEProblemBase::hasFunction(), AdvancedOutput::hasOutputHelper(), FEProblemBase::hasPostprocessor(), FEProblemBase::hasUserObject(), FEProblemBase::hasVectorPostprocessor(), FEProblemBase::init(), AdvancedOutput::initExecutionTypes(), AttribName::initFrom(), CSVReader::initialize(), StatisticsVectorPostprocessor::initialize(), HistogramVectorPostprocessor::initialize(), MultiAppProjectionTransfer::initialSetup(), DerivativeFunctionMaterialBase::initialSetup(), SolutionUserObject::initialSetup(), AdvancedOutput::initOutputList(), FEProblemBase::initPostprocessorData(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), Material::initStatefulProperties(), FEProblemBase::initVectorPostprocessorData(), Function::integral(), InterfaceKernel::InterfaceKernel(), MooseObject::isParamValid(), LinearCombinationFunction::LinearCombinationFunction(), Marker::Marker(), MatDiffusionBase< Real >::MatDiffusionBase(), MaterialDerivativeTestKernelBase< Real >::MaterialDerivativeTestKernelBase(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), Distribution::median(), MemoryUsageReporter::MemoryUsageReporter(), MeshSideSetGenerator::MeshSideSetGenerator(), ElementDeleterBase::modify(), MooseVariableInterface< Real >::MooseVariableInterface(), NearestPointBase< LayeredAverage >::NearestPointBase(), NodalValueSampler::NodalValueSampler(), NodalVariableValue::NodalVariableValue(), DOFMapOutput::output(), Output::Output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), ConsoleUtils::outputOutputInformation(), Nemesis::outputPostprocessors(), Exodus::outputPostprocessors(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), AdvancedOutput::outputVectorPostprocessors(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedGenerateSideset::ParsedGenerateSideset(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshGenerator::ParsedSubdomainMeshGenerator(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PointSamplerBase::PointSamplerBase(), Registry::registerObjectsTo(), FEProblemBase::registerRandomInterface(), Material::resetQpProperties(), MultiApp::restore(), Sampler::Sampler(), ScalarComponentIC::ScalarComponentIC(), setBoundaryName(), Control::setControllableValue(), Control::setControllableValueByName(), OutputWarehouse::setFileNumbers(), setSubdomainName(), Split::setup(), TransientMultiApp::setupApp(), SideSetsFromNormalsGenerator::SideSetsFromNormalsGenerator(), SideSetsFromPointsGenerator::SideSetsFromPointsGenerator(), SideValueSampler::SideValueSampler(), TransientMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), SubProblem::storeBoundaryDelayedCheckMatProp(), SubProblem::storeBoundaryMatPropName(), SubProblem::storeBoundaryZeroMatProp(), SubProblem::storeSubdomainDelayedCheckMatProp(), SubProblem::storeSubdomainMatPropName(), SubProblem::storeSubdomainZeroMatProp(), TaggingInterface::TaggingInterface(), ThreadedGeneralUserObject::ThreadedGeneralUserObject(), Function::timeDerivative(), VectorPostprocessorVisualizationAux::timestepSetup(), TransientMultiApp::TransientMultiApp(), MultiAppTransfer::variableIntegrityCheck(), and AdvancedOutput::wantOutput().

56 { return _name; }
const std::string & _name
The name of this object, reference to value stored in InputParameters.
Definition: MooseObject.h:180

◆ needsPrepareForUse()

void MooseMesh::needsPrepareForUse ( )

If this method is called, we will call libMesh's prepare_for_use method when we call Moose's prepare method.

This should only be set when the mesh structure is changed by MeshModifiers (i.e. Element deletion).

Definition at line 2305 of file MooseMesh.C.

Referenced by LowerDBlockFromSideset::modify(), and ElementDeleterBase::modify().

2306 {
2307  _needs_prepare_for_use = true;
2308 }
bool _needs_prepare_for_use
True if prepare_for_use should be called when Mesh is prepared.
Definition: MooseMesh.h:912

◆ nElem()

dof_id_type MooseMesh::nElem ( ) const
virtual

Definition at line 2230 of file MooseMesh.C.

2231 {
2232  return getMesh().n_elem();
2233 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ nNodes()

dof_id_type MooseMesh::nNodes ( ) const
virtual

Calls n_nodes/elem() on the underlying libMesh mesh object.

Definition at line 2224 of file MooseMesh.C.

2225 {
2226  return getMesh().n_nodes();
2227 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ node() [1/2]

const Node & MooseMesh::node ( const dof_id_type  i) const
virtual

Various accessors (pointers/references) for Node "i".

If the requested node is a remote node on a distributed mesh, only the query accessors are valid to call, and they return NULL.

Definition at line 423 of file MooseMesh.C.

Referenced by addUniqueNode(), GeneratedMesh::buildMesh(), DistributedGeneratedMesh::buildMesh(), buildPeriodicNodeMap(), cacheInfo(), detectOrthogonalDimRanges(), getNodeBlockIds(), isSemiLocal(), and updateActiveSemiLocalNodeRange().

424 {
425  mooseDeprecated("MooseMesh::node() is deprecated, please use MooseMesh::nodeRef() instead");
426  return nodeRef(i);
427 }
virtual const Node & nodeRef(const dof_id_type i) const
Definition: MooseMesh.C:437
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:158

◆ node() [2/2]

Node & MooseMesh::node ( const dof_id_type  i)
virtual

Definition at line 430 of file MooseMesh.C.

431 {
432  mooseDeprecated("MooseMesh::node() is deprecated, please use MooseMesh::nodeRef() instead");
433  return nodeRef(i);
434 }
virtual const Node & nodeRef(const dof_id_type i) const
Definition: MooseMesh.C:437
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:158

◆ nodePtr() [1/2]

const Node * MooseMesh::nodePtr ( const dof_id_type  i) const
virtual

Definition at line 455 of file MooseMesh.C.

Referenced by dataLoad().

456 {
457  if (i > getMesh().max_node_id())
458  return (*_quadra