![]() |
PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
#include <periDEMModel.h>
Public Member Functions | |
| PeriDEMModel (std::shared_ptr< inp::Input > &deck, std::string modelName="PeriDEMModel") | |
| void | log (std::ostringstream &oss, int priority=0, bool check_condition=true, int override_priority=-1, bool screen_out=false) |
| void | log (const std::string &str, int priority=0, bool check_condition=true, int override_priority=-1, bool screen_out=false) |
| void | run (std::shared_ptr< inp::Input > &deck) |
| void | restart (std::shared_ptr< inp::Input > &deck) |
| void | init () |
| void | close () |
| void | integrate () |
| void | integrateStep () |
| void | computeForces () |
| void | computeExternalForces () |
| void | applyDisplacementBC () |
| void | applyInitialCondition () |
| void | output () |
| std::string | ppTwoParticleTest () |
| std::string | ppCompressiveTest () |
| void | checkStop () |
| void | setContact (std::unique_ptr< contact::Contact > c) |
| void | setPostprocess (std::unique_ptr< postprocess::Postprocess > p) |
Public Member Functions inherited from data::ModelData | |
| ModelData (std::shared_ptr< inp::Input > &deck) | |
| Constructor. | |
| const particle::BaseParticle * | getParticleFromAllList (size_t i) const |
| Get pointer to base particle. | |
| particle::BaseParticle *& | getParticleFromAllList (size_t i) |
| Get pointer to base particle. | |
| const particle::BaseParticle * | getParticleFromParticleList (size_t i) const |
| Get pointer to particle (excluding wall) | |
| particle::BaseParticle *& | getParticleFromParticleList (size_t i) |
| const particle::BaseParticle * | getParticleFromWallList (size_t i) const |
| Get pointer to wall. | |
| particle::BaseParticle *& | getParticleFromWallList (size_t i) |
| double | getDensity (size_t i) |
| Get density of particle. | |
| double | getHorizon (size_t i) |
| Get horizon of particle. | |
| size_t & | getPtId (size_t i) |
| Get particle id given the location in particle list. | |
| const size_t & | getPtId (size_t i) const |
| Get particle id given the location in particle list. | |
| void | setPtId (size_t i, const size_t &id) |
| Set particle id given the location in particle list. | |
| double | getKeyData (std::string key, bool issue_err=false) |
| Get data for a key. | |
| void | appendKeyData (std::string key, double data, bool issue_err=false) |
| Append value to data associated with key. | |
| void | setKeyData (std::string key, double data, bool issue_err=false) |
| Set value to data associated with key. | |
| int | dimension () const |
| double | timeStep () const |
| double | currentDt () const |
| void | setCurrentDt (double dt) |
| void | advanceTime () |
| size_t | numPdForceNodes () const |
| size_t | pdForceNode (size_t k) const |
| bool | isDofFree (size_t i, unsigned int dof) const |
| double | getVMag (size_t i) const |
| void | setVMag (size_t i, double mag) |
| size_t | currentStep () const |
| size_t | numTimeSteps () const |
| const std::string & | timeDiscretization () const |
| bool | performOutput () const |
| bool | shouldOutput () const |
| util::Point & | getXRef (size_t i) |
| Get reference coordinate of the node. | |
| const util::Point & | getXRef (size_t i) const |
| Get reference coordinate of the node. | |
| void | setXRef (size_t i, const util::Point &x) |
| Set reference coordinate of the node. | |
| void | addXRef (size_t i, const util::Point &x) |
| Add reference coordinate of the node. | |
| void | setXRef (size_t i, int dof, double x) |
| Set specific reference coordinate of the node. | |
| void | addXRef (size_t i, int dof, double x) |
| Add specific reference coordinate of the node. | |
| util::Point & | getX (size_t i) |
| Get current coordinate of the node. | |
| const util::Point & | getX (size_t i) const |
| Get current coordinate of the node. | |
| void | setX (size_t i, const util::Point &x) |
| Set current coordinate of the node. | |
| void | addX (size_t i, const util::Point &x) |
| Add current coordinate of the node. | |
| void | setX (size_t i, int dof, double x) |
| Set specific current coordinate of the node. | |
| void | addX (size_t i, int dof, double x) |
| Add to specific current coordinate of the node. | |
| util::Point & | getU (size_t i) |
| Get displacement of the node. | |
| const util::Point & | getU (size_t i) const |
| Get displacement of the node. | |
| void | setU (size_t i, const util::Point &u) |
| Set displacement of the node. | |
| void | addU (size_t i, const util::Point &u) |
| Add to displacement of the node. | |
| void | setU (size_t i, int dof, double u) |
| Set displacement of the node. | |
| void | addU (size_t i, int dof, double u) |
| Add to displacement of the node. | |
| util::Point & | getV (size_t i) |
| Get velocity of the node. | |
| const util::Point & | getV (size_t i) const |
| Get velocity of the node. | |
| void | setV (size_t i, const util::Point &v) |
| Set velocity of the node. | |
| void | addV (size_t i, const util::Point &v) |
| Add to velocity of the node. | |
| void | setV (size_t i, int dof, double v) |
| Set velocity of the node. | |
| void | addV (size_t i, int dof, double v) |
| Add to velocity of the node. | |
| util::Point & | getF (size_t i) |
| Get force of the node. | |
| const util::Point & | getF (size_t i) const |
| Get force of the node. | |
| void | setF (size_t i, const util::Point &f) |
| Set force of the node. | |
| void | addF (size_t i, const util::Point &f) |
| Add to force of the node. | |
| void | setF (size_t i, int dof, double f) |
| Set force of the node. | |
| void | addF (size_t i, int dof, double f) |
| Add to force of the node. | |
| double & | getVol (size_t i) |
| Get volume of the node. | |
| const double & | getVol (size_t i) const |
| Get volume of the node. | |
| void | setVol (size_t i, const double &vol) |
| Set volume of the node. | |
| void | addVol (size_t i, const double &vol) |
| Add to volume of the node. | |
| uint8_t & | getFix (size_t i) |
| Get fixity of the node. | |
| const uint8_t & | getFix (size_t i) const |
| Get fixity of the node. | |
| void | setFix (size_t i, const unsigned int &dof, const bool &flag) |
| Set fixity of the node. | |
| double & | getMx (size_t i) |
| Get weighted-volume (mx) of the node. | |
| const double & | getMx (size_t i) const |
| Get weighted-volume (mx) of the node. | |
| void | setMx (size_t i, const double &mx) |
| Set weighted-volume (mx) of the node. | |
| void | addMx (size_t i, const double &mx) |
| Add to weighted-volume (mx) of the node. | |
| double & | getThetax (size_t i) |
| Get volumetric deformation (thetax) of the node. | |
| const double & | getThetax (size_t i) const |
| Get volumetric deformation (thetax) of the node. | |
| void | setThetax (size_t i, const double &thetax) |
| Set volumetric deformation (thetax) of the node. | |
| void | addThetax (size_t i, const double &thetax) |
| Add to volumetric deformation (thetax) of the node. | |
Data Fields | |
| std::unique_ptr< contact::Contact > | d_contact_p |
| std::unique_ptr< postprocess::Postprocess > | d_postprocess_p |
Data Fields inherited from data::ModelData | |
| size_t | d_n |
| Current time step. | |
| double | d_time |
| Current time. | |
| double | d_currentDt |
| Current timestep. | |
| size_t | d_infoN |
| Print log step interval. | |
| std::string | d_name |
| Model name for log prefixes. | |
| std::vector< std::pair< double, std::string > > | d_pvdParticleEntries |
| (simulation time, VTU filename) for output.pvd | |
| std::vector< std::pair< double, std::string > > | d_pvdStrainEntries |
| (simulation time, VTU filename) for output_strain.pvd | |
| std::map< std::string, double > | d_dbgData |
| Debug data. | |
| std::ofstream | d_ppFile |
| File stream to output information. | |
| std::shared_ptr< inp::Input > | d_input_p |
| Pointer to Input object. | |
| std::shared_ptr< inp::ModelDeck > | d_modelDeck_p |
| Pointer to deck holding problem related data. | |
| std::shared_ptr< inp::OutputDeck > | d_outputDeck_p |
| Pointer to deck holding output related data. | |
| std::shared_ptr< inp::RestartDeck > | d_restartDeck_p |
| Pointer to deck holding restart related data. | |
| std::shared_ptr< inp::TestDeck > | d_testDeck_p |
| Test deck. | |
| std::shared_ptr< inp::BCDeck > | d_bcDeck_p |
| Boundary condition deck. | |
| std::shared_ptr< inp::ParticleDeck > | d_particleDeck_p |
| Pointer to deck holding particle related data. | |
| bool | d_stop |
| flag to stop the simulation midway | |
| double | d_hMax |
| Minimum mesh over all particles and walls. | |
| double | d_hMin |
| Maximum mesh over all particles and walls. | |
| double | d_maxContactR |
| Maximum contact radius between over pairs of particles and walls. | |
| size_t | d_contNeighUpdateInterval |
| Neighborlist update interval. | |
| size_t | d_contNeighTimestepCounter |
| Contact neighborlist time step counter. | |
| double | d_contNeighSearchRadius |
| Neighborlist contact search radius (multiple of d_maxContactR). This variable will be updated during simulation based on maximum velocity. | |
| std::vector< char > | d_mpiIncludeInContactCloud |
| Per entry in d_particlesListTypeAll: include nodes in the MPI contact search cloud (owned grains, walls, and distance-limited ghosts). Empty / all-true when not using multi-rank particle parallel. | |
| std::vector< std::vector< int > > | d_mpiGhostNeedFrom |
| Cached ghost grain ids requested from each MPI rank (skin rebuild). | |
| std::vector< std::vector< int > > | d_mpiGhostServeTo |
| Cached grain ids this rank must send to each MPI rank. | |
| bool | d_mpiGhostPlanValid |
| True once a ghost communication plan has been built. | |
| size_t | d_mpiGhostStepsSinceRebuild |
| Force steps since last ghost-plan rebuild. | |
| bool | d_pdDofMpi |
| Nodal DOF-MPI active. | |
| bool | d_pdGrainAligned |
| DOF owners match whole-grain brick (same as particle-MPI). When true, every node of a grain lives on one rank — contact ghosts are the particle ghost plan, not a full nodal Allreduce. When false, Metis may split a grain across ranks — need syncAllOwned (or a PD halo large enough for contact) before contact reads remote u/v. | |
| std::vector< size_t > | d_pdNodePartition |
| Owner rank for each node when d_pdDofMpi is true. | |
| std::vector< std::vector< int > > | d_pdGhostNeedFrom |
| Ghost node ids requested from each rank (PD DOF halo). | |
| std::vector< std::vector< int > > | d_pdGhostServeTo |
| Local node ids this rank must send to each rank. | |
| std::vector< std::shared_ptr< particle::RefParticle > > | d_referenceParticles |
| Pointer to reference particle. | |
| std::vector< particle::BaseParticle * > | d_particlesListTypeAll |
| List of particles + walls. | |
| std::vector< particle::BaseParticle * > | d_particlesListTypeParticle |
| List of particles. | |
| std::vector< particle::BaseParticle * > | d_particlesListTypeWall |
| List of walls. | |
| std::vector< inp::MatData > | d_particlesMatDataList |
| List of particle material data. Only populated if needed for calculation of stress or other quantities. | |
| std::vector< double > | d_maxVelocityParticlesListTypeAll |
| Maximum velocity among all nodes in the particle for each particle. | |
| double | d_maxVelocity |
| Maximum velocity among all nodes. | |
| std::vector< std::vector< size_t > > | d_zInfo |
| Zone information of particles. For zone 0, d_zInfo[0] = [n1, n2] where n1 is the index at which the particle in this zone starts in d_particlesListTypeAll and n2 is the index + 1, where index is at which the particle in this zone ends. | |
| std::unique_ptr< loading::ParticleULoading > | d_uLoading_p |
| Pointer to displacement Loading object. | |
| std::unique_ptr< loading::ParticleFLoading > | d_fLoading_p |
| Pointer to force Loading object. | |
| std::unique_ptr< geometry::Fracture > | d_fracture_p |
| Fracture state of bonds. | |
| std::unique_ptr< NSearch > | d_nsearch_p |
| Pointer to nsearch. | |
| std::vector< util::Point > | d_xRef |
| reference positions of the nodes | |
| std::vector< util::Point > | d_x |
| Current positions of the nodes. | |
| std::vector< util::Point > | d_u |
| Displacement of the nodes. | |
| std::vector< util::Point > | d_v |
| Velocity of the nodes. | |
| std::vector< double > | d_vMag |
| Magnitude of velocity of the nodes. | |
| std::vector< util::Point > | d_f |
| Total force on the nodes. | |
| std::vector< double > | d_vol |
| Nodal volumes. | |
| std::vector< size_t > | d_ptId |
| Global node to particle id (walls are assigned id after last particle id) | |
| std::vector< std::vector< size_t > > | d_neighC |
| Neighbor data for contact forces. | |
| std::vector< std::vector< size_t > > | d_neighPd |
| Neighbor data for peridynamic forces. | |
| std::vector< std::vector< float > > | d_neighPdSqdDist |
| Square distance neighbor data for peridynamic forces. | |
| std::vector< std::vector< std::vector< size_t > > > | d_neighWallNodes |
| Neighbor data for contact between particle and walls. | |
| std::vector< std::vector< std::vector< double > > > | d_neighWallNodesDistance |
| Neighbor data (distance) for contact between particle and walls. | |
| std::vector< std::vector< size_t > > | d_neighWallNodesCondensed |
| Neighbor data for contact between particle and walls condensed into single vector for each particle. | |
| std::vector< uint8_t > | d_fix |
| Vector of fixity mask of each node. | |
| std::vector< uint8_t > | d_forceFixity |
| Vector of fixity mask of each node for force. | |
| std::vector< double > | d_thetaX |
| Dilation. | |
| std::vector< double > | d_mX |
| Weighted volume. | |
| std::vector< size_t > | d_fPdCompNodes |
| List of global nodes on which force (peridynamic/internal) is to be computed. | |
| std::vector< size_t > | d_fContCompNodes |
| List of global nodes on which force (contact) is to be computed. | |
| std::vector< float > | d_Z |
| Damage at nodes. | |
| std::vector< float > | d_e |
| Energy of the nodes. | |
| std::vector< float > | d_w |
| Work done on each of the nodes. | |
| std::vector< float > | d_phi |
| Damage function \( \phi \) at the nodes (volume-weighted, Silling 2000) | |
| std::vector< float > | d_phiBond |
| Damage as broken-bond count fraction (Bhattacharya & Lipton 2023) | |
| std::vector< float > | d_eF |
| Fracture energy of the nodes. | |
| std::vector< float > | d_eFB |
| Bond-based fracture energy of the nodes. | |
| std::vector< util::Point > | d_xQuadCur |
| Current position of quadrature points. | |
| std::vector< util::SymMatrix3 > | d_strain |
| Strain in elements (values at quadrature points) | |
| std::vector< util::SymMatrix3 > | d_stress |
| Stress in elements (values at quadrature points) | |
| float | d_te |
| Total internal energy. | |
| float | d_tw |
| Total work done. | |
| float | d_tk |
| Total kinetic energy. | |
| float | d_teF |
| Total fracture energy. | |
| float | d_teFB |
| Total bond-based fracture energy. | |
Default driver. Hands the run to time_int::Integrator at integrate(). Physics lives here: forces, BCs, output, particles.
Definition at line 32 of file periDEMModel.h.
|
explicit |
Definition at line 58 of file periDEMModel.cpp.
References data::ModelData::d_name, data::ModelData::d_outputDeck_p, d_postprocess_p, and util::io::initLogger().
| void PeriDEMModel::applyDisplacementBC | ( | ) |
Definition at line 516 of file periDEMModel.cpp.
References data::ModelData::d_particlesListTypeAll, data::ModelData::d_time, data::ModelData::d_uLoading_p, and log().
Referenced by main().
| void PeriDEMModel::applyInitialCondition | ( | ) |
Definition at line 522 of file periDEMModel.cpp.
References loading::applyIC(), data::ModelData::d_bcDeck_p, data::ModelData::d_particlesListTypeAll, and log().
Referenced by main().
| void PeriDEMModel::checkStop | ( | ) |
Definition at line 541 of file periDEMModel.cpp.
References data::ModelData::d_infoN, data::ModelData::d_n, d_postprocess_p, data::ModelData::d_testDeck_p, log(), ppCompressiveTest(), and ppTwoParticleTest().
Referenced by main().
| void PeriDEMModel::close | ( | ) |
Definition at line 124 of file periDEMModel.cpp.
References d_postprocess_p.
Referenced by main(), run(), and anonymous_namespace{main.cpp}::runLaw().
| void PeriDEMModel::computeExternalForces | ( | ) |
Definition at line 480 of file periDEMModel.cpp.
References data::ModelData::d_bcDeck_p, data::ModelData::d_fContCompNodes, data::ModelData::d_fLoading_p, data::ModelData::d_particlesListTypeAll, data::ModelData::d_pdDofMpi, data::ModelData::d_time, util::parallel::getNThreads(), particle::isLocallyOwned(), log(), and util::parallel::mpiRank().
Referenced by computeForces().
| void PeriDEMModel::computeForces | ( | ) |
Definition at line 326 of file periDEMModel.cpp.
References data::ModelData::appendKeyData(), computeExternalForces(), pd::computeForces(), d_contact_p, data::ModelData::d_infoN, data::ModelData::d_input_p, data::ModelData::d_n, data::ModelData::d_x, pd::exchangeGhostDisplacement(), particle::exchangeGhostKinematics(), data::ModelData::getKeyData(), util::parallel::getNThreads(), log(), and util::methods::timeDiff().
Referenced by main(), and anonymous_namespace{main.cpp}::runLaw().
| void PeriDEMModel::init | ( | ) |
Definition at line 129 of file periDEMModel.cpp.
References data::ModelData::appendKeyData(), particle::assignMpiOwners(), material::computeStateMx(), particle::createParticles(), data::ModelData::d_bcDeck_p, d_contact_p, data::ModelData::d_contNeighSearchRadius, data::ModelData::d_contNeighUpdateInterval, data::ModelData::d_fContCompNodes, data::ModelData::d_fix, data::ModelData::d_fLoading_p, data::ModelData::d_fPdCompNodes, data::ModelData::d_fracture_p, data::ModelData::d_infoN, data::ModelData::d_input_p, data::ModelData::d_maxContactR, data::ModelData::d_maxVelocity, data::ModelData::d_maxVelocityParticlesListTypeAll, data::ModelData::d_n, data::ModelData::d_name, data::ModelData::d_neighPd, data::ModelData::d_nsearch_p, data::ModelData::d_outputDeck_p, data::ModelData::d_particleDeck_p, data::ModelData::d_particlesListTypeAll, data::ModelData::d_particlesListTypeParticle, data::ModelData::d_particlesListTypeWall, data::ModelData::d_pdDofMpi, data::ModelData::d_pdNodePartition, data::ModelData::d_phi, data::ModelData::d_phiBond, data::ModelData::d_ptId, data::ModelData::d_testDeck_p, data::ModelData::d_time, data::ModelData::d_uLoading_p, data::ModelData::d_x, data::ModelData::d_Z, data::ModelData::getParticleFromAllList(), util::methods::isFree(), particle::isLocallyOwned(), log(), util::methods::max(), util::parallel::mpiRank(), pd::setupDofPartition(), data::setupQuadratureData(), util::methods::timeDiff(), and nsearch::updatePeridynamicNeighborlist().
Referenced by main(), run(), and anonymous_namespace{main.cpp}::runLaw().
| void PeriDEMModel::integrate | ( | ) |
Definition at line 318 of file periDEMModel.cpp.
References time_int::Integrator::integrate().
Referenced by main(), and run().
| void PeriDEMModel::integrateStep | ( | ) |
Definition at line 322 of file periDEMModel.cpp.
References time_int::Integrator::step().
Referenced by main().
| void PeriDEMModel::log | ( | const std::string & | str, |
| int | priority = 0, |
||
| bool | check_condition = true, |
||
| int | override_priority = -1, |
||
| bool | screen_out = false |
||
| ) |
Definition at line 83 of file periDEMModel.cpp.
References util::io::log().
| void PeriDEMModel::log | ( | std::ostringstream & | oss, |
| int | priority = 0, |
||
| bool | check_condition = true, |
||
| int | override_priority = -1, |
||
| bool | screen_out = false |
||
| ) |
Definition at line 78 of file periDEMModel.cpp.
References util::io::log().
Referenced by applyDisplacementBC(), applyInitialCondition(), checkStop(), computeExternalForces(), computeForces(), init(), output(), and restart().
| void PeriDEMModel::output | ( | ) |
Definition at line 528 of file periDEMModel.cpp.
References data::ModelData::currentStep(), data::ModelData::d_n, data::ModelData::d_name, data::ModelData::d_time, log(), and rw::writeOutput().
Referenced by main().
| std::string PeriDEMModel::ppCompressiveTest | ( | ) |
Definition at line 550 of file periDEMModel.cpp.
References d_postprocess_p.
Referenced by checkStop().
| std::string PeriDEMModel::ppTwoParticleTest | ( | ) |
Definition at line 535 of file periDEMModel.cpp.
References d_postprocess_p.
Referenced by checkStop().
| void PeriDEMModel::restart | ( | std::shared_ptr< inp::Input > & | deck | ) |
Definition at line 104 of file periDEMModel.cpp.
References data::ModelData::d_modelDeck_p, data::ModelData::d_n, data::ModelData::d_name, data::ModelData::d_restartDeck_p, data::ModelData::d_time, data::ModelData::d_x, and log().
Referenced by run().
| void PeriDEMModel::run | ( | std::shared_ptr< inp::Input > & | deck | ) |
Definition at line 88 of file periDEMModel.cpp.
References close(), data::ModelData::d_modelDeck_p, init(), integrate(), and restart().
Referenced by main().
|
inline |
Definition at line 69 of file periDEMModel.h.
References d_contact_p.
|
inline |
Definition at line 71 of file periDEMModel.h.
References d_postprocess_p.
Referenced by main().
| std::unique_ptr<contact::Contact> PeriDEMModel::d_contact_p |
Definition at line 75 of file periDEMModel.h.
Referenced by anonymous_namespace{main.cpp}::checkWallSpringOnly(), computeForces(), init(), main(), and setContact().
| std::unique_ptr<postprocess::Postprocess> PeriDEMModel::d_postprocess_p |
Definition at line 76 of file periDEMModel.h.
Referenced by checkStop(), close(), PeriDEMModel(), ppCompressiveTest(), ppTwoParticleTest(), and setPostprocess().