www.mooseframework.org
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
PatternedMesh Class Reference

Reads one or more 2D mesh files and stitches them together based on a provided two-dimensional pattern array. More...

#include <PatternedMesh.h>

Inheritance diagram for PatternedMesh:
[legend]

Public Types

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

Public Member Functions

 PatternedMesh (const InputParameters &parameters)
 
 PatternedMesh (const PatternedMesh &other_mesh)
 
virtual ~PatternedMesh ()=default
 
virtual std::unique_ptr< MooseMeshsafeClone () const override
 A safer version of the clone() method that hands back an allocated object wrapped in a smart pointer. More...
 
virtual void buildMesh () override
 Must be overridden by child classes. More...
 
virtual MooseMeshclone () const
 Clone method. More...
 
std::unique_ptr< MeshBase > buildMeshBaseObject (ParallelType override_type=ParallelType::DEFAULT)
 Method to construct a libMesh::MeshBase object that is normally set and used by the MooseMesh object during the "init()" phase. More...
 
void setMeshBase (std::unique_ptr< MeshBase > mesh_base)
 Method to set the mesh_base object. More...
 
virtual void init ()
 Initialize the Mesh object. More...
 
virtual unsigned int dimension () const
 Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh mesh object. More...
 
virtual unsigned int effectiveSpatialDimension () const
 Returns the effective spatial dimension determined by the coordinates actually used by the mesh. More...
 
std::vector< BoundaryIDgetBoundaryIDs (const Elem *const elem, const unsigned short int side) const
 Returns a vector of boundary IDs for the requested element on the requested side. More...
 
const std::set< BoundaryID > & getBoundaryIDs () const
 Returns a const reference to a set of all user-specified boundary IDs. More...
 
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...
 
void buildNodeList ()
 Calls BoundaryInfo::build_node_list()/build_side_list() and makes separate copies of Nodes/Elems in those lists. More...
 
void buildBndElemList ()
 
const std::map< dof_id_type, std::vector< dof_id_type > > & nodeToElemMap ()
 If not already created, creates a map from every node to all elements to which they are connected. More...
 
const std::map< dof_id_type, std::vector< dof_id_type > > & nodeToActiveSemilocalElemMap ()
 If not already created, creates a map from every node to all active semilocal elements to which they are connected. More...
 
virtual bnd_node_iterator bndNodesBegin ()
 Return iterators to the beginning/end of the boundary nodes list. More...
 
virtual bnd_node_iterator bndNodesEnd ()
 
virtual bnd_elem_iterator bndElemsBegin ()
 Return iterators to the beginning/end of the boundary elements list. More...
 
virtual bnd_elem_iterator bndElemsEnd ()
 
void buildNodeListFromSideList ()
 Calls BoundaryInfo::build_node_list_from_side_list(). More...
 
void buildSideList (std::vector< dof_id_type > &el, std::vector< unsigned short int > &sl, std::vector< boundary_id_type > &il)
 Calls BoundaryInfo::build_side_list(). More...
 
std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > buildSideList ()
 As above, but uses the non-deprecated std::tuple interface. More...
 
unsigned int sideWithBoundaryID (const Elem *const elem, const BoundaryID boundary_id) const
 Calls BoundaryInfo::side_with_boundary_id(). More...
 
MeshBase::const_node_iterator localNodesBegin ()
 Calls local_nodes_begin/end() on the underlying libMesh mesh object. More...
 
MeshBase::const_node_iterator localNodesEnd ()
 
MeshBase::const_element_iterator activeLocalElementsBegin ()
 Calls active_local_nodes_begin/end() on the underlying libMesh mesh object. More...
 
const MeshBase::const_element_iterator activeLocalElementsEnd ()
 
virtual dof_id_type nNodes () const
 Calls n_nodes/elem() on the underlying libMesh mesh object. More...
 
virtual dof_id_type nElem () const
 
virtual dof_id_type maxNodeId () const
 Calls max_node/elem_id() on the underlying libMesh mesh object. More...
 
virtual dof_id_type maxElemId () const
 
virtual const Node & node (const dof_id_type i) const
 Various accessors (pointers/references) for Node "i". More...
 
virtual Node & node (const dof_id_type i)
 
virtual const Node & nodeRef (const dof_id_type i) const
 
virtual Node & nodeRef (const dof_id_type i)
 
virtual const Node * nodePtr (const dof_id_type i) const
 
virtual Node * nodePtr (const dof_id_type i)
 
virtual const Node * queryNodePtr (const dof_id_type i) const
 
virtual Node * queryNodePtr (const dof_id_type i)
 
virtual Elem * elem (const dof_id_type i)
 Various accessors (pointers/references) for Elem "i". More...
 
virtual const Elem * elem (const dof_id_type i) const
 
virtual Elem * elemPtr (const dof_id_type i)
 
virtual const Elem * elemPtr (const dof_id_type i) const
 
virtual Elem * queryElemPtr (const dof_id_type i)
 
virtual const Elem * queryElemPtr (const dof_id_type i) const
 
bool prepared () const
 Setter/getter for the _is_prepared flag. More...
 
virtual void prepared (bool state)
 
void needsPrepareForUse ()
 If this method is called, we will call libMesh's prepare_for_use method when we call Moose's prepare method. More...
 
void meshChanged ()
 Declares that the MooseMesh has changed, invalidates cached data and rebuilds caches. More...
 
virtual void onMeshChanged ()
 Declares a callback function that is executed at the conclusion of meshChanged(). More...
 
void cacheChangedLists ()
 Cache information about what elements were refined and coarsened in the previous step. More...
 
ConstElemPointerRangerefinedElementRange () const
 Return a range that is suitable for threaded execution over elements that were just refined. More...
 
ConstElemPointerRangecoarsenedElementRange () const
 Return a range that is suitable for threaded execution over elements that were just coarsened. More...
 
const std::vector< const Elem * > & coarsenedElementChildren (const Elem *elem) const
 Get the newly removed children element ids for an element that was just coarsened. More...
 
void updateActiveSemiLocalNodeRange (std::set< dof_id_type > &ghosted_elems)
 Clears the "semi-local" node list and rebuilds it. More...
 
bool isSemiLocal (Node *node)
 Returns true if the node is semi-local. More...
 
const std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > & getBoundariesToElems () const
 Returns a map of boundaries to elements. More...
 
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...
 
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...
 
void needsRemoteElemDeletion (bool need_delete)
 Set whether we need to delete remote elements. More...
 
bool needsRemoteElemDeletion () const
 Whether we need to delete remote elements. 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
 
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 ()
 
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

const std::vector< MeshFileName > & _files
 
const std::vector< std::vector< unsigned int > > & _pattern
 
ReplicatedMesh * _original_mesh
 
std::vector< std::unique_ptr< ReplicatedMesh > > _meshes
 
std::vector< std::unique_ptr< ReplicatedMesh > > _row_meshes
 
const Real _x_width
 
const Real _y_width
 
const Real _z_width
 
std::vector< std::unique_ptr< GhostingFunctor > > _ghosting_functors
 Deprecated (DO NOT USE) More...
 
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
 The list of active geometric relationship managers (bound to the underlying MeshBase object). More...
 
ParallelType _parallel_type
 Can be set to DISTRIBUTED, REPLICATED, or DEFAULT. More...
 
bool _use_distributed_mesh
 False by default. More...
 
bool _distribution_overridden
 
bool _parallel_type_overridden
 
std::unique_ptr< libMesh::MeshBase > _mesh
 Pointer to underlying libMesh mesh object. More...
 
MooseEnum _partitioner_name
 The partitioner used on this mesh. More...
 
bool _partitioner_overridden
 
std::unique_ptr< Partitioner > _custom_partitioner
 The custom partitioner. More...
 
bool _custom_partitioner_requested
 
unsigned int _uniform_refine_level
 The level of uniform refinement requested (set to zero if AMR is disabled) More...
 
bool _is_changed
 true if mesh is changed (i.e. after adaptivity step) More...
 
bool _is_nemesis
 True if a Nemesis Mesh was read in. More...
 
bool _is_prepared
 True if prepare has been called on the mesh. More...
 
bool _needs_prepare_for_use
 True if prepare_for_use should be called when Mesh is prepared. More...
 
std::unique_ptr< ConstElemPointerRange_refined_elements
 The elements that were just refined. More...
 
std::unique_ptr< ConstElemPointerRange_coarsened_elements
 The elements that were just coarsened. More...
 
std::map< const Elem *, std::vector< const Elem * > > _coarsened_element_children
 Map of Parent elements to child elements for elements that were just coarsened. More...
 
std::set< Node * > _semilocal_node_list
 Used for generating the semilocal node range. More...
 
std::unique_ptr< ConstElemRange > _active_local_elem_range
 A range for use with threading. More...
 
std::unique_ptr< SemiLocalNodeRange_active_semilocal_node_range
 
std::unique_ptr< NodeRange > _active_node_range
 
std::unique_ptr< ConstNodeRange > _local_node_range
 
std::unique_ptr< StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > > _bnd_node_range
 
std::unique_ptr< StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > > _bnd_elem_range
 
std::map< dof_id_type, std::vector< dof_id_type > > _node_to_elem_map
 A map of all of the current nodes to the elements that they are connected to. More...
 
bool _node_to_elem_map_built
 
std::map< dof_id_type, std::vector< dof_id_type > > _node_to_active_semilocal_elem_map
 A map of all of the current nodes to the active elements that they are connected to. More...
 
bool _node_to_active_semilocal_elem_map_built
 
std::set< SubdomainID_mesh_subdomains
 A set of subdomain IDs currently present in the mesh. More...
 
std::unique_ptr< std::map< BoundaryID, RealVectorValue > > _boundary_to_normal_map
 The boundary to normal map - valid only when AddAllSideSetsByNormals is active. More...
 
std::vector< BndNode * > _bnd_nodes
 array of boundary nodes More...
 
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_node_ids
 Map of sets of node IDs in each boundary. More...
 
std::vector< BndElement * > _bnd_elems
 array of boundary elems More...
 
std::unordered_map< boundary_id_type, std::unordered_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
 

Detailed Description

Reads one or more 2D mesh files and stitches them together based on a provided two-dimensional pattern array.

Assigns new boundary ids/names to the left, right, top, and bottom boundaries as specified by user. The boundary nodes of the read in meshes must match up relative to the stitching pattern specified by the user – no new nodes are added in order to generate a conforming grid, and non-conforming grids (with nodes in the middle of edges) are not allowed.

Definition at line 36 of file PatternedMesh.h.

Member Typedef Documentation

◆ bnd_elem_iterator_imp

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

Definition at line 1000 of file MooseMesh.h.

◆ bnd_node_iterator_imp

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

Definition at line 993 of file MooseMesh.h.

◆ const_bnd_elem_iterator_imp

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

Definition at line 1001 of file MooseMesh.h.

◆ const_bnd_node_iterator_imp

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

Definition at line 994 of file MooseMesh.h.

◆ PeriodicNodeInfo

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

Helper type for building periodic node maps.

Definition at line 865 of file MooseMesh.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited

Convenience enums.

Enumerator

Definition at line 907 of file MooseMesh.h.

908  {
909  X = 0,
910  Y,
911  Z
912  };

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
MIN 
MAX 

Definition at line 913 of file MooseMesh.h.

914  {
915  MIN = 0,
916  MAX
917  };

◆ ParallelType

enum MooseMesh::ParallelType
stronginherited
Enumerator
DEFAULT 
REPLICATED 
DISTRIBUTED 

Definition at line 87 of file MooseMesh.h.

88  {
89  DEFAULT,
90  REPLICATED,
91  DISTRIBUTED
92  };

Constructor & Destructor Documentation

◆ PatternedMesh() [1/2]

PatternedMesh::PatternedMesh ( const InputParameters parameters)

Definition at line 56 of file PatternedMesh.C.

58  _files(getParam<std::vector<MeshFileName>>("files")),
59  _pattern(getParam<std::vector<std::vector<unsigned int>>>("pattern")),
60  _x_width(getParam<Real>("x_width")),
61  _y_width(getParam<Real>("y_width")),
62  _z_width(getParam<Real>("z_width"))
63 {
64  // The PatternedMesh class only works with ReplicatedMesh
65  errorIfDistributedMesh("PatternedMesh");
66 
67  _meshes.reserve(_files.size());
68 }
std::vector< std::unique_ptr< ReplicatedMesh > > _meshes
Definition: PatternedMesh.h:58
const Real _y_width
Definition: PatternedMesh.h:64
MooseMesh(const InputParameters &parameters)
Typical "Moose-style" constructor and copy constructor.
Definition: MooseMesh.C:152
const Real _z_width
Definition: PatternedMesh.h:65
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseObject.h:188
const std::vector< MeshFileName > & _files
Definition: PatternedMesh.h:49
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.
Definition: MooseMesh.C:2687
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
const Real _x_width
Definition: PatternedMesh.h:63
const std::vector< std::vector< unsigned int > > & _pattern
Definition: PatternedMesh.h:52

◆ PatternedMesh() [2/2]

PatternedMesh::PatternedMesh ( const PatternedMesh other_mesh)

Definition at line 70 of file PatternedMesh.C.

71  : MooseMesh(other_mesh),
72  _files(other_mesh._files),
73  _pattern(other_mesh._pattern),
74  _x_width(other_mesh._x_width),
75  _y_width(other_mesh._y_width),
76  _z_width(other_mesh._z_width)
77 {
78 }
const Real _y_width
Definition: PatternedMesh.h:64
MooseMesh(const InputParameters &parameters)
Typical "Moose-style" constructor and copy constructor.
Definition: MooseMesh.C:152
const Real _z_width
Definition: PatternedMesh.h:65
const std::vector< MeshFileName > & _files
Definition: PatternedMesh.h:49
const Real _x_width
Definition: PatternedMesh.h:63
const std::vector< std::vector< unsigned int > > & _pattern
Definition: PatternedMesh.h:52

◆ ~PatternedMesh()

virtual PatternedMesh::~PatternedMesh ( )
virtualdefault

Member Function Documentation

◆ activeLocalElementsBegin()

MeshBase::const_element_iterator MooseMesh::activeLocalElementsBegin ( )
inherited

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

Definition at line 2219 of file MooseMesh.C.

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

2220 {
2221  return getMesh().active_local_elements_begin();
2222 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ activeLocalElementsEnd()

const MeshBase::const_element_iterator MooseMesh::activeLocalElementsEnd ( )
inherited

Definition at line 2225 of file MooseMesh.C.

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

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

◆ addGhostedBoundary()

void MooseMesh::addGhostedBoundary ( BoundaryID  boundary_id)
inherited

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

Definition at line 2375 of file MooseMesh.C.

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

2376 {
2377  _ghosted_boundaries.insert(boundary_id);
2378 }
std::set< unsigned int > _ghosted_boundaries
Definition: MooseMesh.h:1017

◆ addMortarInterface()

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

Definition at line 2760 of file MooseMesh.C.

2764 {
2765  TIME_SECTION(_add_mortar_interface_timer);
2766 
2767  SubdomainID domain_id = getSubdomainID(domain_name);
2768  boundary_id_type master_id = getBoundaryID(master);
2769  boundary_id_type slave_id = getBoundaryID(slave);
2770 
2771  std::unique_ptr<MortarInterface> iface = libmesh_make_unique<MortarInterface>();
2772 
2773  iface->_id = domain_id;
2774  iface->_master = master;
2775  iface->_slave = slave;
2776  iface->_name = name;
2777 
2778  for (auto & elem : as_range(_mesh->level_elements_begin(0), _mesh->level_elements_end(0)))
2779  {
2780  if (elem->subdomain_id() == domain_id)
2781  iface->_elems.push_back(elem);
2782  }
2783 
2784  setSubdomainName(iface->_id, name);
2785 
2786  _mortar_interface.push_back(std::move(iface));
2788  _mortar_interface_by_ids[std::pair<BoundaryID, BoundaryID>(master_id, slave_id)] =
2789  _mortar_interface.back().get();
2790 }
std::map< std::pair< BoundaryID, BoundaryID >, MortarInterface * > _mortar_interface_by_ids
Mortar interfaces mapped though master, slave IDs pairs.
Definition: MooseMesh.h:1048
PerfID _add_mortar_interface_timer
Definition: MooseMesh.h:1196
subdomain_id_type SubdomainID
Definition: MooseTypes.h:160
std::vector< std::unique_ptr< MortarInterface > > _mortar_interface
Definition: MooseMesh.h:1046
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:1120
std::map< std::string, MortarInterface * > _mortar_interface_by_name
Mortar interfaces mapped through their names.
Definition: MooseMesh.h:1045
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:896
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2255
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
Definition: MooseMesh.C:1009
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.
Definition: MooseMesh.C:1077

◆ addPeriodicVariable()

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

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

Referenced by AddPeriodicBCAction::setPeriodicVars().

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

◆ addQuadratureNode()

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

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

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

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

◆ addUniqueNode()

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

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

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

◆ allowRecovery()

void MooseMesh::allowRecovery ( bool  allow)
inlineinherited

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

Definition at line 805 of file MooseMesh.h.

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

◆ bndElemsBegin()

MooseMesh::bnd_elem_iterator MooseMesh::bndElemsBegin ( )
virtualinherited

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

Definition at line 878 of file MooseMesh.C.

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

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

◆ bndElemsEnd()

MooseMesh::bnd_elem_iterator MooseMesh::bndElemsEnd ( )
virtualinherited

Definition at line 886 of file MooseMesh.C.

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

887 {
888  Predicates::NotNull<bnd_elem_iterator_imp> p;
889  return bnd_elem_iterator(_bnd_elems.end(), _bnd_elems.end(), p);
890 }
std::vector< BndElement * > _bnd_elems
array of boundary elems
Definition: MooseMesh.h:999

◆ bndNodesBegin()

MooseMesh::bnd_node_iterator MooseMesh::bndNodesBegin ( )
virtualinherited

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

Definition at line 862 of file MooseMesh.C.

Referenced by MooseMesh::getBoundaryNodeRange().

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

◆ bndNodesEnd()

MooseMesh::bnd_node_iterator MooseMesh::bndNodesEnd ( )
virtualinherited

Definition at line 870 of file MooseMesh.C.

Referenced by MooseMesh::getBoundaryNodeRange().

871 {
872  Predicates::NotNull<bnd_node_iterator_imp> p;
873  return bnd_node_iterator(_bnd_nodes.end(), _bnd_nodes.end(), p);
874 }
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:992

◆ buildBndElemList()

void MooseMesh::buildBndElemList ( )
inherited

Definition at line 669 of file MooseMesh.C.

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

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

◆ buildMesh()

void PatternedMesh::buildMesh ( )
overridevirtual

Must be overridden by child classes.

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

Implements MooseMesh.

Definition at line 87 of file PatternedMesh.C.

88 {
89  // Read in all of the meshes
90  for (MooseIndex(_files) i = 0; i < _files.size(); ++i)
91  {
92  _meshes.emplace_back(libmesh_make_unique<ReplicatedMesh>(_communicator));
93  auto & mesh = _meshes.back();
94 
95  mesh->read(_files[i]);
96  }
97 
98  // Create a mesh for all n-1 rows, the first row is the original mesh
99  _row_meshes.reserve(_pattern.size() - 1);
100  for (MooseIndex(_pattern) i = 0; i < _pattern.size() - 1; ++i)
101  _row_meshes.emplace_back(libmesh_make_unique<ReplicatedMesh>(_communicator));
102 
103  // Local pointers to simplify algorithm
104  std::vector<ReplicatedMesh *> row_meshes;
105  row_meshes.reserve(_pattern.size());
106  // First row is the original mesh
107  row_meshes.push_back(static_cast<ReplicatedMesh *>(&getMesh()));
108  // Copy the remaining raw pointers into the local vector
109  for (const auto & row_mesh : _row_meshes)
110  row_meshes.push_back(row_mesh.get());
111 
112  BoundaryID left = getBoundaryID(getParam<BoundaryName>("left_boundary"));
113  BoundaryID right = getBoundaryID(getParam<BoundaryName>("right_boundary"));
114  BoundaryID top = getBoundaryID(getParam<BoundaryName>("top_boundary"));
115  BoundaryID bottom = getBoundaryID(getParam<BoundaryName>("bottom_boundary"));
116 
117  // Build each row mesh
118  for (MooseIndex(_pattern) i = 0; i < _pattern.size(); ++i)
119  for (MooseIndex(_pattern) j = 0; j < _pattern[i].size(); ++j)
120  {
121  Real deltax = j * _x_width, deltay = i * _y_width;
122 
123  // If this is the first cell of the row initialize the row mesh
124  if (j == 0)
125  {
126  row_meshes[i]->read(_files[_pattern[i][j]]);
127 
128  MeshTools::Modification::translate(*row_meshes[i], deltax, -deltay, 0);
129 
130  continue;
131  }
132 
133  ReplicatedMesh & cell_mesh = *_meshes[_pattern[i][j]];
134 
135  // Move the mesh into the right spot. -i because we are starting at the top
136  MeshTools::Modification::translate(cell_mesh, deltax, -deltay, 0);
137 
138  row_meshes[i]->stitch_meshes(dynamic_cast<ReplicatedMesh &>(cell_mesh),
139  right,
140  left,
141  TOLERANCE,
142  /*clear_stitched_boundary_ids=*/true);
143 
144  // Undo the translation
145  MeshTools::Modification::translate(cell_mesh, -deltax, deltay, 0);
146  }
147 
148  // Now stitch together the rows
149  // We're going to stitch them all to row 0 (which is the real mesh)
150  for (MooseIndex(_pattern) i = 1; i < _pattern.size(); i++)
151  row_meshes[0]->stitch_meshes(
152  *row_meshes[i], bottom, top, TOLERANCE, /*clear_stitched_boundary_ids=*/true);
153 }
std::vector< std::unique_ptr< ReplicatedMesh > > _meshes
Definition: PatternedMesh.h:58
const Real _y_width
Definition: PatternedMesh.h:64
const std::vector< MeshFileName > & _files
Definition: PatternedMesh.h:49
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569
const Real _x_width
Definition: PatternedMesh.h:63
const std::vector< std::vector< unsigned int > > & _pattern
Definition: PatternedMesh.h:52
std::vector< std::unique_ptr< ReplicatedMesh > > _row_meshes
Definition: PatternedMesh.h:61
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
Definition: MooseMesh.C:1009
boundary_id_type BoundaryID
Definition: MooseTypes.h:158

◆ buildMeshBaseObject()

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

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

Definition at line 1971 of file MooseMesh.C.

Referenced by MooseMesh::init().

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

◆ buildNodeList()

void MooseMesh::buildNodeList ( )
inherited

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

Referenced by MooseMesh::update().

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

◆ buildNodeListFromSideList()

void MooseMesh::buildNodeListFromSideList ( )
inherited

Calls BoundaryInfo::build_node_list_from_side_list().

Definition at line 2169 of file MooseMesh.C.

Referenced by MooseMesh::prepare(), and MooseMesh::update().

2170 {
2172  getMesh().get_boundary_info().build_node_list_from_side_list();
2173 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569
bool _construct_node_list_from_side_list
Whether or not to allow generation of nodesets from sidesets.
Definition: MooseMesh.h:1166

◆ buildPeriodicNodeMap()

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

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

Definition at line 1173 of file MooseMesh.C.

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

◆ buildPeriodicNodeSets()

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

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

Definition at line 1258 of file MooseMesh.C.

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

◆ buildRefinementAndCoarseningMaps()

void MooseMesh::buildRefinementAndCoarseningMaps ( Assembly assembly)
inherited

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

Referenced by FEProblemBase::initialSetup().

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

◆ buildSideList() [1/2]

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

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

Referenced by PenetrationLocator::detectPenetration(), and InterfaceQpValueUserObject::initialize().

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

◆ buildSideList() [2/2]

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

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

Definition at line 2195 of file MooseMesh.C.

2196 {
2197  return getMesh().get_boundary_info().build_side_list();
2198 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ cacheChangedLists()

void MooseMesh::cacheChangedLists ( )
inherited

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

Definition at line 523 of file MooseMesh.C.

Referenced by FEProblemBase::meshChangedHelper().

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

◆ cacheInfo()

void MooseMesh::cacheInfo ( )
protectedinherited

Definition at line 822 of file MooseMesh.C.

Referenced by MooseMesh::update().

823 {
824  TIME_SECTION(_cache_info_timer);
825 
826  // TODO: Thread this!
827  for (const auto & elem : getMesh().element_ptr_range())
828  {
829  SubdomainID subdomain_id = elem->subdomain_id();
830 
831  for (unsigned int side = 0; side < elem->n_sides(); side++)
832  {
833  std::vector<BoundaryID> boundaryids = getBoundaryIDs(elem, side);
834 
835  std::set<BoundaryID> & subdomain_set = _subdomain_boundary_ids[subdomain_id];
836 
837  subdomain_set.insert(boundaryids.begin(), boundaryids.end());
838  }
839 
840  for (unsigned int nd = 0; nd < elem->n_nodes(); ++nd)
841  {
842  Node & node = *elem->node_ptr(nd);
843  _block_node_list[node.id()].insert(elem->subdomain_id());
844  }
845  }
846 }
const std::set< BoundaryID > & getBoundaryIDs() const
Returns a const reference to a set of all user-specified boundary IDs.
Definition: MooseMesh.C:2163
subdomain_id_type SubdomainID
Definition: MooseTypes.h:160
std::map< dof_id_type, std::set< SubdomainID > > _block_node_list
list of nodes that belongs to a specified block (domain)
Definition: MooseMesh.h:1012
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569
PerfID _cache_info_timer
Definition: MooseMesh.h:1183
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:1160
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:424
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2255

◆ changeBoundaryId()

void MooseMesh::changeBoundaryId ( const boundary_id_type  old_id,
const boundary_id_type  new_id,
bool  delete_prev 
)
inherited

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

Referenced by MeshExtruder::changeID().

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

◆ clearQuadratureNodes()

void MooseMesh::clearQuadratureNodes ( )
inherited

Clear out any existing quadrature nodes.

Most likely called before re-adding them.

Definition at line 997 of file MooseMesh.C.

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

998 {
999  // Delete all the quadrature nodes
1000  for (auto & it : _quadrature_nodes)
1001  delete it.second;
1002 
1003  _quadrature_nodes.clear();
1005  _extra_bnd_nodes.clear();
1006 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:1006
std::vector< BndNode > _extra_bnd_nodes
Definition: MooseMesh.h:1009
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:1008

◆ clone()

MooseMesh & MooseMesh::clone ( ) const
virtualinherited

Clone method.

Allocates memory you are responsible to clean up.

Definition at line 1965 of file MooseMesh.C.

Referenced by TiledMesh::buildMesh().

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

◆ coarsenedElementChildren()

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

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

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

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

◆ coarsenedElementRange()

ConstElemPointerRange * MooseMesh::coarsenedElementRange ( ) const
inherited

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

Referenced by FEProblemBase::meshChangedHelper().

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

◆ 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 271 of file Restartable.h.

272 {
273  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
274 
275  registerRecoverableDataOnApp(full_name);
276 
277  return declareRestartableDataWithContext<T>(data_name, nullptr);
278 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:196
std::string _restartable_name
The name of the object.
Definition: Restartable.h:193
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 282 of file Restartable.h.

283 {
284  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
285 
286  registerRecoverableDataOnApp(full_name);
287 
288  return declareRestartableDataWithContext<T>(data_name, init_value, nullptr);
289 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:196
std::string _restartable_name
The name of the object.
Definition: Restartable.h:193
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 204 of file Restartable.h.

205 {
206  return declareRestartableDataWithContext<T>(data_name, nullptr);
207 }

◆ 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 211 of file Restartable.h.

212 {
213  return declareRestartableDataWithContext<T>(data_name, init_value, nullptr);
214 }

◆ 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 218 of file Restartable.h.

219 {
220  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
221  auto data_ptr = libmesh_make_unique<RestartableData<T>>(full_name, context);
222  T & restartable_data_ref = data_ptr->get();
223 
224  registerRestartableDataOnApp(full_name, std::move(data_ptr), _restartable_tid);
225 
226  return restartable_data_ref;
227 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:196
std::string _restartable_name
The name of the object.
Definition: Restartable.h:193
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:199
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 231 of file Restartable.h.

234 {
235  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
236  auto data_ptr = libmesh_make_unique<RestartableData<T>>(full_name, context);
237  data_ptr->set() = init_value;
238 
239  T & restartable_data_ref = data_ptr->get();
240  registerRestartableDataOnApp(full_name, std::move(data_ptr), _restartable_tid);
241 
242  return restartable_data_ref;
243 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:196
std::string _restartable_name
The name of the object.
Definition: Restartable.h:193
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:199
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 247 of file Restartable.h.

248 {
249  return declareRestartableDataWithObjectNameWithContext<T>(data_name, object_name, nullptr);
250 }

◆ 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 254 of file Restartable.h.

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

◆ detectOrthogonalDimRanges()

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

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

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

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

◆ dimension()

unsigned int MooseMesh::dimension ( ) const
virtualinherited

◆ dimensionWidth()

Real MooseMesh::dimensionWidth ( unsigned int  component) const
inherited

Returns the width of the requested dimension.

Definition at line 1462 of file MooseMesh.C.

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

1463 {
1464  return getMaxInDimension(component) - getMinInDimension(component);
1465 }
virtual Real getMaxInDimension(unsigned int component) const
Definition: MooseMesh.C:1477
virtual Real getMinInDimension(unsigned int component) const
Returns the min or max of the requested dimension respectively.
Definition: MooseMesh.C:1468

◆ effectiveSpatialDimension()

unsigned int MooseMesh::effectiveSpatialDimension ( ) const
virtualinherited

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

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

Definition at line 2141 of file MooseMesh.C.

Referenced by Exodus::setOutputDimensionInExodusWriter().

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

◆ elem() [1/2]

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

◆ elem() [2/2]

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

Definition at line 2262 of file MooseMesh.C.

2263 {
2264  mooseDeprecated("MooseMesh::elem() is deprecated, please use MooseMesh::elemPtr() instead");
2265  return elemPtr(i);
2266 }
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:2269
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:158

◆ elemPtr() [1/2]

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

◆ elemPtr() [2/2]

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

Definition at line 2275 of file MooseMesh.C.

2276 {
2277  return getMesh().elem_ptr(i);
2278 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ enabled()

virtual bool MooseObject::enabled ( ) const
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 96 of file MooseObject.h.

Referenced by EigenKernel::enabled().

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

◆ errorIfDistributedMesh()

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

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

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

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

◆ exReader()

ExodusII_IO * MooseMesh::exReader ( ) const
virtualinherited

Not implemented – always returns NULL.

Reimplemented in FileMesh.

Definition at line 2583 of file MooseMesh.C.

Referenced by FEProblemBase::initialSetup().

2584 {
2585  // TODO: Implement or remove
2586  return nullptr;
2587 }

◆ freeBndElems()

void MooseMesh::freeBndElems ( )
protectedinherited

Definition at line 332 of file MooseMesh.C.

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

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

◆ freeBndNodes()

void MooseMesh::freeBndNodes ( )
protectedinherited

Definition at line 314 of file MooseMesh.C.

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

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

◆ getActiveLocalElementRange()

ConstElemRange * MooseMesh::getActiveLocalElementRange ( )
inherited

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

Definition at line 739 of file MooseMesh.C.

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

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

◆ getActiveNodeRange()

NodeRange * MooseMesh::getActiveNodeRange ( )
inherited

Definition at line 753 of file MooseMesh.C.

Referenced by MooseMesh::meshChanged().

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

◆ getActiveSemiLocalNodeRange()

SemiLocalNodeRange * MooseMesh::getActiveSemiLocalNodeRange ( ) const
inherited

Definition at line 767 of file MooseMesh.C.

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

◆ getBoundariesToElems()

const std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > & MooseMesh::getBoundariesToElems ( ) const
inherited

Returns a map of boundaries to elements.

Definition at line 816 of file MooseMesh.C.

817 {
818  return _bnd_elem_ids;
819 }
std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > _bnd_elem_ids
Map of set of elem IDs connected to each boundary.
Definition: MooseMesh.h:1004

◆ getBoundaryElementRange()

ConstBndElemRange * MooseMesh::getBoundaryElementRange ( )
inherited

Definition at line 803 of file MooseMesh.C.

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

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

◆ getBoundaryID()

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

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

Referenced by AddPeriodicBCAction::act(), MooseMesh::addMortarInterface(), ConstraintWarehouse::addObject(), TiledMesh::buildMesh(), StitchedMesh::buildMesh(), 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().

1010 {
1011  if (boundary_name == "ANY_BOUNDARY_ID")
1012  mooseError("Please use getBoundaryIDs() when passing \"ANY_BOUNDARY_ID\"");
1013 
1015  std::istringstream ss(boundary_name);
1016 
1017  if (!(ss >> id))
1018  id = getMesh().get_boundary_info().get_id_by_name(boundary_name);
1019 
1020  return id;
1021 }
const BoundaryID INVALID_BOUNDARY_ID
Definition: MooseTypes.C:18
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569
boundary_id_type BoundaryID
Definition: MooseTypes.h:158

◆ getBoundaryIDs() [1/3]

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

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

Definition at line 2155 of file MooseMesh.C.

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

2156 {
2157  std::vector<BoundaryID> ids;
2158  getMesh().get_boundary_info().boundary_ids(elem, side, ids);
2159  return ids;
2160 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2255

◆ getBoundaryIDs() [2/3]

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

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

Referenced by MooseMesh::cacheInfo().

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

◆ getBoundaryIDs() [3/3]

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

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

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

◆ getBoundaryName()

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

Return the name of the boundary given the id.

Definition at line 1148 of file MooseMesh.C.

Referenced by MaterialPropertyDebugOutput::printMaterialMap().

1149 {
1150  BoundaryInfo & boundary_info = getMesh().get_boundary_info();
1151 
1152  std::vector<BoundaryID> side_boundaries;
1153  boundary_info.build_side_boundary_ids(side_boundaries);
1154 
1155  // We need to figure out if this boundary is a sideset or nodeset
1156  if (std::find(side_boundaries.begin(), side_boundaries.end(), boundary_id) !=
1157  side_boundaries.end())
1158  return boundary_info.get_sideset_name(boundary_id);
1159  else
1160  return boundary_info.get_nodeset_name(boundary_id);
1161 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ getBoundaryNodeRange()

ConstBndNodeRange * MooseMesh::getBoundaryNodeRange ( )
inherited

Definition at line 790 of file MooseMesh.C.

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

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

◆ getCheckedPointerParam()

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

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

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

Definition at line 77 of file MooseObject.h.

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

◆ getCoarseningMap()

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

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

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

1734 {
1735  std::pair<int, ElemType> the_pair(input_side, elem.type());
1736 
1737  if (_elem_type_to_coarsening_map.find(the_pair) == _elem_type_to_coarsening_map.end())
1738  mooseError("Could not find a suitable qp refinement map!");
1739 
1740  return _elem_type_to_coarsening_map[the_pair];
1741 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< std::pair< int, ElemType >, std::vector< std::pair< unsigned int, QpMap > > > _elem_type_to_coarsening_map
Holds mappings for volume to volume and parent side to child side.
Definition: MooseMesh.h:1157
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2255

◆ getFileName()

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

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

862 { return ""; }

◆ getGhostedBoundaries()

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

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

Definition at line 2387 of file MooseMesh.C.

2388 {
2389  return _ghosted_boundaries;
2390 }
std::set< unsigned int > _ghosted_boundaries
Definition: MooseMesh.h:1017

◆ getGhostedBoundaryInflation()

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

Return a writable reference to the _ghosted_boundaries_inflation vector.

Definition at line 2393 of file MooseMesh.C.

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

2394 {
2396 }
std::vector< Real > _ghosted_boundaries_inflation
Definition: MooseMesh.h:1018

◆ getGhostingPatchSize()

unsigned int MooseMesh::getGhostingPatchSize ( ) const
inlineinherited

Getter for the ghosting_patch_size parameter.

Definition at line 475 of file MooseMesh.h.

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

475 { 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:1024

◆ getInflatedProcessorBoundingBox()

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

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

Referenced by PointSamplerBase::execute().

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

◆ getLocalNodeRange()

ConstNodeRange * MooseMesh::getLocalNodeRange ( )
inherited

Definition at line 776 of file MooseMesh.C.

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

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

◆ getMaxInDimension()

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

Reimplemented in AnnularMesh, DistributedGeneratedMesh, and GeneratedMesh.

Definition at line 1477 of file MooseMesh.C.

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

1478 {
1479  mooseAssert(_mesh, "The MeshBase has not been constructed");
1480  mooseAssert(component < _bounds.size(), "Requested dimension out of bounds");
1481 
1482  return _bounds[component][MAX];
1483 }
std::vector< std::vector< Real > > _bounds
The bounds in each dimension of the mesh for regular orthogonal meshes.
Definition: MooseMesh.h:1039
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:896

◆ getMaxLeafSize()

unsigned int MooseMesh::getMaxLeafSize ( ) const
inlineinherited

Getter for the maximum leaf size parameter.

Definition at line 480 of file MooseMesh.h.

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

480 { return _max_leaf_size; };
unsigned int _max_leaf_size
Definition: MooseMesh.h:1027

◆ getMesh() [1/2]

MeshBase & MooseMesh::getMesh ( )
inherited

Accessor for the underlying libMesh Mesh object.

Definition at line 2569 of file MooseMesh.C.

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

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

◆ getMesh() [2/2]

const MeshBase & MooseMesh::getMesh ( ) const
inherited

Definition at line 2576 of file MooseMesh.C.

2577 {
2578  mooseAssert(_mesh, "Mesh hasn't been created");
2579  return *_mesh;
2580 }
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:896

◆ getMinInDimension()

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

Returns the min or max of the requested dimension respectively.

Reimplemented in AnnularMesh, DistributedGeneratedMesh, and GeneratedMesh.

Definition at line 1468 of file MooseMesh.C.

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

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

◆ getMooseApp()

MooseApp& MooseObject::getMooseApp ( ) const
inlineinherited

Get the MooseApp this object is associated with.

Definition at line 91 of file MooseObject.h.

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

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

◆ getMortarInterface()

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

Definition at line 2708 of file MooseMesh.C.

Referenced by GeometricSearchData::generateMortarNodes().

2709 {
2710  std::map<std::pair<BoundaryID, BoundaryID>, MortarInterface *>::iterator it =
2711  _mortar_interface_by_ids.find(std::pair<BoundaryID, BoundaryID>(master, slave));
2712  if (it != _mortar_interface_by_ids.end())
2713  return (*it).second;
2714  else
2715  mooseError(
2716  "Requesting non-existing mortar interface (master = ", master, ", slave = ", slave, ").");
2717 }
std::map< std::pair< BoundaryID, BoundaryID >, MortarInterface * > _mortar_interface_by_ids
Mortar interfaces mapped though master, slave IDs pairs.
Definition: MooseMesh.h:1048
void mooseError(Args &&... args) const
Definition: MooseObject.h:144

◆ getMortarInterfaceByName()

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

Definition at line 2698 of file MooseMesh.C.

2699 {
2700  std::map<std::string, MortarInterface *>::iterator it = _mortar_interface_by_name.find(name);
2701  if (it != _mortar_interface_by_name.end())
2702  return (*it).second;
2703  else
2704  mooseError("Requesting non-existent mortar interface '", name, "'.");
2705 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< std::string, MortarInterface * > _mortar_interface_by_name
Mortar interfaces mapped through their names.
Definition: MooseMesh.h:1045
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ getMortarInterfaces()

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

◆ getNodeBlockIds()

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

Return list of blocks to which the given node belongs.

Definition at line 849 of file MooseMesh.C.

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

850 {
851  std::map<dof_id_type, std::set<SubdomainID>>::const_iterator it =
852  _block_node_list.find(node.id());
853 
854  if (it == _block_node_list.end())
855  mooseError("Unable to find node: ", node.id(), " in any block list.");
856 
857  return it->second;
858 }
std::map< dof_id_type, std::set< SubdomainID > > _block_node_list
list of nodes that belongs to a specified block (domain)
Definition: MooseMesh.h:1012
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
virtual const Node & node(const dof_id_type i) const
Various accessors (pointers/references) for Node "i".
Definition: MooseMesh.C:424

◆ getNodeList()

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

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

Definition at line 2596 of file MooseMesh.C.

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

2597 {
2598  std::map<boundary_id_type, std::vector<dof_id_type>>::const_iterator it =
2599  _node_set_nodes.find(nodeset_id);
2600 
2601  if (it == _node_set_nodes.end())
2602  {
2603  // On a distributed mesh we might not know about a remote nodeset,
2604  // so we'll return an empty vector and hope the nodeset exists
2605  // elsewhere.
2606  if (!getMesh().is_serial())
2607  {
2608  static const std::vector<dof_id_type> empty_vec;
2609  return empty_vec;
2610  }
2611  // On a replicated mesh we should know about every nodeset and if
2612  // we're asked for one that doesn't exist then it must be a bug.
2613  else
2614  {
2615  mooseError("Unable to nodeset ID: ", nodeset_id, '.');
2616  }
2617  }
2618 
2619  return it->second;
2620 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< boundary_id_type, std::vector< dof_id_type > > _node_set_nodes
list of nodes that belongs to a specified nodeset: indexing [nodeset_id] -> [array of node ids] ...
Definition: MooseMesh.h:1015
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ getNormalByBoundaryID()

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

Returns the normal vector associated with a given BoundaryID.

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

Definition at line 1955 of file MooseMesh.C.

1956 {
1957  mooseAssert(_boundary_to_normal_map.get() != nullptr, "Boundary To Normal Map not built!");
1958 
1959  // Note: Boundaries that are not in the map (existing boundaries) will default
1960  // construct a new RealVectorValue - (x,y,z)=(0, 0, 0)
1961  return (*_boundary_to_normal_map)[id];
1962 }
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:989

◆ getPairedBoundaryMapping()

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

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

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

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

◆ getParam()

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

Retrieve a parameter for the object.

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

Definition at line 188 of file MooseObject.h.

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

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

◆ getPatchSize()

unsigned int MooseMesh::getPatchSize ( ) const
inherited

Getter for the patch_size parameter.

Definition at line 2528 of file MooseMesh.C.

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

2529 {
2530  return _patch_size;
2531 }
unsigned int _patch_size
The number of nodes to consider in the NearestNode neighborhood.
Definition: MooseMesh.h:1021

◆ getPatchUpdateStrategy()

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

Get the current patch update strategy.

Definition at line 2540 of file MooseMesh.C.

Referenced by FEProblemBase::possiblyRebuildGeomSearchPatches().

2541 {
2542  return _patch_update_strategy;
2543 }
Moose::PatchUpdateType _patch_update_strategy
The patch update strategy.
Definition: MooseMesh.h:1030

◆ getPointLocator()

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

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

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

2755 {
2756  return getMesh().sub_point_locator();
2757 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ getQuadratureNode()

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

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

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

982 {
983  mooseAssert(_elem_to_side_to_qp_to_quadrature_nodes.find(elem->id()) !=
985  "Elem has no quadrature nodes!");
986  mooseAssert(_elem_to_side_to_qp_to_quadrature_nodes[elem->id()].find(side) !=
988  "Side has no quadrature nodes!");
989  mooseAssert(_elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side].find(qp) !=
991  "qp not found on side!");
992 
993  return _elem_to_side_to_qp_to_quadrature_nodes[elem->id()][side][qp];
994 }
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:1008
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2255

◆ getRefinementMap()

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

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

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

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("Could not find a suitable qp refinement map!");
1680 
1681  return _elem_type_to_refinement_map[the_pair];
1682  }
1683  else // Need to map a child side to parent volume qps
1684  {
1685  std::pair<int, int> child_pair(child, child_side);
1686 
1687  if (_elem_type_to_child_side_refinement_map.find(elem.type()) ==
1689  _elem_type_to_child_side_refinement_map[elem.type()].find(child_pair) ==
1691  mooseError("Could not find a suitable qp refinement map!");
1692 
1693  return _elem_type_to_child_side_refinement_map[elem.type()][child_pair];
1694  }
1695 
1702 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< ElemType, std::map< std::pair< int, int >, std::vector< std::vector< QpMap > > > > _elem_type_to_child_side_refinement_map
Holds mappings for "internal" child sides to parent volume. The second key is (child, child_side).
Definition: MooseMesh.h:1153
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2255
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:1149

◆ getSubdomainBoundaryIds()

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

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

Referenced by FEProblemBase::prepareMaterials().

2624 {
2625  std::map<SubdomainID, std::set<BoundaryID>>::const_iterator it =
2626  _subdomain_boundary_ids.find(subdomain_id);
2627 
2628  if (it == _subdomain_boundary_ids.end())
2629  mooseError("Unable to find subdomain ID: ", subdomain_id, '.');
2630 
2631  return it->second;
2632 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< SubdomainID, std::set< BoundaryID > > _subdomain_boundary_ids
Holds a map from subomdain ids to the boundary ids that are attached to it.
Definition: MooseMesh.h:1160

◆ getSubdomainID()

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

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

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

1078 {
1079  if (subdomain_name == "ANY_BLOCK_ID")
1080  mooseError("Please use getSubdomainIDs() when passing \"ANY_BLOCK_ID\"");
1081 
1083  std::istringstream ss(subdomain_name);
1084 
1085  if (!(ss >> id) || !ss.eof())
1086  id = getMesh().get_id_by_name(subdomain_name);
1087 
1088  return id;
1089 }
subdomain_id_type SubdomainID
Definition: MooseTypes.h:160
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
const SubdomainID INVALID_BLOCK_ID
Definition: MooseTypes.C:16
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ getSubdomainIDs()

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

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

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

◆ getSubdomainName()

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

Return the name of a block given an id.

Definition at line 1126 of file MooseMesh.C.

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

1127 {
1128  return getMesh().subdomain_name(subdomain_id);
1129 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ ghostGhostedBoundaries()

void MooseMesh::ghostGhostedBoundaries ( )
inherited

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

Definition at line 2457 of file MooseMesh.C.

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

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

◆ hasSecondOrderElements()

bool MooseMesh::hasSecondOrderElements ( )
inherited

check if the mesh has SECOND order elements

Definition at line 2732 of file MooseMesh.C.

Referenced by Assembly::Assembly().

2733 {
2734  bool mesh_has_second_order_elements = false;
2735  for (auto it = activeLocalElementsBegin(), end = activeLocalElementsEnd(); it != end; ++it)
2736  if ((*it)->default_order() == SECOND)
2737  {
2738  mesh_has_second_order_elements = true;
2739  break;
2740  }
2741 
2742  // We checked our local elements, so take the max over all processors.
2743  comm().max(mesh_has_second_order_elements);
2744  return mesh_has_second_order_elements;
2745 }
MeshBase::const_element_iterator activeLocalElementsBegin()
Calls active_local_nodes_begin/end() on the underlying libMesh mesh object.
Definition: MooseMesh.C:2219
MPI_Comm comm
const MeshBase::const_element_iterator activeLocalElementsEnd()
Definition: MooseMesh.C:2225

◆ init()

void MooseMesh::init ( )
virtualinherited

Initialize the Mesh object.

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

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

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

Definition at line 2034 of file MooseMesh.C.

Referenced by GridPartitioner::_do_partition().

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

◆ isBoundaryElem() [1/2]

bool MooseMesh::isBoundaryElem ( dof_id_type  elem_id) const
inherited

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

Definition at line 2661 of file MooseMesh.C.

2662 {
2663  bool found_elem = false;
2664  for (const auto & it : _bnd_elem_ids)
2665  {
2666  if (it.second.find(elem_id) != it.second.end())
2667  {
2668  found_elem = true;
2669  break;
2670  }
2671  }
2672  return found_elem;
2673 }
std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > _bnd_elem_ids
Map of set of elem IDs connected to each boundary.
Definition: MooseMesh.h:1004

◆ isBoundaryElem() [2/2]

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

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

Definition at line 2676 of file MooseMesh.C.

2677 {
2678  bool found_elem = false;
2679  auto it = _bnd_elem_ids.find(bnd_id);
2680  if (it != _bnd_elem_ids.end())
2681  if (it->second.find(elem_id) != it->second.end())
2682  found_elem = true;
2683  return found_elem;
2684 }
std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > _bnd_elem_ids
Map of set of elem IDs connected to each boundary.
Definition: MooseMesh.h:1004

◆ isBoundaryNode() [1/2]

bool MooseMesh::isBoundaryNode ( dof_id_type  node_id) const
inherited

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

Definition at line 2635 of file MooseMesh.C.

Referenced by NodalNormalsPreprocessor::execute().

2636 {
2637  bool found_node = false;
2638  for (const auto & it : _bnd_node_ids)
2639  {
2640  if (it.second.find(node_id) != it.second.end())
2641  {
2642  found_node = true;
2643  break;
2644  }
2645  }
2646  return found_node;
2647 }
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:996

◆ isBoundaryNode() [2/2]

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

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

Definition at line 2650 of file MooseMesh.C.

2651 {
2652  bool found_node = false;
2653  std::map<boundary_id_type, std::set<dof_id_type>>::const_iterator it = _bnd_node_ids.find(bnd_id);
2654  if (it != _bnd_node_ids.end())
2655  if (it->second.find(node_id) != it->second.end())
2656  found_node = true;
2657  return found_node;
2658 }
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:996

◆ isCustomPartitionerRequested()

bool MooseMesh::isCustomPartitionerRequested ( ) const
inherited

Setter and getter for _custom_partitioner_requested.

Definition at line 2726 of file MooseMesh.C.

2727 {
2729 }
bool _custom_partitioner_requested
Definition: MooseMesh.h:904

◆ isDistributedMesh()

bool MooseMesh::isDistributedMesh ( ) const
inlineinherited

Returns the final Mesh distribution type.

Definition at line 785 of file MooseMesh.h.

Referenced by AddPeriodicBCAction::autoTranslationBoundaries(), VerifyNodalUniqueID::finalize(), VerifyElementUniqueID::finalize(), ConsoleUtils::outputMeshInformation(), and RandomData::updateGenerators().

785 { return _use_distributed_mesh; }
bool _use_distributed_mesh
False by default.
Definition: MooseMesh.h:891

◆ isParallelTypeForced()

bool MooseMesh::isParallelTypeForced ( ) const
inlineinherited

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

Definition at line 790 of file MooseMesh.h.

Referenced by ConsoleUtils::outputMeshInformation().

790 { return _parallel_type_overridden; }
bool _parallel_type_overridden
Definition: MooseMesh.h:893

◆ isParamValid()

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

Test if the supplied parameter is valid.

Parameters
nameThe name of the parameter to test

Definition at line 86 of file MooseObject.h.

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

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

◆ isPartitionerForced()

bool MooseMesh::isPartitionerForced ( ) const
inlineinherited

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

Definition at line 800 of file MooseMesh.h.

Referenced by ConsoleUtils::outputMeshInformation().

800 { return _partitioner_overridden; }
bool _partitioner_overridden
Definition: MooseMesh.h:900

◆ isRegularOrthogonal()

bool MooseMesh::isRegularOrthogonal ( )
inlineinherited

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

Definition at line 847 of file MooseMesh.h.

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

◆ isSemiLocal()

bool MooseMesh::isSemiLocal ( Node *  node)
inherited

Returns true if the node is semi-local.

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

Definition at line 602 of file MooseMesh.C.

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

◆ isTranslatedPeriodic()

bool MooseMesh::isTranslatedPeriodic ( unsigned int  nonlinear_var_num,
unsigned int  component 
) const
inherited

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

Referenced by MooseMesh::minPeriodicVector().

1508 {
1509  mooseAssert(component < dimension(), "Requested dimension out of bounds");
1510 
1511  if (_periodic_dim.find(nonlinear_var_num) != _periodic_dim.end())
1512  return _periodic_dim.at(nonlinear_var_num)[component];
1513  else
1514  return false;
1515 }
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:2135
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:1059

◆ localNodesBegin()

MeshBase::const_node_iterator MooseMesh::localNodesBegin ( )
inherited

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

Definition at line 2207 of file MooseMesh.C.

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

2208 {
2209  return getMesh().local_nodes_begin();
2210 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ localNodesEnd()

MeshBase::const_node_iterator MooseMesh::localNodesEnd ( )
inherited

Definition at line 2213 of file MooseMesh.C.

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

2214 {
2215  return getMesh().local_nodes_end();
2216 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ maxElemId()

dof_id_type MooseMesh::maxElemId ( ) const
virtualinherited

Definition at line 2249 of file MooseMesh.C.

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

2250 {
2251  return getMesh().max_elem_id();
2252 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ maxNodeId()

dof_id_type MooseMesh::maxNodeId ( ) const
virtualinherited

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

2244 {
2245  return getMesh().max_node_id();
2246 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ meshBoundaryIds()

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

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

Definition at line 2324 of file MooseMesh.C.

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

2325 {
2326  return _mesh_boundary_ids;
2327 }
std::set< BoundaryID > _mesh_boundary_ids
A set of boundary IDs currently present in the mesh.
Definition: MooseMesh.h:983

◆ meshChanged()

void MooseMesh::meshChanged ( )
inherited

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

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

493 {
494  TIME_SECTION(_mesh_changed_timer);
495 
496  update();
497 
498  // Delete all of the cached ranges
499  _active_local_elem_range.reset();
500  _active_node_range.reset();
502  _local_node_range.reset();
503  _bnd_node_range.reset();
504  _bnd_elem_range.reset();
505 
506  // Rebuild the ranges
512 
513  // Call the callback function onMeshChanged
514  onMeshChanged();
515 }
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:739
virtual void onMeshChanged()
Declares a callback function that is executed at the conclusion of meshChanged(). ...
Definition: MooseMesh.C:518
ConstNodeRange * getLocalNodeRange()
Definition: MooseMesh.C:776
std::unique_ptr< NodeRange > _active_node_range
Definition: MooseMesh.h:957
std::unique_ptr< StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > > _bnd_elem_range
Definition: MooseMesh.h:961
void update()
Calls buildNodeListFromSideList(), buildNodeList(), and buildBndElemList().
Definition: MooseMesh.C:405
PerfID _mesh_changed_timer
Definition: MooseMesh.h:1171
std::unique_ptr< StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > > _bnd_node_range
Definition: MooseMesh.h:959
NodeRange * getActiveNodeRange()
Definition: MooseMesh.C:753
std::unique_ptr< ConstElemRange > _active_local_elem_range
A range for use with threading.
Definition: MooseMesh.h:954
StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
Definition: MooseMesh.C:803
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
Definition: MooseMesh.C:790
std::unique_ptr< SemiLocalNodeRange > _active_semilocal_node_range
Definition: MooseMesh.h:956
std::unique_ptr< ConstNodeRange > _local_node_range
Definition: MooseMesh.h:958

◆ meshNodesetIds()

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

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

Definition at line 2336 of file MooseMesh.C.

Referenced by BoundaryRestrictable::initializeBoundaryRestrictable().

2337 {
2338  return _mesh_nodeset_ids;
2339 }
std::set< BoundaryID > _mesh_nodeset_ids
Definition: MooseMesh.h:985

◆ meshSidesetIds()

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

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

Definition at line 2330 of file MooseMesh.C.

Referenced by BoundaryRestrictable::initializeBoundaryRestrictable().

2331 {
2332  return _mesh_sideset_ids;
2333 }
std::set< BoundaryID > _mesh_sideset_ids
Definition: MooseMesh.h:984

◆ meshSubdomains()

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

◆ minPeriodicDistance()

Real MooseMesh::minPeriodicDistance ( unsigned int  nonlinear_var_num,
Point  p,
Point  q 
) const
inherited

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

1544 {
1545  return minPeriodicVector(nonlinear_var_num, p, q).norm();
1546 }
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:1518

◆ minPeriodicVector()

RealVectorValue MooseMesh::minPeriodicVector ( unsigned int  nonlinear_var_num,
Point  p,
Point  q 
) const
inherited

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

Referenced by MooseMesh::minPeriodicDistance().

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

◆ mooseDeprecated()

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

◆ mooseError()

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

Definition at line 144 of file MooseObject.h.

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

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

◆ mooseInfo()

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

◆ mooseWarning()

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

◆ name()

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

Get the name of the object.

Returns
The name of the object

Definition at line 56 of file MooseObject.h.

Referenced by GridPartitioner::_do_partition(), FEProblemBase::addADJacobianMaterial(), FEProblemBase::addADResidualMaterial(), Executioner::addAttributeReporter(), DumpObjectsProblem::addAuxKernel(), FEProblemBase::addAuxKernel(), DumpObjectsProblem::addAuxScalarKernel(), FEProblemBase::addAuxScalarKernel(), DumpObjectsProblem::addBoundaryCondition(), FEProblemBase::addBoundaryCondition(), DumpObjectsProblem::addConstraint(), FEProblemBase::addConstraint(), FEProblemBase::addDamper(), DumpObjectsProblem::addDGKernel(), FEProblemBase::addDGKernel(), DumpObjectsProblem::addDiracKernel(), FEProblemBase::addDiracKernel(), FEProblemBase::addDistribution(), DumpObjectsProblem::addFunction(), FEProblemBase::addFunction(), FEProblemBase::addIndicator(), DumpObjectsProblem::addInitialCondition(), FEProblemBase::addInitialCondition(), DumpObjectsProblem::addInterfaceKernel(), FEProblemBase::addInterfaceKernel(), DumpObjectsProblem::addKernel(), FEProblemBase::addKernel(), FEProblemBase::addMarker(), DumpObjectsProblem::addMaterial(), FEProblemBase::addMaterial(), FEProblemBase::addMaterialHelper(), MooseMesh::addMortarInterface(), FEProblemBase::addMultiApp(), DumpObjectsProblem::addNodalKernel(), FEProblemBase::addNodalKernel(), FEProblemBase::addPostprocessor(), FEProblemBase::addPredictor(), CreateDisplacedProblemAction::addProxyAlgebraicRelationshipManagers(), CreateDisplacedProblemAction::addProxyGeometricRelationshipManagers(), FEProblemBase::addSampler(), DumpObjectsProblem::addScalarKernel(), FEProblemBase::addScalarKernel(), FEProblemBase::addTimeIntegrator(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), FEProblemBase::addVectorPostprocessor(), Output::advancedExecuteOn(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), DerivativeParsedMaterialHelper::assembleDerivatives(), AStableDirk4::AStableDirk4(), Function::average(), MultiApp::backup(), BreakMeshByBlockGenerator::BreakMeshByBlockGenerator(), ChangeOverTimePostprocessor::ChangeOverTimePostprocessor(), FEProblemBase::checkDependMaterialsHelper(), Damper::checkMinDamping(), Material::checkStatefulSanity(), CompositeFunction::CompositeFunction(), Material::computeSubdomainProperties(), VectorPostprocessorVisualizationAux::computeValue(), MultiApp::createApp(), FEProblemBase::declareVectorPostprocessorVector(), DOFMapOutput::demangle(), DerivativeSumMaterial::DerivativeSumMaterial(), DGKernelBase::DGKernelBase(), DumpObjectsProblem::dumpObjectHelper(), ElementValueSampler::ElementValueSampler(), MooseMesh::errorIfDistributedMesh(), AB2PredictorCorrector::estimateTimeError(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), StatisticsVectorPostprocessor::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), PointValue::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppNearestNodeTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppVectorPostprocessorTransfer::execute(), HistogramVectorPostprocessor::execute(), MultiAppCopyTransfer::execute(), Exodus::Exodus(), FileOutput::FileOutput(), MultiApp::fillPositions(), PointSamplerBase::finalize(), DerivativeParsedMaterialHelper::findMatPropDerivative(), FunctionDT::FunctionDT(), GeneralUserObject::GeneralUserObject(), LowerDBlockFromSidesetGenerator::generate(), StitchedMeshGenerator::generate(), Material::getADMaterialProperty(), MultiApp::getBoundingBox(), MooseObject::getCheckedPointerParam(), Control::getControllableParameterByName(), Control::getControllableValue(), Control::getControllableValueByName(), DistributionInterface::getDistribution(), FEProblemBase::getDistribution(), DistributionInterface::getDistributionByName(), MultiApp::getExecutioner(), OutputWarehouse::getFileNumbers(), FEProblemBase::getFunction(), SolutionUserObject::getLocalVarIndex(), Marker::getMarkerValue(), FEProblemBase::getMaterial(), NodalPatchRecovery::getMaterialProperty(), Material::getMaterialProperty(), AuxKernelTempl< ComputeValueType >::getMaterialProperty(), SubProblem::getMaterialPropertyBlockNames(), SubProblem::getMaterialPropertyBoundaryNames(), NodalPatchRecovery::getMaterialPropertyOld(), AuxKernelTempl< ComputeValueType >::getMaterialPropertyOld(), Material::getMaterialPropertyOld(), NodalPatchRecovery::getMaterialPropertyOlder(), Material::getMaterialPropertyOlder(), AuxKernelTempl< ComputeValueType >::getMaterialPropertyOlder(), MeshGenerator::getMesh(), MooseMesh::getMortarInterfaceByName(), OutputWarehouse::getOutput(), MooseObject::getParam(), GeneralUserObject::getPostprocessorValue(), FEProblemBase::getPostprocessorValue(), GeneralUserObject::getPostprocessorValueByName(), FEProblemBase::getPostprocessorValueOld(), FEProblemBase::getPostprocessorValueOlder(), FEProblemBase::getSampler(), FEProblemBase::getScatterVectorPostprocessorValue(), FEProblemBase::getScatterVectorPostprocessorValueOld(), Transient::getTimeStepperName(), InitialConditionBase::getUserObject(), FEProblemBase::getUserObject(), InitialConditionBase::getUserObjectBase(), FEProblemBase::getUserObjectBase(), InitialConditionBase::getUserObjectByName(), GeneralUserObject::getVectorPostprocessorValue(), FEProblemBase::getVectorPostprocessorValue(), GeneralUserObject::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(), Registry::isADObj(), MooseObject::isParamValid(), Registry::isRegisteredObj(), 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(), Registry::objData(), DOFMapOutput::output(), Output::Output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), ConsoleUtils::outputOutputInformation(), Nemesis::outputPostprocessors(), Exodus::outputPostprocessors(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), AdvancedOutput::outputVectorPostprocessors(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedGenerateSideset::ParsedGenerateSideset(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshGenerator::ParsedSubdomainMeshGenerator(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PointSamplerBase::PointSamplerBase(), Registry::registerObjectsTo(), FEProblemBase::registerRandomInterface(), Material::resetQpProperties(), MultiApp::restore(), Sampler::Sampler(), ScalarComponentIC::ScalarComponentIC(), MooseMesh::setBoundaryName(), Control::setControllableValue(), Control::setControllableValueByName(), OutputWarehouse::setFileNumbers(), MooseMesh::setSubdomainName(), Split::setup(), TransientMultiApp::setupApp(), SideSetsFromNormalsGenerator::SideSetsFromNormalsGenerator(), SideSetsFromPointsGenerator::SideSetsFromPointsGenerator(), SideValueSampler::SideValueSampler(), TransientMultiApp::solveStep(), SpatialAverageBase::SpatialAverageBase(), UserObject::spatialValue(), StitchedMesh::StitchedMesh(), SubProblem::storeBoundaryDelayedCheckMatProp(), SubProblem::storeBoundaryMatPropName(), SubProblem::storeBoundaryZeroMatProp(), SubProblem::storeSubdomainDelayedCheckMatProp(), SubProblem::storeSubdomainMatPropName(), SubProblem::storeSubdomainZeroMatProp(), TaggingInterface::TaggingInterface(), ThreadedGeneralUserObject::ThreadedGeneralUserObject(), Function::timeDerivative(), VectorPostprocessorVisualizationAux::timestepSetup(), TransientMultiApp::TransientMultiApp(), MultiAppTransfer::variableIntegrityCheck(), and AdvancedOutput::wantOutput().

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

◆ needsPrepareForUse()

void MooseMesh::needsPrepareForUse ( )
inherited

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

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

2313 {
2314  _needs_prepare_for_use = true;
2315 }
bool _needs_prepare_for_use
True if prepare_for_use should be called when Mesh is prepared.
Definition: MooseMesh.h:932

◆ needsRemoteElemDeletion() [1/2]

void MooseMesh::needsRemoteElemDeletion ( bool  need_delete)
inlineinherited

Set whether we need to delete remote elements.

Definition at line 870 of file MooseMesh.h.

870 { _need_delete = need_delete; }
bool _need_delete
Whether we need to delete remote elements after init&#39;ing the EquationSystems.
Definition: MooseMesh.h:1199

◆ needsRemoteElemDeletion() [2/2]

bool MooseMesh::needsRemoteElemDeletion ( ) const
inlineinherited

Whether we need to delete remote elements.

Definition at line 875 of file MooseMesh.h.

875 { return _need_delete; }
bool _need_delete
Whether we need to delete remote elements after init&#39;ing the EquationSystems.
Definition: MooseMesh.h:1199

◆ nElem()

dof_id_type MooseMesh::nElem ( ) const
virtualinherited

Definition at line 2237 of file MooseMesh.C.

2238 {
2239  return getMesh().n_elem();
2240 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ nNodes()

dof_id_type MooseMesh::nNodes ( ) const
virtualinherited

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

Definition at line 2231 of file MooseMesh.C.

2232 {
2233  return getMesh().n_nodes();
2234 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ node() [1/2]

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

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

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

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

◆ node() [2/2]

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

Definition at line 431 of file MooseMesh.C.

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

◆ nodePtr() [1/2]

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

Definition at line 456 of file MooseMesh.C.

Referenced by dataLoad().

457 {
458  if (i > getMesh().max_node_id())
459  return (*_quadrature_nodes.find(i)).second;
460 
461  return getMesh().node_ptr(i);
462 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:1006
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ nodePtr() [2/2]

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

Definition at line 465 of file MooseMesh.C.

466 {
467  if (i > getMesh().max_node_id())
468  return _quadrature_nodes[i];
469 
470  return getMesh().node_ptr(i);
471 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:1006
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ nodeRef() [1/2]

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

◆ nodeRef() [2/2]

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

Definition at line 447 of file MooseMesh.C.

448 {
449  if (i > getMesh().max_node_id())
450  return *_quadrature_nodes[i];
451 
452  return getMesh().node_ref(i);
453 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:1006
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ nodeToActiveSemilocalElemMap()

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

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

715 {
716  if (!_node_to_active_semilocal_elem_map_built) // Guard the creation with a double checked lock
717  {
718  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
719 
721 
723  {
724  for (const auto & elem :
725  as_range(getMesh().semilocal_elements_begin(), getMesh().semilocal_elements_end()))
726  if (elem->active())
727  for (unsigned int n = 0; n < elem->n_nodes(); n++)
728  _node_to_active_semilocal_elem_map[elem->node_id(n)].push_back(elem->id());
729 
731  true; // MUST be set at the end for double-checked locking to work!
732  }
733  }
734 
736 }
bool _node_to_active_semilocal_elem_map_built
Definition: MooseMesh.h:969
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569
PetscInt n
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2255
PerfID _node_to_active_semilocal_elem_map_timer
Definition: MooseMesh.h:1177
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:968

◆ nodeToElemMap()

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

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

Definition at line 692 of file MooseMesh.C.

Referenced by NodalPatchRecovery::compute(), PenetrationLocator::detectPenetration(), DMMooseGetEmbedding_Private(), NonlinearSystemBase::findImplicitGeometricCouplingEntries(), NearestNodeLocator::findNodes(), LinearNodalConstraint::LinearNodalConstraint(), BreakMeshByBlock::modify(), EqualValueBoundaryConstraint::updateConstrainedNodes(), RandomData::updateGenerators(), and NearestNodeLocator::updatePatch().

693 {
694  if (!_node_to_elem_map_built) // Guard the creation with a double checked lock
695  {
696  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
697 
699  {
700  TIME_SECTION(_node_to_elem_map_timer);
701 
702  for (const auto & elem : getMesh().active_element_ptr_range())
703  for (unsigned int n = 0; n < elem->n_nodes(); n++)
704  _node_to_elem_map[elem->node_id(n)].push_back(elem->id());
705 
706  _node_to_elem_map_built = true; // MUST be set at the end for double-checked locking to work!
707  }
708  }
709 
710  return _node_to_elem_map;
711 }
bool _node_to_elem_map_built
Definition: MooseMesh.h:965
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:964
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569
PetscInt n
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2255
PerfID _node_to_elem_map_timer
Definition: MooseMesh.h:1176

◆ onMeshChanged()

void MooseMesh::onMeshChanged ( )
virtualinherited

Declares a callback function that is executed at the conclusion of meshChanged().

Ther user can implement actions required after changing the mesh here.

Definition at line 518 of file MooseMesh.C.

Referenced by MooseMesh::meshChanged().

519 {
520 }

◆ operator const libMesh::MeshBase &()

MooseMesh::operator const libMesh::MeshBase & ( ) const
inherited

Definition at line 2566 of file MooseMesh.C.

2566 { return getMesh(); }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ operator libMesh::MeshBase &()

MooseMesh::operator libMesh::MeshBase & ( )
inherited

Implicit conversion operator from MooseMesh -> libMesh::MeshBase.

Definition at line 2564 of file MooseMesh.C.

2564 { return getMesh(); }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ paramError()

template<typename... Args>
void MooseObject::paramError ( const std::string &  param,
Args...  args 
)
inlineinherited

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.

If this object's parameters were not created directly by the Parser, then this function falls back to the normal behavior of mooseError - only printing a message using the given args.

Definition at line 105 of file MooseObject.h.

Referenced by ADIntegratedBCTempl< T, compute_stage >::ADIntegratedBCTempl(), ADKernelTempl< T, compute_stage >::ADKernelTempl(), ConcentricCircleMeshGenerator::ConcentricCircleMeshGenerator(), DGKernelBase::DGKernelBase(), ElementValueSampler::ElementValueSampler(), StitchedMeshGenerator::generate(), MeshCollectionGenerator::generate(), StackGenerator::generate(), MultiApp::init(), IntegratedBC::IntegratedBC(), Kernel::Kernel(), MeshCollectionGenerator::MeshCollectionGenerator(), NodalBC::NodalBC(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalValueSampler::NodalValueSampler(), RandomIC::RandomIC(), MultiAppCopyTransfer::transfer(), and TransientMultiApp::TransientMultiApp().

105  {
106  auto prefix = param + ": ";
107  if (!_pars.inputLocation(param).empty())
108  prefix = _pars.inputLocation(param) + ": (" + _pars.paramFullpath(param) + "):\n";
109  mooseError(prefix, args...);
110  }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
const std::string & inputLocation(const std::string &param) const
Get/set a string representing the location in the input text the parameter originated from (i...
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:171
const std::string & paramFullpath(const std::string &param) const
Get/set a string representing the full HIT parameter path from the input file (e.g.

◆ parameters()

const InputParameters& MooseObject::parameters ( ) const
inlineinherited

Get the parameters of the object.

Returns
The parameters of the object

Definition at line 62 of file MooseObject.h.

Referenced by FEProblemBase::addADJacobianMaterial(), FEProblemBase::addADResidualMaterial(), 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(), FEProblem::addLineSearch(), FEProblemBase::addMarker(), DumpObjectsProblem::addMaterial(), FEProblemBase::addMaterial(), FEProblemBase::addMaterialHelper(), FEProblemBase::addMultiApp(), DumpObjectsProblem::addNodalKernel(), FEProblemBase::addNodalKernel(), FEProblemBase::addOutput(), FEProblemBase::addPostprocessor(), FEProblemBase::addPredictor(), FEProblemBase::addSampler(), DumpObjectsProblem::addScalarKernel(), FEProblemBase::addScalarKernel(), FEProblemBase::addTimeIntegrator(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), FEProblemBase::addVectorPostprocessor(), ADPiecewiseLinearInterpolationMaterial< compute_stage >::ADPiecewiseLinearInterpolationMaterial(), AdvancedOutput::AdvancedOutput(), assemble_l2(), Moose::assemble_matrix(), AuxKernelTempl< ComputeValueType >::AuxKernelTempl(), AuxScalarKernel::AuxScalarKernel(), BoundsAux::BoundsAux(), LibmeshPartitioner::clone(), OversampleOutput::cloneMesh(), Moose::compute_bounds(), Moose::compute_jacobian(), Moose::compute_nearnullspace(), Moose::compute_nullspace(), Moose::compute_postcheck(), Moose::compute_transpose_nullspace(), Console::Console(), DumpObjectsProblem::deduceNecessaryParameters(), DumpObjectsProblem::dumpObjectHelper(), EigenProblem::EigenProblem(), Eigenvalue::Eigenvalue(), Exodus::Exodus(), FEProblem::FEProblem(), GapValueAux::GapValueAux(), MooseObject::getCheckedPointerParam(), GhostingUserObject::GhostingUserObject(), MooseMesh::init(), BlockRestrictable::initializeBlockRestrictable(), FEProblemBase::initNullSpaceVectors(), InterfaceKernel::InterfaceKernel(), isValid(), LayeredSideIntegral::LayeredSideIntegral(), MooseVariableInterface< Real >::MooseVariableInterface(), NearestPointBase< LayeredAverage >::NearestPointBase(), NodeFaceConstraint::NodeFaceConstraint(), PenetrationAux::PenetrationAux(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), MultiAppProjectionTransfer::projectSolution(), RandomIC::RandomIC(), InputParameterWarehouse::removeInputParameters(), FEProblem::setInputParametersFEProblem(), FEProblemBase::setInputParametersFEProblem(), DumpObjectsProblem::stringifyParameters(), and Transient::Transient().

62 { return _pars; }
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:171

◆ paramInfo()

template<typename... Args>
void MooseObject::paramInfo ( const std::string &  param,
Args...  args 
)
inlineinherited

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.

If this object's parameters were not created directly by the Parser, then this function falls back to the normal behavior of mooseInfo - only printing a message using the given args.

Definition at line 135 of file MooseObject.h.

Referenced by TransientMultiApp::TransientMultiApp().

136  {
137  auto prefix = param + ": ";
138  if (!_pars.inputLocation(param).empty())
139  prefix = _pars.inputLocation(param) + ": (" + _pars.paramFullpath(param) + "):\n";
140  mooseInfo(prefix, args...);
141  }
const std::string & inputLocation(const std::string &param) const
Get/set a string representing the location in the input text the parameter originated from (i...
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:171
void mooseInfo(Args &&... args) const
Definition: MooseObject.h:164
const std::string & paramFullpath(const std::string &param) const
Get/set a string representing the full HIT parameter path from the input file (e.g.

◆ paramWarning()

template<typename... Args>
void MooseObject::paramWarning ( const std::string &  param,
Args...  args 
)
inlineinherited

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.

If this object's parameters were not created directly by the Parser, then this function falls back to the normal behavior of mooseWarning - only printing a message using the given args.

Definition at line 119 of file MooseObject.h.

120  {
121  auto prefix = param + ": ";
122  if (!_pars.inputLocation(param).empty())
123  prefix = _pars.inputLocation(param) + ": (" + _pars.paramFullpath(param) + "):\n";
124  mooseWarning(prefix, args...);
125  }
void mooseWarning(Args &&... args) const
Definition: MooseObject.h:152
const std::string & inputLocation(const std::string &param) const
Get/set a string representing the location in the input text the parameter originated from (i...
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:171
const std::string & paramFullpath(const std::string &param) const
Get/set a string representing the full HIT parameter path from the input file (e.g.

◆ partitionerName()

const MooseEnum& MooseMesh::partitionerName ( ) const
inlineinherited

Definition at line 795 of file MooseMesh.h.

Referenced by ConsoleUtils::outputMeshInformation().

795 { return _partitioner_name; }
MooseEnum _partitioner_name
The partitioner used on this mesh.
Definition: MooseMesh.h:899

◆ prepare()

void MooseMesh::prepare ( bool  force = false)
inherited

Calls prepare_for_use() if force=true on the underlying Mesh object, then communicates various boundary information on parallel meshes.

Also calls update() internally.

Definition at line 345 of file MooseMesh.C.

Referenced by SetupMeshCompleteAction::completeSetup(), and MeshModifier::modifyMeshHelper().

346 {
347  TIME_SECTION(_prepare_timer);
348 
349  mooseAssert(_mesh, "The MeshBase has not been constructed");
350 
351  if (dynamic_cast<DistributedMesh *>(&getMesh()) && !_is_nemesis)
352  {
353  // Call prepare_for_use() and don't mess with the renumbering
354  // setting
355  if (force || _needs_prepare_for_use)
356  getMesh().prepare_for_use();
357  }
358  else
359  {
360  // Call prepare_for_use() and DO NOT allow renumbering
361  getMesh().allow_renumbering(false);
362  if (force || _needs_prepare_for_use)
363  getMesh().prepare_for_use();
364  }
365 
366  // Collect (local) subdomain IDs
367  _mesh_subdomains.clear();
368  for (const auto & elem : getMesh().element_ptr_range())
369  _mesh_subdomains.insert(elem->subdomain_id());
370 
371  // Make sure nodesets have been generated
373 
374  // Collect (local) boundary IDs
375  const std::set<BoundaryID> & local_bids = getMesh().get_boundary_info().get_boundary_ids();
376  _mesh_boundary_ids.insert(local_bids.begin(), local_bids.end());
377 
378  const std::set<BoundaryID> & local_node_bids =
379  getMesh().get_boundary_info().get_node_boundary_ids();
380  _mesh_nodeset_ids.insert(local_node_bids.begin(), local_node_bids.end());
381 
382  const std::set<BoundaryID> & local_side_bids =
383  getMesh().get_boundary_info().get_side_boundary_ids();
384  _mesh_sideset_ids.insert(local_side_bids.begin(), local_side_bids.end());
385 
386  // Communicate subdomain and boundary IDs if this is a parallel mesh
387  if (!getMesh().is_serial())
388  {
389  _communicator.set_union(_mesh_subdomains);
390  _communicator.set_union(_mesh_boundary_ids);
391  _communicator.set_union(_mesh_nodeset_ids);
392  _communicator.set_union(_mesh_sideset_ids);
393  }
394 
396 
397  update();
398 
399  // Prepared has been called
400  _is_prepared = true;
401  _needs_prepare_for_use = false;
402 }
bool _is_nemesis
True if a Nemesis Mesh was read in.
Definition: MooseMesh.h:926
bool _is_prepared
True if prepare has been called on the mesh.
Definition: MooseMesh.h:929
void buildNodeListFromSideList()
Calls BoundaryInfo::build_node_list_from_side_list().
Definition: MooseMesh.C:2169
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569
void update()
Calls buildNodeListFromSideList(), buildNodeList(), and buildBndElemList().
Definition: MooseMesh.C:405
std::set< BoundaryID > _mesh_nodeset_ids
Definition: MooseMesh.h:985
PerfID _prepare_timer
Timers.
Definition: MooseMesh.h:1169
std::set< BoundaryID > _mesh_boundary_ids
A set of boundary IDs currently present in the mesh.
Definition: MooseMesh.h:983
std::set< BoundaryID > _mesh_sideset_ids
Definition: MooseMesh.h:984
bool detectOrthogonalDimRanges(Real tol=1e-6)
This routine determines whether the Mesh is a regular orthogonal mesh (i.e.
Definition: MooseMesh.C:1285
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:896
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2255
std::set< SubdomainID > _mesh_subdomains
A set of subdomain IDs currently present in the mesh.
Definition: MooseMesh.h:975
bool _needs_prepare_for_use
True if prepare_for_use should be called when Mesh is prepared.
Definition: MooseMesh.h:932

◆ prepared() [1/2]

bool MooseMesh::prepared ( ) const
inherited

Setter/getter for the _is_prepared flag.

Definition at line 2293 of file MooseMesh.C.

Referenced by SetupMeshCompleteAction::completeSetup(), MooseApp::executeMeshModifiers(), MeshExtruder::modify(), DistributedGeneratedMesh::prepared(), GeneratedMesh::prepared(), and AnnularMesh::prepared().

2294 {
2295  return _is_prepared;
2296 }
bool _is_prepared
True if prepare has been called on the mesh.
Definition: MooseMesh.h:929

◆ prepared() [2/2]

void MooseMesh::prepared ( bool  state)
virtualinherited

If we are explicitly setting the mesh to not prepared, then we've likely modified the mesh and can no longer make assumptions about orthogonality. We really should recheck.

Reimplemented in AnnularMesh, DistributedGeneratedMesh, and GeneratedMesh.

Definition at line 2299 of file MooseMesh.C.

2300 {
2301  _is_prepared = state;
2302 
2307  if (!state)
2308  _regular_orthogonal_mesh = false;
2309 }
bool _is_prepared
True if prepare has been called on the mesh.
Definition: MooseMesh.h:929
bool _regular_orthogonal_mesh
Boolean indicating whether this mesh was detected to be regular and orthogonal.
Definition: MooseMesh.h:1036

◆ printInfo()

void MooseMesh::printInfo ( std::ostream &  os = libMesh::out) const
inherited

Calls print_info() on the underlying Mesh.

Definition at line 2590 of file MooseMesh.C.

Referenced by Adaptivity::adaptMesh().

2591 {
2592  getMesh().print_info(os);
2593 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ queryElemPtr() [1/2]

Elem * MooseMesh::queryElemPtr ( const dof_id_type  i)
virtualinherited

Definition at line 2281 of file MooseMesh.C.

Referenced by EqualValueBoundaryConstraint::updateConstrainedNodes().

2282 {
2283  return getMesh().query_elem_ptr(i);
2284 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ queryElemPtr() [2/2]

const Elem * MooseMesh::queryElemPtr ( const dof_id_type  i) const
virtualinherited

Definition at line 2287 of file MooseMesh.C.

2288 {
2289  return getMesh().query_elem_ptr(i);
2290 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ queryNodePtr() [1/2]

const Node * MooseMesh::queryNodePtr ( const dof_id_type  i) const
virtualinherited

Definition at line 474 of file MooseMesh.C.

Referenced by NonlinearSystemBase::findImplicitGeometricCouplingEntries(), and EqualValueBoundaryConstraint::updateConstrainedNodes().

475 {
476  if (i > getMesh().max_node_id())
477  return (*_quadrature_nodes.find(i)).second;
478 
479  return getMesh().query_node_ptr(i);
480 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:1006
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ queryNodePtr() [2/2]

Node * MooseMesh::queryNodePtr ( const dof_id_type  i)
virtualinherited

Definition at line 483 of file MooseMesh.C.

484 {
485  if (i > getMesh().max_node_id())
486  return _quadrature_nodes[i];
487 
488  return getMesh().query_node_ptr(i);
489 }
std::map< dof_id_type, Node * > _quadrature_nodes
Definition: MooseMesh.h:1006
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569

◆ refinedElementRange()

ConstElemPointerRange * MooseMesh::refinedElementRange ( ) const
inherited

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

Returns
The Parent elements that are now set to be INACTIVE. Their children are the new elements.

Definition at line 541 of file MooseMesh.C.

Referenced by FEProblemBase::meshChangedHelper().

542 {
543  return _refined_elements.get();
544 }
std::unique_ptr< ConstElemPointerRange > _refined_elements
The elements that were just refined.
Definition: MooseMesh.h:935

◆ registerTimedSection()

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level 
)
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
Returns
The ID of the section - use when starting timing

Definition at line 50 of file PerfGraphInterface.C.

51 {
52  if (_prefix != "")
53  return _perf_graph.registerSection(_prefix + "::" + section_name, level);
54  else
55  return _perf_graph.registerSection(section_name, level);
56 }
PerfGraph & _perf_graph
The performance graph to add to.
std::string _prefix
A prefix to use for all sections.
PerfID registerSection(const std::string &section_name, unsigned int level)
Registers a named section of code.
Definition: PerfGraph.C:42

◆ safeClone()

std::unique_ptr< MooseMesh > PatternedMesh::safeClone ( ) const
overridevirtual

A safer version of the clone() method that hands back an allocated object wrapped in a smart pointer.

This makes it much less likely that the caller will leak the memory in question.

Implements MooseMesh.

Definition at line 81 of file PatternedMesh.C.

82 {
83  return libmesh_make_unique<PatternedMesh>(*this);
84 }

◆ setBoundaryName()

void MooseMesh::setBoundaryName ( BoundaryID  boundary_id,
BoundaryName  name 
)
inherited

This method returns a writable reference to a boundary name based on the id parameter.

Definition at line 1132 of file MooseMesh.C.

Referenced by SetupMeshAction::setupMesh().

1133 {
1134  BoundaryInfo & boundary_info = getMesh().get_boundary_info();
1135 
1136  std::vector<BoundaryID> side_boundaries;
1137  boundary_info.build_side_boundary_ids(side_boundaries);
1138 
1139  // We need to figure out if this boundary is a sideset or nodeset
1140  if (std::find(side_boundaries.begin(), side_boundaries.end(), boundary_id) !=
1141  side_boundaries.end())
1142  boundary_info.sideset_name(boundary_id) = name;
1143  else
1144  boundary_info.nodeset_name(boundary_id) = name;
1145 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ setBoundaryToNormalMap() [1/2]

void MooseMesh::setBoundaryToNormalMap ( std::unique_ptr< std::map< BoundaryID, RealVectorValue >>  boundary_map)
inherited

Sets the mapping between BoundaryID and normal vector Is called by AddAllSideSetsByNormals.

Definition at line 2348 of file MooseMesh.C.

Referenced by AddAllSideSetsByNormals::modify().

2350 {
2351  _boundary_to_normal_map = std::move(boundary_map);
2352 }
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:989

◆ setBoundaryToNormalMap() [2/2]

void MooseMesh::setBoundaryToNormalMap ( std::map< BoundaryID, RealVectorValue > *  boundary_map)
inherited

Definition at line 2355 of file MooseMesh.C.

2356 {
2357  mooseDeprecated("setBoundaryToNormalMap(std::map<BoundaryID, RealVectorValue> * boundary_map) is "
2358  "deprecated, use the unique_ptr version instead");
2359  _boundary_to_normal_map.reset(boundary_map);
2360 }
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:989
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:158

◆ setCustomPartitioner()

void MooseMesh::setCustomPartitioner ( Partitioner *  partitioner)
inherited

Setter for custom partitioner.

Definition at line 2720 of file MooseMesh.C.

2721 {
2722  _custom_partitioner = partitioner->clone();
2723 }
std::unique_ptr< Partitioner > _custom_partitioner
The custom partitioner.
Definition: MooseMesh.h:903

◆ setGhostedBoundaryInflation()

void MooseMesh::setGhostedBoundaryInflation ( const std::vector< Real > &  inflation)
inherited

This sets the inflation amount for the bounding box for each partition for use in ghosting boundaries.

Definition at line 2381 of file MooseMesh.C.

Referenced by SetupMeshAction::setupMesh().

2382 {
2383  _ghosted_boundaries_inflation = inflation;
2384 }
std::vector< Real > _ghosted_boundaries_inflation
Definition: MooseMesh.h:1018

◆ setIsCustomPartitionerRequested()

void MooseMesh::setIsCustomPartitionerRequested ( bool  cpr)
inherited

Definition at line 2748 of file MooseMesh.C.

2749 {
2751 }
bool _custom_partitioner_requested
Definition: MooseMesh.h:904

◆ setMeshBase()

void MooseMesh::setMeshBase ( std::unique_ptr< MeshBase >  mesh_base)
inherited

Method to set the mesh_base object.

If this method is NOT called prior to calling init(), a MeshBase object will be automatically constructed and set.

Definition at line 2028 of file MooseMesh.C.

2029 {
2030  _mesh = std::move(mesh_base);
2031 }
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer to underlying libMesh mesh object.
Definition: MooseMesh.h:896

◆ setMeshBoundaryIDs()

void MooseMesh::setMeshBoundaryIDs ( std::set< BoundaryID boundary_IDs)
inherited

Sets the set of BoundaryIDs Is called by AddAllSideSetsByNormals.

Definition at line 2342 of file MooseMesh.C.

Referenced by AddAllSideSetsByNormals::modify().

2343 {
2344  _mesh_boundary_ids = boundary_IDs;
2345 }
std::set< BoundaryID > _mesh_boundary_ids
A set of boundary IDs currently present in the mesh.
Definition: MooseMesh.h:983

◆ setPatchUpdateStrategy()

void MooseMesh::setPatchUpdateStrategy ( Moose::PatchUpdateType  patch_update_strategy)
inherited

Set the patch size update strategy.

Definition at line 2534 of file MooseMesh.C.

2535 {
2536  _patch_update_strategy = patch_update_strategy;
2537 }
Moose::PatchUpdateType _patch_update_strategy
The patch update strategy.
Definition: MooseMesh.h:1030

◆ setSubdomainName()

void MooseMesh::setSubdomainName ( SubdomainID  subdomain_id,
SubdomainName  name 
)
inherited

This method returns a writable reference to a subdomain name based on the id parameter.

Definition at line 1120 of file MooseMesh.C.

Referenced by MooseMesh::addMortarInterface(), MooseMesh::MooseMesh(), and SetupMeshAction::setupMesh().

1121 {
1122  getMesh().subdomain_name(subdomain_id) = name;
1123 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ setUniformRefineLevel()

void MooseMesh::setUniformRefineLevel ( unsigned int  level)
inherited

Set uniform refinement level.

Definition at line 2369 of file MooseMesh.C.

Referenced by SetupMeshAction::setupMesh().

2370 {
2371  _uniform_refine_level = level;
2372 }
unsigned int _uniform_refine_level
The level of uniform refinement requested (set to zero if AMR is disabled)
Definition: MooseMesh.h:920

◆ sideWithBoundaryID()