11#ifndef DATA_MODELDATA_H
12#define DATA_MODELDATA_H
310 void setX(
size_t i,
int dof,
double x) {
d_x[i][dof] = x; };
318 void addX(
size_t i,
int dof,
double x) {
d_x[i][dof] += x; };
357 void setU(
size_t i,
int dof,
double u) {
d_u[i][dof] = u; };
365 void addU(
size_t i,
int dof,
double u) {
d_u[i][dof] += u; };
404 void setV(
size_t i,
int dof,
double v) {
d_v[i][dof] = v; };
412 void addV(
size_t i,
int dof,
double v) {
d_v[i][dof] += v; };
451 void setF(
size_t i,
int dof,
double f) {
d_f[i][dof] = f; };
459 void addF(
size_t i,
int dof,
double f) {
d_f[i][dof] += f; };
515 void setFix(
size_t i,
const unsigned int &dof,
523 flag ? (
d_fix[i] |= 1UL << dof) : (
d_fix[i] &= ~(1UL << dof));
541 const double &
getMx(
size_t i)
const {
return d_mX[i]; };
548 void setMx(
size_t i,
const double &mx) {
d_mX[i] = mx; };
555 void addMx(
size_t i,
const double &mx) {
d_mX[i] += mx; };
745 std::vector<util::Point>
d_x;
748 std::vector<util::Point>
d_u;
751 std::vector<util::Point>
d_v;
757 std::vector<util::Point>
d_f;
A class to store model data.
std::vector< util::Point > d_x
Current positions of the nodes.
void addU(size_t i, int dof, double u)
Add to displacement of the node.
void addMx(size_t i, const double &mx)
Add to weighted-volume (mx) of the node.
std::vector< util::Point > d_xRef
reference positions of the nodes
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< float > d_Z
Damage at nodes.
void setF(size_t i, int dof, double f)
Set force of the node.
const std::string & timeDiscretization() const
const util::Point & getF(size_t i) const
Get force of the node.
std::vector< size_t > d_fContCompNodes
List of global nodes on which force (contact) is to be computed.
std::vector< float > d_eFB
Bond-based fracture energy of the nodes.
std::vector< util::Point > d_u
Displacement of the nodes.
std::vector< double > d_maxVelocityParticlesListTypeAll
Maximum velocity among all nodes in the particle for each particle.
float d_teF
Total fracture energy.
std::vector< uint8_t > d_fix
Vector of fixity mask of each node.
std::vector< std::vector< std::vector< size_t > > > d_neighWallNodes
Neighbor data for contact between particle and walls.
size_t currentStep() const
size_t pdForceNode(size_t k) const
std::vector< float > d_e
Energy of the nodes.
std::vector< util::Point > d_f
Total force on the nodes.
double & getThetax(size_t i)
Get volumetric deformation (thetax) of the node.
void addF(size_t i, int dof, double f)
Add to force of the node.
std::vector< double > d_mX
Weighted volume.
double & getMx(size_t i)
Get weighted-volume (mx) of the node.
std::vector< std::vector< int > > d_pdGhostNeedFrom
Ghost node ids requested from each rank (PD DOF halo).
std::vector< std::pair< double, std::string > > d_pvdStrainEntries
(simulation time, VTU filename) for output_strain.pvd
std::unique_ptr< loading::ParticleULoading > d_uLoading_p
Pointer to displacement Loading object.
std::shared_ptr< inp::TestDeck > d_testDeck_p
Test deck.
std::vector< std::vector< int > > d_pdGhostServeTo
Local node ids this rank must send to each rank.
size_t & getPtId(size_t i)
Get particle id given the location in particle list.
const double & getVol(size_t i) const
Get volume of the node.
const util::Point & getU(size_t i) const
Get displacement of the node.
uint8_t & getFix(size_t i)
Get fixity of the node.
void addV(size_t i, const util::Point &v)
Add to velocity of the node.
void setF(size_t i, const util::Point &f)
Set force of the node.
bool d_pdDofMpi
Nodal DOF-MPI active.
std::vector< particle::BaseParticle * > d_particlesListTypeParticle
List of particles.
particle::BaseParticle *& getParticleFromParticleList(size_t i)
std::vector< std::vector< float > > d_neighPdSqdDist
Square distance neighbor data for peridynamic forces.
std::vector< size_t > d_pdNodePartition
Owner rank for each node when d_pdDofMpi is true.
void addThetax(size_t i, const double &thetax)
Add to volumetric deformation (thetax) of the node.
float d_tk
Total kinetic energy.
const util::Point & getX(size_t i) const
Get current coordinate of the node.
std::unique_ptr< geometry::Fracture > d_fracture_p
Fracture state of bonds.
void setU(size_t i, const util::Point &u)
Set displacement of the node.
double d_time
Current time.
std::string d_name
Model name for log prefixes.
void addXRef(size_t i, int dof, double x)
Add specific reference coordinate of the node.
const util::Point & getXRef(size_t i) const
Get reference coordinate of the node.
util::Point & getU(size_t i)
Get displacement of the node.
particle::BaseParticle *& getParticleFromAllList(size_t i)
Get pointer to base particle.
float d_te
Total internal energy.
std::vector< double > d_thetaX
Dilation.
particle::BaseParticle *& getParticleFromWallList(size_t i)
std::shared_ptr< inp::ModelDeck > d_modelDeck_p
Pointer to deck holding problem related data.
std::vector< std::vector< size_t > > d_neighC
Neighbor data for contact forces.
void setVMag(size_t i, double mag)
std::vector< size_t > d_ptId
Global node to particle id (walls are assigned id after last particle id)
std::vector< float > d_phi
Damage function at the nodes (volume-weighted, Silling 2000)
const particle::BaseParticle * getParticleFromParticleList(size_t i) const
Get pointer to particle (excluding wall)
double getDensity(size_t i)
Get density of particle.
std::shared_ptr< inp::RestartDeck > d_restartDeck_p
Pointer to deck holding restart related data.
void setFix(size_t i, const unsigned int &dof, const bool &flag)
Set fixity of the node.
double d_hMin
Maximum mesh over all particles and walls.
double & getVol(size_t i)
Get volume of the node.
std::vector< float > d_w
Work done on each of the nodes.
std::shared_ptr< inp::ParticleDeck > d_particleDeck_p
Pointer to deck holding particle related data.
const uint8_t & getFix(size_t i) const
Get fixity of the node.
util::Point & getF(size_t i)
Get force of the node.
std::vector< particle::BaseParticle * > d_particlesListTypeWall
List of walls.
util::Point & getV(size_t i)
Get velocity of the node.
std::unique_ptr< NSearch > d_nsearch_p
Pointer to nsearch.
const util::Point & getV(size_t i) const
Get velocity of the node.
std::vector< particle::BaseParticle * > d_particlesListTypeAll
List of particles + walls.
bool d_mpiGhostPlanValid
True once a ghost communication plan has been built.
util::Point & getX(size_t i)
Get current coordinate of the node.
size_t d_mpiGhostStepsSinceRebuild
Force steps since last ghost-plan rebuild.
void addXRef(size_t i, const util::Point &x)
Add reference coordinate of the node.
void setU(size_t i, int dof, double u)
Set displacement of the node.
std::vector< std::vector< size_t > > d_neighPd
Neighbor data for peridynamic forces.
void addF(size_t i, const util::Point &f)
Add to force of the node.
std::vector< float > d_eF
Fracture energy of the nodes.
double d_maxContactR
Maximum contact radius between over pairs of particles and walls.
void appendKeyData(std::string key, double data, bool issue_err=false)
Append value to data associated with key.
bool isDofFree(size_t i, unsigned int dof) const
size_t numTimeSteps() const
double d_contNeighSearchRadius
Neighborlist contact search radius (multiple of d_maxContactR). This variable will be updated during ...
void setCurrentDt(double dt)
util::Point & getXRef(size_t i)
Get reference coordinate of the node.
std::vector< inp::MatData > d_particlesMatDataList
List of particle material data. Only populated if needed for calculation of stress or other quantitie...
double d_hMax
Minimum mesh over all particles and walls.
float d_teFB
Total bond-based fracture energy.
const double & getThetax(size_t i) const
Get volumetric deformation (thetax) of the node.
void setXRef(size_t i, int dof, double x)
Set specific reference coordinate of the node.
void addU(size_t i, const util::Point &u)
Add to displacement of the node.
void addX(size_t i, const util::Point &x)
Add current coordinate of the node.
bool d_pdGrainAligned
DOF owners match whole-grain brick (same as particle-MPI). When true, every node of a grain lives on ...
std::vector< size_t > d_fPdCompNodes
List of global nodes on which force (peridynamic/internal) is to be computed.
size_t d_contNeighTimestepCounter
Contact neighborlist time step counter.
double getKeyData(std::string key, bool issue_err=false)
Get data for a key.
std::map< std::string, double > d_dbgData
Debug data.
double getHorizon(size_t i)
Get horizon of particle.
void setMx(size_t i, const double &mx)
Set weighted-volume (mx) of the node.
std::vector< std::vector< int > > d_mpiGhostServeTo
Cached grain ids this rank must send to each MPI rank.
void setThetax(size_t i, const double &thetax)
Set volumetric deformation (thetax) of the node.
std::vector< std::pair< double, std::string > > d_pvdParticleEntries
(simulation time, VTU filename) for output.pvd
std::vector< double > d_vMag
Magnitude of velocity of the nodes.
std::unique_ptr< loading::ParticleFLoading > d_fLoading_p
Pointer to force Loading object.
double getVMag(size_t i) const
void setPtId(size_t i, const size_t &id)
Set particle id given the location in particle list.
double d_maxVelocity
Maximum velocity among all nodes.
std::shared_ptr< inp::Input > d_input_p
Pointer to Input object.
size_t d_contNeighUpdateInterval
Neighborlist update interval.
size_t d_infoN
Print log step interval.
void setXRef(size_t i, const util::Point &x)
Set reference coordinate of the node.
double d_currentDt
Current timestep.
const particle::BaseParticle * getParticleFromWallList(size_t i) const
Get pointer to wall.
const size_t & getPtId(size_t i) const
Get particle id given the location in particle list.
void setV(size_t i, const util::Point &v)
Set velocity of the node.
void addV(size_t i, int dof, double v)
Add to velocity of the node.
bool shouldOutput() const
std::shared_ptr< inp::BCDeck > d_bcDeck_p
Boundary condition deck.
void setV(size_t i, int dof, double v)
Set velocity of the node.
size_t numPdForceNodes() const
std::vector< double > d_vol
Nodal volumes.
void addX(size_t i, int dof, double x)
Add to specific current coordinate of the node.
std::shared_ptr< inp::OutputDeck > d_outputDeck_p
Pointer to deck holding output related data.
std::ofstream d_ppFile
File stream to output information.
const double & getMx(size_t i) const
Get weighted-volume (mx) of the node.
std::vector< std::vector< std::vector< double > > > d_neighWallNodesDistance
Neighbor data (distance) for contact between particle and walls.
std::vector< util::SymMatrix3 > d_stress
Stress in elements (values at quadrature points)
void setKeyData(std::string key, double data, bool issue_err=false)
Set value to data associated with key.
std::vector< util::Point > d_v
Velocity of the nodes.
ModelData(std::shared_ptr< inp::Input > &deck)
Constructor.
std::vector< float > d_phiBond
Damage as broken-bond count fraction (Bhattacharya & Lipton 2023)
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 p...
std::vector< std::shared_ptr< particle::RefParticle > > d_referenceParticles
Pointer to reference particle.
float d_tw
Total work done.
std::vector< util::SymMatrix3 > d_strain
Strain in elements (values at quadrature points)
std::vector< uint8_t > d_forceFixity
Vector of fixity mask of each node for force.
bool d_stop
flag to stop the simulation midway
void setVol(size_t i, const double &vol)
Set volume of the node.
std::vector< std::vector< int > > d_mpiGhostNeedFrom
Cached ghost grain ids requested from each MPI rank (skin rebuild).
void setX(size_t i, int dof, double x)
Set specific current coordinate of the node.
size_t d_n
Current time step.
const particle::BaseParticle * getParticleFromAllList(size_t i) const
Get pointer to base particle.
std::vector< char > d_mpiIncludeInContactCloud
Per entry in d_particlesListTypeAll: include nodes in the MPI contact search cloud (owned grains,...
void setX(size_t i, const util::Point &x)
Set current coordinate of the node.
std::vector< util::Point > d_xQuadCur
Current position of quadrature points.
void addVol(size_t i, const double &vol)
Add to volume of the node.
bool performOutput() const
A class for nearest neighbor search using nanoflann library.
A class to store particle geometry, nodal discretization, and methods.
A class to store reference particle related data. Consider a case of multiple hexagon-shaped particle...
void setupQuadratureData(ModelData &data)
nsearch::NFlannSearchKd< 3 > NSearch
Collection of methods and data related to particle object.
T max(const std::vector< T > &data)
Returns the maximum from list of data.
bool isFree(const int &i, const unsigned int &dof)
Returns true if degree of freedom is free.
A structure to represent 3d vectors.