PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
material Namespace Reference

Data Structures

class  BaseInfluenceFn
 A base class for computing influence function. More...
 
class  ConstInfluenceFn
 A class to implement constant influence function. More...
 
class  GaussianInfluenceFn
 A class to implement Gaussian influence function. More...
 
class  LinearInfluenceFn
 A class to implement linear influence function. More...
 
class  Material
 Collection of methods and database related to peridynamic material. More...
 
class  PdElastic
 A class providing methods to compute energy density and force of peridynamic material. More...
 
class  PdState
 A class providing methods to compute energy density and force of peridynamic material. More...
 
class  PmbMaterial
 A class providing methods to compute energy density and force of peridynamic material. More...
 
class  RnpMaterial
 A class providing methods to compute energy density and force of peridynamic material. More...
 

Functions

void computeStateMx (data::ModelData *model, bool compute_in_parallel=false)
 Computes the moment \( m_x \) term in state-based peridynamic formulation.
 
void computeStateThetax (data::ModelData *model, bool compute_in_parallel=false)
 
void computeHydrostaticStrain (data::ModelData *model, bool compute_in_parallel=false)
 
void updateBondFractureData (data::ModelData *model, bool compute_in_parallel=false)
 
Conversion methods
double toNu (double lambda, double mu)
 Compute Poisson's ratio from Lame parameters.
 
double toNuEG (double E, double G)
 Compute Poisson's ratio from Young's and Shear modulus.
 
double toE (double K, double nu)
 Compute Young's modulus E from Bulk modulus K and Poisson's ratio nu.
 
double toK (double E, double nu)
 Compute Bulk modulus K from Young's modulus K and Poisson's ratio nu.
 
double toLambdaE (double E, double nu)
 Compute Lame first parameter lambda from Young's modulus E and Poisson's ratio nu.
 
double toLambdaK (double K, double nu)
 Compute Lame first parameter lambda from Bulk modulus K and Poisson's ratio nu.
 
double toGE (double E, double nu)
 Compute shear modulus from Young's modulus E and Poisson's ratio nu.
 
double toGK (double K, double nu)
 Compute shear modulus from Bulk modulus K and Poisson's ratio nu.
 
double toELambda (double lambda, double nu)
 Compute Young's modulus E from Lame first parameter lambda and Poisson's ratio nu.
 
double toGc (double KIc, double nu, double E)
 Compute critical energy release rate Gc from critical stress-intensity factor KIc, Poisson's ratio nu, and Young's modulus E.
 
double toKIc (double Gc, double nu, double E)
 Compute critical stress-intensity factor KIc from critical energy release rate Gc, Poisson's ratio \( nu\), and Young's modulus E.
 

Function Documentation

◆ computeHydrostaticStrain()

void material::computeHydrostaticStrain ( data::ModelData *  model,
bool  compute_in_parallel = false 
)

Definition at line 296 of file materialUtil.cpp.

296 {
297
298 model->d_thetaX.resize(model->d_x.size());
299 if (!compute_in_parallel) {
300 for (size_t i = 0; i < model->d_x.size(); i++) {
301 const auto &pti = model->getPtId(i);
302 const auto &particle = model->getParticleFromAllList(pti);
303
304 auto thetax = computeHydrostaticStrainI(i, model->d_xRef, model->d_u,
305 model->d_vol,
306 model->d_neighPd, model->d_neighPdSqdDist,
307 particle->getMeshSize(),
308 particle->getMaterial(),
309 model->d_fracture_p.get(),
310 particle->getDimension());
311
312 model->setThetax(i, thetax);
313 }
314 } else {
315
316 tf::Executor executor(util::parallel::getNThreads());
317 tf::Taskflow taskflow;
318
319 taskflow.for_each_index(
320 (std::size_t) 0, model->d_x.size(), (std::size_t) 1, [model](std::size_t i) {
321 const auto &pti = model->getPtId(i);
322 const auto &particle = model->getParticleFromAllList(pti);
323
324 auto thetax = computeHydrostaticStrainI(i,
325 model->d_xRef,
326 model->d_u,
327 model->d_vol,
328 model->d_neighPd, model->d_neighPdSqdDist,
329 particle->getMeshSize(),
330 particle->getMaterial(),
331 model->d_fracture_p.get(),
332 particle->getDimension());
333
334 model->setThetax(i, thetax);
335 }
336 ); // for_each
337
338 executor.run(taskflow).get();
339 }
340
341}
std::vector< util::Point > d_x
Current positions of the nodes.
Definition modelData.h:745
std::vector< util::Point > d_xRef
reference positions of the nodes
Definition modelData.h:742
std::vector< util::Point > d_u
Displacement of the nodes.
Definition modelData.h:748
size_t & getPtId(size_t i)
Get particle id given the location in particle list.
Definition modelData.h:187
std::vector< std::vector< float > > d_neighPdSqdDist
Square distance neighbor data for peridynamic forces.
Definition modelData.h:773
std::unique_ptr< geometry::Fracture > d_fracture_p
Fracture state of bonds.
Definition modelData.h:736
std::vector< double > d_thetaX
Dilation.
Definition modelData.h:802
std::vector< std::vector< size_t > > d_neighPd
Neighbor data for peridynamic forces.
Definition modelData.h:770
void setThetax(size_t i, const double &thetax)
Set volumetric deformation (thetax) of the node.
Definition modelData.h:579
std::vector< double > d_vol
Nodal volumes.
Definition modelData.h:760
const particle::BaseParticle * getParticleFromAllList(size_t i) const
Get pointer to base particle.
Definition modelData.h:86
double computeHydrostaticStrainI(size_t i, const std::vector< util::Point > &nodes, const std::vector< util::Point > &nodes_disp, const std::vector< double > &nodal_vol, const std::vector< std::vector< size_t > > &neighbors, const std::vector< std::vector< float > > &neighbors_sq_dist, const double &mesh_size, const material::Material *material, const geometry::Fracture *fracture, size_t dim)
Collection of methods and data related to particle object.
Definition modelData.h:36
unsigned int getNThreads()
Get number of threads to be used by taskflow.

References anonymous_namespace{materialUtil.cpp}::computeHydrostaticStrainI(), data::ModelData::d_fracture_p, data::ModelData::d_neighPd, data::ModelData::d_neighPdSqdDist, data::ModelData::d_thetaX, data::ModelData::d_u, data::ModelData::d_vol, data::ModelData::d_x, data::ModelData::d_xRef, util::parallel::getNThreads(), data::ModelData::getParticleFromAllList(), data::ModelData::getPtId(), and data::ModelData::setThetax().

Here is the call graph for this function:

◆ computeStateMx()

void material::computeStateMx ( data::ModelData *  model,
bool  compute_in_parallel = false 
)

Computes the moment \( m_x \) term in state-based peridynamic formulation.

Definition at line 214 of file materialUtil.cpp.

214 {
215
216 model->d_mX.resize(model->d_x.size());
217 if (!compute_in_parallel) {
218 for (size_t i = 0; i < model->d_x.size(); i++) {
219 const auto &pti = model->getPtId(i);
220 const auto &particle = model->getParticleFromAllList(pti);
221 auto mx = computeStateMxI(i, model->d_xRef, model->d_vol,
222 model->d_neighPd, model->d_neighPdSqdDist,
223 particle->getMeshSize(),
224 particle->getMaterial());
225
226 model->setMx(i, mx);
227 }
228 } else {
229
230 tf::Executor executor(util::parallel::getNThreads());
231 tf::Taskflow taskflow;
232
233 taskflow.for_each_index(
234 (std::size_t) 0, model->d_x.size(), (std::size_t) 1, [model](std::size_t i) {
235 const auto &pti = model->getPtId(i);
236 const auto &particle = model->getParticleFromAllList(pti);
237 auto mx = computeStateMxI(i, model->d_xRef, model->d_vol,
238 model->d_neighPd, model->d_neighPdSqdDist,
239 particle->getMeshSize(),
240 particle->getMaterial());
241
242 model->setMx(i, mx);
243 }
244 ); // for_each
245
246 executor.run(taskflow).get();
247 }
248}
std::vector< double > d_mX
Weighted volume.
Definition modelData.h:808
void setMx(size_t i, const double &mx)
Set weighted-volume (mx) of the node.
Definition modelData.h:548
double computeStateMxI(size_t i, const std::vector< util::Point > &nodes, const std::vector< double > &nodal_vol, const std::vector< std::vector< size_t > > &neighbors, const std::vector< std::vector< float > > &neighbors_sq_dist, const double &mesh_size, const material::Material *material)

References anonymous_namespace{materialUtil.cpp}::computeStateMxI(), data::ModelData::d_mX, data::ModelData::d_neighPd, data::ModelData::d_neighPdSqdDist, data::ModelData::d_vol, data::ModelData::d_x, data::ModelData::d_xRef, util::parallel::getNThreads(), data::ModelData::getParticleFromAllList(), data::ModelData::getPtId(), and data::ModelData::setMx().

Referenced by PeriDEMModel::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeStateThetax()

void material::computeStateThetax ( data::ModelData *  model,
bool  compute_in_parallel = false 
)

Definition at line 250 of file materialUtil.cpp.

250 {
251
252 model->d_thetaX.resize(model->d_x.size());
253 if (!compute_in_parallel) {
254 for (size_t i = 0; i < model->d_x.size(); i++) {
255 const auto &pti = model->getPtId(i);
256 const auto &particle = model->getParticleFromAllList(pti);
257
258 auto thetax = computeStateThetaxI(i, model->d_xRef, model->d_u,
259 model->d_vol,
260 model->d_neighPd, model->d_neighPdSqdDist,
261 particle->getMeshSize(),
262 particle->getMaterial(),
263 model->d_fracture_p.get(),
264 model->d_mX);
265
266 model->setThetax(i, thetax);
267
268 }
269
270 } else {
271
272 tf::Executor executor(util::parallel::getNThreads());
273 tf::Taskflow taskflow;
274
275 taskflow.for_each_index(
276 (std::size_t) 0, model->d_x.size(), (std::size_t) 1, [model](std::size_t i) {
277 const auto &pti = model->getPtId(i);
278 const auto &particle = model->getParticleFromAllList(pti);
279
280 auto thetax = computeStateThetaxI(i, model->d_xRef, model->d_u,
281 model->d_vol,
282 model->d_neighPd, model->d_neighPdSqdDist,
283 particle->getMeshSize(),
284 particle->getMaterial(),
285 model->d_fracture_p.get(),
286 model->d_mX);
287
288 model->setThetax(i, thetax);
289 }
290 ); // for_each
291
292 executor.run(taskflow).get();
293 }
294}
double computeStateThetaxI(size_t i, const std::vector< util::Point > &nodes, const std::vector< util::Point > &nodes_disp, const std::vector< double > &nodal_vol, const std::vector< std::vector< size_t > > &neighbors, const std::vector< std::vector< float > > &neighbors_sq_dist, const double &mesh_size, const material::Material *material, const geometry::Fracture *fracture, const std::vector< double > &mx)

References anonymous_namespace{materialUtil.cpp}::computeStateThetaxI(), data::ModelData::d_fracture_p, data::ModelData::d_mX, data::ModelData::d_neighPd, data::ModelData::d_neighPdSqdDist, data::ModelData::d_thetaX, data::ModelData::d_u, data::ModelData::d_vol, data::ModelData::d_x, data::ModelData::d_xRef, util::parallel::getNThreads(), data::ModelData::getParticleFromAllList(), data::ModelData::getPtId(), and data::ModelData::setThetax().

Here is the call graph for this function:

◆ toE()

double material::toE ( double  K,
double  nu 
)
inline

Compute Young's modulus E from Bulk modulus K and Poisson's ratio nu.

Parameters
KBulk modulus
nuPoisson's ratio
Returns
E Young's modulus

Definition at line 51 of file materialUtil.h.

51{ return K * (3. * (1. - 2. * nu)); }

Referenced by anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), and getInputJson().

Here is the caller graph for this function:

◆ toELambda()

double material::toELambda ( double  lambda,
double  nu 
)
inline

Compute Young's modulus E from Lame first parameter lambda and Poisson's ratio nu.

Parameters
lambdaLame first parameter
nuPoisson's ratio
Returns
E Young's modulus

Definition at line 106 of file materialUtil.h.

106 {
107 return lambda * (1. + nu) * (1. - 2. * nu) / nu;
108 }

◆ toGc()

double material::toGc ( double  KIc,
double  nu,
double  E 
)
inline

Compute critical energy release rate Gc from critical stress-intensity factor KIc, Poisson's ratio nu, and Young's modulus E.

Below conversion from KIc to Gc assumes plane-stress condition. For plane-stress condition, we need to modify the Young's modulus \( E\) to \( \frac{E}{1 - \nu^2} \) where \( \nu\) is the Poisson's ratio.

Parameters
KIcCritical stress-intensity factor
nuPoisson's ratio
EYoung's modulus
Returns
Gc Critical energy release rate

Definition at line 123 of file materialUtil.h.

123{ return KIc * KIc / E; }

Referenced by anonymous_namespace{main.cpp}::buildInputJson().

Here is the caller graph for this function:

◆ toGE()

double material::toGE ( double  E,
double  nu 
)
inline

Compute shear modulus from Young's modulus E and Poisson's ratio nu.

Parameters
EYoung's modulus
nuPoisson's ratio
Returns
G Shear modulus

Definition at line 87 of file materialUtil.h.

87{ return E / (2. * (1. + nu)); }

Referenced by anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), and getInputJson().

Here is the caller graph for this function:

◆ toGK()

double material::toGK ( double  K,
double  nu 
)
inline

Compute shear modulus from Bulk modulus K and Poisson's ratio nu.

Parameters
KBulk modulus
nuPoisson's ratio
Returns
G Shear modulus

Definition at line 95 of file materialUtil.h.

95 {
96 return 3. * K * (1. - 2. * nu) / (2. * (1. + nu));
97 }

◆ toK()

double material::toK ( double  E,
double  nu 
)
inline

Compute Bulk modulus K from Young's modulus K and Poisson's ratio nu.

Parameters
EYoung's modulus
nuPoisson's ratio
Returns
K Bulk modulus

Definition at line 59 of file materialUtil.h.

59{ return E / (3. * (1. - 2. * nu)); }

◆ toKIc()

double material::toKIc ( double  Gc,
double  nu,
double  E 
)
inline

Compute critical stress-intensity factor KIc from critical energy release rate Gc, Poisson's ratio \( nu\), and Young's modulus E.

Below conversion from Gc to KIc assumes plane-stress condition. For plane-stress condition, we need to modify the Young's modulus \( E\) to \( \frac{E}{1 - \nu^2} \) where \( \nu\) is the Poisson's ratio.

Parameters
GcCritical energy release rate
nuPoisson's ratio
EYoung's modulus
Returns
KIc Critical stress-intensity factor

Definition at line 138 of file materialUtil.h.

138{ return std::sqrt(Gc * E); }

◆ toLambdaE()

double material::toLambdaE ( double  E,
double  nu 
)
inline

Compute Lame first parameter lambda from Young's modulus E and Poisson's ratio nu.

Parameters
EYoung's modulus
nuPoisson's ratio
Returns
lambda Lame first parameter

Definition at line 68 of file materialUtil.h.

68 {
69 return E * nu / ((1. + nu) * (1. - 2. * nu));
70 }

◆ toLambdaK()

double material::toLambdaK ( double  K,
double  nu 
)
inline

Compute Lame first parameter lambda from Bulk modulus K and Poisson's ratio nu.

Parameters
KBulk modulus
nuPoisson's ratio
Returns
lambda Lame first parameter

Definition at line 79 of file materialUtil.h.

79{ return 3. * K * nu / (1. + nu); }

◆ toNu()

double material::toNu ( double  lambda,
double  mu 
)
inline

Compute Poisson's ratio from Lame parameters.

Parameters
lambdaLame first parameter
muLame second parameter
Returns
nu Poisson's ratio

Definition at line 35 of file materialUtil.h.

35{ return lambda * 0.5 / (lambda + mu); }

◆ toNuEG()

double material::toNuEG ( double  E,
double  G 
)
inline

Compute Poisson's ratio from Young's and Shear modulus.

Parameters
EYoungs modulus
GShear modulus
Returns
nu Poisson's ratio

Definition at line 43 of file materialUtil.h.

43{ return E * 0.5 / G - 1.; }

◆ updateBondFractureData()

void material::updateBondFractureData ( data::ModelData *  model,
bool  compute_in_parallel = false 
)

Definition at line 343 of file materialUtil.cpp.

343 {
344
345 if (!compute_in_parallel) {
346 for (size_t i = 0; i < model->d_x.size(); i++) {
347 const auto &pti = model->getPtId(i);
348 const auto &particle = model->getParticleFromAllList(pti);
349
350 updateBondFractureDataI(i, model->d_xRef, model->d_neighPd, model->d_u,
351 particle->getMaterial(),
352 model->d_fracture_p.get());
353 }
354 } else {
355
356 tf::Executor executor(util::parallel::getNThreads());
357 tf::Taskflow taskflow;
358
359 taskflow.for_each_index(
360 (std::size_t) 0, model->d_x.size(), (std::size_t) 1, [model](std::size_t i) {
361 const auto &pti = model->getPtId(i);
362 const auto &particle = model->getParticleFromAllList(pti);
363
364 updateBondFractureDataI(i,
365 model->d_xRef,
366 model->d_neighPd,
367 model->d_u,
368 particle->getMaterial(),
369 model->d_fracture_p.get());
370 }
371 ); // for_each
372
373 executor.run(taskflow).get();
374 }
375}
void updateBondFractureDataI(size_t i, const std::vector< util::Point > &nodes, const std::vector< std::vector< size_t > > &neighbors, const std::vector< util::Point > &nodes_disp, const material::Material *material, geometry::Fracture *fracture)

References data::ModelData::d_fracture_p, data::ModelData::d_neighPd, data::ModelData::d_u, data::ModelData::d_x, data::ModelData::d_xRef, util::parallel::getNThreads(), data::ModelData::getParticleFromAllList(), data::ModelData::getPtId(), and anonymous_namespace{materialUtil.cpp}::updateBondFractureDataI().

Here is the call graph for this function: