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

A 2D GeneratedMesh where xmin, xmax, etc. More...

#include <ImageMesh.h>

Inheritance diagram for ImageMesh:
[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

 ImageMesh (const InputParameters &parameters)
 
 ImageMesh (const ImageMesh &other_mesh)
 
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 Real getMinInDimension (unsigned int component) const override
 Returns the min or max of the requested dimension respectively. More...
 
virtual Real getMaxInDimension (unsigned int component) const override
 
virtual void prepared (bool state) override
 
bool prepared () const
 Setter/getter for the _is_prepared flag. 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
 
void needsPrepareForUse ()
 If this method is called, we will call libMesh's prepare_for_use method when we call Moose's prepare method. More...
 
void meshChanged ()
 Declares that the MooseMesh has changed, invalidates cached data and rebuilds caches. More...
 
virtual void onMeshChanged ()
 Declares a callback function that is executed at the conclusion of meshChanged(). More...
 
void cacheChangedLists ()
 Cache information about what elements were refined and coarsened in the previous step. More...
 
ConstElemPointerRangerefinedElementRange () const
 Return a range that is suitable for threaded execution over elements that were just refined. More...
 
ConstElemPointerRangecoarsenedElementRange () const
 Return a range that is suitable for threaded execution over elements that were just coarsened. More...
 
const std::vector< const Elem * > & coarsenedElementChildren (const Elem *elem) const
 Get the newly removed children element ids for an element that was just coarsened. More...
 
void updateActiveSemiLocalNodeRange (std::set< dof_id_type > &ghosted_elems)
 Clears the "semi-local" node list and rebuilds it. More...
 
bool isSemiLocal (Node *node)
 Returns true if the node is semi-local. More...
 
ConstElemRange * getActiveLocalElementRange ()
 Return pointers to range objects for various types of ranges (local nodes, boundary elems, etc.). More...
 
NodeRange * getActiveNodeRange ()
 
SemiLocalNodeRangegetActiveSemiLocalNodeRange () const
 
ConstNodeRange * getLocalNodeRange ()
 
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange ()
 
StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange ()
 
const std::set< SubdomainID > & meshSubdomains () const
 Returns a read-only reference to the set of subdomains currently present in the Mesh. More...
 
const std::set< BoundaryID > & meshBoundaryIds () const
 Returns a read-only reference to the set of boundary IDs currently present in the Mesh. More...
 
const std::set< BoundaryID > & meshSidesetIds () const
 Returns a read-only reference to the set of sidesets currently present in the Mesh. More...
 
const std::set< BoundaryID > & meshNodesetIds () const
 Returns a read-only reference to the set of nodesets currently present in the Mesh. More...
 
void setBoundaryToNormalMap (std::unique_ptr< std::map< BoundaryID, RealVectorValue >> boundary_map)
 Sets the mapping between BoundaryID and normal vector Is called by AddAllSideSetsByNormals. More...
 
void setBoundaryToNormalMap (std::map< BoundaryID, RealVectorValue > *boundary_map)
 
void setMeshBoundaryIDs (std::set< BoundaryID > boundary_IDs)
 Sets the set of BoundaryIDs Is called by AddAllSideSetsByNormals. More...
 
const RealVectorValue & getNormalByBoundaryID (BoundaryID id) const
 Returns the normal vector associated with a given BoundaryID. More...
 
void prepare (bool force=false)
 Calls prepare_for_use() if force=true on the underlying Mesh object, then communicates various boundary information on parallel meshes. More...
 
void update ()
 Calls buildNodeListFromSideList(), buildNodeList(), and buildBndElemList(). More...
 
unsigned int uniformRefineLevel () const
 Returns the level of uniform refinement requested (zero if AMR is disabled). More...
 
void setUniformRefineLevel (unsigned int)
 Set uniform refinement level. More...
 
void addGhostedBoundary (BoundaryID boundary_id)
 This will add the boundary ids to be ghosted to this processor. More...
 
void setGhostedBoundaryInflation (const std::vector< Real > &inflation)
 This sets the inflation amount for the bounding box for each partition for use in ghosting boundaries. More...
 
const std::set< unsigned int > & getGhostedBoundaries () const
 Return a writable reference to the set of ghosted boundary IDs. More...
 
const std::vector< Real > & getGhostedBoundaryInflation () const
 Return a writable reference to the _ghosted_boundaries_inflation vector. More...
 
void ghostGhostedBoundaries ()
 Actually do the ghosting of boundaries that need to be ghosted to this processor. More...
 
unsigned int getPatchSize () const
 Getter for the patch_size parameter. More...
 
unsigned int getGhostingPatchSize () const
 Getter for the ghosting_patch_size parameter. More...
 
unsigned int getMaxLeafSize () const
 Getter for the maximum leaf size parameter. More...
 
void setPatchUpdateStrategy (Moose::PatchUpdateType patch_update_strategy)
 Set the patch size update strategy. More...
 
const Moose::PatchUpdateTypegetPatchUpdateStrategy () const
 Get the current patch update strategy. More...
 
BoundingBox getInflatedProcessorBoundingBox (Real inflation_multiplier=0.01) const
 Get a (slightly inflated) processor bounding box. More...
 
 operator libMesh::MeshBase & ()
 Implicit conversion operator from MooseMesh -> libMesh::MeshBase. More...
 
 operator const libMesh::MeshBase & () const
 
MeshBase & getMesh ()
 Accessor for the underlying libMesh Mesh object. More...
 
const MeshBase & getMesh () const
 
virtual ExodusII_IO * exReader () const
 Not implemented – always returns NULL. More...
 
void printInfo (std::ostream &os=libMesh::out) const
 Calls print_info() on the underlying Mesh. More...
 
const std::set< SubdomainID > & getNodeBlockIds (const Node &node) const
 Return list of blocks to which the given node belongs. More...
 
const std::vector< dof_id_type > & getNodeList (boundary_id_type nodeset_id) const
 Return a writable reference to a vector of node IDs that belong to nodeset_id. More...
 
const Node * addUniqueNode (const Point &p, Real tol=1e-6)
 Add a new node to the mesh. More...
 
Node * addQuadratureNode (const Elem *elem, const unsigned short int side, const unsigned int qp, BoundaryID bid, const Point &point)
 Adds a fictitious "QuadratureNode". More...
 
Node * getQuadratureNode (const Elem *elem, const unsigned short int side, const unsigned int qp)
 Get a specified quadrature node. More...
 
void clearQuadratureNodes ()
 Clear out any existing quadrature nodes. More...
 
BoundaryID getBoundaryID (const BoundaryName &boundary_name) const
 Get the associated BoundaryID for the boundary name. More...
 
SubdomainID getSubdomainID (const SubdomainName &subdomain_name) const
 Get the associated subdomain ID for the subdomain name. More...
 
std::vector< SubdomainIDgetSubdomainIDs (const std::vector< SubdomainName > &subdomain_name) const
 Get the associated subdomainIDs for the subdomain names that are passed in. More...
 
void setSubdomainName (SubdomainID subdomain_id, SubdomainName name)
 This method returns a writable reference to a subdomain name based on the id parameter. More...
 
const std::string & getSubdomainName (SubdomainID subdomain_id)
 Return the name of a block given an id. More...
 
void setBoundaryName (BoundaryID boundary_id, BoundaryName name)
 This method returns a writable reference to a boundary name based on the id parameter. More...
 
const std::string & getBoundaryName (BoundaryID boundary_id)
 Return the name of the boundary given the id. More...
 
void buildPeriodicNodeMap (std::multimap< dof_id_type, dof_id_type > &periodic_node_map, unsigned int var_number, PeriodicBoundaries *pbs) const
 This routine builds a multimap of boundary ids to matching boundary ids across all periodic boundaries in the system. More...
 
void buildPeriodicNodeSets (std::map< BoundaryID, std::set< dof_id_type >> &periodic_node_sets, unsigned int var_number, PeriodicBoundaries *pbs) const
 This routine builds a datastructure of node ids organized by periodic boundary ids. More...
 
Real dimensionWidth (unsigned int component) const
 Returns the width of the requested dimension. More...
 
bool detectOrthogonalDimRanges (Real tol=1e-6)
 This routine determines whether the Mesh is a regular orthogonal mesh (i.e. More...
 
void addPeriodicVariable (unsigned int var_num, BoundaryID primary, BoundaryID secondary)
 For "regular orthogonal" meshes, determine if variable var_num is periodic with respect to the primary and secondary BoundaryIDs, record this fact in the _periodic_dim data structure. More...
 
bool isTranslatedPeriodic (unsigned int nonlinear_var_num, unsigned int component) const
 Returns whether this generated mesh is periodic in the given dimension for the given variable. More...
 
RealVectorValue minPeriodicVector (unsigned int nonlinear_var_num, Point p, Point q) const
 This function returns the minimum vector between two points on the mesh taking into account periodicity for the given variable number. More...
 
Real minPeriodicDistance (unsigned int nonlinear_var_num, Point p, Point q) const
 This function returns the distance between two points on the mesh taking into account periodicity for the given variable number. More...
 
const std::pair< BoundaryID, BoundaryID > * getPairedBoundaryMapping (unsigned int component)
 This function attempts to return the paired boundary ids for the given component. More...
 
void buildRefinementAndCoarseningMaps (Assembly *assembly)
 Create the refinement and coarsening maps necessary for projection of stateful material properties when using adaptivity. More...
 
const std::vector< std::vector< QpMap > > & getRefinementMap (const Elem &elem, int parent_side, int child, int child_side)
 Get the refinement map for a given element type. More...
 
const std::vector< std::pair< unsigned int, QpMap > > & getCoarseningMap (const Elem &elem, int input_side)
 Get the coarsening map for a given element type. More...
 
void changeBoundaryId (const boundary_id_type old_id, const boundary_id_type new_id, bool delete_prev)
 Change all the boundary IDs for a given side from old_id to new_id. More...
 
const std::set< BoundaryID > & getSubdomainBoundaryIds (SubdomainID subdomain_id) const
 Get the list of boundary ids associated with the given subdomain id. More...
 
bool isBoundaryNode (dof_id_type node_id) const
 Returns true if the requested node is in the list of boundary nodes, false otherwise. More...
 
bool isBoundaryNode (dof_id_type node_id, BoundaryID bnd_id) const
 Returns true if the requested node is in the list of boundary nodes for the specified boundary, false otherwise. More...
 
bool isBoundaryElem (dof_id_type elem_id) const
 Returns true if the requested element is in the list of boundary elements, false otherwise. More...
 
bool isBoundaryElem (dof_id_type elem_id, BoundaryID bnd_id) const
 Returns true if the requested element is in the list of boundary elements for the specified boundary, false otherwise. More...
 
void errorIfDistributedMesh (std::string name) const
 Generate a unified error message if the underlying libMesh mesh is a DistributedMesh. More...
 
bool isDistributedMesh () const
 Returns the final Mesh distribution type. More...
 
bool isParallelTypeForced () const
 Tell the user if the distribution was overriden for any reason. More...
 
const MooseEnumpartitionerName () const
 
bool isPartitionerForced () const
 Tell the user if the partitioner was overriden for any reason. More...
 
void allowRecovery (bool allow)
 Set whether or not this mesh is allowed to read a recovery file. More...
 
void addMortarInterface (const std::string &name, BoundaryName master, BoundaryName slave, SubdomainName domain_id)
 
std::vector< std::unique_ptr< MooseMesh::MortarInterface > > & getMortarInterfaces ()
 
MooseMesh::MortarInterfacegetMortarInterfaceByName (const std::string name)
 
MooseMesh::MortarInterfacegetMortarInterface (BoundaryID master, BoundaryID slave)
 
void setCustomPartitioner (Partitioner *partitioner)
 Setter for custom partitioner. More...
 
bool isRegularOrthogonal ()
 Getter to query if the mesh was detected to be regular and orthogonal. More...
 
bool hasSecondOrderElements ()
 check if the mesh has SECOND order elements More...
 
virtual std::unique_ptr< PointLocatorBase > getPointLocator () const
 Proxy function to get a (sub)PointLocator from either the underlying libMesh mesh (default), or to allow derived meshes to return a custom point locator. More...
 
virtual std::string getFileName () const
 Returns the name of the mesh file read to produce this mesh if any or an empty string otherwise. More...
 
const std::string & type () const
 Get the type of this object. More...
 
const std::string & name () const
 Get the name of the object. More...
 
const InputParametersparameters () const
 Get the parameters of the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 
template<typename T >
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 Verifies that the requested parameter exists and is not NULL and returns it to the caller. More...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp () const
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled () const
 Return the enabled status of the object. More...
 
template<typename... Args>
void paramError (const std::string &param, Args... args)
 Emits an error prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void paramWarning (const std::string &param, Args... args)
 Emits a warning prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void paramInfo (const std::string &param, Args... args)
 Emits an informational message prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void mooseError (Args &&... args) const
 
template<typename... Args>
void mooseWarning (Args &&... args) const
 
template<typename... Args>
void mooseDeprecated (Args &&... args) const
 
template<typename... Args>
void mooseInfo (Args &&... args) const
 
std::string fileSuffix ()
 
const std::vector< std::string > & filenames ()
 
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 buildMesh2D (const std::string &filename)
 buildMesh() calls this helper function to build 2D ImageMeshes. More...
 
void buildMesh3D (const std::vector< std::string > &filenames)
 buildMesh() calls this helper function to build 3D ImageMeshes from stacks of images. More...
 
void GetPixelInfo (std::string filename, int &xpixels, int &ypixels)
 Process a single image with the 'file' command to find out the number of pixels in the x and y directions. More...
 
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...
 
void errorCheck ()
 

Protected Attributes

const bool _scale_to_one
 If true, forces the maximum width (height) of the mesh to be 1.0 while retaining the original aspect ratio of the image. More...
 
const Real & _cells_per_pixel
 A number <= 1.0 which determines the number of cells in the mesh per pixel in each direction. More...
 
MooseEnum _dim
 The dimension of the mesh. More...
 
unsigned int _nx
 Number of elements in x, y, z direction. More...
 
unsigned int _ny
 
unsigned int _nz
 
Real _xmin
 The min/max values for x,y,z component. More...
 
Real _xmax
 
Real _ymin
 
Real _ymax
 
Real _zmin
 
Real _zmax
 
bool _gauss_lobatto_grid
 All of the libmesh build_line/square/cube routines support an option to grade the mesh into the boundaries according to the spacing of the Gauss-Lobatto quadrature points. More...
 
Real _bias_x
 The amount by which to bias the cells in the x,y,z directions. More...
 
Real _bias_y
 
Real _bias_z
 
bool _dims_may_have_changed
 Boolean to indicate that dimensions may have changed. More...
 
std::vector< std::unique_ptr< GhostingFunctor > > _ghosting_functors
 Deprecated (DO NOT USE) More...
 
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
 The list of active geometric relationship managers (bound to the underlying MeshBase object). More...
 
ParallelType _parallel_type
 Can be set to DISTRIBUTED, REPLICATED, or DEFAULT. More...
 
bool _use_distributed_mesh
 False by default. More...
 
bool _distribution_overridden
 
bool _parallel_type_overridden
 
std::unique_ptr< libMesh::MeshBase > _mesh
 Pointer to underlying libMesh mesh object. More...
 
MooseEnum _partitioner_name
 The partitioner used on this mesh. More...
 
bool _partitioner_overridden
 
std::unique_ptr< Partitioner > _custom_partitioner
 The custom partitioner. More...
 
bool _custom_partitioner_requested
 
unsigned int _uniform_refine_level
 The level of uniform refinement requested (set to zero if AMR is disabled) More...
 
bool _is_changed
 true if mesh is changed (i.e. after adaptivity step) More...
 
bool _is_nemesis
 True if a Nemesis Mesh was read in. More...
 
bool _is_prepared
 True if prepare has been called on the mesh. More...
 
bool _needs_prepare_for_use
 True if prepare_for_use should be called when Mesh is prepared. More...
 
std::unique_ptr< ConstElemPointerRange_refined_elements
 The elements that were just refined. More...
 
std::unique_ptr< ConstElemPointerRange_coarsened_elements
 The elements that were just coarsened. More...
 
std::map< const Elem *, std::vector< const Elem * > > _coarsened_element_children
 Map of Parent elements to child elements for elements that were just coarsened. More...
 
std::set< Node * > _semilocal_node_list
 Used for generating the semilocal node range. More...
 
std::unique_ptr< ConstElemRange > _active_local_elem_range
 A range for use with threading. More...
 
std::unique_ptr< SemiLocalNodeRange_active_semilocal_node_range
 
std::unique_ptr< NodeRange > _active_node_range
 
std::unique_ptr< ConstNodeRange > _local_node_range
 
std::unique_ptr< StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > > _bnd_node_range
 
std::unique_ptr< StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > > _bnd_elem_range
 
std::map< dof_id_type, std::vector< dof_id_type > > _node_to_elem_map
 A map of all of the current nodes to the elements that they are connected to. More...
 
bool _node_to_elem_map_built
 
std::map< dof_id_type, std::vector< dof_id_type > > _node_to_active_semilocal_elem_map
 A map of all of the current nodes to the active elements that they are connected to. More...
 
bool _node_to_active_semilocal_elem_map_built
 
std::set< SubdomainID_mesh_subdomains
 A set of subdomain IDs currently present in the mesh. More...
 
std::unique_ptr< std::map< BoundaryID, RealVectorValue > > _boundary_to_normal_map
 The boundary to normal map - valid only when AddAllSideSetsByNormals is active. More...
 
std::vector< BndNode * > _bnd_nodes
 array of boundary nodes More...
 
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_node_ids
 Map of sets of node IDs in each boundary. More...
 
std::vector< BndElement * > _bnd_elems
 array of boundary elems More...
 
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_elem_ids
 Map of set of elem IDs connected to each boundary. More...
 
std::map< dof_id_type, Node * > _quadrature_nodes
 
std::map< dof_id_type, std::map< unsigned int, std::map< dof_id_type, Node * > > > _elem_to_side_to_qp_to_quadrature_nodes
 
std::vector< BndNode_extra_bnd_nodes
 
std::map< dof_id_type, std::set< SubdomainID > > _block_node_list
 list of nodes that belongs to a specified block (domain) More...
 
std::map< boundary_id_type, std::vector< dof_id_type > > _node_set_nodes
 list of nodes that belongs to a specified nodeset: indexing [nodeset_id] -> [array of node ids] More...
 
std::set< unsigned int > _ghosted_boundaries
 
std::vector< Real > _ghosted_boundaries_inflation
 
unsigned int _patch_size
 The number of nodes to consider in the NearestNode neighborhood. More...
 
unsigned int _ghosting_patch_size
 The number of nearest neighbors to consider for ghosting purposes when iteration patch update strategy is used. More...
 
unsigned int _max_leaf_size
 
Moose::PatchUpdateType _patch_update_strategy
 The patch update strategy. More...
 
std::vector< Node * > _node_map
 Vector of all the Nodes in the mesh for determining when to add a new point. More...
 
bool _regular_orthogonal_mesh
 Boolean indicating whether this mesh was detected to be regular and orthogonal. More...
 
std::vector< std::vector< Real > > _bounds
 The bounds in each dimension of the mesh for regular orthogonal meshes. More...
 
std::vector< std::pair< BoundaryID, BoundaryID > > _paired_boundary
 A vector holding the paired boundaries for a regular orthogonal mesh. More...
 
std::map< std::string, MortarInterface * > _mortar_interface_by_name
 Mortar interfaces mapped through their names. More...
 
std::vector< std::unique_ptr< MortarInterface > > _mortar_interface
 
std::map< std::pair< BoundaryID, BoundaryID >, MortarInterface * > _mortar_interface_by_ids
 Mortar interfaces mapped though master, slave IDs pairs. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. More...
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const std::string & _type
 The type of this object (the Class name) More...
 
const std::string & _name
 The name of this object, reference to value stored in InputParameters. More...
 
const bool & _enabled
 Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects. More...
 
const InputParameters_pg_params
 Params. More...
 
PerfGraph_perf_graph
 The performance graph to add to. More...
 
std::string _prefix
 A prefix to use for all sections. More...
 
int _status
 
std::string _file_suffix
 
std::vector< std::string > _filenames
 
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

A 2D GeneratedMesh where xmin, xmax, etc.

are determined from an input image file.

Definition at line 24 of file ImageMesh.h.

Member Typedef Documentation

◆ bnd_elem_iterator_imp

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

Definition at line 980 of file MooseMesh.h.

◆ bnd_node_iterator_imp

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

Definition at line 973 of file MooseMesh.h.

◆ const_bnd_elem_iterator_imp

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

Definition at line 981 of file MooseMesh.h.

◆ const_bnd_node_iterator_imp

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

Definition at line 974 of file MooseMesh.h.

◆ PeriodicNodeInfo

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

Helper type for building periodic node maps.

Definition at line 855 of file MooseMesh.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited

Convenience enums.

Enumerator

Definition at line 887 of file MooseMesh.h.

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

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
MIN 
MAX 

Definition at line 893 of file MooseMesh.h.

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

◆ ParallelType

enum MooseMesh::ParallelType
stronginherited
Enumerator
DEFAULT 
REPLICATED 
DISTRIBUTED 

Definition at line 85 of file MooseMesh.h.

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

Constructor & Destructor Documentation

◆ ImageMesh() [1/2]

ImageMesh::ImageMesh ( const InputParameters parameters)

Definition at line 41 of file ImageMesh.C.

44  _scale_to_one(getParam<bool>("scale_to_one")),
45  _cells_per_pixel(getParam<Real>("cells_per_pixel"))
46 {
47  // Failure is not an option
48  errorCheck();
49 }
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
GeneratedMesh(const InputParameters &parameters)
Definition: GeneratedMesh.C:80
const Real & _cells_per_pixel
A number <= 1.0 which determines the number of cells in the mesh per pixel in each direction...
Definition: ImageMesh.h:65
FileRangeBuilder(const InputParameters &params)
const bool _scale_to_one
If true, forces the maximum width (height) of the mesh to be 1.0 while retaining the original aspect ...
Definition: ImageMesh.h:55

◆ ImageMesh() [2/2]

ImageMesh::ImageMesh ( const ImageMesh other_mesh)

Definition at line 51 of file ImageMesh.C.

52  : GeneratedMesh(other_mesh),
53  FileRangeBuilder(other_mesh.parameters()),
54  _scale_to_one(getParam<bool>("scale_to_one")),
55  _cells_per_pixel(getParam<Real>("cells_per_pixel"))
56 {
57 }
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
GeneratedMesh(const InputParameters &parameters)
Definition: GeneratedMesh.C:80
const Real & _cells_per_pixel
A number <= 1.0 which determines the number of cells in the mesh per pixel in each direction...
Definition: ImageMesh.h:65
FileRangeBuilder(const InputParameters &params)
const bool _scale_to_one
If true, forces the maximum width (height) of the mesh to be 1.0 while retaining the original aspect ...
Definition: ImageMesh.h:55

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

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

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

◆ activeLocalElementsEnd()

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

Definition at line 2218 of file MooseMesh.C.

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

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

◆ addGhostedBoundary()

void MooseMesh::addGhostedBoundary ( BoundaryID  boundary_id)
inherited

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

Definition at line 2368 of file MooseMesh.C.

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

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

◆ addMortarInterface()

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

Definition at line 2753 of file MooseMesh.C.

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

◆ addPeriodicVariable()

void MooseMesh::addPeriodicVariable ( unsigned int  var_num,
BoundaryID  primary,
BoundaryID  secondary 
)
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 1479 of file MooseMesh.C.

Referenced by AddPeriodicBCAction::setPeriodicVars().

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

◆ addQuadratureNode()

Node * MooseMesh::addQuadratureNode ( const Elem *  elem,
const unsigned short int  side,
const unsigned int  qp,
BoundaryID  bid,
const Point &  point 
)
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 920 of file MooseMesh.C.

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

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

◆ addUniqueNode()

const Node * MooseMesh::addUniqueNode ( const Point &  p,
Real  tol = 1e-6 
)
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 886 of file MooseMesh.C.

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

◆ allowRecovery()

void MooseMesh::allowRecovery ( bool  allow)
inlineinherited

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

Definition at line 795 of file MooseMesh.h.

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

◆ bndElemsBegin()

MooseMesh::bnd_elem_iterator MooseMesh::bndElemsBegin ( )
virtualinherited

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

Definition at line 871 of file MooseMesh.C.

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

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

◆ bndElemsEnd()

MooseMesh::bnd_elem_iterator MooseMesh::bndElemsEnd ( )
virtualinherited

Definition at line 879 of file MooseMesh.C.

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

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

◆ bndNodesBegin()

MooseMesh::bnd_node_iterator MooseMesh::bndNodesBegin ( )
virtualinherited

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

Definition at line 855 of file MooseMesh.C.

Referenced by MooseMesh::getBoundaryNodeRange().

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

◆ bndNodesEnd()

MooseMesh::bnd_node_iterator MooseMesh::bndNodesEnd ( )
virtualinherited

Definition at line 863 of file MooseMesh.C.

Referenced by MooseMesh::getBoundaryNodeRange().

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

◆ buildBndElemList()

void MooseMesh::buildBndElemList ( )
inherited

Definition at line 668 of file MooseMesh.C.

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

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

◆ buildMesh()

void ImageMesh::buildMesh ( )
overridevirtual

Must be overridden by child classes.

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

Reimplemented from GeneratedMesh.

Definition at line 66 of file ImageMesh.C.

67 {
68  // A list of filenames of length 1 means we are building a 2D mesh
69  if (_filenames.size() == 1)
71 
72  else
74 }
void buildMesh3D(const std::vector< std::string > &filenames)
buildMesh() calls this helper function to build 3D ImageMeshes from stacks of images.
Definition: ImageMesh.C:77
void buildMesh2D(const std::string &filename)
buildMesh() calls this helper function to build 2D ImageMeshes.
Definition: ImageMesh.C:147
std::vector< std::string > _filenames

◆ buildMesh2D()

void ImageMesh::buildMesh2D ( const std::string &  filename)
protected

buildMesh() calls this helper function to build 2D ImageMeshes.

Definition at line 147 of file ImageMesh.C.

Referenced by buildMesh().

148 {
149  int xpixels = 0, ypixels = 0;
150 
151  // Extract the number of pixels from the image using the file command
152  GetPixelInfo(filename, xpixels, ypixels);
153 
154  // Set the maximum dimension to 1.0 while scaling the other
155  // direction to maintain the aspect ratio.
156  _xmax = xpixels;
157  _ymax = ypixels;
158 
159  if (_scale_to_one)
160  {
161  Real max = std::max(_xmax, _ymax);
162  _xmax /= max;
163  _ymax /= max;
164  }
165 
166  // Compute the number of cells in the x and y direction based on
167  // the user's cells_per_pixel parameter. Note: we use ints here
168  // because the GeneratedMesh params object uses ints for these...
169  _nx = static_cast<int>(_cells_per_pixel * xpixels);
170  _ny = static_cast<int>(_cells_per_pixel * ypixels);
171 
172  // Actually build the Mesh
173  MeshTools::Generation::build_square(dynamic_cast<UnstructuredMesh &>(getMesh()),
174  _nx,
175  _ny,
176  /*xmin=*/0.,
177  /*xmax=*/_xmax,
178  /*ymin=*/0.,
179  /*ymax=*/_ymax,
180  QUAD4);
181 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
unsigned int _ny
Definition: GeneratedMesh.h:44
const Real & _cells_per_pixel
A number <= 1.0 which determines the number of cells in the mesh per pixel in each direction...
Definition: ImageMesh.h:65
unsigned int _nx
Number of elements in x, y, z direction.
Definition: GeneratedMesh.h:44
const bool _scale_to_one
If true, forces the maximum width (height) of the mesh to be 1.0 while retaining the original aspect ...
Definition: ImageMesh.h:55
void GetPixelInfo(std::string filename, int &xpixels, int &ypixels)
Process a single image with the &#39;file&#39; command to find out the number of pixels in the x and y direct...
Definition: ImageMesh.C:184

◆ buildMesh3D()

void ImageMesh::buildMesh3D ( const std::vector< std::string > &  filenames)
protected

buildMesh() calls this helper function to build 3D ImageMeshes from stacks of images.

Definition at line 77 of file ImageMesh.C.

Referenced by buildMesh().

78 {
79  // If the user gave us a "stack" with 0 or 1 files in it, we can't
80  // really create a 3D Mesh from that
81  if (filenames.size() <= 1)
82  mooseError("ImageMesh error: Cannot create a 3D ImageMesh from an image stack with ",
83  filenames.size(),
84  " images.");
85 
86  // For each file in the stack, process it using the 'file' command.
87  // We want to be sure that all the images in the stack are the same
88  // size, for example...
89  int xpixels = 0, ypixels = 0, zpixels = filenames.size();
90 
91  // Take pixel info from the first image in the stack to determine the aspect ratio
92  GetPixelInfo(filenames[0], xpixels, ypixels);
93 
94  // TODO: Check that all images are the same aspect ratio and have
95  // the same number of pixels? ImageFunction does not currently do
96  // this...
97  // for (const auto & filename : filenames)
98  // {
99  // // Extract the number of pixels from the image using the file command
100  // GetPixelInfo(filename, xpixels, ypixels);
101  //
102  // // Moose::out << "Image " << filename << " has size: " << xpixels << " by " << ypixels <<
103  // std::endl;
104  // }
105 
106  // Use the number of x and y pixels and the number of images to
107  // determine the the x, y, and z dimensions of the mesh. We assume
108  // that there is 1 pixel in the z-direction for each image in the
109  // stack.
110 
111  // Set the maximum dimension to 1.0 while scaling the other
112  // directions to maintain the aspect ratio.
113  _xmax = xpixels;
114  _ymax = ypixels;
115  _zmax = zpixels;
116 
117  if (_scale_to_one)
118  {
119  Real max = std::max(std::max(_xmax, _ymax), _zmax);
120  _xmax /= max;
121  _ymax /= max;
122  _zmax /= max;
123  }
124 
125  // Compute the number of cells in the x and y direction based on
126  // the user's cells_per_pixel parameter. Note: we use ints here
127  // because the GeneratedMesh params object uses ints for these...
128  _nx = static_cast<int>(_cells_per_pixel * xpixels);
129  _ny = static_cast<int>(_cells_per_pixel * ypixels);
130  _nz = static_cast<int>(_cells_per_pixel * zpixels);
131 
132  // Actually build the Mesh
133  MeshTools::Generation::build_cube(dynamic_cast<UnstructuredMesh &>(getMesh()),
134  _nx,
135  _ny,
136  _nz,
137  /*xmin=*/0.,
138  /*xmax=*/_xmax,
139  /*ymin=*/0.,
140  /*ymax=*/_ymax,
141  /*zmin=*/0.,
142  /*zmax=*/_zmax,
143  HEX8);
144 }
void build_cube(UnstructuredMesh &mesh, const unsigned int nx, unsigned int ny, unsigned int nz, const Real xmin, const Real xmax, const Real ymin, const Real ymax, const Real zmin, const Real zmax, const ElemType type, bool verbose)
const std::vector< std::string > & filenames()
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
unsigned int _ny
Definition: GeneratedMesh.h:44
unsigned int _nz
Definition: GeneratedMesh.h:44
const Real & _cells_per_pixel
A number <= 1.0 which determines the number of cells in the mesh per pixel in each direction...
Definition: ImageMesh.h:65
unsigned int _nx
Number of elements in x, y, z direction.
Definition: GeneratedMesh.h:44
const bool _scale_to_one
If true, forces the maximum width (height) of the mesh to be 1.0 while retaining the original aspect ...
Definition: ImageMesh.h:55
void GetPixelInfo(std::string filename, int &xpixels, int &ypixels)
Process a single image with the &#39;file&#39; command to find out the number of pixels in the x and y direct...
Definition: ImageMesh.C:184

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

Referenced by MooseMesh::init().

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

◆ buildNodeList()

void MooseMesh::buildNodeList ( )
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 634 of file MooseMesh.C.

Referenced by MooseMesh::update().

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

◆ buildNodeListFromSideList()

void MooseMesh::buildNodeListFromSideList ( )
inherited

Calls BoundaryInfo::build_node_list_from_side_list().

Definition at line 2162 of file MooseMesh.C.

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

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

◆ buildPeriodicNodeMap()

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

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

Definition at line 1166 of file MooseMesh.C.

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

◆ buildPeriodicNodeSets()

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

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

Definition at line 1251 of file MooseMesh.C.

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

◆ buildRefinementAndCoarseningMaps()

void MooseMesh::buildRefinementAndCoarseningMaps ( Assembly assembly)
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 1560 of file MooseMesh.C.

Referenced by FEProblemBase::initialSetup().

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

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

Referenced by PenetrationLocator::detectPenetration().

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

◆ buildSideList() [2/2]

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

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

Definition at line 2188 of file MooseMesh.C.

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

◆ cacheChangedLists()

void MooseMesh::cacheChangedLists ( )
inherited

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

Definition at line 522 of file MooseMesh.C.

Referenced by FEProblemBase::meshChangedHelper().

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

◆ cacheInfo()

void MooseMesh::cacheInfo ( )
protectedinherited

Definition at line 815 of file MooseMesh.C.

Referenced by MooseMesh::update().

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

◆ changeBoundaryId()

void MooseMesh::changeBoundaryId ( const boundary_id_type  old_id,
const boundary_id_type  new_id,
bool  delete_prev 
)
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 1906 of file MooseMesh.C.

Referenced by MeshExtruder::changeID().

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

◆ clearQuadratureNodes()

void MooseMesh::clearQuadratureNodes ( )
inherited

Clear out any existing quadrature nodes.

Most likely called before re-adding them.

Definition at line 990 of file MooseMesh.C.

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

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

◆ clone()

MooseMesh & MooseMesh::clone ( ) const
virtualinherited

Clone method.

Allocates memory you are responsible to clean up.

Definition at line 1958 of file MooseMesh.C.

Referenced by TiledMesh::buildMesh().

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

◆ coarsenedElementChildren()

const std::vector< const Elem * > & MooseMesh::coarsenedElementChildren ( const Elem *  elem) const
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 552 of file MooseMesh.C.

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

553 {
554  auto elem_to_child_pair = _coarsened_element_children.find(elem);
555  mooseAssert(elem_to_child_pair != _coarsened_element_children.end(), "Missing element in map");
556  return elem_to_child_pair->second;
557 }
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248
std::map< const Elem *, std::vector< const Elem * > > _coarsened_element_children
Map of Parent elements to child elements for elements that were just coarsened.
Definition: MooseMesh.h:925

◆ coarsenedElementRange()

ConstElemPointerRange * MooseMesh::coarsenedElementRange ( ) const
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 546 of file MooseMesh.C.

Referenced by FEProblemBase::meshChangedHelper().

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

◆ declareRecoverableData() [1/2]

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

Declare a piece of data as "recoverable".

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

Note - this data will NOT be restored on Restart!

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

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

Definition at line 269 of file Restartable.h.

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

◆ declareRecoverableData() [2/2]

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

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

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

Note - this data will NOT be restored on Restart!

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

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

Definition at line 280 of file Restartable.h.

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

◆ declareRestartableData() [1/2]

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

Declare a piece of data as "restartable".

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

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

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

Definition at line 202 of file Restartable.h.

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

◆ declareRestartableData() [2/2]

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

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

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

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

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

Definition at line 209 of file Restartable.h.

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

◆ declareRestartableDataWithContext() [1/2]

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

Declare a piece of data as "restartable".

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

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

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

Definition at line 216 of file Restartable.h.

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

◆ declareRestartableDataWithContext() [2/2]

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

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

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

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

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

Definition at line 229 of file Restartable.h.

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

◆ declareRestartableDataWithObjectName()

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

Declare a piece of data as "restartable".

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

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

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

Definition at line 245 of file Restartable.h.

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

◆ declareRestartableDataWithObjectNameWithContext()

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

Declare a piece of data as "restartable".

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

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

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

Definition at line 252 of file Restartable.h.

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

◆ detectOrthogonalDimRanges()

bool MooseMesh::detectOrthogonalDimRanges ( Real  tol = 1e-6)
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 1278 of file MooseMesh.C.

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

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

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

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

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

◆ effectiveSpatialDimension()

unsigned int MooseMesh::effectiveSpatialDimension ( ) const
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 2134 of file MooseMesh.C.

Referenced by Exodus::setOutputDimensionInExodusWriter().

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

◆ elem() [1/2]

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

◆ elem() [2/2]

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

Definition at line 2255 of file MooseMesh.C.

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

◆ elemPtr() [1/2]

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

◆ elemPtr() [2/2]

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

Definition at line 2268 of file MooseMesh.C.

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

◆ enabled()

virtual bool MooseObject::enabled ( ) const
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 96 of file MooseObject.h.

Referenced by EigenKernel::enabled().

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

◆ errorCheck()

void FileRangeBuilder::errorCheck ( )
protectedinherited

Definition at line 159 of file FileRangeBuilder.C.

Referenced by ImageMesh().

160 {
161  switch (_status)
162  {
163  case 0:
164  return;
165  case 1:
166  mooseError("Cannot provide both file and file_base parameters");
167  break;
168  case 2:
169  mooseError("You must provide a valid value for either the 'file' parameter or the "
170  "'file_base' parameter.");
171  break;
172  case 3:
173  mooseError(
174  "If you provide a 'file_base', you must also provide a valid 'file_suffix', e.g. 'png'.");
175  break;
176  default:
177  mooseError("Unknown error code!");
178  }
179 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

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

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

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

◆ exReader()

ExodusII_IO * MooseMesh::exReader ( ) const
virtualinherited

Not implemented – always returns NULL.

Reimplemented in FileMesh.

Definition at line 2576 of file MooseMesh.C.

Referenced by FEProblemBase::initialSetup().

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

◆ filenames()

const std::vector<std::string>& FileRangeBuilder::filenames ( )
inlineinherited

◆ fileSuffix()

std::string FileRangeBuilder::fileSuffix ( )
inlineinherited

Definition at line 45 of file FileRangeBuilder.h.

Referenced by ImageSampler::setupImageSampler(), and MeshBaseImageSampler::setupImageSampler().

45 { return _file_suffix; }
std::string _file_suffix

◆ freeBndElems()

void MooseMesh::freeBndElems ( )
protectedinherited

Definition at line 331 of file MooseMesh.C.

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

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

◆ freeBndNodes()

void MooseMesh::freeBndNodes ( )
protectedinherited

Definition at line 313 of file MooseMesh.C.

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

314 {
315  // free memory
316  for (auto & bnode : _bnd_nodes)
317  delete bnode;
318 
319  for (auto & it : _node_set_nodes)
320  it.second.clear();
321 
322  _node_set_nodes.clear();
323 
324  for (auto & it : _bnd_node_ids)
325  it.second.clear();
326 
327  _bnd_node_ids.clear();
328 }
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_node_ids
Map of sets of node IDs in each boundary.
Definition: MooseMesh.h:976
std::map< boundary_id_type, std::vector< dof_id_type > > _node_set_nodes
list of nodes that belongs to a specified nodeset: indexing [nodeset_id] -> [array of node ids] ...
Definition: MooseMesh.h:994
std::vector< BndNode * > _bnd_nodes
array of boundary nodes
Definition: MooseMesh.h:972

◆ getActiveLocalElementRange()

ConstElemRange * MooseMesh::getActiveLocalElementRange ( )
inherited

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

Definition at line 738 of file MooseMesh.C.

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

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

◆ getActiveNodeRange()

NodeRange * MooseMesh::getActiveNodeRange ( )
inherited

Definition at line 752 of file MooseMesh.C.

Referenced by MooseMesh::meshChanged().

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

◆ getActiveSemiLocalNodeRange()

SemiLocalNodeRange * MooseMesh::getActiveSemiLocalNodeRange ( ) const
inherited

Definition at line 766 of file MooseMesh.C.

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

◆ getBoundaryElementRange()

ConstBndElemRange * MooseMesh::getBoundaryElementRange ( )
inherited

Definition at line 802 of file MooseMesh.C.

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

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

◆ getBoundaryID()

BoundaryID MooseMesh::getBoundaryID ( const BoundaryName &  boundary_name) const
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 1002 of file MooseMesh.C.

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

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

◆ getBoundaryIDs() [1/3]

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

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

Definition at line 2148 of file MooseMesh.C.

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

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

◆ getBoundaryIDs() [2/3]

const std::set< BoundaryID > & MooseMesh::getBoundaryIDs ( ) const
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 2156 of file MooseMesh.C.

Referenced by MooseMesh::cacheInfo().

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

◆ getBoundaryIDs() [3/3]

std::vector< BoundaryID > MooseMesh::getBoundaryIDs ( const std::vector< BoundaryName > &  boundary_name,
bool  generate_unknown = false 
) const
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 1017 of file MooseMesh.C.

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

◆ getBoundaryName()

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

Return the name of the boundary given the id.

Definition at line 1141 of file MooseMesh.C.

Referenced by MaterialPropertyDebugOutput::printMaterialMap().

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

◆ getBoundaryNodeRange()

ConstBndNodeRange * MooseMesh::getBoundaryNodeRange ( )
inherited

Definition at line 789 of file MooseMesh.C.

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

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

◆ getCheckedPointerParam()

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

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

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

Definition at line 77 of file MooseObject.h.

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

◆ getCoarseningMap()

const std::vector< std::pair< unsigned int, QpMap > > & MooseMesh::getCoarseningMap ( const Elem &  elem,
int  input_side 
)
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 1726 of file MooseMesh.C.

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

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

◆ getFileName()

virtual std::string MooseMesh::getFileName ( ) const
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 852 of file MooseMesh.h.

852 { 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 2380 of file MooseMesh.C.

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

◆ getGhostedBoundaryInflation()

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

Return a writable reference to the _ghosted_boundaries_inflation vector.

Definition at line 2386 of file MooseMesh.C.

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

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

◆ getGhostingPatchSize()

unsigned int MooseMesh::getGhostingPatchSize ( ) const
inlineinherited

Getter for the ghosting_patch_size parameter.

Definition at line 465 of file MooseMesh.h.

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

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

◆ getInflatedProcessorBoundingBox()

BoundingBox MooseMesh::getInflatedProcessorBoundingBox ( Real  inflation_multiplier = 0.01) const
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 2539 of file MooseMesh.C.

Referenced by PointSamplerBase::execute().

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

◆ getLocalNodeRange()

ConstNodeRange * MooseMesh::getLocalNodeRange ( )
inherited

Definition at line 775 of file MooseMesh.C.

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

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

◆ getMaxInDimension()

Real GeneratedMesh::getMaxInDimension ( unsigned int  component) const
overridevirtualinherited

Reimplemented from MooseMesh.

Definition at line 135 of file GeneratedMesh.C.

136 {
138  return MooseMesh::getMaxInDimension(component);
139 
140  switch (component)
141  {
142  case 0:
143  return _xmax;
144  case 1:
145  return _dim > 1 ? _ymax : 0;
146  case 2:
147  return _dim > 2 ? _zmax : 0;
148  default:
149  mooseError("Invalid component");
150  }
151 }
virtual Real getMaxInDimension(unsigned int component) const
Definition: MooseMesh.C:1470
MooseEnum _dim
The dimension of the mesh.
Definition: GeneratedMesh.h:41
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
bool _dims_may_have_changed
Boolean to indicate that dimensions may have changed.
Definition: GeneratedMesh.h:64

◆ getMaxLeafSize()

unsigned int MooseMesh::getMaxLeafSize ( ) const
inlineinherited

Getter for the maximum leaf size parameter.

Definition at line 470 of file MooseMesh.h.

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

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

◆ getMesh() [1/2]

MeshBase & MooseMesh::getMesh ( )
inherited

Accessor for the underlying libMesh Mesh object.

Definition at line 2562 of file MooseMesh.C.

Referenced by MooseMesh::activeLocalElementsBegin(), MooseMesh::activeLocalElementsEnd(), Adaptivity::adaptMesh(), BreakMeshByBlock::addInterfaceBoundary(), MooseMesh::addQuadratureNode(), MooseMesh::addUniqueNode(), GeometricRelationshipManager::attachGeometricFunctorHelper(), RelationshipManager::attachRelationshipManagers(), MooseMesh::buildBndElemList(), TiledMesh::buildMesh(), FileMesh::buildMesh(), AnnularMesh::buildMesh(), GeneratedMesh::buildMesh(), RinglebMesh::buildMesh(), SpiralAnnularMesh::buildMesh(), DistributedGeneratedMesh::buildMesh(), ConcentricCircleMesh::buildMesh(), StitchedMesh::buildMesh(), PatternedMesh::buildMesh(), buildMesh2D(), 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(), VerifyElementUniqueID::initialize(), VerifyNodalUniqueID::initialize(), OversampleOutput::initOversample(), MooseMesh::localNodesBegin(), MooseMesh::localNodesEnd(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), MooseMesh::maxElemId(), MooseMesh::maxNodeId(), GeometryBase::meshChanged(), Nemesis::meshChanged(), BreakBoundaryOnSubdomain::modify(), BreakMeshByBlock::modify(), SideSetsBetweenSubdomains::modify(), SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), MeshSideSet::modify(), LowerDBlockFromSideset::modify(), AssignSubdomainID::modify(), AssignElementSubdomainID::modify(), SmoothMesh::modify(), ElementDeleterBase::modify(), AddAllSideSetsByNormals::modify(), ParsedAddSideset::modify(), SideSetsAroundSubdomain::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), ImageSubdomain::modify(), OrientedSubdomainBoundingBox::modify(), BoundingBoxNodeSet::modify(), SubdomainBoundingBox::modify(), AddSideSetsFromBoundingBox::modify(), MooseMesh::MooseMesh(), MooseMesh::nElem(), MooseMesh::nNodes(), NodalPatchRecovery::NodalPatchRecovery(), NodalVariableValue::NodalVariableValue(), MooseMesh::nodePtr(), MooseMesh::nodeRef(), MooseMesh::nodeToActiveSemilocalElemMap(), MooseMesh::nodeToElemMap(), ComputeNodalUserObjectsThread::onNode(), 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().

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

◆ getMesh() [2/2]

const MeshBase & MooseMesh::getMesh ( ) const
inherited

Definition at line 2569 of file MooseMesh.C.

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

◆ getMinInDimension()

Real GeneratedMesh::getMinInDimension ( unsigned int  component) const
overridevirtualinherited

Returns the min or max of the requested dimension respectively.

Reimplemented from MooseMesh.

Definition at line 116 of file GeneratedMesh.C.

Referenced by GeneratedMesh::buildMesh().

117 {
119  return MooseMesh::getMinInDimension(component);
120 
121  switch (component)
122  {
123  case 0:
124  return _xmin;
125  case 1:
126  return _dim > 1 ? _ymin : 0;
127  case 2:
128  return _dim > 2 ? _zmin : 0;
129  default:
130  mooseError("Invalid component");
131  }
132 }
virtual Real getMinInDimension(unsigned int component) const
Returns the min or max of the requested dimension respectively.
Definition: MooseMesh.C:1461
MooseEnum _dim
The dimension of the mesh.
Definition: GeneratedMesh.h:41
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
bool _dims_may_have_changed
Boolean to indicate that dimensions may have changed.
Definition: GeneratedMesh.h:64
Real _xmin
The min/max values for x,y,z component.
Definition: GeneratedMesh.h:47

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

Referenced by GeometricSearchData::generateMortarNodes().

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

◆ getMortarInterfaceByName()

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

Definition at line 2691 of file MooseMesh.C.

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

◆ getMortarInterfaces()

std::vector<std::unique_ptr<MooseMesh::MortarInterface> >& MooseMesh::getMortarInterfaces ( )
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 842 of file MooseMesh.C.

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

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

◆ getNodeList()

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

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

Definition at line 2589 of file MooseMesh.C.

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

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

◆ getNormalByBoundaryID()

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

Returns the normal vector associated with a given BoundaryID.

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

Definition at line 1948 of file MooseMesh.C.

1949 {
1950  mooseAssert(_boundary_to_normal_map.get() != nullptr, "Boundary To Normal Map not built!");
1951 
1952  // Note: Boundaries that are not in the map (existing boundaries) will default
1953  // construct a new RealVectorValue - (x,y,z)=(0, 0, 0)
1954  return (*_boundary_to_normal_map)[id];
1955 }
std::unique_ptr< std::map< BoundaryID, RealVectorValue > > _boundary_to_normal_map
The boundary to normal map - valid only when AddAllSideSetsByNormals is active.
Definition: MooseMesh.h:969

◆ getPairedBoundaryMapping()

const std::pair< BoundaryID, BoundaryID > * MooseMesh::getPairedBoundaryMapping ( unsigned int  component)
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 1542 of file MooseMesh.C.

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

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

◆ getParam()

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

Retrieve a parameter for the object.

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

Definition at line 188 of file MooseObject.h.

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

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

◆ getPatchSize()

unsigned int MooseMesh::getPatchSize ( ) const
inherited

Getter for the patch_size parameter.

Definition at line 2521 of file MooseMesh.C.

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

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

◆ getPatchUpdateStrategy()

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

Get the current patch update strategy.

Definition at line 2533 of file MooseMesh.C.

Referenced by FEProblemBase::possiblyRebuildGeomSearchPatches().

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

◆ GetPixelInfo()

void ImageMesh::GetPixelInfo ( std::string  filename,
int &  xpixels,
int &  ypixels 
)
protected

Process a single image with the 'file' command to find out the number of pixels in the x and y directions.

Definition at line 184 of file ImageMesh.C.

Referenced by buildMesh2D(), and buildMesh3D().

185 {
186  // For reporting possible error messages
187  std::string error_message = "";
188 
189  // A template for creating a temporary file.
190  char temp_file[] = "file_command_output.XXXXXX";
191 
192  // Use a do-loop so we can break out under various error conditions
193  // while still cleaning up temporary files. Basically use goto
194  // statements without actually using them.
195  do
196  {
197  // mkstemp is not in namespace std for whatever reason...
198  int fd = mkstemp(temp_file);
199 
200  // If mkstemp fails, we failed.
201  if (fd == -1)
202  {
203  error_message = "Error creating temporary file in ImageMesh::buildMesh()";
204  break;
205  }
206 
207  // Construct the command string
208  std::ostringstream command;
209  command << "file " << filename << " 2>/dev/null 1>" << temp_file;
210 
211  // Make the system call, catch the return code
212  int exit_status = std::system(command.str().c_str());
213 
214  // If the system command returned a non-zero status, we failed.
215  if (exit_status != 0)
216  {
217  error_message = "Error calling 'file' command in ImageMesh::buildMesh()";
218  break;
219  }
220 
221  // Open the file which contains the result of the system command
222  std::ifstream fin(temp_file);
223 
224  // Read the contents of the output file into a string
225  std::string command_result;
226  std::getline(fin, command_result);
227 
228  // A regular expression which matches "NNN x NNN" , i.e. any number
229  // of digits, a space, an 'x', a space, and any number of digits.
230  // The parentheses define capture groups which are stored into the
231  // xsize and ysize integers.
232  // Here's an example string:
233  // sixteenth_image001_cropped3_closing_298.png: PNG image data, 115 x 99, 16-bit/color RGB,
234  // non-interlaced
235  xpixels = 0, ypixels = 0;
236  pcrecpp::RE re("(\\d+) x (\\d+)");
237  re.PartialMatch(command_result, &xpixels, &ypixels);
238 
239  // Detect failure of the regex
240  if ((xpixels == 0) || (ypixels == 0))
241  {
242  error_message = "Regex failed to find a match in " + command_result;
243  break;
244  }
245  } while (false);
246 
247  // Remove the temporary file. This will still work even if the file was never created...
248  std::remove(temp_file);
249 
250  // Report and exit if there was an error
251  if (error_message != "")
252  mooseError(error_message);
253 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
nl system()

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

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

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

◆ getQuadratureNode()

Node * MooseMesh::getQuadratureNode ( const Elem *  elem,
const unsigned short int  side,
const unsigned int  qp 
)
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 972 of file MooseMesh.C.

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

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

◆ getRefinementMap()

const std::vector< std::vector< QpMap > > & MooseMesh::getRefinementMap ( const Elem &  elem,
int  parent_side,
int  child,
int  child_side 
)
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 1662 of file MooseMesh.C.

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

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

◆ getSubdomainBoundaryIds()

const std::set< BoundaryID > & MooseMesh::getSubdomainBoundaryIds ( SubdomainID  subdomain_id) const
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 2616 of file MooseMesh.C.

Referenced by FEProblemBase::prepareMaterials().

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

◆ getSubdomainID()

SubdomainID MooseMesh::getSubdomainID ( const SubdomainName &  subdomain_name) const
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 1070 of file MooseMesh.C.

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

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

◆ getSubdomainIDs()

std::vector< SubdomainID > MooseMesh::getSubdomainIDs ( const std::vector< SubdomainName > &  subdomain_name) const
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 1085 of file MooseMesh.C.

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

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

◆ getSubdomainName()

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

Return the name of a block given an id.

Definition at line 1119 of file MooseMesh.C.

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

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

◆ ghostGhostedBoundaries()

void MooseMesh::ghostGhostedBoundaries ( )
inherited

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

Definition at line 2450 of file MooseMesh.C.

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

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

◆ hasSecondOrderElements()

bool MooseMesh::hasSecondOrderElements ( )
inherited

check if the mesh has SECOND order elements

Definition at line 2725 of file MooseMesh.C.

Referenced by Assembly::Assembly().

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

◆ init()

void MooseMesh::init ( )
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 2027 of file MooseMesh.C.

Referenced by GridPartitioner::_do_partition().

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

◆ isBoundaryElem() [1/2]

bool MooseMesh::isBoundaryElem ( dof_id_type  elem_id) const
inherited

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

Definition at line 2654 of file MooseMesh.C.

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

◆ isBoundaryElem() [2/2]

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

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

Definition at line 2669 of file MooseMesh.C.

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

◆ isBoundaryNode() [1/2]

bool MooseMesh::isBoundaryNode ( dof_id_type  node_id) const
inherited

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

Definition at line 2628 of file MooseMesh.C.

Referenced by NodalNormalsPreprocessor::execute().

2629 {
2630  bool found_node = false;
2631  for (const auto & it : _bnd_node_ids)
2632  {
2633  if (it.second.find(node_id) != it.second.end())
2634  {
2635  found_node = true;
2636  break;
2637  }
2638  }
2639  return found_node;
2640 }
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_node_ids
Map of sets of node IDs in each boundary.
Definition: MooseMesh.h:976

◆ isBoundaryNode() [2/2]

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

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

Definition at line 2643 of file MooseMesh.C.

2644 {
2645  bool found_node = false;
2646  std::map<boundary_id_type, std::set<dof_id_type>>::const_iterator it = _bnd_node_ids.find(bnd_id);
2647  if (it != _bnd_node_ids.end())
2648  if (it->second.find(node_id) != it->second.end())
2649  found_node = true;
2650  return found_node;
2651 }
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_node_ids
Map of sets of node IDs in each boundary.
Definition: MooseMesh.h:976

◆ isCustomPartitionerRequested()

bool MooseMesh::isCustomPartitionerRequested ( ) const
inherited

Setter and getter for _custom_partitioner_requested.

Definition at line 2719 of file MooseMesh.C.

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

◆ isDistributedMesh()

bool MooseMesh::isDistributedMesh ( ) const
inlineinherited

◆ isParallelTypeForced()

bool MooseMesh::isParallelTypeForced ( ) const
inlineinherited

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

Definition at line 780 of file MooseMesh.h.

Referenced by ConsoleUtils::outputMeshInformation().

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

◆ isParamValid()

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

Test if the supplied parameter is valid.

Parameters
nameThe name of the parameter to test

Definition at line 86 of file MooseObject.h.

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

Referenced by ConsoleUtils::outputMeshInformation().

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

◆ isRegularOrthogonal()

bool MooseMesh::isRegularOrthogonal ( )
inlineinherited

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

Definition at line 837 of file MooseMesh.h.

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

◆ isSemiLocal()

bool MooseMesh::isSemiLocal ( Node *  node)
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 601 of file MooseMesh.C.

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

◆ isTranslatedPeriodic()

bool MooseMesh::isTranslatedPeriodic ( unsigned int  nonlinear_var_num,
unsigned int  component 
) const
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 1500 of file MooseMesh.C.

Referenced by MooseMesh::minPeriodicVector().

1501 {
1502  mooseAssert(component < dimension(), "Requested dimension out of bounds");
1503 
1504  if (_periodic_dim.find(nonlinear_var_num) != _periodic_dim.end())
1505  return _periodic_dim.at(nonlinear_var_num)[component];
1506  else
1507  return false;
1508 }
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:2128
std::map< unsigned int, std::vector< bool > > _periodic_dim
A map of vectors indicating which dimensions are periodic in a regular orthogonal mesh for the specif...
Definition: MooseMesh.h:1038

◆ localNodesBegin()

MeshBase::const_node_iterator MooseMesh::localNodesBegin ( )
inherited

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

Definition at line 2200 of file MooseMesh.C.

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

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

◆ localNodesEnd()

MeshBase::const_node_iterator MooseMesh::localNodesEnd ( )
inherited

Definition at line 2206 of file MooseMesh.C.

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

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

◆ maxElemId()

dof_id_type MooseMesh::maxElemId ( ) const
virtualinherited

Definition at line 2242 of file MooseMesh.C.

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

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

◆ maxNodeId()

dof_id_type MooseMesh::maxNodeId ( ) const
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 2236 of file MooseMesh.C.

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

◆ meshBoundaryIds()

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

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

Definition at line 2317 of file MooseMesh.C.

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

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

◆ meshChanged()

void MooseMesh::meshChanged ( )
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 491 of file MooseMesh.C.

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

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

◆ meshNodesetIds()

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

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

Definition at line 2329 of file MooseMesh.C.

Referenced by BoundaryRestrictable::initializeBoundaryRestrictable().

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

◆ meshSidesetIds()

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

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

Definition at line 2323 of file MooseMesh.C.

Referenced by BoundaryRestrictable::initializeBoundaryRestrictable().

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

◆ meshSubdomains()

const std::set< SubdomainID > & MooseMesh::meshSubdomains ( ) const
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 1536 of file MooseMesh.C.

1537 {
1538  return minPeriodicVector(nonlinear_var_num, p, q).norm();
1539 }
RealVectorValue minPeriodicVector(unsigned int nonlinear_var_num, Point p, Point q) const
This function returns the minimum vector between two points on the mesh taking into account periodici...
Definition: MooseMesh.C:1511

◆ minPeriodicVector()

RealVectorValue MooseMesh::minPeriodicVector ( unsigned int  nonlinear_var_num,
Point  p,
Point  q 
) const
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 1511 of file MooseMesh.C.

Referenced by MooseMesh::minPeriodicDistance().

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

◆ mooseDeprecated()

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

◆ mooseError()

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

Definition at line 144 of file MooseObject.h.

Referenced by PetscExternalPartitioner::_do_partition(), GridPartitioner::_do_partition(), FEProblemBase::addConstraint(), FEProblemBase::addInitialCondition(), FEProblem::addLineSearch(), FEProblemBase::addLineSearch(), FEProblemBase::addOutput(), DiracKernel::addPointWithValidId(), FEProblemBase::addPostprocessor(), MooseMesh::addQuadratureNode(), FEProblemBase::addVectorPostprocessor(), Output::advancedExecuteOn(), AnnularMesh::AnnularMesh(), AnnularMeshGenerator::AnnularMeshGenerator(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), DerivativeParsedMaterialHelper::assembleDerivatives(), Function::average(), Axisymmetric2D3DSolutionFunction::Axisymmetric2D3DSolutionFunction(), BicubicSplineFunction::BicubicSplineFunction(), BoundingValueElementDamper::BoundingValueElementDamper(), BoundingValueNodalDamper::BoundingValueNodalDamper(), BoundsAux::BoundsAux(), BreakMeshByBlockGenerator::BreakMeshByBlockGenerator(), BreakMeshByBlockGeneratorBase::BreakMeshByBlockGeneratorBase(), MooseMesh::buildCoarseningMap(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), Piecewise::buildFromXY(), TiledMesh::buildMesh(), FileMesh::buildMesh(), SpiralAnnularMesh::buildMesh(), DistributedGeneratedMesh::buildMesh(), GeneratedMesh::buildMesh(), ImageMeshGenerator::buildMesh3D(), 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(), ConcentricCircleMeshGenerator::ConcentricCircleMeshGenerator(), TimeStepper::constrainStep(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), CoupledForce::CoupledForce(), DebugResidualAux::DebugResidualAux(), BicubicSplineFunction::derivative(), DerivativeSumMaterial::DerivativeSumMaterial(), DGKernel::DGKernel(), FEProblemBase::duplicateVariableCheck(), EigenProblem::EigenProblem(), Eigenvalues::Eigenvalues(), ElementalVariableValue::ElementalVariableValue(), ElementQualityAux::ElementQualityAux(), MooseMesh::errorIfDistributedMesh(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), MultiAppPostprocessorTransfer::execute(), DiscreteElementUserObject::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), ElementQualityChecker::execute(), NodalValueSampler::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), FindValueOnLine::execute(), MultiAppNearestNodeTransfer::execute(), TimeExtremeValue::execute(), VectorPostprocessorComparison::execute(), LeastSquaresFit::execute(), LeastSquaresFitHistory::execute(), FEProblemBase::executeControls(), MultiAppVectorPostprocessorTransfer::executeFromMultiapp(), MultiAppVectorPostprocessorTransfer::executeToMultiapp(), Exodus::Exodus(), FileOutput::FileOutput(), CentroidMultiApp::fillPositions(), MultiApp::fillPositions(), VerifyNodalUniqueID::finalize(), VerifyElementUniqueID::finalize(), DiscreteElementUserObject::finalize(), ElementQualityChecker::finalize(), MemoryUsage::finalize(), PointSamplerBase::finalize(), Transfer::find_sys(), BreakMeshByBlockBase::findFreeBoundaryId(), BreakMeshByBlockGeneratorBase::findFreeBoundaryId(), FunctionDT::FunctionDT(), FunctionMaterialBase::FunctionMaterialBase(), ParsedMaterialHelper::functionParse(), FunctionScalarAux::FunctionScalarAux(), FunctionScalarIC::FunctionScalarIC(), GapValueAux::GapValueAux(), ElementSubdomainIDGenerator::generate(), ExtraNodesetGenerator::generate(), RenameBlockGenerator::generate(), RenameBoundaryGenerator::generate(), GeneratedMeshGenerator::generate(), MeshExtruderGenerator::generate(), SideSetsFromBoundingBoxGenerator::generate(), StackGenerator::generate(), SpiralAnnularMeshGenerator::generate(), PatternedMeshGenerator::generate(), BoundingBoxNodeSetGenerator::generate(), GeneratedMesh::GeneratedMesh(), GeneratedMeshGenerator::GeneratedMeshGenerator(), RandomICBase::generateRandom(), GenericConstantMaterial::GenericConstantMaterial(), GenericFunctionMaterial::GenericFunctionMaterial(), MooseMesh::getBoundaryID(), MultiApp::getBoundingBox(), MooseMesh::getCoarseningMap(), Control::getControllableParameterByName(), FEProblemBase::getCoordSystem(), PiecewiseConstant::getDirection(), FEProblemBase::getDistribution(), ElementGenerator::getElemType(), MultiApp::getExecutioner(), FEProblemBase::getFunction(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), SubProblem::getMatrixTagID(), AnnularMesh::getMaxInDimension(), DistributedGeneratedMesh::getMaxInDimension(), GeneratedMesh::getMaxInDimension(), FEProblemBase::getMaxQps(), FEProblemBase::getMaxShapeFunctions(), AnnularMesh::getMinInDimension(), DistributedGeneratedMesh::getMinInDimension(), GeneratedMesh::getMinInDimension(), MooseMesh::getMortarInterface(), MooseMesh::getMortarInterfaceByName(), MooseMesh::getNodeBlockIds(), MooseMesh::getNodeList(), FEProblemBase::getNonlinearSystem(), MooseMesh::getPairedBoundaryMapping(), ImageMeshGenerator::GetPixelInfo(), GetPixelInfo(), 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(), 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(), SubProblem::meshChanged(), MeshExtruder::MeshExtruder(), MeshExtruderGenerator::MeshExtruderGenerator(), MeshSideSetGenerator::MeshSideSetGenerator(), SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), MeshExtruder::modify(), BreakMeshByBlockBase::modify(), AddExtraNodeset::modify(), AssignElementSubdomainID::modify(), SmoothMesh::modify(), AddAllSideSetsByNormals::modify(), ElementDeleterBase::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), ImageSubdomain::modify(), OrientedSubdomainBoundingBox::modify(), BoundingBoxNodeSet::modify(), AddSideSetsFromBoundingBox::modify(), SubdomainBoundingBox::modify(), MooseMesh::MooseMesh(), MultiAppMeshFunctionTransfer::MultiAppMeshFunctionTransfer(), MultiAppPostprocessorTransfer::MultiAppPostprocessorTransfer(), NearestNodeDistanceAux::NearestNodeDistanceAux(), NearestNodeValueAux::NearestNodeValueAux(), RenameBlockGenerator::newBlockID(), RenameBlock::newBlockID(), RenameBlockGenerator::newBlockName(), RenameBlock::newBlockName(), NewmarkBeta::NewmarkBeta(), NodalConstraint::NodalConstraint(), NodalScalarKernel::NodalScalarKernel(), NodalVariableValue::NodalVariableValue(), NumDOFs::NumDOFs(), NumNonlinearIterations::NumNonlinearIterations(), NumVars::NumVars(), ElementSideNeighborLayers::operator()(), ElementPointNeighbors::operator()(), RelationshipManager::operator==(), XDA::output(), SolutionHistory::output(), Exodus::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), Console::outputVectorPostprocessors(), AdvancedOutput::outputVectorPostprocessors(), MooseObject::paramError(), PiecewiseBilinear::parse(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedGenerateSideset::ParsedGenerateSideset(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshGenerator::ParsedSubdomainMeshGenerator(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PetscExternalPartitioner::PetscExternalPartitioner(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), Piecewise::Piecewise(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), PiecewiseMulticonstant::PiecewiseMulticonstant(), PiecewiseMultiInterpolation::PiecewiseMultiInterpolation(), SolutionUserObject::pointValueGradientWrapper(), SolutionUserObject::pointValueWrapper(), LStableDirk2::postResidual(), LStableDirk3::postResidual(), ImplicitMidpoint::postResidual(), ExplicitTVDRK2::postResidual(), AStableDirk4::postResidual(), LStableDirk4::postResidual(), ExplicitRK2::postResidual(), Predictor::Predictor(), Transient::preExecute(), SolutionUserObject::readExodusII(), SolutionUserObject::readXda(), EqualValueEmbeddedConstraint::reinitConstraint(), RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm(), RenameBlock::RenameBlock(), RenameBlockGenerator::RenameBlockGenerator(), RenameBoundaryGenerator::RenameBoundaryGenerator(), RinglebMesh::RinglebMesh(), RinglebMeshGenerator::RinglebMeshGenerator(), ScalarComponentIC::ScalarComponentIC(), BicubicSplineFunction::secondDerivative(), FEProblemBase::setCoordSystem(), PiecewiseBase::setData(), EigenProblem::setEigenproblemType(), Sampler::setNumberOfRequiedRandomSeeds(), Exodus::setOutputDimensionInExodusWriter(), Split::setup(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), SideSetsFromBoundingBoxGenerator::SideSetsFromBoundingBoxGenerator(), SideSetsFromNormals::SideSetsFromNormals(), SideSetsFromNormalsGenerator::SideSetsFromNormalsGenerator(), SideSetsFromPoints::SideSetsFromPoints(), SideSetsFromPointsGenerator::SideSetsFromPointsGenerator(), SolutionTimeAdaptiveDT::SolutionTimeAdaptiveDT(), SolutionUserObject::SolutionUserObject(), PicardSolve::solve(), ActuallyExplicitEuler::solve(), FullSolveMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), SpiralAnnularMesh::SpiralAnnularMesh(), SpiralAnnularMeshGenerator::SpiralAnnularMeshGenerator(), StitchedMesh::StitchedMesh(), NodalUserObject::subdomainSetup(), GeneralUserObject::subdomainSetup(), Constraint::subdomainSetup(), Console::systemInfoFlags(), Terminator::Terminator(), TestSetupPostprocessorDataActionFunction::TestSetupPostprocessorDataActionFunction(), ThreadedGeneralUserObject::ThreadedGeneralUserObject(), ThreadedGeneralUserObject::threadJoin(), DiscreteElementUserObject::threadJoin(), GeneralUserObject::threadJoin(), TiledMeshGenerator::TiledMeshGenerator(), Function::timeDerivative(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), VectorPostprocessorVisualizationAux::timestepSetup(), MultiAppCopyTransfer::transfer(), MultiAppMeshFunctionTransfer::transferVariable(), FEProblemBase::uDotDotOldRequested(), FEProblemBase::uDotOldRequested(), EqualValueBoundaryConstraint::updateConstrainedNodes(), SolutionUserObject::updateExodusBracketingTimeIndices(), Axisymmetric2D3DSolutionFunction::value(), ValueRangeMarker::ValueRangeMarker(), ValueThresholdMarker::ValueThresholdMarker(), MultiAppTransfer::variableIntegrityCheck(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), VectorNodalBC::VectorNodalBC(), VectorOfPostprocessors::VectorOfPostprocessors(), VectorPostprocessorFunction::VectorPostprocessorFunction(), MooseParsedGradFunction::vectorValue(), MooseParsedFunction::vectorValue(), VolumeHistogram::VolumeHistogram(), VTKOutput::VTKOutput(), DOFMapOutput::writeStreamToFile(), and Console::writeStreamToFile().

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

◆ mooseInfo()

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

◆ mooseWarning()

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

◆ name()

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

Get the name of the object.

Returns
The name of the object

Definition at line 56 of file MooseObject.h.

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

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

◆ needsPrepareForUse()

void MooseMesh::needsPrepareForUse ( )
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 2305 of file MooseMesh.C.

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

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

◆ nElem()

dof_id_type MooseMesh::nElem ( ) const
virtualinherited

Definition at line 2230 of file MooseMesh.C.

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

◆ nNodes()

dof_id_type MooseMesh::nNodes ( ) const
virtualinherited

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

Definition at line 2224 of file MooseMesh.C.

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

◆ node() [1/2]

const Node & MooseMesh::node ( const dof_id_type  i) const
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 423 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().

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

◆ node() [2/2]

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

Definition at line 430 of file MooseMesh.C.

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

◆ nodePtr() [1/2]

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

Definition at line 455 of file MooseMesh.C.

Referenced by dataLoad().

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

◆ nodePtr() [2/2]

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

Definition at line 464 of file MooseMesh.C.

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

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

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

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

714 {
715  if (!_node_to_active_semilocal_elem_map_built) // Guard the creation with a double checked lock
716  {
717  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
718 
720 
722  {
723  for (const auto & elem :
724  as_range(getMesh().semilocal_elements_begin(), getMesh().semilocal_elements_end()))
725  if (elem->active())
726  for (unsigned int n = 0; n < elem->n_nodes(); n++)
727  _node_to_active_semilocal_elem_map[elem->node_id(n)].push_back(elem->id());
728 
730  true; // MUST be set at the end for double-checked locking to work!
731  }
732  }
733 
735 }
bool _node_to_active_semilocal_elem_map_built
Definition: MooseMesh.h:949
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
PetscInt n
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248
PerfID _node_to_active_semilocal_elem_map_timer
Definition: MooseMesh.h:1156
std::map< dof_id_type, std::vector< dof_id_type > > _node_to_active_semilocal_elem_map
A map of all of the current nodes to the active elements that they are connected to.
Definition: MooseMesh.h:948

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

692 {
693  if (!_node_to_elem_map_built) // Guard the creation with a double checked lock
694  {
695  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
696 
698  {
699  TIME_SECTION(_node_to_elem_map_timer);
700 
701  for (const auto & elem : getMesh().active_element_ptr_range())
702  for (unsigned int n = 0; n < elem->n_nodes(); n++)
703  _node_to_elem_map[elem->node_id(n)].push_back(elem->id());
704 
705  _node_to_elem_map_built = true; // MUST be set at the end for double-checked locking to work!
706  }
707  }
708 
709  return _node_to_elem_map;
710 }
bool _node_to_elem_map_built
Definition: MooseMesh.h:945
std::map< dof_id_type, std::vector< dof_id_type > > _node_to_elem_map
A map of all of the current nodes to the elements that they are connected to.
Definition: MooseMesh.h:944
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
PetscInt n
virtual Elem * elem(const dof_id_type i)
Various accessors (pointers/references) for Elem "i".
Definition: MooseMesh.C:2248
PerfID _node_to_elem_map_timer
Definition: MooseMesh.h:1155

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

Referenced by MooseMesh::meshChanged().

518 {
519 }

◆ operator const libMesh::MeshBase &()

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

Definition at line 2559 of file MooseMesh.C.

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

◆ operator libMesh::MeshBase &()

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

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

Definition at line 2557 of file MooseMesh.C.

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

◆ 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(), DGKernel::DGKernel(), ElementValueSampler::ElementValueSampler(), StackGenerator::generate(), StitchedMeshGenerator::generate(), MultiApp::init(), IntegratedBC::IntegratedBC(), Kernel::Kernel(), 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(), AdvancedOutput::AdvancedOutput(), assemble_l2(), Moose::assemble_matrix(), AuxKernel::AuxKernel(), 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(), Executioner::Executioner(), Exodus::Exodus(), FEProblem::FEProblem(), GapValueAux::GapValueAux(), MooseObject::getCheckedPointerParam(), 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 785 of file MooseMesh.h.

Referenced by ConsoleUtils::outputMeshInformation().

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

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

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

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

◆ prepared() [1/2]

void GeneratedMesh::prepared ( bool  state)
overridevirtualinherited

Reimplemented from MooseMesh.

Definition at line 106 of file GeneratedMesh.C.

107 {
108  MooseMesh::prepared(state);
109 
110  // Fall back on scanning the mesh for coordinates instead of using input parameters for queries
111  if (!state)
112  _dims_may_have_changed = true;
113 }
bool prepared() const
Setter/getter for the _is_prepared flag.
Definition: MooseMesh.C:2286
bool _dims_may_have_changed
Boolean to indicate that dimensions may have changed.
Definition: GeneratedMesh.h:64

◆ prepared() [2/2]

bool MooseMesh::prepared ( ) const
inherited

Setter/getter for the _is_prepared flag.

Definition at line 2286 of file MooseMesh.C.

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

2287 {
2288  return _is_prepared;
2289 }
bool _is_prepared
True if prepare has been called on the mesh.
Definition: MooseMesh.h:909

◆ printInfo()

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

Calls print_info() on the underlying Mesh.

Definition at line 2583 of file MooseMesh.C.

Referenced by Adaptivity::adaptMesh().

2584 {
2585  getMesh().print_info(os);
2586 }
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562

◆ queryElemPtr() [1/2]

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

Definition at line 2274 of file MooseMesh.C.

Referenced by EqualValueBoundaryConstraint::updateConstrainedNodes().

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

◆ queryElemPtr() [2/2]

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

Definition at line 2280 of file MooseMesh.C.

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

◆ queryNodePtr() [1/2]

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

Definition at line 473 of file MooseMesh.C.

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

474 {
475  if (i > getMesh().max_node_id())
476  return (*_quadrature_nodes.find(i)).second;
477 
478  return getMesh().q