https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
PeridynamicsMesh Class Reference

Peridynamics mesh class. More...

#include <PeridynamicsMesh.h>

Inheritance diagram for PeridynamicsMesh:
[legend]

Public Types

enum  ParallelType { ParallelType::DEFAULT, ParallelType::REPLICATED, ParallelType::DISTRIBUTED }
 
typedef std::pair< const Node *, BoundaryIDPeriodicNodeInfo
 
typedef DataFileName DataFileParameterType
 

Public Member Functions

 PeridynamicsMesh (const InputParameters &parameters)
 
 PeridynamicsMesh (const PeridynamicsMesh &)=default
 
PeridynamicsMeshoperator= (const PeridynamicsMesh &other_mesh)=delete
 
virtual std::unique_ptr< MooseMeshsafeClone () const override
 
virtual void buildMesh () override
 
virtual unsigned int dimension () const override
 
dof_id_type nPDNodes () const
 Function to return number of PD nodes. More...
 
dof_id_type nPDBonds () const
 Function to return number of PD Edge elements. More...
 
void createPeridynamicsMeshData (MeshBase &fe_mesh, std::set< dof_id_type > converted_elem_id, std::multimap< SubdomainID, SubdomainID > bonding_block_pairs, std::multimap< SubdomainID, SubdomainID > non_bonding_block_pairs)
 Function to assign values to member variables (PD mesh data) of this class this function will be called in the PD mesh generator class. More...
 
std::vector< dof_id_typegetNeighbors (dof_id_type node_id)
 Function to return neighbor nodes indices for node node_id. More...
 
dof_id_type getNeighborIndex (dof_id_type node_i, dof_id_type node_j)
 Function to return the local neighbor index of node_j from node_i's neighbor list. More...
 
std::vector< dof_id_typegetBonds (dof_id_type node_id)
 Function to return the bond number connected with node node_id. More...
 
std::vector< dof_id_typegetBondDeformationGradientNeighbors (dof_id_type node_id, dof_id_type neighbor_id)
 Function to return indices of neighbors used in formulation of bond-associated deformation gradient for bond connecting node_id and neighbor_id. More...
 
SubdomainID getNodeBlockID (dof_id_type node_id)
 Function to return block ID for node node_id. More...
 
void setNodeBlockID (SubdomainID id)
 Function to set block ID for all PD nodes. More...
 
Point getNodeCoord (dof_id_type node_id)
 Function to return coordinates for node node_id. More...
 
std::vector< dof_id_typegetPDNodeIDToFEElemIDMap ()
 Function to return the correspondence between PD node IDs and FE element IDs. More...
 
Real getNodeVolume (dof_id_type node_id)
 Function to return nodal volume for node node_id. More...
 
Real getHorizonVolume (dof_id_type node_id)
 Function to return summation of neighbor nodal volumes for node node_id. More...
 
Real getHorizonSubsetVolume (dof_id_type node_id, dof_id_type neighbor_id)
 Function to return the volume of a horizon subset for bond-associated deformation gradient calculation for bond connecting node node_id and its neighbor neighbor_id. More...
 
Real getHorizonSubsetVolumeSum (dof_id_type node_id)
 Function to return the summation of all horizon subset volumes for node node_id. More...
 
Real getHorizonSubsetVolumeFraction (dof_id_type node_id, dof_id_type neighbor_id)
 Function to return the volume fraction of a horizon subset used for bond-associated deformation gradient calculation for bond connecting node node_id and its neighbor neighbor_id. More...
 
Real getNodeAverageSpacing (dof_id_type node_id)
 Function to return the average spacing between node node_id with its most adjacent neighbors. More...
 
Real getHorizon (dof_id_type node_id)
 Function to return horizon size. More...
 
Real getBoundaryOffset (dof_id_type node_id)
 Function to return offset for boundary nodes. More...
 
Real getNeighborWeight (dof_id_type node_id, dof_id_type neighbor_id)
 Function to return normalized weight for neighbor neighbor_id of node node_id based on predefined weight function. More...
 
virtual MooseMeshclone () const
 
void determineUseDistributedMesh ()
 
std::unique_ptr< MeshBase > buildMeshBaseObject (unsigned int dim=libMesh::invalid_uint)
 
std::unique_ptr< T > buildTypedMesh (unsigned int dim=libMesh::invalid_uint)
 
void setMeshBase (std::unique_ptr< MeshBase > mesh_base)
 
virtual void init ()
 
virtual unsigned int spatialDimension () const
 
virtual unsigned int effectiveSpatialDimension () const
 
unsigned int getBlocksMaxDimension (const std::vector< SubdomainName > &blocks) const
 
std::vector< BoundaryIDgetBoundaryIDs (const Elem *const elem, const unsigned short int side) const
 
const std::set< BoundaryID > & getBoundaryIDs () const
 
std::vector< BoundaryIDgetBoundaryIDs (const std::vector< BoundaryName > &boundary_name, bool generate_unknown=false) const
 
const Elem * getLowerDElem (const Elem *, unsigned short int) const
 
unsigned int getHigherDSide (const Elem *elem) const
 
void buildNodeList ()
 
void buildBndElemList ()
 
const std::map< dof_id_type, std::vector< dof_id_type > > & nodeToElemMap ()
 
const std::map< dof_id_type, std::vector< dof_id_type > > & nodeToActiveSemilocalElemMap ()
 
virtual bnd_node_iterator bndNodesBegin ()
 
virtual bnd_node_iterator bndNodesEnd ()
 
virtual bnd_elem_iterator bndElemsBegin ()
 
virtual bnd_elem_iterator bndElemsEnd ()
 
void buildNodeListFromSideList ()
 
void buildSideList (std::vector< dof_id_type > &el, std::vector< unsigned short int > &sl, std::vector< boundary_id_type > &il)
 
std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > buildSideList ()
 
std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > buildActiveSideList () const
 
unsigned int sideWithBoundaryID (const Elem *const elem, const BoundaryID boundary_id) const
 
MeshBase::node_iterator localNodesBegin ()
 
MeshBase::const_node_iterator localNodesBegin () const
 
MeshBase::node_iterator localNodesEnd ()
 
MeshBase::const_node_iterator localNodesEnd () const
 
MeshBase::element_iterator activeLocalElementsBegin ()
 
MeshBase::const_element_iterator activeLocalElementsBegin () const
 
const MeshBase::element_iterator activeLocalElementsEnd ()
 
const MeshBase::const_element_iterator activeLocalElementsEnd () const
 
virtual dof_id_type nNodes () const
 
virtual dof_id_type nElem () const
 
virtual dof_id_type nLocalNodes () const
 
virtual dof_id_type nActiveElem () const
 
virtual dof_id_type nActiveLocalElem () const
 
virtual SubdomainID nSubdomains () const
 
virtual unsigned int nPartitions () const
 
virtual bool skipPartitioning () const
 
virtual bool skipNoncriticalPartitioning () const
 
virtual dof_id_type maxNodeId () const
 
virtual dof_id_type maxElemId () const
 
virtual const Node & node (const dof_id_type i) const
 
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)
 
virtual const Elem * elem (const dof_id_type i) const
 
virtual Elem * elemPtr (const dof_id_type i)
 
virtual const Elem * elemPtr (const dof_id_type i) const
 
virtual Elem * queryElemPtr (const dof_id_type i)
 
virtual const Elem * queryElemPtr (const dof_id_type i) const
 
bool prepared () const
 
virtual void prepared (bool state)
 
void needsPrepareForUse ()
 
void meshChanged ()
 
virtual void onMeshChanged ()
 
void cacheChangedLists ()
 
ConstElemPointerRangerefinedElementRange () const
 
ConstElemPointerRangecoarsenedElementRange () const
 
const std::vector< const Elem *> & coarsenedElementChildren (const Elem *elem) const
 
void updateActiveSemiLocalNodeRange (std::set< dof_id_type > &ghosted_elems)
 
bool isSemiLocal (Node *const node) const
 
const std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > & getBoundariesToElems () const
 
const std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > & getBoundariesToActiveSemiLocalElemIds () const
 
std::unordered_set< dof_id_typegetBoundaryActiveSemiLocalElemIds (BoundaryID bid) const
 
std::unordered_set< dof_id_typegetBoundaryActiveNeighborElemIds (BoundaryID bid) const
 
bool isBoundaryFullyExternalToSubdomains (BoundaryID bid, const std::set< SubdomainID > &blk_group) const
 
const std::set< SubdomainID > & meshSubdomains () const
 
const std::set< BoundaryID > & meshBoundaryIds () const
 
const std::set< BoundaryID > & meshSidesetIds () const
 
const std::set< BoundaryID > & meshNodesetIds () const
 
void setBoundaryToNormalMap (std::unique_ptr< std::map< BoundaryID, RealVectorValue >> boundary_map)
 
void setBoundaryToNormalMap (std::map< BoundaryID, RealVectorValue > *boundary_map)
 
void setMeshBoundaryIDs (std::set< BoundaryID > boundary_IDs)
 
const RealVectorValuegetNormalByBoundaryID (BoundaryID id) const
 
bool prepare (const MeshBase *mesh_to_clone)
 
void update ()
 
unsigned int uniformRefineLevel () const
 
void setUniformRefineLevel (unsigned int, bool deletion=true)
 
bool skipDeletionRepartitionAfterRefine () const
 
bool skipRefineWhenUseSplit () const
 
void addGhostedBoundary (BoundaryID boundary_id)
 
void setGhostedBoundaryInflation (const std::vector< Real > &inflation)
 
const std::set< unsigned int > & getGhostedBoundaries () const
 
const std::vector< Real > & getGhostedBoundaryInflation () const
 
void ghostGhostedBoundaries ()
 
void needGhostGhostedBoundaries (bool needghost)
 
unsigned int getPatchSize () const
 
unsigned int getGhostingPatchSize () const
 
unsigned int getMaxLeafSize () const
 
void setPatchUpdateStrategy (Moose::PatchUpdateType patch_update_strategy)
 
const Moose::PatchUpdateTypegetPatchUpdateStrategy () const
 
libMesh::BoundingBox getInflatedProcessorBoundingBox (Real inflation_multiplier=0.01) const
 
 operator libMesh::MeshBase & ()
 
 operator const libMesh::MeshBase & () const
 
MeshBase & getMesh ()
 
MeshBase & getMesh (const std::string &name)
 
const MeshBase & getMesh () const
 
const MeshBase & getMesh (const std::string &name) const
 
const MeshBase * getMeshPtr () const
 
void printInfo (std::ostream &os=libMesh::out, const unsigned int verbosity=0) const
 
const std::set< SubdomainID > & getNodeBlockIds (const Node &node) const
 
const std::vector< dof_id_type > & getNodeList (boundary_id_type nodeset_id) const
 
const Node * addUniqueNode (const Point &p, Real tol=1e-6)
 
Node * addQuadratureNode (const Elem *elem, const unsigned short int side, const unsigned int qp, BoundaryID bid, const Point &point)
 
Node * getQuadratureNode (const Elem *elem, const unsigned short int side, const unsigned int qp)
 
void clearQuadratureNodes ()
 
BoundaryID getBoundaryID (const BoundaryName &boundary_name) const
 
SubdomainID getSubdomainID (const SubdomainName &subdomain_name) const
 
std::vector< SubdomainIDgetSubdomainIDs (const std::vector< SubdomainName > &subdomain_names) const
 
std::set< SubdomainIDgetSubdomainIDs (const std::set< SubdomainName > &subdomain_names) const
 
void setSubdomainName (SubdomainID subdomain_id, const SubdomainName &name)
 
const std::string & getSubdomainName (SubdomainID subdomain_id) const
 
std::vector< SubdomainName > getSubdomainNames (const std::vector< SubdomainID > &subdomain_ids) const
 
void setBoundaryName (BoundaryID boundary_id, BoundaryName name)
 
const std::string & getBoundaryName (BoundaryID boundary_id)
 
void buildPeriodicNodeMap (std::multimap< dof_id_type, dof_id_type > &periodic_node_map, unsigned int var_number, libMesh::PeriodicBoundaries *pbs) const
 
void buildPeriodicNodeSets (std::map< BoundaryID, std::set< dof_id_type >> &periodic_node_sets, unsigned int var_number, libMesh::PeriodicBoundaries *pbs) const
 
Real dimensionWidth (unsigned int component) const
 
bool detectOrthogonalDimRanges (Real tol=1e-6)
 
void addPeriodicVariable (unsigned int var_num, BoundaryID primary, BoundaryID secondary)
 
bool isTranslatedPeriodic (unsigned int nonlinear_var_num, unsigned int component) const
 
RealVectorValue minPeriodicVector (unsigned int nonlinear_var_num, Point p, Point q) const
 
Real minPeriodicDistance (unsigned int nonlinear_var_num, Point p, Point q) const
 
const std::pair< BoundaryID, BoundaryID > * getPairedBoundaryMapping (unsigned int component)
 
void buildRefinementAndCoarseningMaps (Assembly *assembly)
 
const std::vector< std::vector< QpMap > > & getRefinementMap (const Elem &elem, int parent_side, int child, int child_side)
 
const std::vector< std::pair< unsigned int, QpMap > > & getCoarseningMap (const Elem &elem, int input_side)
 
void changeBoundaryId (const boundary_id_type old_id, const boundary_id_type new_id, bool delete_prev)
 
const std::set< BoundaryID > & getSubdomainBoundaryIds (const SubdomainID subdomain_id) const
 
std::set< BoundaryIDgetSubdomainInterfaceBoundaryIds (const SubdomainID subdomain_id) const
 
std::set< SubdomainIDgetBoundaryConnectedBlocks (const BoundaryID bid) const
 
std::set< SubdomainIDgetBoundaryConnectedSecondaryBlocks (const BoundaryID bid) const
 
std::set< SubdomainIDgetInterfaceConnectedBlocks (const BoundaryID bid) const
 
const std::set< SubdomainID > & getBlockConnectedBlocks (const SubdomainID subdomain_id) const
 
bool isBoundaryNode (dof_id_type node_id) const
 
bool isBoundaryNode (dof_id_type node_id, BoundaryID bnd_id) const
 
bool isBoundaryElem (dof_id_type elem_id) const
 
bool isBoundaryElem (dof_id_type elem_id, BoundaryID bnd_id) const
 
void errorIfDistributedMesh (std::string name) const
 
virtual bool isDistributedMesh () const
 
bool isParallelTypeForced () const
 
void setParallelType (ParallelType parallel_type)
 
ParallelType getParallelType () const
 
const MooseEnumpartitionerName () const
 
bool isPartitionerForced () const
 
void allowRecovery (bool allow)
 
void setCustomPartitioner (libMesh::Partitioner *partitioner)
 
bool isRegularOrthogonal ()
 
bool hasSecondOrderElements ()
 
virtual std::unique_ptr< libMesh::PointLocatorBasegetPointLocator () const
 
virtual std::string getFileName () const
 
void needsRemoteElemDeletion (bool need_delete)
 
bool needsRemoteElemDeletion () const
 
void allowRemoteElementRemoval (bool allow_removal)
 
bool allowRemoteElementRemoval () const
 
void deleteRemoteElements ()
 
bool hasMeshBase () const
 
bool hasElementID (const std::string &id_name) const
 
unsigned int getElementIDIndex (const std::string &id_name) const
 
dof_id_type maxElementID (unsigned int elem_id_index) const
 
dof_id_type minElementID (unsigned int elem_id_index) const
 
bool areElemIDsIdentical (const std::string &id_name1, const std::string &id_name2) const
 
std::set< dof_id_typegetAllElemIDs (unsigned int elem_id_index) const
 
std::set< dof_id_typegetElemIDsOnBlocks (unsigned int elem_id_index, const std::set< SubdomainID > &blks) const
 
std::unordered_map< dof_id_type, std::set< dof_id_type > > getElemIDMapping (const std::string &from_id_name, const std::string &to_id_name) const
 
void cacheFaceInfoVariableOwnership () const
 
void cacheFVElementalDoFs () const
 
void computeFiniteVolumeCoords () const
 
void isDisplaced (bool is_displaced)
 
bool isDisplaced () const
 
const std::map< boundary_id_type, std::vector< dof_id_type > > & nodeSetNodes () const
 
Moose::CoordinateSystemType getCoordSystem (SubdomainID sid) const
 
const std::map< SubdomainID, Moose::CoordinateSystemType > & getCoordSystem () const
 
Moose::CoordinateSystemType getUniqueCoordSystem () const
 
void setCoordSystem (const std::vector< SubdomainName > &blocks, const MultiMooseEnum &coord_sys)
 
void setAxisymmetricCoordAxis (const MooseEnum &rz_coord_axis)
 
void setGeneralAxisymmetricCoordAxes (const std::vector< SubdomainName > &blocks, const std::vector< std::pair< Point, RealVectorValue >> &axes)
 
const std::pair< Point, RealVectorValue > & getGeneralAxisymmetricCoordAxis (SubdomainID subdomain_id) const
 
bool usingGeneralAxisymmetricCoordAxes () const
 
unsigned int getAxisymmetricRadialCoord () const
 
void checkCoordinateSystems ()
 
void setCoordData (const MooseMesh &other_mesh)
 
void markFiniteVolumeInfoDirty ()
 
bool isFiniteVolumeInfoDirty () const
 
MooseAppCoordTransformcoordTransform ()
 
const MooseUnitslengthUnit () const
 
const std::unordered_map< std::pair< const Elem *, unsigned short int >, const Elem *> & getLowerDElemMap () const
 
bool isSplit () const
 
void buildFiniteVolumeInfo () const
 
void setupFiniteVolumeMeshData () const
 
void doingPRefinement (bool doing_p_refinement)
 
bool doingPRefinement () const
 
unsigned int maxPLevel () const
 
unsigned int maxHLevel () const
 
const std::vector< QpMap > & getPRefinementMap (const Elem &elem) const
 
const std::vector< QpMap > & getPRefinementSideMap (const Elem &elem) const
 
const std::vector< QpMap > & getPCoarseningMap (const Elem &elem) const
 
const std::vector< QpMap > & getPCoarseningSideMap (const Elem &elem) const
 
void buildPRefinementAndCoarseningMaps (Assembly *assembly)
 
bool isLowerD (const SubdomainID subdomain_id) const
 
bool hasLowerD () const
 
const std::set< SubdomainID > & interiorLowerDBlocks () const
 
const std::set< SubdomainID > & boundaryLowerDBlocks () const
 
bool getConstructNodeListFromSideList ()
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
PerfGraphperfGraph ()
 
libMesh::ConstElemRangegetActiveLocalElementRange ()
 
libMesh::ConstElemRangegetActiveLocalElementRange ()
 
libMesh::NodeRangegetActiveNodeRange ()
 
libMesh::NodeRangegetActiveNodeRange ()
 
SemiLocalNodeRangegetActiveSemiLocalNodeRange () const
 
SemiLocalNodeRangegetActiveSemiLocalNodeRange () const
 
libMesh::ConstNodeRangegetLocalNodeRange ()
 
libMesh::ConstNodeRangegetLocalNodeRange ()
 
libMesh::StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode *> * getBoundaryNodeRange ()
 
libMesh::StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode *> * getBoundaryNodeRange ()
 
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement *> * getBoundaryElementRange ()
 
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement *> * getBoundaryElementRange ()
 
virtual Real getMinInDimension (unsigned int component) const
 
virtual Real getMinInDimension (unsigned int component) const
 
virtual Real getMaxInDimension (unsigned int component) const
 
virtual Real getMaxInDimension (unsigned int component) const
 
bool isCustomPartitionerRequested () const
 
bool isCustomPartitionerRequested () const
 
void setIsCustomPartitionerRequested (bool cpr)
 
void setIsCustomPartitionerRequested (bool cpr)
 
unsigned int nFace () const
 
unsigned int nFace () const
 
const std::vector< const FaceInfo *> & faceInfo () const
 
const FaceInfofaceInfo (const Elem *elem, unsigned int side) const
 
const std::vector< const FaceInfo *> & faceInfo () const
 
const FaceInfofaceInfo (const Elem *elem, unsigned int side) const
 
face_info_iterator ownedFaceInfoBegin ()
 
face_info_iterator ownedFaceInfoBegin ()
 
face_info_iterator ownedFaceInfoEnd ()
 
face_info_iterator ownedFaceInfoEnd ()
 
elem_info_iterator ownedElemInfoBegin ()
 
elem_info_iterator ownedElemInfoBegin ()
 
elem_info_iterator ownedElemInfoEnd ()
 
elem_info_iterator ownedElemInfoEnd ()
 
const ElemInfoelemInfo (const dof_id_type id) const
 
const ElemInfoelemInfo (const dof_id_type id) const
 
const std::vector< const ElemInfo *> & elemInfoVector () const
 
const std::vector< const ElemInfo *> & elemInfoVector () const
 
const std::vector< FaceInfo > & allFaceInfo () const
 
const std::vector< FaceInfo > & allFaceInfo () const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void setSubdomainName (MeshBase &mesh, SubdomainID subdomain_id, const SubdomainName &name)
 
static void changeBoundaryId (MeshBase &mesh, const boundary_id_type old_id, const boundary_id_type new_id, bool delete_prev)
 
static MooseEnum partitioning ()
 
static MooseEnum elemTypes ()
 
static void setPartitioner (MeshBase &mesh_base, MooseEnum &partitioner, bool use_distributed_mesh, const InputParameters &params, MooseObject &context_obj)
 

Public Attributes

const ConsoleStream _console
 

Protected Types

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 createNodeHorizBasedData (std::multimap< SubdomainID, SubdomainID > bonding_block_pairs, std::multimap< SubdomainID, SubdomainID > non_bonding_block_pairs)
 Function to create neighbors and other data for each material point with given horizon. More...
 
bool checkInterface (SubdomainID pdnode_blockID_i, SubdomainID pdnode_blockID_j, std::multimap< SubdomainID, SubdomainID > blockID_pairs)
 Function to check existence of interface between two blocks. More...
 
void createNeighborHorizonBasedData ()
 Function to create node neighbors and other data for each material point based on NEIGHBOR_HORIZON based horizon partition for deformation gradient calculation. More...
 
bool checkPointInsideRectangle (Point point, Point rec_p1, Point rec_p2, Real rec_height, Real tol=0)
 Function to check whether a material point falls within a given rectangular crack geometry. More...
 
bool checkCrackIntersectBond (Point crack_p1, Point crack_p2, Real crack_width, Point bond_p1, Point bond_p2)
 Function to check whether a bond crosses crack surface. More...
 
bool checkSegmentIntersectSegment (Point seg1_p1, Point seg1_p2, Point seg2_p1, Point seg2_p2)
 Function to check whether a segment crosses another segment. More...
 
void cacheInfo ()
 
void freeBndNodes ()
 
void freeBndElems ()
 
void setPartitionerHelper (MeshBase *mesh=nullptr)
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 

Protected Attributes

unsigned int_dim
 Mesh dimension. More...
 
unsigned int_n_pdnodes
 Number of total material points. More...
 
unsigned int_n_pdbonds
 Number of total bonds. More...
 
std::vector< std::vector< dof_id_type > > & _pdnode_neighbors
 Neighbor lists for each material point determined using the horizon. More...
 
std::vector< std::vector< dof_id_type > > & _pdnode_bonds
 Bond lists associated with material points. More...
 
std::vector< std::vector< std::vector< dof_id_type > > > & _dg_neighbors
 Neighbor lists for deformation gradient calculation using bond-associated horizon. More...
 
std::vector< std::vector< Real > > & _pdnode_sub_vol
 Volume of horizon subsets for bond-associated deformation gradients at a node. More...
 
std::vector< Real > & _pdnode_sub_vol_sum
 Summation of volumes of all horizon subsets at a node. More...
 
std::map< dof_id_type, Real > & _boundary_node_offset
 Offset of each boundary node to its original FE element boundary edge or face. More...
 
std::vector< Real > & _pdnode_weight_normalizer
 normalizer for calculating weighted values at a node from elemental values within its horizon More...
 
 X
 
 Y
 
 Z
 
 MIN
 
 MAX
 
std::vector< std::unique_ptr< libMesh::GhostingFunctor > > _ghosting_functors
 
std::vector< std::shared_ptr< RelationshipManager > > _relationship_managers
 
bool _built_from_other_mesh
 
ParallelType _parallel_type
 
bool _use_distributed_mesh
 
bool _distribution_overridden
 
bool _parallel_type_overridden
 
std::unique_ptr< libMesh::MeshBase_mesh
 
MooseEnum _partitioner_name
 
bool _partitioner_overridden
 
std::unique_ptr< libMesh::Partitioner_custom_partitioner
 
bool _custom_partitioner_requested
 
unsigned int _uniform_refine_level
 
bool _skip_refine_when_use_split
 
bool _skip_deletion_repartition_after_refine
 
bool _is_changed
 
bool _is_nemesis
 
bool _moose_mesh_prepared
 
std::unique_ptr< ConstElemPointerRange_refined_elements
 
std::unique_ptr< ConstElemPointerRange_coarsened_elements
 
std::map< const Elem *, std::vector< const Elem *> > _coarsened_element_children
 
std::set< Node *> _semilocal_node_list
 
std::unique_ptr< libMesh::ConstElemRange_active_local_elem_range
 
std::unique_ptr< SemiLocalNodeRange_active_semilocal_node_range
 
std::unique_ptr< libMesh::NodeRange_active_node_range
 
std::unique_ptr< libMesh::ConstNodeRange_local_node_range
 
std::unique_ptr< libMesh::StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode *> > _bnd_node_range
 
std::unique_ptr< libMesh::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
 
bool _node_to_elem_map_built
 
std::map< dof_id_type, std::vector< dof_id_type > > _node_to_active_semilocal_elem_map
 
bool _node_to_active_semilocal_elem_map_built
 
std::set< SubdomainID_mesh_subdomains
 
std::unique_ptr< std::map< BoundaryID, RealVectorValue > > _boundary_to_normal_map
 
std::vector< BndNode *> _bnd_nodes
 
std::map< boundary_id_type, std::set< dof_id_type > > _bnd_node_ids
 
std::vector< BndElement *> _bnd_elems
 
std::unordered_map< boundary_id_type, std::unordered_set< dof_id_type > > _bnd_elem_ids
 
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
 
std::map< boundary_id_type, std::vector< dof_id_type > > _node_set_nodes
 
std::set< unsigned int_ghosted_boundaries
 
std::vector< Real_ghosted_boundaries_inflation
 
unsigned int _patch_size
 
unsigned int _ghosting_patch_size
 
unsigned int _max_leaf_size
 
Moose::PatchUpdateType _patch_update_strategy
 
std::vector< Node *> _node_map
 
bool _regular_orthogonal_mesh
 
std::vector< std::vector< Real > > _bounds
 
std::vector< std::pair< BoundaryID, BoundaryID > > _paired_boundary
 
const bool _is_split
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
std::set< BoundaryID_mesh_boundary_ids
 
std::set< BoundaryID_mesh_sideset_ids
 
std::set< BoundaryID_mesh_nodeset_ids
 
const Parallel::Communicator & _communicator
 
const Real _horizon_radius
 Horizon size control parameters. More...
 
const bool _has_horizon_number
 
const Real _horizon_number
 
const Real _bah_ratio
 
const bool _has_cracks
 Information for crack generation. More...
 
std::vector< Point > _cracks_start
 
std::vector< Point > _cracks_end
 
std::vector< Real_cracks_width
 
std::vector< Point > _pdnode_coord
 Data associated with each peridynamics node. More...
 
std::vector< Real > & _pdnode_average_spacing
 
std::vector< Real > & _pdnode_horizon_radius
 
std::vector< Real > & _pdnode_vol
 
std::vector< Real > & _pdnode_horizon_vol
 
std::vector< SubdomainID > & _pdnode_blockID
 
std::vector< dof_id_type > & _pdnode_elemID
 

Detailed Description

Peridynamics mesh class.

Definition at line 20 of file PeridynamicsMesh.h.

Constructor & Destructor Documentation

◆ PeridynamicsMesh() [1/2]

PeridynamicsMesh::PeridynamicsMesh ( const InputParameters parameters)

Definition at line 41 of file PeridynamicsMesh.C.

43  _horizon_radius(isParamValid("horizon_radius") ? getParam<Real>("horizon_radius") : 0),
44  _has_horizon_number(isParamValid("horizon_number")),
45  _horizon_number(_has_horizon_number ? getParam<Real>("horizon_number") : 0),
46  _bah_ratio(getParam<Real>("bond_associated_horizon_ratio")),
47  _has_cracks(isParamValid("cracks_start") || isParamValid("cracks_end")),
48  _dim(declareRestartableData<unsigned int>("dim")),
49  _n_pdnodes(declareRestartableData<unsigned int>("n_pdnodes")),
50  _n_pdbonds(declareRestartableData<unsigned int>("n_pdbonds")),
51  _pdnode_average_spacing(declareRestartableData<std::vector<Real>>("pdnode_average_spacing")),
52  _pdnode_horizon_radius(declareRestartableData<std::vector<Real>>("pdnode_horizon_radius")),
53  _pdnode_vol(declareRestartableData<std::vector<Real>>("pdnode_vol")),
54  _pdnode_horizon_vol(declareRestartableData<std::vector<Real>>("pdnode_horizon_vol")),
55  _pdnode_blockID(declareRestartableData<std::vector<SubdomainID>>("pdnode_blockID")),
56  _pdnode_elemID(declareRestartableData<std::vector<dof_id_type>>("pdnode_elemID")),
58  declareRestartableData<std::vector<std::vector<dof_id_type>>>("pdnode_neighbors")),
59  _pdnode_bonds(declareRestartableData<std::vector<std::vector<dof_id_type>>>("pdnode_bonds")),
61  declareRestartableData<std::vector<std::vector<std::vector<dof_id_type>>>>("dg_neighbors")),
62  _pdnode_sub_vol(declareRestartableData<std::vector<std::vector<Real>>>("pdnode_sub_vol")),
63  _pdnode_sub_vol_sum(declareRestartableData<std::vector<Real>>("pdnode_sub_vol_sum")),
65  declareRestartableData<std::map<dof_id_type, Real>>("boundary_node_offset")),
66  _pdnode_weight_normalizer(declareRestartableData<std::vector<Real>>("pdnode_weight_normalizer"))
67 {
68  if (!(isParamValid("horizon_radius") || _has_horizon_number))
69  mooseError("Must specify either horizon_radius or horizon_number to determine horizon size in "
70  "the mesh block!");
71 
72  if (_has_cracks)
73  {
74  _cracks_start = getParam<std::vector<Point>>("cracks_start");
75  _cracks_end = getParam<std::vector<Point>>("cracks_end");
76  }
77  else
78  {
79  _cracks_start.push_back(Point(0., 0., 0.));
80  _cracks_end.push_back(Point(0., 0., 0.));
81  }
82 
83  if (_cracks_start.size() != _cracks_end.size())
84  mooseError(
85  "Number of cracks starting points is NOT the same as number of cracks ending points!");
86 
87  if (_has_cracks)
88  {
89  if (isParamValid("cracks_width"))
90  {
91  _cracks_width = getParam<std::vector<Real>>("cracks_width");
92  if (_cracks_width.size() != _cracks_start.size())
93  mooseError("Number of cracks width is NOT the same as number of cracks!");
94  }
95  else
96  {
97  for (unsigned int i = 0; i < _cracks_start.size(); ++i)
98  _cracks_width.push_back(0);
99  }
100  }
101  else
102  _cracks_width.push_back(0);
103 }
std::vector< std::vector< dof_id_type > > & _pdnode_neighbors
Neighbor lists for each material point determined using the horizon.
std::vector< SubdomainID > & _pdnode_blockID
std::vector< Point > _cracks_end
MooseMesh()=delete
std::vector< std::vector< Real > > & _pdnode_sub_vol
Volume of horizon subsets for bond-associated deformation gradients at a node.
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Real > & _pdnode_vol
std::vector< Real > & _pdnode_sub_vol_sum
Summation of volumes of all horizon subsets at a node.
T & declareRestartableData(const std::string &data_name, Args &&... args)
std::vector< Real > & _pdnode_average_spacing
std::map< dof_id_type, Real > & _boundary_node_offset
Offset of each boundary node to its original FE element boundary edge or face.
std::vector< dof_id_type > & _pdnode_elemID
bool isParamValid(const std::string &name) const
const Real _horizon_number
const Real _horizon_radius
Horizon size control parameters.
const bool _has_cracks
Information for crack generation.
unsigned int & _dim
Mesh dimension.
std::vector< Real > & _pdnode_horizon_vol
std::vector< Real > & _pdnode_horizon_radius
std::vector< Real > & _pdnode_weight_normalizer
normalizer for calculating weighted values at a node from elemental values within its horizon ...
std::vector< Real > _cracks_width
std::vector< std::vector< dof_id_type > > & _pdnode_bonds
Bond lists associated with material points.
const bool _has_horizon_number
std::vector< std::vector< std::vector< dof_id_type > > > & _dg_neighbors
Neighbor lists for deformation gradient calculation using bond-associated horizon.
void mooseError(Args &&... args) const
const InputParameters & parameters() const
std::vector< Point > _cracks_start
unsigned int & _n_pdbonds
Number of total bonds.

◆ PeridynamicsMesh() [2/2]

PeridynamicsMesh::PeridynamicsMesh ( const PeridynamicsMesh )
default

Member Function Documentation

◆ buildMesh()

void PeridynamicsMesh::buildMesh ( )
overridevirtual

Implements MooseMesh.

Definition at line 112 of file PeridynamicsMesh.C.

113 {
114  if (!hasMeshBase())
115  {
116  auto & entry = _app.getMeshGeneratorSystem();
117  _mesh = entry.getSavedMesh(entry.mainMeshGeneratorName());
118  }
119  _mesh->allow_renumbering(false);
120  _mesh->prepare_for_use();
121  _mesh->allow_renumbering(true);
122 }
MooseApp & _app
bool hasMeshBase() const
std::unique_ptr< libMesh::MeshBase > _mesh
MeshGeneratorSystem & getMeshGeneratorSystem()

◆ checkCrackIntersectBond()

bool PeridynamicsMesh::checkCrackIntersectBond ( Point  crack_p1,
Point  crack_p2,
Real  crack_width,
Point  bond_p1,
Point  bond_p2 
)
protected

Function to check whether a bond crosses crack surface.

Parameters
crack_p1Crack starting point
crack_p2Crack ending point
crack_widthCrack width
bond_p1Bond starting point
bond_p2Bond ending point
Returns
Whether the given bond crosses the given crack surface

Definition at line 566 of file PeridynamicsMesh.C.

Referenced by createNodeHorizBasedData().

568 {
569  bool intersect0 = false;
570  bool intersect1 = false;
571  bool intersect2 = false;
572  if ((crack_p2 - crack_p1).norm())
573  {
574  intersect0 = checkSegmentIntersectSegment(crack_p1, crack_p2, bond_p1, bond_p2);
575  if (crack_width != 0.)
576  {
577  Real crack_len = (crack_p1 - crack_p2).norm();
578  Real cos_crack = (crack_p2(0) - crack_p1(0)) / crack_len;
579  Real sin_crack = (crack_p2(1) - crack_p1(1)) / crack_len;
580  Real new_crack_p1x = crack_p1(0) - crack_width / 2.0 * sin_crack;
581  Real new_crack_p1y = crack_p1(1) + crack_width / 2.0 * cos_crack;
582  Real new_crack_p2x = crack_p2(0) - crack_width / 2.0 * sin_crack;
583  Real new_crack_p2y = crack_p2(1) + crack_width / 2.0 * cos_crack;
584  Point new_crack_p1 = Point(new_crack_p1x, new_crack_p1y, 0.);
585  Point new_crack_p2 = Point(new_crack_p2x, new_crack_p2y, 0.);
586  intersect1 = checkSegmentIntersectSegment(new_crack_p1, new_crack_p2, bond_p1, bond_p2);
587  new_crack_p1x = crack_p1(0) + crack_width / 2.0 * sin_crack;
588  new_crack_p1y = crack_p1(1) - crack_width / 2.0 * cos_crack;
589  new_crack_p2x = crack_p2(0) + crack_width / 2.0 * sin_crack;
590  new_crack_p2y = crack_p2(1) - crack_width / 2.0 * cos_crack;
591  new_crack_p1 = Point(new_crack_p1x, new_crack_p1y, 0.);
592  new_crack_p2 = Point(new_crack_p2x, new_crack_p2y, 0.);
593  intersect2 = checkSegmentIntersectSegment(new_crack_p1, new_crack_p2, bond_p1, bond_p2);
594  }
595  }
596 
597  return intersect0 || intersect1 || intersect2;
598 }
bool checkSegmentIntersectSegment(Point seg1_p1, Point seg1_p2, Point seg2_p1, Point seg2_p2)
Function to check whether a segment crosses another segment.
auto norm(const T &a) -> decltype(std::abs(a))
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ checkInterface()

bool PeridynamicsMesh::checkInterface ( SubdomainID  pdnode_blockID_i,
SubdomainID  pdnode_blockID_j,
std::multimap< SubdomainID, SubdomainID blockID_pairs 
)
protected

Function to check existence of interface between two blocks.

Parameters
blockID_i& blockID_j IDs of two querying blocks
blockID_pairsID pairs of neighboring blocks

Definition at line 316 of file PeridynamicsMesh.C.

Referenced by createNodeHorizBasedData().

319 {
320  bool is_interface = false;
321  std::pair<std::multimap<SubdomainID, SubdomainID>::iterator,
322  std::multimap<SubdomainID, SubdomainID>::iterator>
323  ret;
324  // check existence of the case when i is the key and j is the value
325  ret = blockID_pairs.equal_range(pdnode_blockID_i);
326  for (std::multimap<SubdomainID, SubdomainID>::iterator it = ret.first; it != ret.second; ++it)
327  if (pdnode_blockID_j == it->second)
328  is_interface = true;
329 
330  // check existence of the case when j is the key and i is the value
331  ret = blockID_pairs.equal_range(pdnode_blockID_j);
332  for (std::multimap<SubdomainID, SubdomainID>::iterator it = ret.first; it != ret.second; ++it)
333  if (pdnode_blockID_i == it->second)
334  is_interface = true;
335 
336  return is_interface;
337 }

◆ checkPointInsideRectangle()

bool PeridynamicsMesh::checkPointInsideRectangle ( Point  point,
Point  rec_p1,
Point  rec_p2,
Real  rec_height,
Real  tol = 0 
)
protected

Function to check whether a material point falls within a given rectangular crack geometry.

Parameters
pointThe querying point
rec_p1The center of one edge of a rectangle
rec_p2The center of the opposite edge of the retangle
rec_heightThe distance between the rest two edges of the rectangle
tolAcceptable tolerence
Returns
Whether the given point is within the given rectangule

Definition at line 540 of file PeridynamicsMesh.C.

Referenced by createNodeHorizBasedData().

542 {
543  Real crack_length = (rec_p2 - rec_p1).norm();
544  bool inside = crack_length;
545 
546  if (inside)
547  {
548  Real a = rec_p2(1) - rec_p1(1);
549  Real b = rec_p1(0) - rec_p2(0);
550  Real c = rec_p2(0) * rec_p1(1) - rec_p2(1) * rec_p1(0);
551  inside =
552  inside && (std::abs(a * point(0) + b * point(1) + c) / crack_length < rec_height / 2.0);
553 
554  a = rec_p2(0) - rec_p1(0);
555  b = rec_p2(1) - rec_p1(1);
556  c = 0.5 * (rec_p1(1) * rec_p1(1) - rec_p2(1) * rec_p2(1) - rec_p2(0) * rec_p2(0) +
557  rec_p1(0) * rec_p1(0));
558  inside = inside && (std::abs(a * point(0) + b * point(1) + c) / crack_length <
559  (tol + crack_length) / 2.0);
560  }
561 
562  return inside;
563 }
const double tol
auto norm(const T &a) -> decltype(std::abs(a))
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ checkSegmentIntersectSegment()

bool PeridynamicsMesh::checkSegmentIntersectSegment ( Point  seg1_p1,
Point  seg1_p2,
Point  seg2_p1,
Point  seg2_p2 
)
protected

Function to check whether a segment crosses another segment.

Parameters
seg1_p1The starting point of segment 1
seg1_p2The ending point of segment 1
seg2_p1The starting point of segment 2
seg2_p2The ending point of segment 2
Returns
Whether the given segements cross each other

Definition at line 601 of file PeridynamicsMesh.C.

Referenced by checkCrackIntersectBond().

605 {
606  // Fail if the segments share an end-point
607  if ((seg1_p1(0) == seg2_p1(0) && seg1_p1(1) == seg2_p1(1)) ||
608  (seg1_p2(0) == seg2_p1(0) && seg1_p2(1) == seg2_p1(1)) ||
609  (seg1_p1(0) == seg2_p2(0) && seg1_p1(1) == seg2_p2(1)) ||
610  (seg1_p2(0) == seg2_p2(0) && seg1_p2(1) == seg2_p2(1)))
611  {
612  return false;
613  }
614 
615  // Fail if the segments intersect at a given end-point but not normal to the crack
616  if ((seg1_p1(1) - seg1_p2(1)) / (seg1_p1(0) - seg1_p2(0)) ==
617  (seg1_p1(1) - seg2_p1(1)) / (seg1_p1(0) - seg2_p1(0)) ||
618  (seg1_p1(1) - seg1_p2(1)) / (seg1_p1(0) - seg1_p2(0)) ==
619  (seg1_p1(1) - seg2_p2(1)) / (seg1_p1(0) - seg2_p2(0)) ||
620  (seg2_p1(1) - seg2_p2(1)) / (seg2_p1(0) - seg2_p2(0)) ==
621  (seg2_p1(1) - seg1_p1(1)) / (seg2_p1(0) - seg1_p1(0)) ||
622  (seg2_p1(1) - seg2_p2(1)) / (seg2_p1(0) - seg2_p2(0)) ==
623  (seg2_p1(1) - seg1_p2(1)) / (seg2_p1(0) - seg1_p2(0)))
624  {
625  Real COSseg1_seg2 = (seg1_p2 - seg1_p1) * (seg2_p2 - seg2_p1) /
626  ((seg1_p2 - seg1_p1).norm() * (seg2_p2 - seg2_p1).norm());
627  if (COSseg1_seg2 > -0.08715574 && COSseg1_seg2 < 0.08715574)
628  return false;
629  }
630 
631  // Translate the system so that point seg1_p1 is on the origin
632  seg1_p2(0) -= seg1_p1(0);
633  seg1_p2(1) -= seg1_p1(1);
634  seg2_p1(0) -= seg1_p1(0);
635  seg2_p1(1) -= seg1_p1(1);
636  seg2_p2(0) -= seg1_p1(0);
637  seg2_p2(1) -= seg1_p1(1);
638 
639  // Length of segment seg1_p1-seg1_p2
640  Real seg1_len = seg1_p2.norm();
641 
642  // Rotate the system so that point seg1_p2 is on the positive X axis
643  Real cos_seg1 = seg1_p2(0) / seg1_len;
644  Real sin_seg1 = seg1_p2(1) / seg1_len;
645  Real newX = seg2_p1(0) * cos_seg1 + seg2_p1(1) * sin_seg1;
646  seg2_p1(1) = seg2_p1(1) * cos_seg1 - seg2_p1(0) * sin_seg1;
647  seg2_p1(0) = newX;
648  newX = seg2_p2(0) * cos_seg1 + seg2_p2(1) * sin_seg1;
649  seg2_p2(1) = seg2_p2(1) * cos_seg1 - seg2_p2(0) * sin_seg1;
650  seg2_p2(0) = newX;
651 
652  // Fail if segment seg2_p1-seg2_p2 doesn't cross segment seg1_p1-seg1_p2
653  if ((seg2_p1(1) < 0. && seg2_p2(1) < 0.) || (seg2_p1(1) >= 0. && seg2_p2(1) >= 0.))
654  return false;
655 
656  // Fail if segment seg2_p1-seg2_p2 crosses segment seg1_p1-seg1_p2 outside of segment
657  // seg1_p1-seg1_p2
658  Real seg1_pos = seg2_p2(0) + (seg2_p1(0) - seg2_p2(0)) * seg2_p2(1) / (seg2_p2(1) - seg2_p1(1));
659  if (seg1_pos < 0. || seg1_pos > seg1_len)
660  return false;
661 
662  return true;
663 }
auto norm(const T &a) -> decltype(std::abs(a))
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ createNeighborHorizonBasedData()

void PeridynamicsMesh::createNeighborHorizonBasedData ( )
protected

Function to create node neighbors and other data for each material point based on NEIGHBOR_HORIZON based horizon partition for deformation gradient calculation.

Definition at line 340 of file PeridynamicsMesh.C.

Referenced by createPeridynamicsMeshData().

341 {
342  for (unsigned int i = 0; i < _n_pdnodes; ++i)
343  {
344  std::vector<dof_id_type> n_pd_neighbors = _pdnode_neighbors[i];
345  _dg_neighbors[i].resize(n_pd_neighbors.size());
346  _pdnode_sub_vol[i].resize(n_pd_neighbors.size(), 0.0);
347 
348  for (unsigned int j = 0; j < n_pd_neighbors.size(); ++j)
349  for (unsigned int k = j; k < n_pd_neighbors.size(); ++k) // only search greater number index
350  if ((_pdnode_coord[n_pd_neighbors[j]] - _pdnode_coord[n_pd_neighbors[k]]).norm() <=
352  {
353  // only save the corresponding index in neighbor list, rather than the actual node id
354  // for neighbor j
355  _dg_neighbors[i][j].push_back(k);
356  _pdnode_sub_vol[i][j] += _pdnode_vol[n_pd_neighbors[k]];
357  _pdnode_sub_vol_sum[i] += _pdnode_vol[n_pd_neighbors[k]];
358  // for neighbor k
359  if (k > j)
360  {
361  _dg_neighbors[i][k].push_back(j);
362  _pdnode_sub_vol[i][k] += _pdnode_vol[n_pd_neighbors[j]];
363  _pdnode_sub_vol_sum[i] += _pdnode_vol[n_pd_neighbors[j]];
364  }
365  }
366  }
367 }
std::vector< std::vector< dof_id_type > > & _pdnode_neighbors
Neighbor lists for each material point determined using the horizon.
std::vector< std::vector< Real > > & _pdnode_sub_vol
Volume of horizon subsets for bond-associated deformation gradients at a node.
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Real > & _pdnode_vol
std::vector< Real > & _pdnode_sub_vol_sum
Summation of volumes of all horizon subsets at a node.
std::vector< Point > _pdnode_coord
Data associated with each peridynamics node.
std::vector< Real > & _pdnode_horizon_radius
std::vector< std::vector< std::vector< dof_id_type > > > & _dg_neighbors
Neighbor lists for deformation gradient calculation using bond-associated horizon.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
static const std::string k
Definition: NS.h:130

◆ createNodeHorizBasedData()

void PeridynamicsMesh::createNodeHorizBasedData ( std::multimap< SubdomainID, SubdomainID bonding_block_pairs,
std::multimap< SubdomainID, SubdomainID non_bonding_block_pairs 
)
protected

Function to create neighbors and other data for each material point with given horizon.

Parameters
bonding_block_pairsID pairs of blocks to be connected via interfacial bonds
non_bonding_block_pairsID pairs of blocks not to be connected

Definition at line 246 of file PeridynamicsMesh.C.

Referenced by createPeridynamicsMeshData().

249 {
250  // search neighbors
251  for (unsigned int i = 0; i < _n_pdnodes; ++i)
252  {
253  Real dis = 0.0;
254  for (unsigned int j = 0; j < _n_pdnodes; ++j)
255  {
256  dis = (_pdnode_coord[i] - _pdnode_coord[j]).norm();
257  if (dis <= 1.0001 * _pdnode_horizon_radius[i] && j != i)
258  {
259  bool is_interface = false;
260  if (!bonding_block_pairs.empty())
261  is_interface =
262  checkInterface(_pdnode_blockID[i], _pdnode_blockID[j], bonding_block_pairs);
263 
264  if (!non_bonding_block_pairs.empty())
265  is_interface =
266  !checkInterface(_pdnode_blockID[i], _pdnode_blockID[j], non_bonding_block_pairs);
267 
268  if (_pdnode_blockID[i] == _pdnode_blockID[j] || is_interface)
269  {
270  // check whether pdnode i falls in the region whose bonds may need to be removed due to
271  // the pre-existing cracks
272  bool intersect = false;
273  for (unsigned int k = 0; k < _cracks_start.size(); ++k)
274  {
276  _cracks_start[k],
277  _cracks_end[k],
279  4.0 * _pdnode_horizon_radius[i]))
280  intersect = intersect || checkCrackIntersectBond(_cracks_start[k],
281  _cracks_end[k],
282  _cracks_width[k],
283  _pdnode_coord[i],
284  _pdnode_coord[j]);
285  }
286  // remove bonds cross the crack to form crack surface
287  if (!intersect)
288  {
289  // Use the addition balance scheme to remove unbalanced interactions
290  // check whether j was already considered as a neighbor of i, if not, add j to i's
291  // neighborlist
292  if (std::find(_pdnode_neighbors[i].begin(), _pdnode_neighbors[i].end(), j) ==
293  _pdnode_neighbors[i].end())
294  {
295  _pdnode_neighbors[i].push_back(j);
298  }
299  // check whether i was also considered as a neighbor of j, if not, add i to j's
300  // neighborlist
301  if (std::find(_pdnode_neighbors[j].begin(), _pdnode_neighbors[j].end(), i) ==
302  _pdnode_neighbors[j].end())
303  {
304  _pdnode_neighbors[j].push_back(i);
307  }
308  }
309  }
310  }
311  }
312  }
313 }
std::vector< std::vector< dof_id_type > > & _pdnode_neighbors
Neighbor lists for each material point determined using the horizon.
std::vector< SubdomainID > & _pdnode_blockID
bool checkInterface(SubdomainID pdnode_blockID_i, SubdomainID pdnode_blockID_j, std::multimap< SubdomainID, SubdomainID > blockID_pairs)
Function to check existence of interface between two blocks.
std::vector< Point > _cracks_end
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Real > & _pdnode_vol
std::vector< Point > _pdnode_coord
Data associated with each peridynamics node.
std::vector< Real > & _pdnode_horizon_vol
auto norm(const T &a) -> decltype(std::abs(a))
std::vector< Real > & _pdnode_horizon_radius
std::vector< Real > & _pdnode_weight_normalizer
normalizer for calculating weighted values at a node from elemental values within its horizon ...
std::vector< Real > _cracks_width
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
bool checkCrackIntersectBond(Point crack_p1, Point crack_p2, Real crack_width, Point bond_p1, Point bond_p2)
Function to check whether a bond crosses crack surface.
std::vector< Point > _cracks_start
static const std::string k
Definition: NS.h:130
bool checkPointInsideRectangle(Point point, Point rec_p1, Point rec_p2, Real rec_height, Real tol=0)
Function to check whether a material point falls within a given rectangular crack geometry...

◆ createPeridynamicsMeshData()

void PeridynamicsMesh::createPeridynamicsMeshData ( MeshBase &  fe_mesh,
std::set< dof_id_type converted_elem_id,
std::multimap< SubdomainID, SubdomainID bonding_block_pairs,
std::multimap< SubdomainID, SubdomainID non_bonding_block_pairs 
)

Function to assign values to member variables (PD mesh data) of this class this function will be called in the PD mesh generator class.

Parameters
fe_meshThe finite element mesh based on which the peridynamics mesh will be created
converted_elem_idThe IDs of finite elements to be converted to peridynamics mesh

Definition at line 143 of file PeridynamicsMesh.C.

Referenced by MeshGeneratorPD::generate().

148 {
149  _dim = fe_mesh.mesh_dimension();
150  _n_pdnodes = converted_elem_id.size();
151 
152  // initialize data size
153  _pdnode_coord.resize(_n_pdnodes);
156  _pdnode_vol.resize(_n_pdnodes);
157  _pdnode_horizon_vol.resize(_n_pdnodes, 0.0);
158  _pdnode_blockID.resize(_n_pdnodes);
159  _pdnode_elemID.resize(_n_pdnodes);
161  _pdnode_bonds.resize(_n_pdnodes);
162  _dg_neighbors.resize(_n_pdnodes);
163  _pdnode_sub_vol.resize(_n_pdnodes);
164  _pdnode_sub_vol_sum.resize(_n_pdnodes, 0.0);
166 
167  // loop through converted fe elements to generate PD nodes structure
168  unsigned int id = 0; // make pd nodes start at 0 in the new mesh
169  for (const auto & eid : converted_elem_id)
170  {
171  Elem * fe_elem = fe_mesh.elem_ptr(eid);
172  // calculate the nodes spacing as average distance between fe element with its neighbors
173  unsigned int n_fe_neighbors = 0;
174  Real dist_sum = 0.0;
175  for (unsigned int j = 0; j < fe_elem->n_neighbors(); ++j)
176  if (fe_elem->neighbor_ptr(j) != nullptr)
177  {
178  dist_sum += (fe_elem->vertex_average() - fe_elem->neighbor_ptr(j)->vertex_average()).norm();
179  n_fe_neighbors++;
180  }
181  else // this side is on boundary and calculate the distance to the centroid
182  {
183  Real dist = 0.0;
184  std::vector<unsigned int> nid = fe_elem->nodes_on_side(j);
185  Point p0 = fe_elem->vertex_average();
186  Point p1 = fe_elem->point(nid[0]);
187  if (fe_elem->dim() == 2) // 2D elems
188  {
189  Point p2 = fe_elem->point(nid.back());
190  Real area = 0.5 * std::abs(p0(0) * (p1(1) - p2(1)) + p1(0) * (p2(1) - p0(1)) +
191  p2(0) * (p0(1) - p1(1)));
192  dist = 2.0 * area / fe_elem->length(nid[0], nid[1]);
193  }
194  else // 3D elems
195  {
196  Point p2 = fe_elem->point(nid[1]);
197  Point p3 = fe_elem->point(nid.back());
198  Point vec0 = p1 - p2;
199  Point vec1 = p1 - p3;
200  Point normal = vec0.cross(vec1);
201  normal /= normal.norm();
202  dist = std::abs(normal(0) * (p0(0) - p1(0)) + normal(1) * (p0(1) - p1(1)) +
203  normal(2) * (p0(2) - p1(2)));
204  }
205  _boundary_node_offset.insert(std::make_pair(id, -dist));
206  }
207 
208  _pdnode_coord[id] = fe_elem->vertex_average();
209  _pdnode_average_spacing[id] = dist_sum / n_fe_neighbors;
211  (_has_horizon_number ? _horizon_number * dist_sum / n_fe_neighbors : _horizon_radius);
212  // NOTE: PeridynamicsMesh does not support RZ/RSpherical so using volume from libmesh elem is
213  // fine
214  _pdnode_vol[id] = fe_elem->volume();
215  _pdnode_blockID[id] = fe_elem->subdomain_id() + 1000; // set new subdomain id for PD mesh in
216  // case FE mesh is retained
217  _pdnode_elemID[id] = fe_elem->id();
218 
219  ++id;
220  }
221 
222  // search node neighbors and create other nodal data
223  createNodeHorizBasedData(bonding_block_pairs, non_bonding_block_pairs);
224 
225  createNeighborHorizonBasedData(); // applies to non-ordinary state-based model only.
226 
227  // total number of peridynamic bonds
228  _n_pdbonds = 0;
229  for (unsigned int i = 0; i < _n_pdnodes; ++i)
230  _n_pdbonds += _pdnode_neighbors[i].size();
231  _n_pdbonds /= 2;
232 
233  unsigned int k = 0;
234  for (unsigned int i = 0; i < _n_pdnodes; ++i)
235  for (unsigned int j = 0; j < _pdnode_neighbors[i].size(); ++j)
236  if (_pdnode_neighbors[i][j] > i)
237  {
238  // build the bond list for each node
239  _pdnode_bonds[i].push_back(k);
240  _pdnode_bonds[_pdnode_neighbors[i][j]].push_back(k);
241  ++k;
242  }
243 }
std::vector< std::vector< dof_id_type > > & _pdnode_neighbors
Neighbor lists for each material point determined using the horizon.
std::vector< SubdomainID > & _pdnode_blockID
void createNodeHorizBasedData(std::multimap< SubdomainID, SubdomainID > bonding_block_pairs, std::multimap< SubdomainID, SubdomainID > non_bonding_block_pairs)
Function to create neighbors and other data for each material point with given horizon.
std::vector< std::vector< Real > > & _pdnode_sub_vol
Volume of horizon subsets for bond-associated deformation gradients at a node.
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Real > & _pdnode_vol
std::vector< Real > & _pdnode_sub_vol_sum
Summation of volumes of all horizon subsets at a node.
std::vector< Real > & _pdnode_average_spacing
std::map< dof_id_type, Real > & _boundary_node_offset
Offset of each boundary node to its original FE element boundary edge or face.
std::vector< dof_id_type > & _pdnode_elemID
std::vector< Point > _pdnode_coord
Data associated with each peridynamics node.
void createNeighborHorizonBasedData()
Function to create node neighbors and other data for each material point based on NEIGHBOR_HORIZON ba...
const Real _horizon_number
const Real _horizon_radius
Horizon size control parameters.
unsigned int & _dim
Mesh dimension.
std::vector< Real > & _pdnode_horizon_vol
auto norm(const T &a) -> decltype(std::abs(a))
std::vector< Real > & _pdnode_horizon_radius
std::vector< Real > & _pdnode_weight_normalizer
normalizer for calculating weighted values at a node from elemental values within its horizon ...
std::vector< std::vector< dof_id_type > > & _pdnode_bonds
Bond lists associated with material points.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const bool _has_horizon_number
std::vector< std::vector< std::vector< dof_id_type > > > & _dg_neighbors
Neighbor lists for deformation gradient calculation using bond-associated horizon.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
static const std::string k
Definition: NS.h:130
unsigned int & _n_pdbonds
Number of total bonds.

◆ dimension()

unsigned int PeridynamicsMesh::dimension ( ) const
overridevirtual

Reimplemented from MooseMesh.

Definition at line 125 of file PeridynamicsMesh.C.

Referenced by RBMPresetOldValuePD::shouldApply().

126 {
127  return _dim;
128 }
unsigned int & _dim
Mesh dimension.

◆ getBondDeformationGradientNeighbors()

std::vector< dof_id_type > PeridynamicsMesh::getBondDeformationGradientNeighbors ( dof_id_type  node_id,
dof_id_type  neighbor_id 
)

Function to return indices of neighbors used in formulation of bond-associated deformation gradient for bond connecting node_id and neighbor_id.

Parameters
node_idThe ID of the node providing the neighbor list
neighbor_idThe ID of the node querying the neighbor list
Returns
The neighbor list for calculation of bond-associated deformation gradient for the neighbor

Definition at line 399 of file PeridynamicsMesh.C.

400 {
401  if (node_id > _n_pdnodes)
402  mooseError("Querying node ID exceeds the available PD node IDs!");
403 
404  if (neighbor_id > _pdnode_neighbors[node_id].size() - 1)
405  mooseError("Querying neighbor index exceeds the available neighbors!");
406 
407  std::vector<dof_id_type> dg_neighbors = _dg_neighbors[node_id][neighbor_id];
408  if (dg_neighbors.size() < _dim)
409  mooseError("Not enough number of neighbors to calculate deformation gradient at PD node: ",
410  node_id);
411 
412  return dg_neighbors;
413 }
std::vector< std::vector< dof_id_type > > & _pdnode_neighbors
Neighbor lists for each material point determined using the horizon.
unsigned int & _n_pdnodes
Number of total material points.
unsigned int & _dim
Mesh dimension.
std::vector< std::vector< std::vector< dof_id_type > > > & _dg_neighbors
Neighbor lists for deformation gradient calculation using bond-associated horizon.
void mooseError(Args &&... args) const

◆ getBonds()

std::vector< dof_id_type > PeridynamicsMesh::getBonds ( dof_id_type  node_id)

Function to return the bond number connected with node node_id.

Parameters
node_idThe querying node index
Returns
List of associated bond IDs

Definition at line 390 of file PeridynamicsMesh.C.

Referenced by SingularShapeTensorEliminatorUserObjectPD::checkShapeTensorSingularity(), NodalRankTwoPD::computeRankTwoTensors(), GeneralizedPlaneStrainUserObjectOSPD::execute(), GhostElemPD::ghostElements(), and RBMPresetOldValuePD::shouldApply().

391 {
392  if (node_id > _n_pdnodes)
393  mooseError("Querying node ID exceeds the available PD node IDs!");
394 
395  return _pdnode_bonds[node_id];
396 }
unsigned int & _n_pdnodes
Number of total material points.
std::vector< std::vector< dof_id_type > > & _pdnode_bonds
Bond lists associated with material points.
void mooseError(Args &&... args) const

◆ getBoundaryOffset()

Real PeridynamicsMesh::getBoundaryOffset ( dof_id_type  node_id)

Function to return offset for boundary nodes.

Parameters
node_idThe querying node index
Returns
The offset

Definition at line 515 of file PeridynamicsMesh.C.

Referenced by BoundaryOffsetPD::computeValue().

516 {
517  if (_boundary_node_offset.count(node_id))
518  return _boundary_node_offset[node_id];
519  else
520  return 0.0;
521 }
std::map< dof_id_type, Real > & _boundary_node_offset
Offset of each boundary node to its original FE element boundary edge or face.

◆ getHorizon()

Real PeridynamicsMesh::getHorizon ( dof_id_type  node_id)

Function to return horizon size.

Parameters
node_idThe querying node index
Returns
The horizon radius

Definition at line 506 of file PeridynamicsMesh.C.

Referenced by SingularShapeTensorEliminatorUserObjectPD::checkShapeTensorSingularity(), NodalRankTwoPD::computeRankTwoTensors(), PeridynamicsKernelBase::prepare(), and PeridynamicsMaterialBase::setupMeshRelatedData().

507 {
508  if (node_id > _n_pdnodes)
509  mooseError("Querying node ID exceeds the available PD node IDs!");
510 
511  return _pdnode_horizon_radius[node_id];
512 }
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Real > & _pdnode_horizon_radius
void mooseError(Args &&... args) const

◆ getHorizonSubsetVolume()

Real PeridynamicsMesh::getHorizonSubsetVolume ( dof_id_type  node_id,
dof_id_type  neighbor_id 
)

Function to return the volume of a horizon subset for bond-associated deformation gradient calculation for bond connecting node node_id and its neighbor neighbor_id.

Parameters
node_idThe ID of the node
neighbor_idThe ID of the querying neighbor in the list of node node_id
Returns
The horizon subset volume

Definition at line 464 of file PeridynamicsMesh.C.

465 {
466  if (node_id > _n_pdnodes)
467  mooseError("Querying node ID exceeds the available PD node IDs!");
468 
469  if (neighbor_id > _pdnode_neighbors[node_id].size() - 1)
470  mooseError("Querying neighbor index exceeds the available neighbors!");
471 
472  return _pdnode_sub_vol[node_id][neighbor_id];
473 }
std::vector< std::vector< dof_id_type > > & _pdnode_neighbors
Neighbor lists for each material point determined using the horizon.
std::vector< std::vector< Real > > & _pdnode_sub_vol
Volume of horizon subsets for bond-associated deformation gradients at a node.
unsigned int & _n_pdnodes
Number of total material points.
void mooseError(Args &&... args) const

◆ getHorizonSubsetVolumeFraction()

Real PeridynamicsMesh::getHorizonSubsetVolumeFraction ( dof_id_type  node_id,
dof_id_type  neighbor_id 
)

Function to return the volume fraction of a horizon subset used for bond-associated deformation gradient calculation for bond connecting node node_id and its neighbor neighbor_id.

Parameters
node_idThe ID of the node
neighbor_idThe ID of the querying neighbor in the list of node node_id
Returns
The horizon subset volume fraction for neighbor neighbor_id of node node_id

Definition at line 485 of file PeridynamicsMesh.C.

Referenced by GeneralizedPlaneStrainUserObjectNOSPD::execute(), and PeridynamicsKernelBase::prepare().

486 {
487  if (node_id > _n_pdnodes)
488  mooseError("Querying node ID exceeds the available PD node IDs!");
489 
490  if (neighbor_id > _pdnode_neighbors[node_id].size() - 1)
491  mooseError("Querying neighbor index exceeds the available neighbors!");
492 
493  return _pdnode_sub_vol[node_id][neighbor_id] / _pdnode_sub_vol_sum[node_id];
494 }
std::vector< std::vector< dof_id_type > > & _pdnode_neighbors
Neighbor lists for each material point determined using the horizon.
std::vector< std::vector< Real > > & _pdnode_sub_vol
Volume of horizon subsets for bond-associated deformation gradients at a node.
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Real > & _pdnode_sub_vol_sum
Summation of volumes of all horizon subsets at a node.
void mooseError(Args &&... args) const

◆ getHorizonSubsetVolumeSum()

Real PeridynamicsMesh::getHorizonSubsetVolumeSum ( dof_id_type  node_id)

Function to return the summation of all horizon subset volumes for node node_id.

Parameters
node_idThe querying node index
Returns
The summation of all horizon subset volumes

Definition at line 476 of file PeridynamicsMesh.C.

477 {
478  if (node_id > _n_pdnodes)
479  mooseError("Querying node ID exceeds the available PD node IDs!");
480 
481  return _pdnode_sub_vol_sum[node_id];
482 }
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Real > & _pdnode_sub_vol_sum
Summation of volumes of all horizon subsets at a node.
void mooseError(Args &&... args) const

◆ getHorizonVolume()

Real PeridynamicsMesh::getHorizonVolume ( dof_id_type  node_id)

Function to return summation of neighbor nodal volumes for node node_id.

Parameters
node_idThe querying node index
Returns
The summation of the volume of all the neighbors

Definition at line 455 of file PeridynamicsMesh.C.

Referenced by NodalDamageIndexPD::computeValue(), PeridynamicsKernelBase::prepare(), and PeridynamicsMaterialBase::setupMeshRelatedData().

456 {
457  if (node_id > _n_pdnodes)
458  mooseError("Querying node ID exceeds the available PD node IDs!");
459 
460  return _pdnode_horizon_vol[node_id];
461 }
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Real > & _pdnode_horizon_vol
void mooseError(Args &&... args) const

◆ getNeighborIndex()

dof_id_type PeridynamicsMesh::getNeighborIndex ( dof_id_type  node_i,
dof_id_type  node_j 
)

Function to return the local neighbor index of node_j from node_i's neighbor list.

Parameters
node_iThe ID of the node providing the neighbor list for query
node_jThe ID of the node querying the neighbor index
Returns
The local index in the neighbor list

Definition at line 376 of file PeridynamicsMesh.C.

Referenced by NodalRankTwoUserObjectBasePD::computeValue(), GeneralizedPlaneStrainUserObjectNOSPD::execute(), and PeridynamicsKernelBase::prepare().

377 {
378  std::vector<dof_id_type> n_pd_neighbors = _pdnode_neighbors[node_i];
379  auto it = std::find(n_pd_neighbors.begin(), n_pd_neighbors.end(), node_j);
380  if (it != n_pd_neighbors.end())
381  return it - n_pd_neighbors.begin();
382  else
383  mooseError(
384  "Material point ", node_j, " is not in the neighbor list of material point ", node_i);
385 
386  return -1;
387 }
std::vector< std::vector< dof_id_type > > & _pdnode_neighbors
Neighbor lists for each material point determined using the horizon.
void mooseError(Args &&... args) const

◆ getNeighbors()

std::vector< dof_id_type > PeridynamicsMesh::getNeighbors ( dof_id_type  node_id)

Function to return neighbor nodes indices for node node_id.

Parameters
node_idThe querying node index
Returns
List of neighbor IDs

Definition at line 370 of file PeridynamicsMesh.C.

Referenced by SingularShapeTensorEliminatorUserObjectPD::checkShapeTensorSingularity(), HeatSourceBPD::computeLocalResidual(), NodalRankTwoPD::computeRankTwoTensors(), MeshGeneratorPD::generate(), and GhostElemPD::ghostElements().

371 {
372  return _pdnode_neighbors[node_id];
373 }
std::vector< std::vector< dof_id_type > > & _pdnode_neighbors
Neighbor lists for each material point determined using the horizon.

◆ getNeighborWeight()

Real PeridynamicsMesh::getNeighborWeight ( dof_id_type  node_id,
dof_id_type  neighbor_id 
)

Function to return normalized weight for neighbor neighbor_id of node node_id based on predefined weight function.

Parameters
node_idThe ID of the node
neighbor_idThe ID of the querying neighbor in the list of node node_id
Returns
The normalized weight for neighbor neighbor_id of node node_id

Definition at line 524 of file PeridynamicsMesh.C.

Referenced by NodalRankTwoUserObjectBasePD::computeValue().

525 {
526  if (node_id > _n_pdnodes)
527  mooseError("Querying node ID exceeds the available PD node IDs!");
528 
529  if (neighbor_id > _pdnode_neighbors[node_id].size() - 1)
530  mooseError("Querying neighbor index exceeds the available neighbors!");
531 
532  Real dis =
533  (_pdnode_coord[node_id] - _pdnode_coord[_pdnode_neighbors[node_id][neighbor_id]]).norm();
534  Real result = _pdnode_horizon_radius[node_id] / dis / _pdnode_weight_normalizer[node_id];
535 
536  return result;
537 }
std::vector< std::vector< dof_id_type > > & _pdnode_neighbors
Neighbor lists for each material point determined using the horizon.
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Point > _pdnode_coord
Data associated with each peridynamics node.
auto norm(const T &a) -> decltype(std::abs(a))
std::vector< Real > & _pdnode_horizon_radius
std::vector< Real > & _pdnode_weight_normalizer
normalizer for calculating weighted values at a node from elemental values within its horizon ...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const

◆ getNodeAverageSpacing()

Real PeridynamicsMesh::getNodeAverageSpacing ( dof_id_type  node_id)

Function to return the average spacing between node node_id with its most adjacent neighbors.

Parameters
node_idThe querying node index
Returns
The node average spacing

Definition at line 497 of file PeridynamicsMesh.C.

498 {
499  if (node_id > _n_pdnodes)
500  mooseError("Querying node ID exceeds the available PD node IDs!");
501 
502  return _pdnode_average_spacing[node_id];
503 }
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Real > & _pdnode_average_spacing
void mooseError(Args &&... args) const

◆ getNodeBlockID()

SubdomainID PeridynamicsMesh::getNodeBlockID ( dof_id_type  node_id)

Function to return block ID for node node_id.

Parameters
node_idThe querying node index
Returns
The block ID of a node

Definition at line 416 of file PeridynamicsMesh.C.

Referenced by MeshGeneratorPD::generate().

417 {
418  if (node_id > _n_pdnodes)
419  mooseError("Querying node ID exceeds the available PD node IDs!");
420 
421  return _pdnode_blockID[node_id];
422 }
std::vector< SubdomainID > & _pdnode_blockID
unsigned int & _n_pdnodes
Number of total material points.
void mooseError(Args &&... args) const

◆ getNodeCoord()

Point PeridynamicsMesh::getNodeCoord ( dof_id_type  node_id)

Function to return coordinates for node node_id.

Parameters
node_idThe querying node index
Returns
The coordinates of a node

Definition at line 431 of file PeridynamicsMesh.C.

Referenced by SingularShapeTensorEliminatorUserObjectPD::checkShapeTensorSingularity(), MechanicsMaterialBasePD::computeBondCurrentLength(), NodalRankTwoPD::computeRankTwoTensors(), GeneralizedPlaneStrainUserObjectNOSPD::execute(), GeneralizedPlaneStrainUserObjectOSPD::execute(), PeridynamicsKernelBase::prepare(), and PeridynamicsMaterialBase::setupMeshRelatedData().

432 {
433  if (node_id > _n_pdnodes)
434  mooseError("Querying node ID exceeds the available PD node IDs!");
435 
436  return _pdnode_coord[node_id];
437 }
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Point > _pdnode_coord
Data associated with each peridynamics node.
void mooseError(Args &&... args) const

◆ getNodeVolume()

Real PeridynamicsMesh::getNodeVolume ( dof_id_type  node_id)

Function to return nodal volume for node node_id.

Parameters
node_idThe querying node index
Returns
The volume of a node

Definition at line 446 of file PeridynamicsMesh.C.

Referenced by SingularShapeTensorEliminatorUserObjectPD::checkShapeTensorSingularity(), NodalRankTwoPD::computeRankTwoTensors(), NodalDamageIndexPD::computeValue(), NodalVolumePD::computeValue(), GeneralizedPlaneStrainUserObjectOSPD::execute(), GeneralizedPlaneStrainUserObjectNOSPD::execute(), NodalIntegralPostprocessorBasePD::execute(), PeridynamicsKernelBase::prepare(), and PeridynamicsMaterialBase::setupMeshRelatedData().

447 {
448  if (node_id > _n_pdnodes)
449  mooseError("Querying node ID exceeds the available PD node IDs!");
450 
451  return _pdnode_vol[node_id];
452 }
unsigned int & _n_pdnodes
Number of total material points.
std::vector< Real > & _pdnode_vol
void mooseError(Args &&... args) const

◆ getPDNodeIDToFEElemIDMap()

std::vector< dof_id_type > PeridynamicsMesh::getPDNodeIDToFEElemIDMap ( )

Function to return the correspondence between PD node IDs and FE element IDs.

Returns
The coordinates of a node

Definition at line 440 of file PeridynamicsMesh.C.

441 {
442  return _pdnode_elemID;
443 }
std::vector< dof_id_type > & _pdnode_elemID

◆ nPDBonds()

dof_id_type PeridynamicsMesh::nPDBonds ( ) const

Function to return number of PD Edge elements.

Returns
Total number of PD bonds

Definition at line 137 of file PeridynamicsMesh.C.

Referenced by MeshGeneratorPD::generate().

138 {
139  return _n_pdbonds;
140 }
unsigned int & _n_pdbonds
Number of total bonds.

◆ nPDNodes()

dof_id_type PeridynamicsMesh::nPDNodes ( ) const

Function to return number of PD nodes.

Returns
Total number of PD nodes

Definition at line 131 of file PeridynamicsMesh.C.

Referenced by MeshGeneratorPD::generate().

132 {
133  return _n_pdnodes;
134 }
unsigned int & _n_pdnodes
Number of total material points.

◆ operator=()

PeridynamicsMesh& PeridynamicsMesh::operator= ( const PeridynamicsMesh other_mesh)
delete

◆ safeClone()

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

Implements MooseMesh.

Definition at line 106 of file PeridynamicsMesh.C.

107 {
108  return _app.getFactory().copyConstruct(*this);
109 }
std::unique_ptr< T > copyConstruct(const T &object)
Factory & getFactory()
MooseApp & _app

◆ setNodeBlockID()

void PeridynamicsMesh::setNodeBlockID ( SubdomainID  id)

Function to set block ID for all PD nodes.

Parameters
idThe subdomain ID for all PD nodes

Definition at line 425 of file PeridynamicsMesh.C.

Referenced by MeshGeneratorPD::generate().

426 {
427  _pdnode_blockID.assign(_n_pdnodes, id);
428 }
std::vector< SubdomainID > & _pdnode_blockID
unsigned int & _n_pdnodes
Number of total material points.

◆ validParams()

InputParameters PeridynamicsMesh::validParams ( )
static

Definition at line 17 of file PeridynamicsMesh.C.

18 {
20  params.addClassDescription("Mesh class to store and return peridynamics specific mesh data");
21 
22  params.addParam<Real>("horizon_radius", "Value of horizon size in terms of radius");
23  params.addParam<Real>("horizon_number",
24  "The material points spacing number, i.e. ratio of horizon radius to the "
25  "effective average spacing");
26  params.addParam<Real>("bond_associated_horizon_ratio",
27  1.5,
28  "Ratio of bond-associated horizon to nodal horizon. This is the only "
29  "parameters to control the size of bond-associated horizon");
30  params.addParam<std::vector<Point>>("cracks_start",
31  "Cartesian coordinates where predefined line cracks start");
32  params.addParam<std::vector<Point>>("cracks_end",
33  "Cartesian coordinates where predefined line cracks end");
34  params.addParam<std::vector<Real>>("cracks_width", "Widths of predefined line cracks");
35 
36  params.set<bool>("_mesh_generator_mesh") = true;
37 
38  return params;
39 }
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _bah_ratio

const Real PeridynamicsMesh::_bah_ratio
protected

Definition at line 189 of file PeridynamicsMesh.h.

Referenced by createNeighborHorizonBasedData().

◆ _boundary_node_offset

std::map<dof_id_type, Real>& PeridynamicsMesh::_boundary_node_offset
protected

Offset of each boundary node to its original FE element boundary edge or face.

Definition at line 234 of file PeridynamicsMesh.h.

Referenced by createPeridynamicsMeshData(), and getBoundaryOffset().

◆ _cracks_end

std::vector<Point> PeridynamicsMesh::_cracks_end
protected

Definition at line 195 of file PeridynamicsMesh.h.

Referenced by createNodeHorizBasedData(), and PeridynamicsMesh().

◆ _cracks_start

std::vector<Point> PeridynamicsMesh::_cracks_start
protected

Definition at line 194 of file PeridynamicsMesh.h.

Referenced by createNodeHorizBasedData(), and PeridynamicsMesh().

◆ _cracks_width

std::vector<Real> PeridynamicsMesh::_cracks_width
protected

Definition at line 196 of file PeridynamicsMesh.h.

Referenced by createNodeHorizBasedData(), and PeridynamicsMesh().

◆ _dg_neighbors

std::vector<std::vector<std::vector<dof_id_type> > >& PeridynamicsMesh::_dg_neighbors
protected

Neighbor lists for deformation gradient calculation using bond-associated horizon.

Definition at line 225 of file PeridynamicsMesh.h.

Referenced by createNeighborHorizonBasedData(), createPeridynamicsMeshData(), and getBondDeformationGradientNeighbors().

◆ _dim

unsigned int& PeridynamicsMesh::_dim
protected

Mesh dimension.

Definition at line 200 of file PeridynamicsMesh.h.

Referenced by createPeridynamicsMeshData(), dimension(), and getBondDeformationGradientNeighbors().

◆ _has_cracks

const bool PeridynamicsMesh::_has_cracks
protected

Information for crack generation.

Definition at line 193 of file PeridynamicsMesh.h.

Referenced by PeridynamicsMesh().

◆ _has_horizon_number

const bool PeridynamicsMesh::_has_horizon_number
protected

Definition at line 187 of file PeridynamicsMesh.h.

Referenced by createPeridynamicsMeshData(), and PeridynamicsMesh().

◆ _horizon_number

const Real PeridynamicsMesh::_horizon_number
protected

Definition at line 188 of file PeridynamicsMesh.h.

Referenced by createPeridynamicsMeshData().

◆ _horizon_radius

const Real PeridynamicsMesh::_horizon_radius
protected

Horizon size control parameters.

Definition at line 186 of file PeridynamicsMesh.h.

Referenced by createPeridynamicsMeshData().

◆ _n_pdbonds

unsigned int& PeridynamicsMesh::_n_pdbonds
protected

Number of total bonds.

Definition at line 206 of file PeridynamicsMesh.h.

Referenced by createPeridynamicsMeshData(), and nPDBonds().

◆ _n_pdnodes

unsigned int& PeridynamicsMesh::_n_pdnodes
protected

◆ _pdnode_average_spacing

std::vector<Real>& PeridynamicsMesh::_pdnode_average_spacing
protected

Definition at line 210 of file PeridynamicsMesh.h.

Referenced by createPeridynamicsMeshData(), and getNodeAverageSpacing().

◆ _pdnode_blockID

std::vector<SubdomainID>& PeridynamicsMesh::_pdnode_blockID
protected

◆ _pdnode_bonds

std::vector<std::vector<dof_id_type> >& PeridynamicsMesh::_pdnode_bonds
protected

Bond lists associated with material points.

Definition at line 222 of file PeridynamicsMesh.h.

Referenced by createPeridynamicsMeshData(), and getBonds().

◆ _pdnode_coord

std::vector<Point> PeridynamicsMesh::_pdnode_coord
protected

Data associated with each peridynamics node.

Definition at line 209 of file PeridynamicsMesh.h.

Referenced by createNeighborHorizonBasedData(), createNodeHorizBasedData(), createPeridynamicsMeshData(), getNeighborWeight(), and getNodeCoord().

◆ _pdnode_elemID

std::vector<dof_id_type>& PeridynamicsMesh::_pdnode_elemID
protected

Definition at line 215 of file PeridynamicsMesh.h.

Referenced by createPeridynamicsMeshData(), and getPDNodeIDToFEElemIDMap().

◆ _pdnode_horizon_radius

std::vector<Real>& PeridynamicsMesh::_pdnode_horizon_radius
protected

◆ _pdnode_horizon_vol

std::vector<Real>& PeridynamicsMesh::_pdnode_horizon_vol
protected

◆ _pdnode_neighbors

std::vector<std::vector<dof_id_type> >& PeridynamicsMesh::_pdnode_neighbors
protected

◆ _pdnode_sub_vol

std::vector<std::vector<Real> >& PeridynamicsMesh::_pdnode_sub_vol
protected

Volume of horizon subsets for bond-associated deformation gradients at a node.

Definition at line 228 of file PeridynamicsMesh.h.

Referenced by createNeighborHorizonBasedData(), createPeridynamicsMeshData(), getHorizonSubsetVolume(), and getHorizonSubsetVolumeFraction().

◆ _pdnode_sub_vol_sum

std::vector<Real>& PeridynamicsMesh::_pdnode_sub_vol_sum
protected

Summation of volumes of all horizon subsets at a node.

Definition at line 231 of file PeridynamicsMesh.h.

Referenced by createNeighborHorizonBasedData(), createPeridynamicsMeshData(), getHorizonSubsetVolumeFraction(), and getHorizonSubsetVolumeSum().

◆ _pdnode_vol

std::vector<Real>& PeridynamicsMesh::_pdnode_vol
protected

◆ _pdnode_weight_normalizer

std::vector<Real>& PeridynamicsMesh::_pdnode_weight_normalizer
protected

normalizer for calculating weighted values at a node from elemental values within its horizon

Definition at line 237 of file PeridynamicsMesh.h.

Referenced by createNodeHorizBasedData(), createPeridynamicsMeshData(), and getNeighborWeight().


The documentation for this class was generated from the following files: