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

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 ()
 Destructor. More...
 
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...
 
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...
 
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...
 
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...
 
MooseEnum _mesh_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 72 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 955 of file MooseMesh.h.

◆ bnd_node_iterator_imp

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

Definition at line 948 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 956 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 949 of file MooseMesh.h.

◆ PeriodicNodeInfo

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

Helper type for building periodic node maps.

Definition at line 830 of file MooseMesh.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected

Convenience enums.

Enumerator

Definition at line 862 of file MooseMesh.h.

863  {
864  X = 0,
865  Y,
866  Z
867  };

◆ anonymous enum

anonymous enum
protected
Enumerator
MIN 
MAX 

Definition at line 868 of file MooseMesh.h.

869  {
870  MIN = 0,
871  MAX
872  };

Constructor & Destructor Documentation

◆ MooseMesh() [1/2]

MooseMesh::MooseMesh ( const InputParameters parameters)

Typical "Moose-style" constructor and copy constructor.

Definition at line 151 of file MooseMesh.C.

153  Restartable(this, "Mesh"),
154  PerfGraphInterface(this),
155  _mesh_parallel_type(getParam<MooseEnum>("parallel_type")),
156  _use_distributed_mesh(false),
159  _partitioner_name(getParam<MooseEnum>("partitioner")),
163  _is_nemesis(getParam<bool>("nemesis")),
164  _is_prepared(false),
165  _needs_prepare_for_use(false),
168  _patch_size(getParam<unsigned int>("patch_size")),
169  _ghosting_patch_size(isParamValid("ghosting_patch_size")
170  ? getParam<unsigned int>("ghosting_patch_size")
171  : 5 * _patch_size),
172  _max_leaf_size(getParam<unsigned int>("max_leaf_size")),
174  _allow_recovery(true),
175  _construct_node_list_from_side_list(getParam<bool>("construct_node_list_from_side_list")),
176  _prepare_timer(registerTimedSection("prepare", 2)),
177  _update_timer(registerTimedSection("update", 3)),
178  _mesh_changed_timer(registerTimedSection("meshChanged", 3)),
179  _cache_changed_lists_timer(registerTimedSection("cacheChangedLists", 5)),
181  registerTimedSection("updateActiveSemiLocalNodeRange", 5)),
182  _build_node_list_timer(registerTimedSection("buildNodeList", 5)),
183  _build_bnd_elem_list_timer(registerTimedSection("buildBndElemList", 5)),
184  _node_to_elem_map_timer(registerTimedSection("nodeToElemMap", 5)),
186  registerTimedSection("nodeToActiveSemilocalElemMap", 5)),
187  _get_active_local_element_range_timer(registerTimedSection("getActiveLocalElementRange", 5)),
188  _get_active_node_range_timer(registerTimedSection("getActiveNodeRange", 5)),
189  _get_local_node_range_timer(registerTimedSection("getLocalNodeRange", 5)),
190  _get_boundary_node_range_timer(registerTimedSection("getBoundaryNodeRange", 5)),
191  _get_boundary_element_range_timer(registerTimedSection("getBoundaryElementRange", 5)),
192  _cache_info_timer(registerTimedSection("cacheInfo", 3)),
193  _build_periodic_node_map_timer(registerTimedSection("buildPeriodicNodeMap", 5)),
194  _build_periodic_node_sets_timer(registerTimedSection("buildPeriodicNodeSets", 5)),
195  _detect_orthogonal_dim_ranges_timer(registerTimedSection("detectOrthogonalDimRanges", 5)),
196  _detect_paired_sidesets_timer(registerTimedSection("detectPairedSidesets", 5)),
197  _build_refinement_map_timer(registerTimedSection("buildRefinementMap", 5)),
198  _build_coarsening_map_timer(registerTimedSection("buildCoarseningMap", 5)),
199  _find_adaptivity_qp_maps_timer(registerTimedSection("findAdaptivityQpMaps", 5)),
201  registerTimedSection("buildRefinementAndCoarseningMaps", 5)),
202  _change_boundary_id_timer(registerTimedSection("changeBoundaryId", 6)),
203  _init_timer(registerTimedSection("init", 2)),
204  _read_recovered_mesh_timer(registerTimedSection("readRecoveredMesh", 2)),
205  _ghost_ghosted_boundaries_timer(registerTimedSection("GhostGhostedBoundaries", 3)),
206  _add_mortar_interface_timer(registerTimedSection("addMortarInterface", 5))
207 {
208  MooseEnum temp_patch_update_strategy = getParam<MooseEnum>("patch_update_strategy");
209  if (temp_patch_update_strategy == "never")
211  else if (temp_patch_update_strategy == "always")
213  else if (temp_patch_update_strategy == "auto")
215  else if (temp_patch_update_strategy == "iteration")
217  else
218  mooseError("Patch update strategy should be never, always, auto or iteration.");
219 
220  if (isParamValid("ghosting_patch_size") && (_patch_update_strategy != Moose::Iteration))
221  mooseError("Ghosting patch size parameter has to be set in the mesh block "
222  "only when 'iteration' patch update strategy is used.");
223 
224  switch (_mesh_parallel_type)
225  {
226  case 0: // PARALLEL
227  _use_distributed_mesh = true;
228  break;
229  case 1: // SERIAL
232  break;
233  case 2: // DEFAULT
234  // The user did not specify 'parallel_type = XYZ' in the input file,
235  // so we allow the --distributed-mesh command line arg to possibly turn
236  // on DistributedMesh. If the command line arg is not present, we pick ReplicatedMesh.
238  _use_distributed_mesh = true;
239 
240  break;
241  // No default switch needed for MooseEnum
242  }
243 
244  // If the user specifies 'nemesis = true' in the Mesh block, or they are using --use-split,
245  // we must use DistributedMesh.
246  if (_is_nemesis || _app.isUseSplit())
247  _use_distributed_mesh = true;
248 
249  unsigned dim = getParam<MooseEnum>("dim");
250 
252  {
253  _mesh = libmesh_make_unique<DistributedMesh>(_communicator, dim);
254  if (_partitioner_name != "default" && _partitioner_name != "parmetis")
255  {
256  _partitioner_name = "parmetis";
258  }
259  }
260  else
261  _mesh = libmesh_make_unique<ReplicatedMesh>(_communicator, dim);
262 
263  if (!getParam<bool>("allow_renumbering"))
264  _mesh->allow_renumbering(false);
265 }
PerfID _build_refinement_map_timer
Definition: MooseMesh.h:1142
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:920
PerfID _build_coarsening_map_timer
Definition: MooseMesh.h:1143
bool _is_nemesis
True if a Nemesis Mesh was read in.
Definition: MooseMesh.h:881
unsigned int _uniform_refine_level
The level of uniform refinement requested (set to zero if AMR is disabled)
Definition: MooseMesh.h:875
unsigned int _max_leaf_size
Definition: MooseMesh.h:981
PerfID _add_mortar_interface_timer
Definition: MooseMesh.h:1150
PerfID _build_node_list_timer
Definition: MooseMesh.h:1128
bool _is_prepared
True if prepare has been called on the mesh.
Definition: MooseMesh.h:884
bool _custom_partitioner_requested
Definition: MooseMesh.h:859
MooseObject(const InputParameters &parameters)
Definition: MooseObject.C:48
MooseEnum _partitioner_name
The partitioner used on this mesh.
Definition: MooseMesh.h:854
bool _node_to_active_semilocal_elem_map_built
Definition: MooseMesh.h:924
PerfID _get_boundary_node_range_timer
Definition: MooseMesh.h:1135
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
bool _allow_recovery
Whether or not this Mesh is allowed to read a recovery file.
Definition: MooseMesh.h:1117
PerfID _detect_paired_sidesets_timer
Definition: MooseMesh.h:1141
PerfID _cache_changed_lists_timer
Definition: MooseMesh.h:1126
bool getDistributedMeshOnCommandLine() const
Returns true if the user specified –distributed-mesh (or –parallel-mesh, for backwards compatibilit...
Definition: MooseApp.h:316
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:846
PerfID _find_adaptivity_qp_maps_timer
Definition: MooseMesh.h:1144
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:57
PerfID _build_periodic_node_sets_timer
Definition: MooseMesh.h:1139
PerfID _update_timer
Definition: MooseMesh.h:1124
bool _construct_node_list_from_side_list
Whether or not to allow generation of nodesets from sidesets.
Definition: MooseMesh.h:1120
PerfID _init_timer
Definition: MooseMesh.h:1147
bool isUseSplit() const
Whether or not we are running with pre-split (distributed mesh)
Definition: MooseApp.C:870
PerfID _read_recovered_mesh_timer
Definition: MooseMesh.h:1148
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:32
PerfID _mesh_changed_timer
Definition: MooseMesh.h:1125
PerfID _prepare_timer
Timers.
Definition: MooseMesh.h:1123
PerfID _cache_info_timer
Definition: MooseMesh.h:1137
bool _parallel_type_overridden
Definition: MooseMesh.h:848
PerfID _build_periodic_node_map_timer
Definition: MooseMesh.h:1138
PerfID _get_local_node_range_timer
Definition: MooseMesh.h:1134
Restartable(const MooseObject *moose_object, const std::string &system_name)
Class constructor.
Definition: Restartable.C:17
PerfID _change_boundary_id_timer
Definition: MooseMesh.h:1146
Moose::PatchUpdateType _patch_update_strategy
The patch update strategy.
Definition: MooseMesh.h:984
PerfID _build_refinement_and_coarsening_maps_timer
Definition: MooseMesh.h:1145
bool _partitioner_overridden
Definition: MooseMesh.h:855
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:851
PerfID _get_boundary_element_range_timer
Definition: MooseMesh.h:1136
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:171
PerfID _build_bnd_elem_list_timer
Definition: MooseMesh.h:1129
unsigned int _patch_size
The number of nodes to consider in the NearestNode neighborhood.
Definition: MooseMesh.h:975
PerfID _ghost_ghosted_boundaries_timer
Definition: MooseMesh.h:1149
PerfID _update_active_semi_local_node_range_timer
Definition: MooseMesh.h:1127
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:1131
bool _distribution_overridden
Definition: MooseMesh.h:847
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:81
MooseEnum _mesh_parallel_type
Can be set to DISTRIBUTED, REPLICATED, or DEFAULT.
Definition: MooseMesh.h:841
unsigned int _ghosting_patch_size
The number of nearest neighbors to consider for ghosting purposes when iteration patch update strateg...
Definition: MooseMesh.h:978
bool _needs_prepare_for_use
True if prepare_for_use should be called when Mesh is prepared.
Definition: MooseMesh.h:887
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:990
PerfID _detect_orthogonal_dim_ranges_timer
Definition: MooseMesh.h:1140
PerfID _get_active_local_element_range_timer
Definition: MooseMesh.h:1132
PerfID _get_active_node_range_timer
Definition: MooseMesh.h:1133
PerfID _node_to_elem_map_timer
Definition: MooseMesh.h:1130

◆ MooseMesh() [2/2]

MooseMesh::MooseMesh ( const MooseMesh other_mesh)

Definition at line 267 of file MooseMesh.C.

268  : MooseObject(other_mesh._pars),
269  Restartable(this, "Mesh"),
270  PerfGraphInterface(this, "CopiedMesh"),
274  _mesh(other_mesh.getMesh().clone()),
278  _is_nemesis(false),
279  _is_prepared(false),
280  _needs_prepare_for_use(false),
282  _patch_size(other_mesh._patch_size),
284  _max_leaf_size(other_mesh._max_leaf_size),
288  _prepare_timer(registerTimedSection("prepare", 2)),
289  _update_timer(registerTimedSection("update", 2)),
290  _mesh_changed_timer(registerTimedSection("meshChanged", 3)),
291  _cache_changed_lists_timer(registerTimedSection("cacheChangedLists", 5)),
293  registerTimedSection("updateActiveSemiLocalNodeRange", 5)),
294  _build_node_list_timer(registerTimedSection("buildNodeList", 5)),
295  _build_bnd_elem_list_timer(registerTimedSection("buildBndElemList", 5)),
296  _node_to_elem_map_timer(registerTimedSection("nodeToElemMap", 5)),
298  registerTimedSection("nodeToActiveSemilocalElemMap", 5)),
299  _get_active_local_element_range_timer(registerTimedSection("getActiveLocalElementRange", 5)),
300  _get_active_node_range_timer(registerTimedSection("getActiveNodeRange", 5)),
301  _get_local_node_range_timer(registerTimedSection("getLocalNodeRange", 5)),
302  _get_boundary_node_range_timer(registerTimedSection("getBoundaryNodeRange", 5)),
303  _get_boundary_element_range_timer(registerTimedSection("getBoundaryElementRange", 5)),
304  _cache_info_timer(registerTimedSection("cacheInfo", 3)),
305  _build_periodic_node_map_timer(registerTimedSection("buildPeriodicNodeMap", 5)),
306  _build_periodic_node_sets_timer(registerTimedSection("buildPeriodicNodeSets", 5)),
307  _detect_orthogonal_dim_ranges_timer(registerTimedSection("detectOrthogonalDimRanges", 5)),
308  _detect_paired_sidesets_timer(registerTimedSection("detectPairedSidesets", 5)),
309  _build_refinement_map_timer(registerTimedSection("buildRefinementMap", 5)),
310  _build_coarsening_map_timer(registerTimedSection("buildCoarseningMap", 5)),
311  _find_adaptivity_qp_maps_timer(registerTimedSection("findAdaptivityQpMaps", 5)),
313  registerTimedSection("buildRefinementAndCoarseningMaps", 5)),
314  _change_boundary_id_timer(registerTimedSection("changeBoundaryId", 5)),
315  _init_timer(registerTimedSection("init", 2)),
316  _read_recovered_mesh_timer(registerTimedSection("readRecoveredMesh", 2)),
317  _ghost_ghosted_boundaries_timer(registerTimedSection("GhostGhostedBoundaries", 3)),
318  _add_mortar_interface_timer(registerTimedSection("addMortarInterface", 5))
319 {
320  // Note: this calls BoundaryInfo::operator= without changing the
321  // ownership semantics of either Mesh's BoundaryInfo object.
322  getMesh().get_boundary_info() = other_mesh.getMesh().get_boundary_info();
323 
324  const std::set<SubdomainID> & subdomains = other_mesh.meshSubdomains();
325  for (const auto & sbd_id : subdomains)
326  setSubdomainName(sbd_id, other_mesh.getMesh().subdomain_name(sbd_id));
327 
328  // Get references to BoundaryInfo objects to make the code below cleaner...
329  const BoundaryInfo & other_boundary_info = other_mesh.getMesh().get_boundary_info();
330  BoundaryInfo & boundary_info = getMesh().get_boundary_info();
331 
332  // Use the other BoundaryInfo object to build the list of side boundary ids
333  std::vector<BoundaryID> side_boundaries;
334  other_boundary_info.build_side_boundary_ids(side_boundaries);
335 
336  // Assign those boundary ids in our BoundaryInfo object
337  for (const auto & side_bnd_id : side_boundaries)
338  boundary_info.sideset_name(side_bnd_id) = other_boundary_info.get_sideset_name(side_bnd_id);
339 
340  // Do the same thing for node boundary ids
341  std::vector<BoundaryID> node_boundaries;
342  other_boundary_info.build_node_boundary_ids(node_boundaries);
343 
344  for (const auto & node_bnd_id : node_boundaries)
345  boundary_info.nodeset_name(node_bnd_id) = other_boundary_info.get_nodeset_name(node_bnd_id);
346 }
PerfID _build_refinement_map_timer
Definition: MooseMesh.h:1142
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:920
PerfID _build_coarsening_map_timer
Definition: MooseMesh.h:1143
bool _is_nemesis
True if a Nemesis Mesh was read in.
Definition: MooseMesh.h:881
unsigned int _uniform_refine_level
The level of uniform refinement requested (set to zero if AMR is disabled)
Definition: MooseMesh.h:875
unsigned int _max_leaf_size
Definition: MooseMesh.h:981
PerfID _add_mortar_interface_timer
Definition: MooseMesh.h:1150
PerfID _build_node_list_timer
Definition: MooseMesh.h:1128
bool _is_prepared
True if prepare has been called on the mesh.
Definition: MooseMesh.h:884
MooseObject(const InputParameters &parameters)
Definition: MooseObject.C:48
MooseEnum _partitioner_name
The partitioner used on this mesh.
Definition: MooseMesh.h:854
PerfID _get_boundary_node_range_timer
Definition: MooseMesh.h:1135
PerfID _detect_paired_sidesets_timer
Definition: MooseMesh.h:1141
PerfID _cache_changed_lists_timer
Definition: MooseMesh.h:1126
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:846
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
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:1154
PerfID _find_adaptivity_qp_maps_timer
Definition: MooseMesh.h:1144
PerfID _build_periodic_node_sets_timer
Definition: MooseMesh.h:1139
PerfID _update_timer
Definition: MooseMesh.h:1124
bool _construct_node_list_from_side_list
Whether or not to allow generation of nodesets from sidesets.
Definition: MooseMesh.h:1120
PerfID _init_timer
Definition: MooseMesh.h:1147
PerfID _read_recovered_mesh_timer
Definition: MooseMesh.h:1148
PerfID _mesh_changed_timer
Definition: MooseMesh.h:1125
PerfID _prepare_timer
Timers.
Definition: MooseMesh.h:1123
PerfID _cache_info_timer
Definition: MooseMesh.h:1137
unsigned int uniformRefineLevel() const
Returns the level of uniform refinement requested (zero if AMR is disabled).
Definition: MooseMesh.C:2306
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:168
PerfID _build_periodic_node_map_timer
Definition: MooseMesh.h:1138
PerfID _get_local_node_range_timer
Definition: MooseMesh.h:1134
Restartable(const MooseObject *moose_object, const std::string &system_name)
Class constructor.
Definition: Restartable.C:17
PerfID _change_boundary_id_timer
Definition: MooseMesh.h:1146
Moose::PatchUpdateType _patch_update_strategy
The patch update strategy.
Definition: MooseMesh.h:984
PerfID _build_refinement_and_coarsening_maps_timer
Definition: MooseMesh.h:1145
bool _partitioner_overridden
Definition: MooseMesh.h:855
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:851
PerfID _get_boundary_element_range_timer
Definition: MooseMesh.h:1136
PerfID _build_bnd_elem_list_timer
Definition: MooseMesh.h:1129
unsigned int _patch_size
The number of nodes to consider in the NearestNode neighborhood.
Definition: MooseMesh.h:975
PerfID _ghost_ghosted_boundaries_timer
Definition: MooseMesh.h:1149
PerfID _update_active_semi_local_node_range_timer
Definition: MooseMesh.h:1127
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:1131
bool _distribution_overridden
Definition: MooseMesh.h:847
MooseEnum _mesh_parallel_type
Can be set to DISTRIBUTED, REPLICATED, or DEFAULT.
Definition: MooseMesh.h:841
unsigned int _ghosting_patch_size
The number of nearest neighbors to consider for ghosting purposes when iteration patch update strateg...
Definition: MooseMesh.h:978
bool _needs_prepare_for_use
True if prepare_for_use should be called when Mesh is prepared.
Definition: MooseMesh.h:887
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:990
PerfID _detect_orthogonal_dim_ranges_timer
Definition: MooseMesh.h:1140
PerfID _get_active_local_element_range_timer
Definition: MooseMesh.h:1132
PerfID _get_active_node_range_timer
Definition: MooseMesh.h:1133
const std::set< SubdomainID > & meshSubdomains() const
Returns a read-only reference to the set of subdomains currently present in the Mesh.
Definition: MooseMesh.C:2261
PerfID _node_to_elem_map_timer
Definition: MooseMesh.h:1130

◆ ~MooseMesh()

MooseMesh::~MooseMesh ( )
virtual

Destructor.

Definition at line 348 of file MooseMesh.C.

349 {
350  freeBndNodes();
351  freeBndElems();
353 }
void freeBndElems()
Definition: MooseMesh.C:374
void clearQuadratureNodes()
Clear out any existing quadrature nodes.
Definition: MooseMesh.C:1031
void freeBndNodes()
Definition: MooseMesh.C:356

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 2169 of file MooseMesh.C.

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

2170 {
2171  return getMesh().active_local_elements_begin();
2172 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ activeLocalElementsEnd()

const MeshBase::const_element_iterator MooseMesh::activeLocalElementsEnd ( )

Definition at line 2175 of file MooseMesh.C.

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

2176 {
2177  return getMesh().active_local_elements_end();
2178 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ addGhostedBoundary()

void MooseMesh::addGhostedBoundary ( BoundaryID  boundary_id)

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

Definition at line 2318 of file MooseMesh.C.

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

2319 {
2320  _ghosted_boundaries.insert(boundary_id);
2321 }
std::set< unsigned int > _ghosted_boundaries
Definition: MooseMesh.h:971

◆ addMortarInterface()

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

Definition at line 2703 of file MooseMesh.C.

2707 {
2708  TIME_SECTION(_add_mortar_interface_timer);
2709 
2710  SubdomainID domain_id = getSubdomainID(domain_name);
2711  boundary_id_type master_id = getBoundaryID(master);
2712  boundary_id_type slave_id = getBoundaryID(slave);
2713 
2714  std::unique_ptr<MortarInterface> iface = libmesh_make_unique<MortarInterface>();
2715 
2716  iface->_id = domain_id;
2717  iface->_master = master;
2718  iface->_slave = slave;
2719  iface->_name = name;
2720 
2721  for (auto & elem : as_range(_mesh->level_elements_begin(0), _mesh->level_elements_end(0)))
2722  {
2723  if (elem->subdomain_id() == domain_id)
2724  iface->_elems.push_back(elem);
2725  }
2726 
2727  setSubdomainName(iface->_id, name);
2728 
2729  _mortar_interface.push_back(std::move(iface));
2731  _mortar_interface_by_ids[std::pair<BoundaryID, BoundaryID>(master_id, slave_id)] =
2732  _mortar_interface.back().get();
2733 }
std::map< std::pair< BoundaryID, BoundaryID >, MortarInterface * > _mortar_interface_by_ids
Mortar interfaces mapped though master, slave IDs pairs.
Definition: MooseMesh.h:1002
PerfID _add_mortar_interface_timer
Definition: MooseMesh.h:1150
subdomain_id_type SubdomainID
Definition: MooseTypes.h:95
std::vector< std::unique_ptr< MortarInterface > > _mortar_interface
Definition: MooseMesh.h:1000
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:1154
std::map< std::string, MortarInterface * > _mortar_interface_by_name
Mortar interfaces mapped through their names.
Definition: MooseMesh.h:999
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:851
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:51
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
Definition: MooseMesh.C:1043
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.
Definition: MooseMesh.C:1111

◆ 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 1522 of file MooseMesh.C.

Referenced by AddPeriodicBCAction::setPeriodicVars().

1523 {
1525  return;
1526 
1527  _periodic_dim[var_num].resize(dimension());
1528 
1529  _half_range = Point(dimensionWidth(0) / 2.0, dimensionWidth(1) / 2.0, dimensionWidth(2) / 2.0);
1530 
1531  for (unsigned int component = 0; component < dimension(); ++component)
1532  {
1533  const std::pair<BoundaryID, BoundaryID> * boundary_ids = getPairedBoundaryMapping(component);
1534 
1535  if (boundary_ids != nullptr &&
1536  ((boundary_ids->first == primary && boundary_ids->second == secondary) ||
1537  (boundary_ids->first == secondary && boundary_ids->second == primary)))
1538  _periodic_dim[var_num][component] = true;
1539  }
1540 }
RealVectorValue _half_range
A convenience vector used to hold values in each dimension representing half of the range...
Definition: MooseMesh.h:1018
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:2099
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:1585
Real dimensionWidth(unsigned int component) const
Returns the width of the requested dimension.
Definition: MooseMesh.C:1500
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:1013
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:990

◆ 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 961 of file MooseMesh.C.

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

966 {
967  Node * qnode;
968 
969  if (_elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side].find(qp) ==
971  {
972  // Create a new node id starting from the max node id and counting down. This will be the least
973  // likely to collide with an existing node id.
974  // Note that we are using numeric_limits<unsigned>::max even
975  // though max_id is stored as a dof_id_type. I tried this with
976  // numeric_limits<dof_id_type>::max and it broke several tests in
977  // MOOSE. So, this is some kind of a magic number that we will
978  // just continue to use...
979  dof_id_type max_id = std::numeric_limits<unsigned int>::max() - 100;
980  dof_id_type new_id = max_id - _quadrature_nodes.size();
981 
982  if (new_id <= getMesh().max_node_id())
983  mooseError("Quadrature node id collides with existing node id!");
984 
985  qnode = new Node(point, new_id);
986 
987  // Keep track of this new node in two different ways for easy lookup
988  _quadrature_nodes[new_id] = qnode;
989  _elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side][qp] = qnode;
990 
991  if (elem->active())
992  {
993  _node_to_elem_map[new_id].push_back(elem->id());
994  _node_to_active_semilocal_elem_map[new_id].push_back(elem->id());
995  }
996  }
997  else
998  qnode = _elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side][qp];
999 
1000  BndNode * bnode = new BndNode(qnode, bid);
1001  _bnd_nodes.push_back(bnode);
1002  _bnd_node_ids[bid].insert(qnode->id());
1003 
1004  _extra_bnd_nodes.push_back(*bnode);
1005 
1006  // Do this so the range will be regenerated next time it is accessed
1007  _bnd_node_range.reset();
1008 
1009  return qnode;
1010 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:960
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:919
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:951
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:947
std::vector< BndNode > _extra_bnd_nodes
Definition: MooseMesh.h:963
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:962
std::unique_ptr< StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > > _bnd_node_range
Definition: MooseMesh.h:914
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205
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:923

◆ 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 927 of file MooseMesh.C.

928 {
933  if (getMesh().n_nodes() != _node_map.size())
934  {
935  _node_map.clear();
936  _node_map.reserve(getMesh().n_nodes());
937  for (const auto & node : getMesh().node_ptr_range())
938  _node_map.push_back(node);
939  }
940 
941  Node * node = nullptr;
942  for (unsigned int i = 0; i < _node_map.size(); ++i)
943  {
944  if (p.relative_fuzzy_equals(*_node_map[i], tol))
945  {
946  node = _node_map[i];
947  break;
948  }
949  }
950  if (node == nullptr)
951  {
952  node = getMesh().add_node(new Node(p));
953  _node_map.push_back(node);
954  }
955 
956  mooseAssert(node != nullptr, "Node is NULL");
957  return node;
958 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
std::vector< Node * > _node_map
Vector of all the Nodes in the mesh for determining when to add a new point.
Definition: MooseMesh.h:987
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:464

◆ allowRecovery()

void MooseMesh::allowRecovery ( bool  allow)
inline

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

Definition at line 770 of file MooseMesh.h.

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

◆ bndElemsBegin()

MooseMesh::bnd_elem_iterator MooseMesh::bndElemsBegin ( )
virtual

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

Definition at line 912 of file MooseMesh.C.

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

913 {
914  Predicates::NotNull<bnd_elem_iterator_imp> p;
915  return bnd_elem_iterator(_bnd_elems.begin(), _bnd_elems.end(), p);
916 }
std::vector< BndElement * > _bnd_elems
array of boundary elems
Definition: MooseMesh.h:954

◆ bndElemsEnd()

MooseMesh::bnd_elem_iterator MooseMesh::bndElemsEnd ( )
virtual

Definition at line 920 of file MooseMesh.C.

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

921 {
922  Predicates::NotNull<bnd_elem_iterator_imp> p;
923  return bnd_elem_iterator(_bnd_elems.end(), _bnd_elems.end(), p);
924 }
std::vector< BndElement * > _bnd_elems
array of boundary elems
Definition: MooseMesh.h:954

◆ bndNodesBegin()

MooseMesh::bnd_node_iterator MooseMesh::bndNodesBegin ( )
virtual

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

Definition at line 896 of file MooseMesh.C.

Referenced by getBoundaryNodeRange().

897 {
898  Predicates::NotNull<bnd_node_iterator_imp> p;
899  return bnd_node_iterator(_bnd_nodes.begin(), _bnd_nodes.end(), p);
900 }
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:947

◆ bndNodesEnd()

MooseMesh::bnd_node_iterator MooseMesh::bndNodesEnd ( )
virtual

Definition at line 904 of file MooseMesh.C.

Referenced by getBoundaryNodeRange().

905 {
906  Predicates::NotNull<bnd_node_iterator_imp> p;
907  return bnd_node_iterator(_bnd_nodes.end(), _bnd_nodes.end(), p);
908 }
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:947

◆ buildBndElemList()

void MooseMesh::buildBndElemList ( )

Definition at line 709 of file MooseMesh.C.

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

710 {
711  TIME_SECTION(_build_bnd_elem_list_timer);
712 
713  freeBndElems();
714 
715  auto bc_tuples = getMesh().get_boundary_info().build_active_side_list();
716 
717  int n = bc_tuples.size();
718  _bnd_elems.clear();
719  _bnd_elems.reserve(n);
720  for (const auto & t : bc_tuples)
721  {
722  auto elem_id = std::get<0>(t);
723  auto side_id = std::get<1>(t);
724  auto bc_id = std::get<2>(t);
725 
726  _bnd_elems.push_back(new BndElement(getMesh().elem_ptr(elem_id), side_id, bc_id));
727  _bnd_elem_ids[bc_id].insert(elem_id);
728  }
729 }
void freeBndElems()
Definition: MooseMesh.C:374
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:958
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
std::vector< BndElement * > _bnd_elems
array of boundary elems
Definition: MooseMesh.h:954
PetscInt n
PerfID _build_bnd_elem_list_timer
Definition: MooseMesh.h:1129

◆ 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 1741 of file MooseMesh.C.

Referenced by buildRefinementAndCoarseningMaps().

1742 {
1743  TIME_SECTION(_build_coarsening_map_timer);
1744 
1745  std::pair<int, ElemType> the_pair(input_side, elem.type());
1746 
1747  if (_elem_type_to_coarsening_map.find(the_pair) != _elem_type_to_coarsening_map.end())
1748  mooseError("Already built a qp coarsening map!");
1749 
1750  std::vector<std::vector<QpMap>> refinement_map;
1751  std::vector<std::pair<unsigned int, QpMap>> & coarsen_map =
1752  _elem_type_to_coarsening_map[the_pair];
1753 
1754  // The -1 here is for a specific child. We don't do that for coarsening maps
1755  // Also note that we're always mapping the same side to the same side (which is guaranteed by
1756  // libMesh).
1758  &elem, qrule, qrule_face, refinement_map, coarsen_map, input_side, -1, input_side);
1759 
1766 }
PerfID _build_coarsening_map_timer
Definition: MooseMesh.h:1143
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
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:1111
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:1811
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205

◆ 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().

◆ 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 675 of file MooseMesh.C.

Referenced by update().

676 {
677  TIME_SECTION(_build_node_list_timer);
678 
679  freeBndNodes();
680 
681  auto bc_tuples = getMesh().get_boundary_info().build_node_list();
682 
683  int n = bc_tuples.size();
684  _bnd_nodes.clear();
685  _bnd_nodes.reserve(n);
686  for (const auto & t : bc_tuples)
687  {
688  auto node_id = std::get<0>(t);
689  auto bc_id = std::get<1>(t);
690 
691  _bnd_nodes.push_back(new BndNode(getMesh().node_ptr(node_id), bc_id));
692  _node_set_nodes[bc_id].push_back(node_id);
693  _bnd_node_ids[bc_id].insert(node_id);
694  }
695 
696  _bnd_nodes.reserve(_bnd_nodes.size() + _extra_bnd_nodes.size());
697  for (unsigned int i = 0; i < _extra_bnd_nodes.size(); i++)
698  {
699  BndNode * bnode = new BndNode(_extra_bnd_nodes[i]._node, _extra_bnd_nodes[i]._bnd_id);
700  _bnd_nodes.push_back(bnode);
701  _bnd_node_ids[std::get<1>(bc_tuples[i])].insert(_extra_bnd_nodes[i]._node->id());
702  }
703 
704  // This sort is here so that boundary conditions are always applied in the same order
705  std::sort(_bnd_nodes.begin(), _bnd_nodes.end(), BndNodeCompare());
706 }
Helper class for sorting Boundary Nodes so that we always get the same order of application for bound...
Definition: MooseMesh.C:651
PerfID _build_node_list_timer
Definition: MooseMesh.h:1128
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:951
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:969
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:947
std::vector< BndNode > _extra_bnd_nodes
Definition: MooseMesh.h:963
PetscInt n
void freeBndNodes()
Definition: MooseMesh.C:356

◆ buildNodeListFromSideList()

void MooseMesh::buildNodeListFromSideList ( )

Calls BoundaryInfo::build_node_list_from_side_list().

Definition at line 2119 of file MooseMesh.C.

Referenced by prepare(), and update().

2120 {
2122  getMesh().get_boundary_info().build_node_list_from_side_list();
2123 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
bool _construct_node_list_from_side_list
Whether or not to allow generation of nodesets from sidesets.
Definition: MooseMesh.h:1120

◆ 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 1207 of file MooseMesh.C.

1210 {
1211  TIME_SECTION(_build_periodic_node_map_timer);
1212 
1213  // clear existing map
1214  periodic_node_map.clear();
1215 
1216  // get periodic nodes
1217  std::vector<PeriodicNodeInfo> periodic_nodes;
1218  for (const auto & t : getMesh().get_boundary_info().build_node_list())
1219  {
1220  // unfortunately libMesh does not give us a pointer, so we have to look it up ourselves
1221  auto node = _mesh->node_ptr(std::get<0>(t));
1222  mooseAssert(node != nullptr,
1223  "libMesh::BoundaryInfo::build_node_list() returned an ID for a non-existing node");
1224  auto bc_id = std::get<1>(t);
1225  periodic_nodes.emplace_back(node, bc_id);
1226  }
1227 
1228  // sort by boundary id
1229  std::sort(periodic_nodes.begin(),
1230  periodic_nodes.end(),
1231  [](const PeriodicNodeInfo & a, const PeriodicNodeInfo & b) -> bool {
1232  return a.second > b.second;
1233  });
1234 
1235  // build kd-tree
1236  using KDTreeType = nanoflann::KDTreeSingleIndexAdaptor<
1237  nanoflann::L2_Simple_Adaptor<Real, PointListAdaptor<PeriodicNodeInfo>>,
1239  LIBMESH_DIM>;
1240  const unsigned int max_leaf_size = 20; // slightly affects runtime
1241  auto point_list =
1242  PointListAdaptor<PeriodicNodeInfo>(periodic_nodes.begin(), periodic_nodes.end());
1243  auto kd_tree = libmesh_make_unique<KDTreeType>(
1244  LIBMESH_DIM, point_list, nanoflann::KDTreeSingleIndexAdaptorParams(max_leaf_size));
1245  mooseAssert(kd_tree != nullptr, "KDTree was not properly initialized.");
1246  kd_tree->buildIndex();
1247 
1248  // data structures for kd-tree search
1249  nanoflann::SearchParams search_params;
1250  std::vector<std::pair<std::size_t, Real>> ret_matches;
1251 
1252  // iterate over periodic nodes (boundary ids are in contiguous blocks)
1253  PeriodicBoundaryBase * periodic = nullptr;
1254  BoundaryID current_bc_id = BoundaryInfo::invalid_id;
1255  for (auto & pair : periodic_nodes)
1256  {
1257  // entering a new block of boundary IDs
1258  if (pair.second != current_bc_id)
1259  {
1260  current_bc_id = pair.second;
1261  periodic = pbs->boundary(current_bc_id);
1262  if (periodic && !periodic->is_my_variable(var_number))
1263  periodic = nullptr;
1264  }
1265 
1266  // variable is not periodic at this node, skip
1267  if (!periodic)
1268  continue;
1269 
1270  // clear result buffer
1271  ret_matches.clear();
1272 
1273  // id of the current node
1274  const auto id = pair.first->id();
1275 
1276  // position where we expect a periodic partner for the current node and boundary
1277  Point search_point = periodic->get_corresponding_pos(*pair.first);
1278 
1279  // search at the expected point
1280  kd_tree->radiusSearch(&(search_point)(0), libMesh::TOLERANCE, ret_matches, search_params);
1281  for (auto & match_pair : ret_matches)
1282  {
1283  const auto & match = periodic_nodes[match_pair.first];
1284  // add matched node if the boundary id is the corresponding id in the periodic pair
1285  if (match.second == periodic->pairedboundary)
1286  periodic_node_map.emplace(id, match.first->id());
1287  }
1288  }
1289 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
std::pair< const Node *, BoundaryID > PeriodicNodeInfo
Helper type for building periodic node maps.
Definition: MooseMesh.h:830
PerfID _build_periodic_node_map_timer
Definition: MooseMesh.h:1138
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:851
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:464
boundary_id_type BoundaryID
Definition: MooseTypes.h:93

◆ 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 1292 of file MooseMesh.C.

1295 {
1296  TIME_SECTION(_build_periodic_node_sets_timer);
1297 
1298  periodic_node_sets.clear();
1299 
1300  // Loop over all the boundary nodes adding the periodic nodes to the appropriate set
1301  for (const auto & t : getMesh().get_boundary_info().build_node_list())
1302  {
1303  auto node_id = std::get<0>(t);
1304  auto bc_id = std::get<1>(t);
1305 
1306  // Is this current node on a known periodic boundary?
1307  if (periodic_node_sets.find(bc_id) != periodic_node_sets.end())
1308  periodic_node_sets[bc_id].insert(node_id);
1309  else // This still might be a periodic node but we just haven't seen this boundary_id yet
1310  {
1311  const PeriodicBoundaryBase * periodic = pbs->boundary(bc_id);
1312  if (periodic && periodic->is_my_variable(var_number))
1313  periodic_node_sets[bc_id].insert(node_id);
1314  }
1315  }
1316 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
PerfID _build_periodic_node_sets_timer
Definition: MooseMesh.h:1139

◆ 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 1603 of file MooseMesh.C.

Referenced by FEProblemBase::initialSetup().

1604 {
1606 
1607  std::map<ElemType, Elem *> canonical_elems;
1608 
1609  // First, loop over all elements and find a canonical element for each type
1610  // Doing it this way guarantees that this is going to work in parallel
1611  for (const auto & elem : getMesh().element_ptr_range()) // TODO: Thread this
1612  {
1613  ElemType type = elem->type();
1614 
1615  if (canonical_elems.find(type) ==
1616  canonical_elems.end()) // If we haven't seen this type of elem before save it
1617  canonical_elems[type] = elem;
1618  else
1619  {
1620  Elem * stored = canonical_elems[type];
1621  if (elem->id() < stored->id()) // Arbitrarily keep the one with a lower id
1622  canonical_elems[type] = elem;
1623  }
1624  }
1625  // Now build the maps using these templates
1626  // Note: This MUST be done NOT threaded!
1627  for (const auto & can_it : canonical_elems)
1628  {
1629  Elem * elem = can_it.second;
1630 
1631  // Need to do this just once to get the right qrules put in place
1632  assembly->setCurrentSubdomainID(elem->subdomain_id());
1633  assembly->reinit(elem);
1634  assembly->reinit(elem, 0);
1635  QBase * qrule = assembly->qRule();
1636  QBase * qrule_face = assembly->qRuleFace();
1637 
1638  // Volume to volume projection for refinement
1639  buildRefinementMap(*elem, *qrule, *qrule_face, -1, -1, -1);
1640 
1641  // Volume to volume projection for coarsening
1642  buildCoarseningMap(*elem, *qrule, *qrule_face, -1);
1643 
1644  // Map the sides of children
1645  for (unsigned int side = 0; side < elem->n_sides(); side++)
1646  {
1647  // Side to side for sides that match parent's sides
1648  buildRefinementMap(*elem, *qrule, *qrule_face, side, -1, side);
1649  buildCoarseningMap(*elem, *qrule, *qrule_face, side);
1650  }
1651 
1652  // Child side to parent volume mapping for "internal" child sides
1653  for (unsigned int child = 0; child < elem->n_children(); ++child)
1654  for (unsigned int side = 0; side < elem->n_sides();
1655  ++side) // Assume children have the same number of sides!
1656  if (!elem->is_child_on_side(child, side)) // Otherwise we already computed that map
1657  buildRefinementMap(*elem, *qrule, *qrule_face, -1, child, side);
1658  }
1659 }
QBase *& qRuleFace()
Returns the reference to the current quadrature being used on a current face.
Definition: Assembly.h:246
QBase *& qRule()
Returns the reference to the current quadrature being used.
Definition: Assembly.h:210
void reinit(const Elem *elem)
Reinitialize objects (JxW, q_points, ...) for an elements.
Definition: Assembly.C:709
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:45
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
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:1741
void setCurrentSubdomainID(SubdomainID i)
set the current subdomain ID
Definition: Assembly.h:280
PerfID _build_refinement_and_coarsening_maps_timer
Definition: MooseMesh.h:1145
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:1662
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205

◆ 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 1662 of file MooseMesh.C.

Referenced by buildRefinementAndCoarseningMaps().

1668 {
1669  TIME_SECTION(_build_refinement_map_timer);
1670 
1671  if (child == -1) // Doing volume mapping or parent side mapping
1672  {
1673  mooseAssert(parent_side == child_side,
1674  "Parent side must match child_side if not passing a specific child!");
1675 
1676  std::pair<int, ElemType> the_pair(parent_side, elem.type());
1677 
1678  if (_elem_type_to_refinement_map.find(the_pair) != _elem_type_to_refinement_map.end())
1679  mooseError("Already built a qp refinement map!");
1680 
1681  std::vector<std::pair<unsigned int, QpMap>> coarsen_map;
1682  std::vector<std::vector<QpMap>> & refinement_map = _elem_type_to_refinement_map[the_pair];
1684  &elem, qrule, qrule_face, refinement_map, coarsen_map, parent_side, child, child_side);
1685  }
1686  else // Need to map a child side to parent volume qps
1687  {
1688  std::pair<int, int> child_pair(child, child_side);
1689 
1690  if (_elem_type_to_child_side_refinement_map.find(elem.type()) !=
1692  _elem_type_to_child_side_refinement_map[elem.type()].find(child_pair) !=
1694  mooseError("Already built a qp refinement map!");
1695 
1696  std::vector<std::pair<unsigned int, QpMap>> coarsen_map;
1697  std::vector<std::vector<QpMap>> & refinement_map =
1698  _elem_type_to_child_side_refinement_map[elem.type()][child_pair];
1700  &elem, qrule, qrule_face, refinement_map, coarsen_map, parent_side, child, child_side);
1701  }
1702 }
PerfID _build_refinement_map_timer
Definition: MooseMesh.h:1142
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
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:1107
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:1811
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205
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:1103

◆ 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 2126 of file MooseMesh.C.

Referenced by PenetrationLocator::detectPenetration().

2129 {
2130 #ifdef LIBMESH_ENABLE_DEPRECATED
2131  mooseDeprecated("The version of MooseMesh::buildSideList() taking three arguments is "
2132  "deprecated, call the version that returns a vector of tuples instead.");
2133  getMesh().get_boundary_info().build_side_list(el, sl, il);
2134 #else
2135  libmesh_ignore(el);
2136  libmesh_ignore(sl);
2137  libmesh_ignore(il);
2138  mooseError("The version of MooseMesh::buildSideList() taking three "
2139  "arguments is not available in your version of libmesh, call the "
2140  "version that returns a vector of tuples instead.");
2141 #endif
2142 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:155

◆ 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 2145 of file MooseMesh.C.

2146 {
2147  return getMesh().get_boundary_info().build_side_list();
2148 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ cacheChangedLists()

void MooseMesh::cacheChangedLists ( )

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

Definition at line 563 of file MooseMesh.C.

Referenced by FEProblemBase::meshChangedHelper().

564 {
565  TIME_SECTION(_cache_changed_lists_timer);
566 
567  ConstElemRange elem_range(getMesh().local_elements_begin(), getMesh().local_elements_end(), 1);
568  CacheChangedListsThread cclt(*this);
569  Threads::parallel_reduce(elem_range, cclt);
570 
572 
573  _refined_elements = libmesh_make_unique<ConstElemPointerRange>(cclt._refined_elements.begin(),
574  cclt._refined_elements.end());
575  _coarsened_elements = libmesh_make_unique<ConstElemPointerRange>(cclt._coarsened_elements.begin(),
576  cclt._coarsened_elements.end());
577  _coarsened_element_children = cclt._coarsened_element_children;
578 }
std::unique_ptr< ConstElemPointerRange > _refined_elements
The elements that were just refined.
Definition: MooseMesh.h:890
PerfID _cache_changed_lists_timer
Definition: MooseMesh.h:1126
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
std::unique_ptr< ConstElemPointerRange > _coarsened_elements
The elements that were just coarsened.
Definition: MooseMesh.h:893
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:900

◆ cacheInfo()

void MooseMesh::cacheInfo ( )
protected

Definition at line 856 of file MooseMesh.C.

Referenced by update().

857 {
858  TIME_SECTION(_cache_info_timer);
859 
860  // TODO: Thread this!
861  for (const auto & elem : getMesh().element_ptr_range())
862  {
863  SubdomainID subdomain_id = elem->subdomain_id();
864 
865  for (unsigned int side = 0; side < elem->n_sides(); side++)
866  {
867  std::vector<BoundaryID> boundaryids = getBoundaryIDs(elem, side);
868 
869  std::set<BoundaryID> & subdomain_set = _subdomain_boundary_ids[subdomain_id];
870 
871  subdomain_set.insert(boundaryids.begin(), boundaryids.end());
872  }
873 
874  for (unsigned int nd = 0; nd < elem->n_nodes(); ++nd)
875  {
876  Node & node = *elem->node_ptr(nd);
877  _block_node_list[node.id()].insert(elem->subdomain_id());
878  }
879  }
880 }
const std::set< BoundaryID > & getBoundaryIDs() const
Returns a const reference to a set of all user-specified boundary IDs.
Definition: MooseMesh.C:2113
subdomain_id_type SubdomainID
Definition: MooseTypes.h:95
std::map< dof_id_type, std::set< SubdomainID > > _block_node_list
list of nodes that belongs to a specified block (domain)
Definition: MooseMesh.h:966
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
PerfID _cache_info_timer
Definition: MooseMesh.h:1137
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:1114
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:464
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205

◆ 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 1949 of file MooseMesh.C.

Referenced by MeshExtruder::changeID().

1952 {
1953  TIME_SECTION(_change_boundary_id_timer);
1954 
1955  // Get a reference to our BoundaryInfo object, we will use it several times below...
1956  BoundaryInfo & boundary_info = getMesh().get_boundary_info();
1957 
1958  // Container to catch ids passed back from BoundaryInfo
1959  std::vector<boundary_id_type> old_ids;
1960 
1961  // Only level-0 elements store BCs. Loop over them.
1962  for (auto & elem : as_range(getMesh().level_elements_begin(0), getMesh().level_elements_end(0)))
1963  {
1964  unsigned int n_sides = elem->n_sides();
1965  for (unsigned int s = 0; s != n_sides; ++s)
1966  {
1967  boundary_info.boundary_ids(elem, s, old_ids);
1968  if (std::find(old_ids.begin(), old_ids.end(), old_id) != old_ids.end())
1969  {
1970  std::vector<boundary_id_type> new_ids(old_ids);
1971  std::replace(new_ids.begin(), new_ids.end(), old_id, new_id);
1972  if (delete_prev)
1973  {
1974  boundary_info.remove_side(elem, s);
1975  boundary_info.add_side(elem, s, new_ids);
1976  }
1977  else
1978  boundary_info.add_side(elem, s, new_ids);
1979  }
1980  }
1981  }
1982 
1983  // Remove any remaining references to the old ID from the
1984  // BoundaryInfo object. This prevents things like empty sidesets
1985  // from showing up when printing information, etc.
1986  if (delete_prev)
1987  boundary_info.remove_id(old_id);
1988 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
PerfID _change_boundary_id_timer
Definition: MooseMesh.h:1146
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205

◆ clearQuadratureNodes()

void MooseMesh::clearQuadratureNodes ( )

Clear out any existing quadrature nodes.

Most likely called before re-adding them.

Definition at line 1031 of file MooseMesh.C.

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

1032 {
1033  // Delete all the quadrature nodes
1034  for (auto & it : _quadrature_nodes)
1035  delete it.second;
1036 
1037  _quadrature_nodes.clear();
1039  _extra_bnd_nodes.clear();
1040 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:960
std::vector< BndNode > _extra_bnd_nodes
Definition: MooseMesh.h:963
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:962

◆ clone()

MooseMesh & MooseMesh::clone ( ) const
virtual

Clone method.

Allocates memory you are responsible to clean up.

Definition at line 2001 of file MooseMesh.C.

Referenced by TiledMesh::buildMesh().

2002 {
2003  mooseError("MooseMesh::clone() is no longer supported, use MooseMesh::safeClone() instead.");
2004 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:140

◆ 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 593 of file MooseMesh.C.

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

594 {
595  auto elem_to_child_pair = _coarsened_element_children.find(elem);
596  mooseAssert(elem_to_child_pair != _coarsened_element_children.end(), "Missing element in map");
597  return elem_to_child_pair->second;
598 }
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205
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:900

◆ 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 587 of file MooseMesh.C.

Referenced by FEProblemBase::meshChangedHelper().

588 {
589  return _coarsened_elements.get();
590 }
std::unique_ptr< ConstElemPointerRange > _coarsened_elements
The elements that were just coarsened.
Definition: MooseMesh.h:893

◆ 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 1319 of file MooseMesh.C.

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

1320 {
1322 
1324  return true;
1325 
1326  std::vector<Real> min(3, std::numeric_limits<Real>::max());
1327  std::vector<Real> max(3, std::numeric_limits<Real>::min());
1328  unsigned int dim = getMesh().mesh_dimension();
1329 
1330  // Find the bounding box of our mesh
1331  for (const auto & node : getMesh().node_ptr_range())
1332  for (unsigned int i = 0; i < dim; ++i)
1333  {
1334  if ((*node)(i) < min[i])
1335  min[i] = (*node)(i);
1336  if ((*node)(i) > max[i])
1337  max[i] = (*node)(i);
1338  }
1339 
1340  this->comm().max(max);
1341  this->comm().min(min);
1342 
1343  _extreme_nodes.resize(8); // 2^LIBMESH_DIM
1344  // Now make sure that there are actual nodes at all of the extremes
1345  std::vector<bool> extreme_matches(8, false);
1346  std::vector<unsigned int> comp_map(3);
1347  for (const auto & node : getMesh().node_ptr_range())
1348  {
1349  // See if the current node is located at one of the extremes
1350  unsigned int coord_match = 0;
1351 
1352  for (unsigned int i = 0; i < dim; ++i)
1353  {
1354  if (std::abs((*node)(i)-min[i]) < tol)
1355  {
1356  comp_map[i] = MIN;
1357  ++coord_match;
1358  }
1359  else if (std::abs((*node)(i)-max[i]) < tol)
1360  {
1361  comp_map[i] = MAX;
1362  ++coord_match;
1363  }
1364  }
1365 
1366  if (coord_match == dim) // Found a coordinate at one of the extremes
1367  {
1368  _extreme_nodes[comp_map[X] * 4 + comp_map[Y] * 2 + comp_map[Z]] = node;
1369  extreme_matches[comp_map[X] * 4 + comp_map[Y] * 2 + comp_map[Z]] = true;
1370  }
1371  }
1372 
1373  // See if we matched all of the extremes for the mesh dimension
1374  this->comm().max(extreme_matches);
1375  if (std::count(extreme_matches.begin(), extreme_matches.end(), true) == (1 << dim))
1376  _regular_orthogonal_mesh = true;
1377 
1378  // Set the bounds
1379  _bounds.resize(LIBMESH_DIM);
1380  for (unsigned int i = 0; i < dim; ++i)
1381  {
1382  _bounds[i].resize(2);
1383  _bounds[i][MIN] = min[i];
1384  _bounds[i][MAX] = max[i];
1385  }
1386  for (unsigned int i = dim; i < LIBMESH_DIM; ++i)
1387  {
1388  _bounds[i].resize(2);
1389  _bounds[i][MIN] = 0;
1390  _bounds[i][MAX] = 0;
1391  }
1392 
1393  return _regular_orthogonal_mesh;
1394 }
std::vector< std::vector< Real > > _bounds
The bounds in each dimension of the mesh for regular orthogonal meshes.
Definition: MooseMesh.h:993
std::vector< Node * > _extreme_nodes
A vector containing the nodes at the corners of a regular orthogonal mesh.
Definition: MooseMesh.h:1021
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
MPI_Comm comm
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:464
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:990
PerfID _detect_orthogonal_dim_ranges_timer
Definition: MooseMesh.h:1140

◆ 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 1397 of file MooseMesh.C.

Referenced by getPairedBoundaryMapping().

1398 {
1399  TIME_SECTION(_detect_paired_sidesets_timer);
1400 
1401  // Loop over level-0 elements (since boundary condition information
1402  // is only directly stored for them) and find sidesets with normals
1403  // that point in the -x, +x, -y, +y, and -z, +z direction. If there
1404  // is a unique sideset id for each direction, then the paired
1405  // sidesets consist of (-x,+x), (-y,+y), (-z,+z). If there are
1406  // multiple sideset ids for a given direction, then we can't pick a
1407  // single pair for that direction. In that case, we'll just return
1408  // as was done in the original algorithm.
1409 
1410  // Points used for direction comparison
1411  const Point minus_x(-1, 0, 0), plus_x(1, 0, 0), minus_y(0, -1, 0), plus_y(0, 1, 0),
1412  minus_z(0, 0, -1), plus_z(0, 0, 1);
1413 
1414  // we need to test all element dimensions from dim down to 1
1415  const unsigned int dim = getMesh().mesh_dimension();
1416 
1417  // boundary id sets for elements of different dimensions
1418  std::vector<std::set<BoundaryID>> minus_x_ids(dim), plus_x_ids(dim), minus_y_ids(dim),
1419  plus_y_ids(dim), minus_z_ids(dim), plus_z_ids(dim);
1420 
1421  std::vector<std::unique_ptr<FEBase>> fe_faces(dim);
1422  std::vector<std::unique_ptr<QGauss>> qfaces(dim);
1423  for (unsigned side_dim = 0; side_dim < dim; ++side_dim)
1424  {
1425  // Face is assumed to be flat, therefore normal is assumed to be
1426  // constant over the face, therefore only compute it at 1 qp.
1427  qfaces[side_dim] = std::unique_ptr<QGauss>(new QGauss(side_dim, CONSTANT));
1428 
1429  // A first-order Lagrange FE for the face.
1430  fe_faces[side_dim] = FEBase::build(side_dim + 1, FEType(FIRST, LAGRANGE));
1431  fe_faces[side_dim]->attach_quadrature_rule(qfaces[side_dim].get());
1432  }
1433 
1434  // We need this to get boundary ids for each boundary face we encounter.
1435  BoundaryInfo & boundary_info = getMesh().get_boundary_info();
1436  std::vector<boundary_id_type> face_ids;
1437 
1438  for (auto & elem : as_range(getMesh().level_elements_begin(0), getMesh().level_elements_end(0)))
1439  {
1440  // dimension of the current element and its normals
1441  unsigned int side_dim = elem->dim() - 1;
1442  const std::vector<Point> & normals = fe_faces[side_dim]->get_normals();
1443 
1444  // loop over element sides
1445  for (unsigned int s = 0; s < elem->n_sides(); s++)
1446  {
1447  // If side is on the boundary
1448  if (elem->neighbor_ptr(s) == nullptr)
1449  {
1450  std::unique_ptr<Elem> side = elem->build_side_ptr(s);
1451 
1452  fe_faces[side_dim]->reinit(elem, s);
1453 
1454  // Get the boundary ID(s) for this side. If there is more
1455  // than 1 boundary id, then we already can't determine a
1456  // unique pairing of sides in this direction, but we'll just
1457  // keep going to keep the logic simple.
1458  boundary_info.boundary_ids(elem, s, face_ids);
1459 
1460  // x-direction faces
1461  if (normals[0].absolute_fuzzy_equals(minus_x))
1462  minus_x_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1463  else if (normals[0].absolute_fuzzy_equals(plus_x))
1464  plus_x_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1465 
1466  // y-direction faces
1467  else if (normals[0].absolute_fuzzy_equals(minus_y))
1468  minus_y_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1469  else if (normals[0].absolute_fuzzy_equals(plus_y))
1470  plus_y_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1471 
1472  // z-direction faces
1473  else if (normals[0].absolute_fuzzy_equals(minus_z))
1474  minus_z_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1475  else if (normals[0].absolute_fuzzy_equals(plus_z))
1476  plus_z_ids[side_dim].insert(face_ids.begin(), face_ids.end());
1477  }
1478  }
1479  }
1480 
1481  for (unsigned side_dim = 0; side_dim < dim; ++side_dim)
1482  {
1483  // If unique pairings were found, fill up the _paired_boundary data
1484  // structure with that information.
1485  if (minus_x_ids[side_dim].size() == 1 && plus_x_ids[side_dim].size() == 1)
1486  _paired_boundary.emplace_back(
1487  std::make_pair(*(minus_x_ids[side_dim].begin()), *(plus_x_ids[side_dim].begin())));
1488 
1489  if (minus_y_ids[side_dim].size() == 1 && plus_y_ids[side_dim].size() == 1)
1490  _paired_boundary.emplace_back(
1491  std::make_pair(*(minus_y_ids[side_dim].begin()), *(plus_y_ids[side_dim].begin())));
1492 
1493  if (minus_z_ids[side_dim].size() == 1 && plus_z_ids[side_dim].size() == 1)
1494  _paired_boundary.emplace_back(
1495  std::make_pair(*(minus_z_ids[side_dim].begin()), *(plus_z_ids[side_dim].begin())));
1496  }
1497 }
PerfID _detect_paired_sidesets_timer
Definition: MooseMesh.h:1141
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205
std::vector< std::pair< BoundaryID, BoundaryID > > _paired_boundary
A vector holding the paired boundaries for a regular orthogonal mesh.
Definition: MooseMesh.h:996

◆ dimension()

unsigned int MooseMesh::dimension ( ) const
virtual

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

Definition at line 2099 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().

2100 {
2101  return getMesh().mesh_dimension();
2102 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ dimensionWidth()

Real MooseMesh::dimensionWidth ( unsigned int  component) const

Returns the width of the requested dimension.

Definition at line 1500 of file MooseMesh.C.

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

1501 {
1502  return getMaxInDimension(component) - getMinInDimension(component);
1503 }
virtual Real getMaxInDimension(unsigned int component) const
Definition: MooseMesh.C:1514
virtual Real getMinInDimension(unsigned int component) const
Returns the min or max of the requested dimension respectively.
Definition: MooseMesh.C:1506

◆ 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 2205 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().

2206 {
2207  mooseDeprecated("MooseMesh::elem() is deprecated, please use MooseMesh::elemPtr() instead");
2208  return elemPtr(i);
2209 }
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:2219
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:155

◆ elem() [2/2]

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

Definition at line 2212 of file MooseMesh.C.

2213 {
2214  mooseDeprecated("MooseMesh::elem() is deprecated, please use MooseMesh::elemPtr() instead");
2215  return elemPtr(i);
2216 }
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:2219
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:155

◆ 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 2225 of file MooseMesh.C.

2226 {
2227  return getMesh().elem_ptr(i);
2228 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ enabled()

virtual bool MooseObject::enabled ( ) const
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 91 of file MooseObject.h.

Referenced by EigenKernel::enabled().

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

◆ 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 2630 of file MooseMesh.C.

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

2631 {
2633  mooseError("Cannot use ",
2634  name,
2635  " with DistributedMesh!\n",
2636  "Consider specifying parallel_type = 'replicated' in your input file\n",
2637  "to prevent it from being run with DistributedMesh.");
2638 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:846
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:51

◆ exReader()

ExodusII_IO * MooseMesh::exReader ( ) const
virtual

Not implemented – always returns NULL.

Reimplemented in FileMesh.

Definition at line 2526 of file MooseMesh.C.

Referenced by FEProblemBase::initialSetup().

2527 {
2528  // TODO: Implement or remove
2529  return nullptr;
2530 }

◆ 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 1811 of file MooseMesh.C.

Referenced by buildCoarseningMap(), and buildRefinementMap().

1819 {
1820  TIME_SECTION(_find_adaptivity_qp_maps_timer);
1821 
1822  ReplicatedMesh mesh(_communicator);
1823  mesh.skip_partitioning(true);
1824 
1825  unsigned int dim = template_elem->dim();
1826  mesh.set_mesh_dimension(dim);
1827 
1828  for (unsigned int i = 0; i < template_elem->n_nodes(); ++i)
1829  mesh.add_point(template_elem->point(i));
1830 
1831  Elem * elem = mesh.add_elem(Elem::build(template_elem->type()).release());
1832 
1833  for (unsigned int i = 0; i < template_elem->n_nodes(); ++i)
1834  elem->set_node(i) = mesh.node_ptr(i);
1835 
1836  std::unique_ptr<FEBase> fe(FEBase::build(dim, FEType()));
1837  fe->get_phi();
1838  const std::vector<Point> & q_points_volume = fe->get_xyz();
1839 
1840  std::unique_ptr<FEBase> fe_face(FEBase::build(dim, FEType()));
1841  fe_face->get_phi();
1842  const std::vector<Point> & q_points_face = fe_face->get_xyz();
1843 
1844  fe->attach_quadrature_rule(&qrule);
1845  fe_face->attach_quadrature_rule(&qrule_face);
1846 
1847  // The current q_points
1848  const std::vector<Point> * q_points;
1849 
1850  if (parent_side != -1)
1851  {
1852  fe_face->reinit(elem, parent_side);
1853  q_points = &q_points_face;
1854  }
1855  else
1856  {
1857  fe->reinit(elem);
1858  q_points = &q_points_volume;
1859  }
1860 
1861  std::vector<Point> parent_ref_points;
1862 
1863  FEInterface::inverse_map(elem->dim(), FEType(), elem, *q_points, parent_ref_points);
1864  MeshRefinement mesh_refinement(mesh);
1865  mesh_refinement.uniformly_refine(1);
1866 
1867  std::map<unsigned int, std::vector<Point>> child_to_ref_points;
1868 
1869  unsigned int n_children = elem->n_children();
1870 
1871  refinement_map.resize(n_children);
1872 
1873  std::vector<unsigned int> children;
1874 
1875  if (child != -1) // Passed in a child explicitly
1876  children.push_back(child);
1877  else
1878  {
1879  children.resize(n_children);
1880  for (unsigned int child = 0; child < n_children; ++child)
1881  children[child] = child;
1882  }
1883 
1884  for (unsigned int i = 0; i < children.size(); ++i)
1885  {
1886  unsigned int child = children[i];
1887 
1888  if ((parent_side != -1 && !elem->is_child_on_side(child, parent_side)))
1889  continue;
1890 
1891  const Elem * child_elem = elem->child_ptr(child);
1892 
1893  if (child_side != -1)
1894  {
1895  fe_face->reinit(child_elem, child_side);
1896  q_points = &q_points_face;
1897  }
1898  else
1899  {
1900  fe->reinit(child_elem);
1901  q_points = &q_points_volume;
1902  }
1903 
1904  std::vector<Point> child_ref_points;
1905 
1906  FEInterface::inverse_map(elem->dim(), FEType(), elem, *q_points, child_ref_points);
1907  child_to_ref_points[child] = child_ref_points;
1908 
1909  std::vector<QpMap> & qp_map = refinement_map[child];
1910 
1911  // Find the closest parent_qp to each child_qp
1912  mapPoints(child_ref_points, parent_ref_points, qp_map);
1913  }
1914 
1915  coarsen_map.resize(parent_ref_points.size());
1916 
1917  // For each parent qp find the closest child qp
1918  for (unsigned int child = 0; child < n_children; child++)
1919  {
1920  if (parent_side != -1 && !elem->is_child_on_side(child, child_side))
1921  continue;
1922 
1923  std::vector<Point> & child_ref_points = child_to_ref_points[child];
1924 
1925  std::vector<QpMap> qp_map;
1926 
1927  // Find all of the closest points from parent_qp to _THIS_ child's qp
1928  mapPoints(parent_ref_points, child_ref_points, qp_map);
1929 
1930  // Check those to see if they are closer than what we currently have for each point
1931  for (unsigned int parent_qp = 0; parent_qp < parent_ref_points.size(); ++parent_qp)
1932  {
1933  std::pair<unsigned int, QpMap> & child_and_map = coarsen_map[parent_qp];
1934  unsigned int & closest_child = child_and_map.first;
1935  QpMap & closest_map = child_and_map.second;
1936 
1937  QpMap & current_map = qp_map[parent_qp];
1938 
1939  if (current_map._distance < closest_map._distance)
1940  {
1941  closest_child = child;
1942  closest_map = current_map;
1943  }
1944  }
1945  }
1946 }
Helper object for holding qp mapping info.
Definition: MooseMesh.h:53
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:1780
PerfID _find_adaptivity_qp_maps_timer
Definition: MooseMesh.h:1144
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205
Real _distance
The distance between them.
Definition: MooseMesh.h:65

◆ freeBndElems()

void MooseMesh::freeBndElems ( )
protected

Definition at line 374 of file MooseMesh.C.

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

375 {
376  // free memory
377  for (auto & belem : _bnd_elems)
378  delete belem;
379 
380  for (auto & it : _bnd_elem_ids)
381  it.second.clear();
382 
383  _bnd_elem_ids.clear();
384 }
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:958
std::vector< BndElement * > _bnd_elems
array of boundary elems
Definition: MooseMesh.h:954

◆ freeBndNodes()

void MooseMesh::freeBndNodes ( )
protected

Definition at line 356 of file MooseMesh.C.

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

357 {
358  // free memory
359  for (auto & bnode : _bnd_nodes)
360  delete bnode;
361 
362  for (auto & it : _node_set_nodes)
363  it.second.clear();
364 
365  _node_set_nodes.clear();
366 
367  for (auto & it : _bnd_node_ids)
368  it.second.clear();
369 
370  _bnd_node_ids.clear();
371 }
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:951
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:969
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:947

◆ getActiveLocalElementRange()

ConstElemRange * MooseMesh::getActiveLocalElementRange ( )

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

Definition at line 779 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(), TransientMultiApp::solveStep(), Transient::solveStep(), updateActiveSemiLocalNodeRange(), Adaptivity::updateErrorVectors(), and SystemBase::zeroVariables().

780 {
782  {
784 
785  _active_local_elem_range = libmesh_make_unique<ConstElemRange>(
786  getMesh().active_local_elements_begin(), getMesh().active_local_elements_end(), GRAIN_SIZE);
787  }
788 
789  return _active_local_elem_range.get();
790 }
static const int GRAIN_SIZE
Definition: MooseMesh.C:57
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
std::unique_ptr< ConstElemRange > _active_local_elem_range
A range for use with threading.
Definition: MooseMesh.h:909
PerfID _get_active_local_element_range_timer
Definition: MooseMesh.h:1132

◆ getActiveNodeRange()

NodeRange * MooseMesh::getActiveNodeRange ( )

Definition at line 793 of file MooseMesh.C.

Referenced by meshChanged().

794 {
795  if (!_active_node_range)
796  {
797  TIME_SECTION(_get_active_node_range_timer);
798 
799  _active_node_range = libmesh_make_unique<NodeRange>(
800  getMesh().active_nodes_begin(), getMesh().active_nodes_end(), GRAIN_SIZE);
801  }
802 
803  return _active_node_range.get();
804 }
std::unique_ptr< NodeRange > _active_node_range
Definition: MooseMesh.h:912
static const int GRAIN_SIZE
Definition: MooseMesh.C:57
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
PerfID _get_active_node_range_timer
Definition: MooseMesh.h:1133

◆ getActiveSemiLocalNodeRange()

SemiLocalNodeRange * MooseMesh::getActiveSemiLocalNodeRange ( ) const

Definition at line 807 of file MooseMesh.C.

808 {
809  mooseAssert(_active_semilocal_node_range,
810  "_active_semilocal_node_range has not been created yet!");
811 
812  return _active_semilocal_node_range.get();
813 }
std::unique_ptr< SemiLocalNodeRange > _active_semilocal_node_range
Definition: MooseMesh.h:911

◆ getBoundaryElementRange()

ConstBndElemRange * MooseMesh::getBoundaryElementRange ( )

Definition at line 843 of file MooseMesh.C.

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

844 {
845  if (!_bnd_elem_range)
846  {
847  TIME_SECTION(_get_boundary_element_range_timer);
849  libmesh_make_unique<ConstBndElemRange>(bndElemsBegin(), bndElemsEnd(), GRAIN_SIZE);
850  }
851 
852  return _bnd_elem_range.get();
853 }
virtual bnd_elem_iterator bndElemsEnd()
Definition: MooseMesh.C:920
virtual bnd_elem_iterator bndElemsBegin()
Return iterators to the beginning/end of the boundary elements list.
Definition: MooseMesh.C:912
std::unique_ptr< StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > > _bnd_elem_range
Definition: MooseMesh.h:916
static const int GRAIN_SIZE
Definition: MooseMesh.C:57
PerfID _get_boundary_element_range_timer
Definition: MooseMesh.h:1136

◆ 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 1043 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().

1044 {
1045  if (boundary_name == "ANY_BOUNDARY_ID")
1046  mooseError("Please use getBoundaryIDs() when passing \"ANY_BOUNDARY_ID\"");
1047 
1049  std::istringstream ss(boundary_name);
1050 
1051  if (!(ss >> id))
1052  id = getMesh().get_boundary_info().get_id_by_name(boundary_name);
1053 
1054  return id;
1055 }
const BoundaryID INVALID_BOUNDARY_ID
Definition: MooseTypes.h:322
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
boundary_id_type BoundaryID
Definition: MooseTypes.h:93

◆ 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 2105 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(), ParsedAddSideset::modify(), SideSetsAroundSubdomain::modify(), ElementDeleterBase::modify(), BoundingBoxNodeSet::modify(), and AddSideSetsFromBoundingBox::modify().

2106 {
2107  std::vector<BoundaryID> ids;
2108  getMesh().get_boundary_info().boundary_ids(elem, side, ids);
2109  return ids;
2110 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205

◆ 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 2113 of file MooseMesh.C.

Referenced by cacheInfo().

2114 {
2115  return getMesh().get_boundary_info().get_boundary_ids();
2116 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ 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 1058 of file MooseMesh.C.

1060 {
1061  const BoundaryInfo & boundary_info = getMesh().get_boundary_info();
1062  const std::map<BoundaryID, std::string> & sideset_map = boundary_info.get_sideset_name_map();
1063  const std::map<BoundaryID, std::string> & nodeset_map = boundary_info.get_nodeset_name_map();
1064 
1065  std::set<BoundaryID> boundary_ids = boundary_info.get_boundary_ids();
1066 
1067  // On a distributed mesh we may have boundary ids that only exist on
1068  // other processors.
1069  if (!this->getMesh().is_replicated())
1070  _communicator.set_union(boundary_ids);
1071 
1072  BoundaryID max_boundary_id = boundary_ids.empty() ? 0 : *(boundary_ids.rbegin());
1073 
1074  std::vector<BoundaryID> ids(boundary_name.size());
1075  for (unsigned int i = 0; i < boundary_name.size(); i++)
1076  {
1077  if (boundary_name[i] == "ANY_BOUNDARY_ID")
1078  {
1079  ids.assign(_mesh_boundary_ids.begin(), _mesh_boundary_ids.end());
1080  if (i)
1081  mooseWarning("You passed \"ANY_BOUNDARY_ID\" in addition to other boundary_names. This "
1082  "may be a logic error.");
1083  break;
1084  }
1085 
1086  BoundaryID id;
1087  std::istringstream ss(boundary_name[i]);
1088 
1089  if (!(ss >> id) || !ss.eof())
1090  {
1096  if (generate_unknown &&
1097  !MooseUtils::doesMapContainValue(sideset_map, std::string(boundary_name[i])) &&
1098  !MooseUtils::doesMapContainValue(nodeset_map, std::string(boundary_name[i])))
1099  id = ++max_boundary_id;
1100  else
1101  id = boundary_info.get_id_by_name(boundary_name[i]);
1102  }
1103 
1104  ids[i] = id;
1105  }
1106 
1107  return ids;
1108 }
void mooseWarning(Args &&... args) const
Definition: MooseObject.h:149
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:173
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
std::set< BoundaryID > _mesh_boundary_ids
A set of boundary IDs currently present in the mesh.
Definition: MooseMesh.h:938
boundary_id_type BoundaryID
Definition: MooseTypes.h:93

◆ getBoundaryName()

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

Return the name of the boundary given the id.

Definition at line 1182 of file MooseMesh.C.

Referenced by MaterialPropertyDebugOutput::printMaterialMap().

1183 {
1184  BoundaryInfo & boundary_info = getMesh().get_boundary_info();
1185 
1186  std::vector<BoundaryID> side_boundaries;
1187  boundary_info.build_side_boundary_ids(side_boundaries);
1188 
1189  // We need to figure out if this boundary is a sideset or nodeset
1190  if (std::find(side_boundaries.begin(), side_boundaries.end(), boundary_id) !=
1191  side_boundaries.end())
1192  return boundary_info.get_sideset_name(boundary_id);
1193  else
1194  return boundary_info.get_nodeset_name(boundary_id);
1195 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ getBoundaryNodeRange()

ConstBndNodeRange * MooseMesh::getBoundaryNodeRange ( )

Definition at line 830 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().

831 {
832  if (!_bnd_node_range)
833  {
834  TIME_SECTION(_get_boundary_node_range_timer);
836  libmesh_make_unique<ConstBndNodeRange>(bndNodesBegin(), bndNodesEnd(), GRAIN_SIZE);
837  }
838 
839  return _bnd_node_range.get();
840 }
virtual bnd_node_iterator bndNodesEnd()
Definition: MooseMesh.C:904
PerfID _get_boundary_node_range_timer
Definition: MooseMesh.h:1135
virtual bnd_node_iterator bndNodesBegin()
Return iterators to the beginning/end of the boundary nodes list.
Definition: MooseMesh.C:896
static const int GRAIN_SIZE
Definition: MooseMesh.C:57
std::unique_ptr< StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > > _bnd_node_range
Definition: MooseMesh.h:914

◆ 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 72 of file MooseObject.h.

73  {
74  return parameters().getCheckedPointerParam<T>(name, error_string);
75  }
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:57
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:51

◆ 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 1769 of file MooseMesh.C.

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

1770 {
1771  std::pair<int, ElemType> the_pair(input_side, elem.type());
1772 
1773  if (_elem_type_to_coarsening_map.find(the_pair) == _elem_type_to_coarsening_map.end())
1774  mooseError("Could not find a suitable qp refinement map!");
1775 
1776  return _elem_type_to_coarsening_map[the_pair];
1777 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
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:1111
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205

◆ 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 827 of file MooseMesh.h.

827 { return ""; }

◆ getGhostedBoundaries()

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

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

Definition at line 2330 of file MooseMesh.C.

2331 {
2332  return _ghosted_boundaries;
2333 }
std::set< unsigned int > _ghosted_boundaries
Definition: MooseMesh.h:971

◆ getGhostedBoundaryInflation()

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

Return a writable reference to the _ghosted_boundaries_inflation vector.

Definition at line 2336 of file MooseMesh.C.

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

2337 {
2339 }
std::vector< Real > _ghosted_boundaries_inflation
Definition: MooseMesh.h:972

◆ getGhostingPatchSize()

unsigned int MooseMesh::getGhostingPatchSize ( ) const
inline

Getter for the ghosting_patch_size parameter.

Definition at line 440 of file MooseMesh.h.

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

440 { 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:978

◆ 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 2489 of file MooseMesh.C.

Referenced by PointSamplerBase::execute().

2490 {
2491  // Grab a bounding box to speed things up. Note that
2492  // local_bounding_box is *not* equivalent to processor_bounding_box
2493  // with processor_id() except in serial.
2494  BoundingBox bbox = MeshTools::create_local_bounding_box(getMesh());
2495 
2496  // Inflate the bbox just a bit to deal with roundoff
2497  // Adding 1% of the diagonal size in each direction on each end
2498  Real inflation_amount = inflation_multiplier * (bbox.max() - bbox.min()).norm();
2499  Point inflation(inflation_amount, inflation_amount, inflation_amount);
2500 
2501  bbox.first -= inflation; // min
2502  bbox.second += inflation; // max
2503 
2504  return bbox;
2505 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ getLocalNodeRange()

ConstNodeRange * MooseMesh::getLocalNodeRange ( )

Definition at line 816 of file MooseMesh.C.

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

817 {
818  if (!_local_node_range)
819  {
820  TIME_SECTION(_get_local_node_range_timer);
821 
822  _local_node_range = libmesh_make_unique<ConstNodeRange>(
823  getMesh().local_nodes_begin(), getMesh().local_nodes_end(), GRAIN_SIZE);
824  }
825 
826  return _local_node_range.get();
827 }
static const int GRAIN_SIZE
Definition: MooseMesh.C:57
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
PerfID _get_local_node_range_timer
Definition: MooseMesh.h:1134
std::unique_ptr< ConstNodeRange > _local_node_range
Definition: MooseMesh.h:913

◆ getMaxInDimension()

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

Reimplemented in AnnularMesh, DistributedGeneratedMesh, and GeneratedMesh.

Definition at line 1514 of file MooseMesh.C.

Referenced by dimensionWidth().

1515 {
1516  mooseAssert(component < _bounds.size(), "Requested dimension out of bounds");
1517 
1518  return _bounds[component][MAX];
1519 }
std::vector< std::vector< Real > > _bounds
The bounds in each dimension of the mesh for regular orthogonal meshes.
Definition: MooseMesh.h:993

◆ getMaxLeafSize()

unsigned int MooseMesh::getMaxLeafSize ( ) const
inline

Getter for the maximum leaf size parameter.

Definition at line 445 of file MooseMesh.h.

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

445 { return _max_leaf_size; };
unsigned int _max_leaf_size
Definition: MooseMesh.h:981

◆ getMesh() [1/2]

MeshBase & MooseMesh::getMesh ( )

Accessor for the underlying libMesh Mesh object.

Definition at line 2512 of file MooseMesh.C.

Referenced by activeLocalElementsBegin(), activeLocalElementsEnd(), Adaptivity::adaptMesh(), BreakMeshByBlock::addInterfaceBoundary(), addQuadratureNode(), addUniqueNode(), GeometricRelationshipManager::attachGeometricFunctorHelper(), RelationshipManager::attachRelationshipManagers(), buildBndElemList(), TiledMesh::buildMesh(), FileMesh::buildMesh(), RinglebMesh::buildMesh(), DistributedGeneratedMesh::buildMesh(), GeneratedMesh::buildMesh(), AnnularMesh::buildMesh(), SpiralAnnularMesh::buildMesh(), ConcentricCircleMesh::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(), FileMesh::FileMesh(), 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(), AssignSubdomainID::modify(), SmoothMesh::modify(), AssignElementSubdomainID::modify(), SideSetsAroundSubdomain::modify(), ParsedAddSideset::modify(), AddAllSideSetsByNormals::modify(), ElementDeleterBase::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), ImageSubdomain::modify(), BoundingBoxNodeSet::modify(), OrientedSubdomainBoundingBox::modify(), AddSideSetsFromBoundingBox::modify(), SubdomainBoundingBox::modify(), MooseMesh(), nElem(), nNodes(), NodalPatchRecovery::NodalPatchRecovery(), NodalVariableValue::NodalVariableValue(), nodePtr(), nodeRef(), nodeToActiveSemilocalElemMap(), nodeToElemMap(), ComputeNodalUserObjectsThread::onNode(), XDA::output(), ConsoleUtils::outputMeshInformation(), PatternedMesh::PatternedMesh(), prepare(), EqualValueEmbeddedConstraint::prepareSlaveToMasterMap(), printInfo(), queryElemPtr(), queryNodePtr(), FileMesh::read(), SubProblem::restrictionBoundaryCheckName(), SubProblem::restrictionSubdomainCheckName(), setBoundaryName(), NonlinearSystemBase::setConstraintSlaveValues(), XFEMInterface::setDisplacedMesh(), XFEMInterface::setMesh(), setSubdomainName(), ImageSampler::setupImageSampler(), SetupMeshAction::setupMesh(), sideWithBoundaryID(), StitchedMesh::StitchedMesh(), MultiAppCopyTransfer::transfer(), DisplacedProblem::undisplaceMesh(), updateActiveSemiLocalNodeRange(), EqualValueBoundaryConstraint::updateConstrainedNodes(), Adaptivity::updateErrorVectors(), RandomData::updateGenerators(), and DisplacedProblem::updateMesh().

2513 {
2514  mooseAssert(_mesh, "Mesh hasn't been created");
2515  return *_mesh;
2516 }
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:851

◆ getMesh() [2/2]

const MeshBase & MooseMesh::getMesh ( ) const

Definition at line 2519 of file MooseMesh.C.

2520 {
2521  mooseAssert(_mesh, "Mesh hasn't been created");
2522  return *_mesh;
2523 }
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:851

◆ 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 1506 of file MooseMesh.C.

Referenced by dimensionWidth().

1507 {
1508  mooseAssert(component < _bounds.size(), "Requested dimension out of bounds");
1509 
1510  return _bounds[component][MIN];
1511 }
std::vector< std::vector< Real > > _bounds
The bounds in each dimension of the mesh for regular orthogonal meshes.
Definition: MooseMesh.h:993

◆ getMooseApp()

MooseApp& MooseObject::getMooseApp ( ) const
inlineinherited

Get the MooseApp this object is associated with.

Definition at line 86 of file MooseObject.h.

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

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

◆ getMortarInterface()

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

Definition at line 2651 of file MooseMesh.C.

Referenced by GeometricSearchData::generateMortarNodes().

2652 {
2653  std::map<std::pair<BoundaryID, BoundaryID>, MortarInterface *>::iterator it =
2654  _mortar_interface_by_ids.find(std::pair<BoundaryID, BoundaryID>(master, slave));
2655  if (it != _mortar_interface_by_ids.end())
2656  return (*it).second;
2657  else
2658  mooseError(
2659  "Requesting non-existing mortar interface (master = ", master, ", slave = ", slave, ").");
2660 }
std::map< std::pair< BoundaryID, BoundaryID >, MortarInterface * > _mortar_interface_by_ids
Mortar interfaces mapped though master, slave IDs pairs.
Definition: MooseMesh.h:1002
void mooseError(Args &&... args) const
Definition: MooseObject.h:140

◆ getMortarInterfaceByName()

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

Definition at line 2641 of file MooseMesh.C.

2642 {
2643  std::map<std::string, MortarInterface *>::iterator it = _mortar_interface_by_name.find(name);
2644  if (it != _mortar_interface_by_name.end())
2645  return (*it).second;
2646  else
2647  mooseError("Requesting non-existent mortar interface '", name, "'.");
2648 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
std::map< std::string, MortarInterface * > _mortar_interface_by_name
Mortar interfaces mapped through their names.
Definition: MooseMesh.h:999
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:51

◆ 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 883 of file MooseMesh.C.

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

884 {
885  std::map<dof_id_type, std::set<SubdomainID>>::const_iterator it =
886  _block_node_list.find(node.id());
887 
888  if (it == _block_node_list.end())
889  mooseError("Unable to find node: ", node.id(), " in any block list.");
890 
891  return it->second;
892 }
std::map< dof_id_type, std::set< SubdomainID > > _block_node_list
list of nodes that belongs to a specified block (domain)
Definition: MooseMesh.h:966
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:464

◆ 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 2539 of file MooseMesh.C.

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

2540 {
2541  std::map<boundary_id_type, std::vector<dof_id_type>>::const_iterator it =
2542  _node_set_nodes.find(nodeset_id);
2543 
2544  if (it == _node_set_nodes.end())
2545  {
2546  // On a distributed mesh we might not know about a remote nodeset,
2547  // so we'll return an empty vector and hope the nodeset exists
2548  // elsewhere.
2549  if (!getMesh().is_serial())
2550  {
2551  static const std::vector<dof_id_type> empty_vec;
2552  return empty_vec;
2553  }
2554  // On a replicated mesh we should know about every nodeset and if
2555  // we're asked for one that doesn't exist then it must be a bug.
2556  else
2557  {
2558  mooseError("Unable to nodeset ID: ", nodeset_id, '.');
2559  }
2560  }
2561 
2562  return it->second;
2563 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
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:969
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ 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 1991 of file MooseMesh.C.

1992 {
1993  mooseAssert(_boundary_to_normal_map.get() != nullptr, "Boundary To Normal Map not built!");
1994 
1995  // Note: Boundaries that are not in the map (existing boundaries) will default
1996  // construct a new RealVectorValue - (x,y,z)=(0, 0, 0)
1997  return (*_boundary_to_normal_map)[id];
1998 }
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:944

◆ 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 1585 of file MooseMesh.C.

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

1586 {
1588  mooseError("Trying to retrieve automatic paired mapping for a mesh that is not regular and "
1589  "orthogonal");
1590 
1591  mooseAssert(component < dimension(), "Requested dimension out of bounds");
1592 
1593  if (_paired_boundary.empty())
1595 
1596  if (component < _paired_boundary.size())
1597  return &_paired_boundary[component];
1598  else
1599  return nullptr;
1600 }
void detectPairedSidesets()
This routine detects paired sidesets of a regular orthogonal mesh (.i.e.
Definition: MooseMesh.C:1397
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:2099
std::vector< std::pair< BoundaryID, BoundaryID > > _paired_boundary
A vector holding the paired boundaries for a regular orthogonal mesh.
Definition: MooseMesh.h:996
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:990

◆ 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 185 of file MooseObject.h.

Referenced by FEProblemBase::addMaterialHelper(), ConstraintWarehouse::addObject(), BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromXandY(), 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().

186 {
187  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
188 }
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:168
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:51

◆ getPatchSize()

unsigned int MooseMesh::getPatchSize ( ) const

Getter for the patch_size parameter.

Definition at line 2471 of file MooseMesh.C.

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

2472 {
2473  return _patch_size;
2474 }
unsigned int _patch_size
The number of nodes to consider in the NearestNode neighborhood.
Definition: MooseMesh.h:975

◆ getPatchUpdateStrategy()

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

Get the current patch update strategy.

Definition at line 2483 of file MooseMesh.C.

Referenced by FEProblemBase::possiblyRebuildGeomSearchPatches().

2484 {
2485  return _patch_update_strategy;
2486 }
Moose::PatchUpdateType _patch_update_strategy
The patch update strategy.
Definition: MooseMesh.h:984

◆ 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 2697 of file MooseMesh.C.

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

2698 {
2699  return getMesh().sub_point_locator();
2700 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ 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 1013 of file MooseMesh.C.

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

1016 {
1017  mooseAssert(_elem_to_side_to_qp_to_quadrature_nodes.find(elem->id()) !=
1019  "Elem has no quadrature nodes!");
1020  mooseAssert(_elem_to_side_to_qp_to_quadrature_nodes[elem->id()].find(side) !=
1022  "Side has no quadrature nodes!");
1023  mooseAssert(_elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side].find(qp) !=
1024  _elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side].end(),
1025  "qp not found on side!");
1026 
1027  return _elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side][qp];
1028 }
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:962
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205

◆ 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 1705 of file MooseMesh.C.

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

1706 {
1707  if (child == -1) // Doing volume mapping or parent side mapping
1708  {
1709  mooseAssert(parent_side == child_side,
1710  "Parent side must match child_side if not passing a specific child!");
1711 
1712  std::pair<int, ElemType> the_pair(parent_side, elem.type());
1713 
1714  if (_elem_type_to_refinement_map.find(the_pair) == _elem_type_to_refinement_map.end())
1715  mooseError("Could not find a suitable qp refinement map!");
1716 
1717  return _elem_type_to_refinement_map[the_pair];
1718  }
1719  else // Need to map a child side to parent volume qps
1720  {
1721  std::pair<int, int> child_pair(child, child_side);
1722 
1723  if (_elem_type_to_child_side_refinement_map.find(elem.type()) ==
1725  _elem_type_to_child_side_refinement_map[elem.type()].find(child_pair) ==
1727  mooseError("Could not find a suitable qp refinement map!");
1728 
1729  return _elem_type_to_child_side_refinement_map[elem.type()][child_pair];
1730  }
1731 
1738 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
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:1107
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205
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:1103

◆ 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 2566 of file MooseMesh.C.

Referenced by FEProblemBase::prepareMaterials().

2567 {
2568  std::map<SubdomainID, std::set<BoundaryID>>::const_iterator it =
2569  _subdomain_boundary_ids.find(subdomain_id);
2570 
2571  if (it == _subdomain_boundary_ids.end())
2572  mooseError("Unable to find subdomain ID: ", subdomain_id, '.');
2573 
2574  return it->second;
2575 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
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:1114

◆ 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 1111 of file MooseMesh.C.

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

1112 {
1113  if (subdomain_name == "ANY_BLOCK_ID")
1114  mooseError("Please use getSubdomainIDs() when passing \"ANY_BLOCK_ID\"");
1115 
1117  std::istringstream ss(subdomain_name);
1118 
1119  if (!(ss >> id) || !ss.eof())
1120  id = getMesh().get_id_by_name(subdomain_name);
1121 
1122  return id;
1123 }
subdomain_id_type SubdomainID
Definition: MooseTypes.h:95
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
const SubdomainID INVALID_BLOCK_ID
Definition: MooseTypes.h:320
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ 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 1126 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().

1127 {
1128  std::vector<SubdomainID> ids(subdomain_name.size());
1129 
1130  for (unsigned int i = 0; i < subdomain_name.size(); i++)
1131  {
1132  if (subdomain_name[i] == "ANY_BLOCK_ID")
1133  {
1134  ids.assign(_mesh_subdomains.begin(), _mesh_subdomains.end());
1135  if (i)
1136  mooseWarning("You passed \"ANY_BLOCK_ID\" in addition to other block names. This may be a "
1137  "logic error.");
1138  break;
1139  }
1140 
1142  std::istringstream ss(subdomain_name[i]);
1143 
1144  if (!(ss >> id) || !ss.eof())
1145  id = getMesh().get_id_by_name(subdomain_name[i]);
1146 
1147  ids[i] = id;
1148  }
1149 
1150  return ids;
1151 }
void mooseWarning(Args &&... args) const
Definition: MooseObject.h:149
subdomain_id_type SubdomainID
Definition: MooseTypes.h:95
const SubdomainID INVALID_BLOCK_ID
Definition: MooseTypes.h:320
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
std::set< SubdomainID > _mesh_subdomains
A set of subdomain IDs currently present in the mesh.
Definition: MooseMesh.h:930

◆ getSubdomainName()

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

Return the name of a block given an id.

Definition at line 1160 of file MooseMesh.C.

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

1161 {
1162  return getMesh().subdomain_name(subdomain_id);
1163 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ ghostGhostedBoundaries()

void MooseMesh::ghostGhostedBoundaries ( )

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

Definition at line 2400 of file MooseMesh.C.

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

2401 {
2402  // No need to do this if using a serial mesh
2403  if (!_use_distributed_mesh)
2404  return;
2405 
2406  TIME_SECTION(_ghost_ghosted_boundaries_timer);
2407 
2408  DistributedMesh & mesh = dynamic_cast<DistributedMesh &>(getMesh());
2409 
2410  // We would like to clear ghosted elements that were added by
2411  // previous invocations of this method; however we can't do so
2412  // simply without also clearing ghosted elements that were added by
2413  // other code; e.g. OversampleOutput. So for now we'll just
2414  // swallow the inefficiency that can come from leaving unnecessary
2415  // elements ghosted after AMR.
2416  // mesh.clear_extra_ghost_elems();
2417 
2418  std::set<const Elem *, CompareElemsByLevel> boundary_elems_to_ghost;
2419  std::set<Node *> connected_nodes_to_ghost;
2420 
2421  std::vector<const Elem *> family_tree;
2422 
2423  for (const auto & t : mesh.get_boundary_info().build_side_list())
2424  {
2425  auto elem_id = std::get<0>(t);
2426  auto bc_id = std::get<2>(t);
2427 
2428  if (_ghosted_boundaries.find(bc_id) != _ghosted_boundaries.end())
2429  {
2430  Elem * elem = mesh.elem_ptr(elem_id);
2431 
2432 #ifdef LIBMESH_ENABLE_AMR
2433  elem->family_tree(family_tree);
2434  Elem * parent = elem->parent();
2435  while (parent)
2436  {
2437  family_tree.push_back(parent);
2438  parent = parent->parent();
2439  }
2440 #else
2441  family_tree.clear();
2442  family_tree.push_back(elem);
2443 #endif
2444  for (const auto & felem : family_tree)
2445  {
2446  boundary_elems_to_ghost.insert(felem);
2447 
2448  // The entries of connected_nodes_to_ghost need to be
2449  // non-constant, so that they will work in things like
2450  // UpdateDisplacedMeshThread. The container returned by
2451  // family_tree contains const Elems even when the Elem
2452  // it is called on is non-const, so once that interface
2453  // gets fixed we can remove this const_cast.
2454  for (unsigned int n = 0; n < felem->n_nodes(); ++n)
2455  connected_nodes_to_ghost.insert(const_cast<Node *>(felem->node_ptr(n)));
2456  }
2457  }
2458  }
2459 
2460  mesh.comm().allgather_packed_range(&mesh,
2461  connected_nodes_to_ghost.begin(),
2462  connected_nodes_to_ghost.end(),
2463  extra_ghost_elem_inserter<Node>(mesh));
2464  mesh.comm().allgather_packed_range(&mesh,
2465  boundary_elems_to_ghost.begin(),
2466  boundary_elems_to_ghost.end(),
2467  extra_ghost_elem_inserter<Elem>(mesh));
2468 }
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:846
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
PetscInt n
PerfID _ghost_ghosted_boundaries_timer
Definition: MooseMesh.h:1149
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2205
std::set< unsigned int > _ghosted_boundaries
Definition: MooseMesh.h:971

◆ hasSecondOrderElements()

bool MooseMesh::hasSecondOrderElements ( )

check if the mesh has SECOND order elements

Definition at line 2675 of file MooseMesh.C.

2676 {
2677  bool mesh_has_second_order_elements = false;
2678  for (auto it = activeLocalElementsBegin(), end = activeLocalElementsEnd(); it != end; ++it)
2679  if ((*it)->default_order() == SECOND)
2680  {
2681  mesh_has_second_order_elements = true;
2682  break;
2683  }
2684 
2685  // We checked our local elements, so take the max over all processors.
2686  comm().max(mesh_has_second_order_elements);
2687  return mesh_has_second_order_elements;
2688 }
MeshBase::const_element_iterator activeLocalElementsBegin()
Calls active_local_nodes_begin/end() on the underlying libMesh mesh object.
Definition: MooseMesh.C:2169
MPI_Comm comm
const MeshBase::const_element_iterator activeLocalElementsEnd()
Definition: MooseMesh.C:2175

◆ 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...

Definition at line 2007 of file MooseMesh.C.

Referenced by GridPartitioner::_do_partition().

2008 {
2010  mooseError("You cannot use the mesh splitter capability with DistributedMesh!");
2011 
2012  TIME_SECTION(_init_timer);
2013 
2015  {
2016  // Check of partitioner is supplied (not allowed if custom partitioner is used)
2017  if (!parameters().isParamSetByAddParam("partitioner"))
2018  mooseError("If partitioner block is provided, partitioner keyword cannot be used!");
2019  // Set custom partitioner
2020  if (!_custom_partitioner.get())
2021  mooseError("Custom partitioner requested but not set!");
2022  getMesh().partitioner().reset(_custom_partitioner.release());
2023  }
2024  else
2025  {
2026  // Set standard partitioner
2027  // Set the partitioner based on partitioner name
2028  switch (_partitioner_name)
2029  {
2030  case -3: // default
2031  // We'll use the default partitioner, but notify the user of which one is being used...
2033  _partitioner_name = "parmetis";
2034  else
2035  _partitioner_name = "metis";
2036  break;
2037 
2038  // No need to explicitily create the metis or parmetis partitioners,
2039  // They are the default for serial and parallel mesh respectively
2040  case -2: // metis
2041  case -1: // parmetis
2042  break;
2043 
2044  case 0: // linear
2045  getMesh().partitioner().reset(new LinearPartitioner);
2046  break;
2047  case 1: // centroid
2048  {
2049  if (!isParamValid("centroid_partitioner_direction"))
2050  mooseError("If using the centroid partitioner you _must_ specify "
2051  "centroid_partitioner_direction!");
2052 
2053  MooseEnum direction = getParam<MooseEnum>("centroid_partitioner_direction");
2054 
2055  if (direction == "x")
2056  getMesh().partitioner().reset(new CentroidPartitioner(CentroidPartitioner::X));
2057  else if (direction == "y")
2058  getMesh().partitioner().reset(new CentroidPartitioner(CentroidPartitioner::Y));
2059  else if (direction == "z")
2060  getMesh().partitioner().reset(new CentroidPartitioner(CentroidPartitioner::Z));
2061  else if (direction == "radial")
2062  getMesh().partitioner().reset(new CentroidPartitioner(CentroidPartitioner::RADIAL));
2063  break;
2064  }
2065  case 2: // hilbert_sfc
2066  getMesh().partitioner().reset(new HilbertSFCPartitioner);
2067  break;
2068  case 3: // morton_sfc
2069  getMesh().partitioner().reset(new MortonSFCPartitioner);
2070  break;
2071  }
2072  }
2073 
2075  {
2076  // Some partitioners are not idempotent. Some recovery data
2077  // files require partitioning to match mesh partitioning. This
2078  // means that, when recovering, we can't safely repartition.
2079  const bool skip_partitioning_later = getMesh().skip_partitioning();
2080  getMesh().skip_partitioning(true);
2081  const bool allow_renumbering_later = getMesh().allow_renumbering();
2082  getMesh().allow_renumbering(false);
2083 
2084  // For now, only read the recovery mesh on the Ultimate Master..
2085  // sub-apps need to just build their mesh like normal
2086  {
2087  TIME_SECTION(_read_recovered_mesh_timer);
2088  getMesh().read(_app.getRecoverFileBase() + "_mesh." + _app.getRecoverFileSuffix());
2089  }
2090 
2091  getMesh().allow_renumbering(allow_renumbering_later);
2092  getMesh().skip_partitioning(skip_partitioning_later);
2093  }
2094  else // Normally just build the mesh
2095  buildMesh();
2096 }
bool _custom_partitioner_requested
Definition: MooseMesh.h:859
std::string getRecoverFileBase()
The file_base for the recovery file.
Definition: MooseApp.h:356
MooseEnum _partitioner_name
The partitioner used on this mesh.
Definition: MooseMesh.h:854
void mooseError(Args &&... args) const
Definition: MooseObject.h:140
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:864
bool _allow_recovery
Whether or not this Mesh is allowed to read a recovery file.
Definition: MooseMesh.h:1117
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:846
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:57
PerfID _init_timer
Definition: MooseMesh.h:1147
PerfID _read_recovered_mesh_timer
Definition: MooseMesh.h:1148
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:32
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:171
std::string getRecoverFileSuffix()
The suffix for the recovery file.
Definition: MooseApp.h:372
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:81
bool isUltimateMaster()
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:526
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:852
std::unique_ptr< Partitioner > _custom_partitioner
The custom partitioner.
Definition: MooseMesh.h:858

◆ 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 2604 of file MooseMesh.C.

2605 {
2606  bool found_elem = false;
2607  for (const auto & it : _bnd_elem_ids)
2608  {
2609  if (it.second.find(elem_id) != it.second.end())
2610  {
2611  found_elem = true;
2612  break;
2613  }
2614  }
2615  return found_elem;
2616 }
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:958

◆ 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 2619 of file MooseMesh.C.

2620 {
2621  bool found_elem = false;
2622  std::map<boundary_id_type, std::set<dof_id_type>>::const_iterator it = _bnd_elem_ids.find(bnd_id);
2623  if (it != _bnd_elem_ids.end())
2624  if (it->second.find(elem_id) != it->second.end())
2625  found_elem = true;
2626  return found_elem;
2627 }
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:958

◆ 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 2578 of file MooseMesh.C.

Referenced by NodalNormalsPreprocessor::execute().

2579 {
2580  bool found_node = false;
2581  for (const auto & it : _bnd_node_ids)
2582  {
2583  if (it.second.find(node_id) != it.second.end())
2584  {
2585  found_node = true;
2586  break;
2587  }
2588  }
2589  return found_node;
2590 }
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:951

◆ 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 2593 of file MooseMesh.C.

2594 {
2595  bool found_node = false;
2596  std::map<boundary_id_type, std::set<dof_id_type>>::const_iterator it = _bnd_node_ids.find(bnd_id);
2597  if (it != _bnd_node_ids.end())
2598  if (it->second.find(node_id) != it->second.end())
2599  found_node = true;
2600  return found_node;
2601 }
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:951

◆ isCustomPartitionerRequested()

bool MooseMesh::isCustomPartitionerRequested ( ) const

Setter and getter for _custom_partitioner_requested.

Definition at line 2669 of file MooseMesh.C.

2670 {
2672 }
bool _custom_partitioner_requested
Definition: MooseMesh.h:859

◆ 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 755 of file MooseMesh.h.

Referenced by ConsoleUtils::outputMeshInformation().

755 { return _parallel_type_overridden; }
bool _parallel_type_overridden
Definition: MooseMesh.h:848

◆ 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 81 of file MooseObject.h.

Referenced by AdvancedOutput::AdvancedOutput(), BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), DistributedGeneratedMesh::buildMesh(), GeneratedMesh::buildMesh(), LibmeshPartitioner::clone(), OversampleOutput::cloneMesh(), CSVReader::CSVReader(), MultiAppNearestNodeTransfer::execute(), Exodus::Exodus(), FEProblemBase::FEProblemBase(), FileOutput::FileOutput(), MultiApp::fillPositions(), FunctionDT::FunctionDT(), RenameBoundaryGenerator::generate(), ElementSubdomainIDGenerator::generate(), BreakBoundaryOnSubdomainGenerator::generate(), ExtraNodesetGenerator::generate(), LowerDBlockFromSidesetGenerator::generate(), MeshSideSetGenerator::generate(), RenameBlockGenerator::generate(), GeneratedMeshGenerator::generate(), ParsedSubdomainMeshGenerator::generate(), MeshExtruderGenerator::generate(), SubdomainBoundingBoxGenerator::generate(), PatternedMeshGenerator::generate(), MultiAppNearestNodeTransfer::getLocalEntities(), MeshGenerator::getMesh(), MultiAppNearestNodeTransfer::getNearestNode(), IterationAdaptiveDT::init(), EigenExecutionerBase::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().

81 { return _pars.isParamValid(name); }
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:168
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:51
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 765 of file MooseMesh.h.

Referenced by ConsoleUtils::outputMeshInformation().

765 { return _partitioner_overridden; }
bool _partitioner_overridden
Definition: MooseMesh.h:855

◆ isRegularOrthogonal()

bool MooseMesh::isRegularOrthogonal ( )
inline

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

Definition at line 812 of file MooseMesh.h.

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

◆ 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 642 of file MooseMesh.C.

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

◆ 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 1543 of file MooseMesh.C.

Referenced by minPeriodicVector().

1544 {
1545  mooseAssert(component < dimension(), "Requested dimension out of bounds");
1546 
1547  if (_periodic_dim.find(nonlinear_var_num) != _periodic_dim.end())
1548  return _periodic_dim.at(nonlinear_var_num)[component];
1549  else
1550  return false;
1551 }
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:2099
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:1013

◆ localNodesBegin()

MeshBase::const_node_iterator MooseMesh::localNodesBegin ( )

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

Definition at line 2157 of file MooseMesh.C.

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

2158 {
2159  return getMesh().local_nodes_begin();
2160 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ localNodesEnd()

MeshBase::const_node_iterator MooseMesh::localNodesEnd ( )

Definition at line 2163 of file MooseMesh.C.

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

2164 {
2165  return getMesh().local_nodes_end();
2166 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ 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 1780 of file MooseMesh.C.

Referenced by findAdaptivityQpMaps().

1783 {
1784  unsigned int n_from = from.size();
1785  unsigned int n_to = to.size();
1786 
1787  qp_map.resize(n_from);
1788 
1789  for (unsigned int i = 0; i < n_from; ++i)
1790  {
1791  const Point & from_point = from[i];
1792 
1793  QpMap & current_map = qp_map[i];
1794 
1795  for (unsigned int j = 0; j < n_to; ++j)
1796  {
1797  const Point & to_point = to[j];
1798  Real distance = (from_point - to_point).norm();
1799 
1800  if (distance < current_map._distance)
1801  {
1802  current_map._distance = distance;
1803  current_map._from = i;
1804  current_map._to = j;
1805  }
1806  }
1807  }
1808 }
Helper object for holding qp mapping info.
Definition: MooseMesh.h:53
unsigned int _to
The qp to map to.
Definition: MooseMesh.h:62
unsigned int _from
The qp to map from.
Definition: MooseMesh.h:59
Real _distance
The distance between them.
Definition: MooseMesh.h:65

◆ maxElemId()

dof_id_type MooseMesh::maxElemId ( ) const
virtual

Definition at line 2199 of file MooseMesh.C.

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

2200 {
2201  return getMesh().max_elem_id();
2202 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ 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 2193 of file MooseMesh.C.

2194 {
2195  return getMesh().max_node_id();
2196 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ 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 2267 of file MooseMesh.C.

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

2268 {
2269  return _mesh_boundary_ids;
2270 }
std::set< BoundaryID > _mesh_boundary_ids
A set of boundary IDs currently present in the mesh.
Definition: MooseMesh.h:938

◆ 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 532 of file MooseMesh.C.

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

533 {
534  TIME_SECTION(_mesh_changed_timer);
535 
536  update();
537 
538  // Delete all of the cached ranges
539  _active_local_elem_range.reset();
540  _active_node_range.reset();
542  _local_node_range.reset();
543  _bnd_node_range.reset();
544  _bnd_elem_range.reset();
545 
546  // Rebuild the ranges
552 
553  // Call the callback function onMeshChanged
554  onMeshChanged();
555 }
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:779
virtual void onMeshChanged()
Declares a callback function that is executed at the conclusion of meshChanged(). ...
Definition: MooseMesh.C:558
ConstNodeRange * getLocalNodeRange()
Definition: MooseMesh.C:816
std::unique_ptr< NodeRange > _active_node_range
Definition: MooseMesh.h:912
std::unique_ptr< StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > > _bnd_elem_range
Definition: MooseMesh.h:916
void update()
Calls buildNodeListFromSideList(), buildNodeList(), and buildBndElemList().
Definition: MooseMesh.C:445
PerfID _mesh_changed_timer
Definition: MooseMesh.h:1125
std::unique_ptr< StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > > _bnd_node_range
Definition: MooseMesh.h:914
NodeRange * getActiveNodeRange()
Definition: MooseMesh.C:793
std::unique_ptr< ConstElemRange > _active_local_elem_range
A range for use with threading.
Definition: MooseMesh.h:909
StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
Definition: MooseMesh.C:843
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
Definition: MooseMesh.C:830
std::unique_ptr< SemiLocalNodeRange > _active_semilocal_node_range
Definition: MooseMesh.h:911
std::unique_ptr< ConstNodeRange > _local_node_range
Definition: MooseMesh.h:913

◆ 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 2279 of file MooseMesh.C.

Referenced by BoundaryRestrictable::initializeBoundaryRestrictable().

2280 {
2281  return _mesh_nodeset_ids;
2282 }
std::set< BoundaryID > _mesh_nodeset_ids
Definition: MooseMesh.h:940

◆ 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 2273 of file MooseMesh.C.

Referenced by BoundaryRestrictable::initializeBoundaryRestrictable().

2274 {
2275  return _mesh_sideset_ids;
2276 }
std::set< BoundaryID > _mesh_sideset_ids
Definition: MooseMesh.h:939

◆ 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 1579 of file MooseMesh.C.

1580 {
1581  return minPeriodicVector(nonlinear_var_num, p, q).norm();
1582 }
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:1554

◆ 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 1554 of file MooseMesh.C.

Referenced by minPeriodicDistance().

1555 {
1556  for (unsigned int i = 0; i < dimension(); ++i)
1557  {
1558  // check to see if we're closer in real or periodic space in x, y, and z
1559  if (isTranslatedPeriodic(nonlinear_var_num, i))
1560  {
1561  // Need to test order before differencing
1562  if (p(i) > q(i))
1563  {
1564  if (p(i) - q(i) > _half_range(i))
1565  p(i) -= _half_range(i) * 2;
1566  }
1567  else
1568  {
1569  if (q(i) - p(i) > _half_range(i))
1570  p(i) += _half_range(i) * 2;
1571  }
1572  }
1573  }
1574 
1575  return q - p;
1576 }
RealVectorValue _half_range
A convenience vector used to hold values in each dimension representing half of the range...
Definition: MooseMesh.h:1018
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:1543
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:2099

◆ 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 140 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(), AllSideSetsByNormalsGenerator::AllSideSetsByNormalsGenerator(), 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(), buildRefinementMap(), buildSideList(), 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(), InterfaceKernel::computeElemNeighJacobian(), TimeSequenceStepperBase::computeFailedDT(), IterationAdaptiveDT::computeFailedDT(), TimeStepper::computeFailedDT(), HistogramVectorPostprocessor::computeHistogram(), EqualValueEmbeddedConstraint::computeQpJacobian(), EqualValueEmbeddedConstraint::computeQpOffDiagJacobian(), FEProblemBase::computeResidualInternal(), FEProblemBase::computeResidualTag(), FEProblemBase::computeResidualType(), StatisticsVectorPostprocessor::computeStatValue(), Material::computeSubdomainProperties(), BDF2::computeTimeDerivatives(), ExplicitEuler::computeTimeDerivatives(), ImplicitEuler::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(), PerflogDumper::execute(), MultiAppPostprocessorTransfer::execute(), DiscreteElementUserObject::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), ElementQualityChecker::execute(), NodalValueSampler::execute(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), FindValueOnLine::execute(), TimeExtremeValue::execute(), VectorPostprocessorComparison::execute(), LeastSquaresFit::execute(), LeastSquaresFitHistory::execute(), FEProblemBase::executeControls(), MultiAppVectorPostprocessorTransfer::executeFromMultiapp(), MultiAppVectorPostprocessorTransfer::executeToMultiapp(), Exodus::Exodus(), FileOutput::FileOutput(), CentroidMultiApp::fillPositions(), MultiApp::fillPositions(), VerifyElementUniqueID::finalize(), VerifyNodalUniqueID::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(), ExtraNodesetGenerator::generate(), ElementSubdomainIDGenerator::generate(), RenameBlockGenerator::generate(), RenameBoundaryGenerator::generate(), StitchedMeshGenerator::generate(), GeneratedMeshGenerator::generate(), MeshExtruderGenerator::generate(), SpiralAnnularMeshGenerator::generate(), SideSetsFromBoundingBoxGenerator::generate(), BoundingBoxNodeSetGenerator::generate(), PatternedMeshGenerator::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(), PiecewiseBase::initialSetup(), FullSolveMultiApp::initialSetup(), SolutionAux::initialSetup(), Axisymmetric2D3DSolutionFunction::initialSetup(), Exodus::initialSetup(), SolutionFunction::initialSetup(), SolutionUserObject::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initShowHideLists(), Material::initStatefulProperties(), Function::integral(), InterfaceKernel::InterfaceKernel(), InterfaceTimeKernel::InterfaceTimeKernel(), EigenExecutionerBase::inversePowerIteration(), InversePowerMethod::InversePowerMethod(), IterationAdaptiveDT::IterationAdaptiveDT(), 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(), BreakMeshByBlockBase::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), SmoothMesh::modify(), AssignElementSubdomainID::modify(), ElementDeleterBase::modify(), AddAllSideSetsByNormals::modify(), RenameBlock::modify(), ParsedSubdomainMeshModifier::modify(), ImageSubdomain::modify(), BoundingBoxNodeSet::modify(), OrientedSubdomainBoundingBox::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(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), Exodus::outputSetup(), AdvancedOutput::outputSystemInformation(), Console::outputVectorPostprocessors(), AdvancedOutput::outputVectorPostprocessors(), MooseObject::paramError(), PiecewiseBilinear::parse(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedGenerateSideset::ParsedGenerateSideset(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshGenerator::ParsedSubdomainMeshGenerator(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PatternedMesh::PatternedMesh(), 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(), 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::setOutputDimension(), Split::setup(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), SideSetsFromBoundingBoxGenerator::SideSetsFromBoundingBoxGenerator(), SideSetsFromNormals::SideSetsFromNormals(), SideSetsFromNormalsGenerator::SideSetsFromNormalsGenerator(), SideSetsFromPoints::SideSetsFromPoints(), SideSetsFromPointsGenerator::SideSetsFromPointsGenerator(), SolutionTimeAdaptiveDT::SolutionTimeAdaptiveDT(), SolutionUserObject::SolutionUserObject(), 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(), Transient::Transient(), TransientMultiApp::TransientMultiApp(), 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().

141  {
142  std::ostringstream oss;
143  moose::internal::mooseStreamAll(oss, std::forward<Args>(args)...);
144  std::string msg = oss.str();
145  callMooseErrorRaw(msg, &_app);
146  }
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:171

◆ 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 51 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(), AllSideSetsByNormalsGenerator::AllSideSetsByNormalsGenerator(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), DerivativeParsedMaterialHelper::assembleDerivatives(), AStableDirk4::AStableDirk4(), Function::average(), 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(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::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(), FEProblemBase::getDistribution(), 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(), Sampler::Sampler(), ScalarComponentIC::ScalarComponentIC(), setBoundaryName(), Control::setControllableValue(), Control::setControllableValueByName(), OutputWarehouse::setFileNumbers(), Exodus::setOutputDimension(), 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(), TiledMeshGenerator::TiledMeshGenerator(), Function::timeDerivative(), VectorPostprocessorVisualizationAux::timestepSetup(), TransientMultiApp::TransientMultiApp(), MultiAppTransfer::variableIntegrityCheck(), and AdvancedOutput::wantOutput().

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

◆ 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 2255 of file MooseMesh.C.

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

2256 {
2257  _needs_prepare_for_use = true;
2258 }
bool _needs_prepare_for_use
True if prepare_for_use should be called when Mesh is prepared.
Definition: MooseMesh.h:887

◆ nElem()

dof_id_type MooseMesh::nElem ( ) const
virtual

Definition at line 2187 of file MooseMesh.C.

2188 {
2189  return getMesh().n_elem();
2190 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ nNodes()

dof_id_type MooseMesh::nNodes ( ) const
virtual

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

Definition at line 2181 of file MooseMesh.C.

2182 {
2183  return getMesh().n_nodes();
2184 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ 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 464 of file MooseMesh.C.

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

465 {
466  mooseDeprecated("MooseMesh::node() is deprecated, please use MooseMesh::nodeRef() instead");
467  return nodeRef(i);
468 }
virtual const Node & nodeRef(const dof_id_type i) const
Definition: MooseMesh.C:478
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:155

◆ node() [2/2]

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

Definition at line 471 of file MooseMesh.C.

472 {
473  mooseDeprecated("MooseMesh::node() is deprecated, please use MooseMesh::nodeRef() instead");
474  return nodeRef(i);
475 }
virtual const Node & nodeRef(const dof_id_type i) const
Definition: MooseMesh.C:478
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:155

◆ nodePtr() [1/2]

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

Definition at line 496 of file MooseMesh.C.

Referenced by dataLoad().

497 {
498  if (i > getMesh().max_node_id())
499  return (*_quadrature_nodes.find(i)).second;
500 
501  return getMesh().node_ptr(i);
502 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:960
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ nodePtr() [2/2]

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

Definition at line 505 of file MooseMesh.C.

506 {
507  if (i > getMesh().max_node_id())
508  return _quadrature_nodes[i];
509 
510  return getMesh().node_ptr(i);
511 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:960
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ nodeRef() [1/2]

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

◆ nodeRef() [2/2]

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

Definition at line 487 of file MooseMesh.C.

488 {
489  if (i > getMesh().max_node_id())
490  return *_quadrature_nodes[i];
491 
492  return getMesh().node_ref(i);
493 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:960
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512

◆ nodeToActiveSemilocalElemMap()

const std::map< dof_id_type, std::vector< dof_id_type > > & MooseMesh::nodeToActiveSemilocalElemMap ( )

If not already created, creates a map from every node to all active semilocal elements to which they are connected.

Semilocal elements include local elements and elements that share at least one node with a local element.

Note
Extra ghosted elements are not included in this map!

Definition at line 754 of file MooseMesh.C.

755 {
756  if (!_node_to_active_semilocal_elem_map_built) // Guard the creation with a double checked lock
757  {
758  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
759 
761 
763  {
764  for (const auto & elem :
765  as_range(getMesh().semilocal_elements_begin(), getMesh().semilocal_elements_end()))
766  if (elem->active())
767  for (unsigned int n = 0; n < elem->n_nodes(); n++)
768  _node_to_active_semilocal_elem_map[elem->node_id(n)].push_back(elem->id());
769 
771  true; // MUST be set at the end for double-checked locking to work!
772  }
773  }
774 
776 }
bool _node_to_active_semilocal_elem_map_built
Definition: MooseMesh.h:924
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2512