PeriDEM 0.2.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 (model::ModelData *model, bool compute_in_parallel=false)
 Computes the moment \( m_x \) term in state-based peridynamic formulation.
 
void computeStateThetax (model::ModelData *model, bool compute_in_parallel=false)
 
void computeHydrostaticStrain (model::ModelData *model, bool compute_in_parallel=false)
 
void updateBondFractureData (model::ModelData *model, bool compute_in_parallel=false)
 

Function Documentation

◆ computeHydrostaticStrain()

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

Definition at line 293 of file materialUtil.cpp.

293 {
294
295 model->d_thetaX.resize(model->d_x.size());
296 if (!compute_in_parallel) {
297 for (size_t i = 0; i < model->d_x.size(); i++) {
298 const auto &pti = model->getPtId(i);
299 const auto &particle = model->getParticleFromAllList(pti);
300
301 auto thetax = computeHydrostaticStrainI(i, model->d_xRef, model->d_u,
302 model->d_vol,
303 model->d_neighPd, model->d_neighPdSqdDist,
304 particle->getMeshSize(),
305 particle->getMaterial(),
306 model->d_fracture_p.get(),
307 particle->getDimension());
308
309 model->setThetax(i, thetax);
310 }
311 } else {
312
313 tf::Executor executor(util::parallel::getNThreads());
314 tf::Taskflow taskflow;
315
316 taskflow.for_each_index(
317 (std::size_t) 0, model->d_x.size(), (std::size_t) 1, [model](std::size_t i) {
318 const auto &pti = model->getPtId(i);
319 const auto &particle = model->getParticleFromAllList(pti);
320
321 auto thetax = computeHydrostaticStrainI(i,
322 model->d_xRef,
323 model->d_u,
324 model->d_vol,
325 model->d_neighPd, model->d_neighPdSqdDist,
326 particle->getMeshSize(),
327 particle->getMaterial(),
328 model->d_fracture_p.get(),
329 particle->getDimension());
330
331 model->setThetax(i, thetax);
332 }
333 ); // for_each
334
335 executor.run(taskflow).get();
336 }
337
338}
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.
unsigned int getNThreads()
Get number of threads to be used by taskflow.

References anonymous_namespace{materialUtil.cpp}::computeHydrostaticStrainI(), and util::parallel::getNThreads().

Here is the call graph for this function:

◆ computeStateMx()

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

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

Definition at line 211 of file materialUtil.cpp.

211 {
212
213 model->d_mX.resize(model->d_x.size());
214 if (!compute_in_parallel) {
215 for (size_t i = 0; i < model->d_x.size(); i++) {
216 const auto &pti = model->getPtId(i);
217 const auto &particle = model->getParticleFromAllList(pti);
218 auto mx = computeStateMxI(i, model->d_xRef, model->d_vol,
219 model->d_neighPd, model->d_neighPdSqdDist,
220 particle->getMeshSize(),
221 particle->getMaterial());
222
223 model->setMx(i, mx);
224 }
225 } else {
226
227 tf::Executor executor(util::parallel::getNThreads());
228 tf::Taskflow taskflow;
229
230 taskflow.for_each_index(
231 (std::size_t) 0, model->d_x.size(), (std::size_t) 1, [model](std::size_t i) {
232 const auto &pti = model->getPtId(i);
233 const auto &particle = model->getParticleFromAllList(pti);
234 auto mx = computeStateMxI(i, model->d_xRef, model->d_vol,
235 model->d_neighPd, model->d_neighPdSqdDist,
236 particle->getMeshSize(),
237 particle->getMaterial());
238
239 model->setMx(i, mx);
240 }
241 ); // for_each
242
243 executor.run(taskflow).get();
244 }
245}
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(), and util::parallel::getNThreads().

Referenced by model::DEMModel::init().

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

◆ computeStateThetax()

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

Definition at line 247 of file materialUtil.cpp.

247 {
248
249 model->d_thetaX.resize(model->d_x.size());
250 if (!compute_in_parallel) {
251 for (size_t i = 0; i < model->d_x.size(); i++) {
252 const auto &pti = model->getPtId(i);
253 const auto &particle = model->getParticleFromAllList(pti);
254
255 auto thetax = computeStateThetaxI(i, model->d_xRef, model->d_u,
256 model->d_vol,
257 model->d_neighPd, model->d_neighPdSqdDist,
258 particle->getMeshSize(),
259 particle->getMaterial(),
260 model->d_fracture_p.get(),
261 model->d_mX);
262
263 model->setThetax(i, thetax);
264
265 }
266
267 } else {
268
269 tf::Executor executor(util::parallel::getNThreads());
270 tf::Taskflow taskflow;
271
272 taskflow.for_each_index(
273 (std::size_t) 0, model->d_x.size(), (std::size_t) 1, [model](std::size_t i) {
274 const auto &pti = model->getPtId(i);
275 const auto &particle = model->getParticleFromAllList(pti);
276
277 auto thetax = computeStateThetaxI(i, model->d_xRef, model->d_u,
278 model->d_vol,
279 model->d_neighPd, model->d_neighPdSqdDist,
280 particle->getMeshSize(),
281 particle->getMaterial(),
282 model->d_fracture_p.get(),
283 model->d_mX);
284
285 model->setThetax(i, thetax);
286 }
287 ); // for_each
288
289 executor.run(taskflow).get();
290 }
291}
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(), and util::parallel::getNThreads().

Here is the call graph for this function:

◆ updateBondFractureData()

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

Definition at line 340 of file materialUtil.cpp.

340 {
341
342 if (!compute_in_parallel) {
343 for (size_t i = 0; i < model->d_x.size(); i++) {
344 const auto &pti = model->getPtId(i);
345 const auto &particle = model->getParticleFromAllList(pti);
346
347 updateBondFractureDataI(i, model->d_xRef, model->d_neighPd, model->d_u,
348 particle->getMaterial(),
349 model->d_fracture_p.get());
350 }
351 } else {
352
353 tf::Executor executor(util::parallel::getNThreads());
354 tf::Taskflow taskflow;
355
356 taskflow.for_each_index(
357 (std::size_t) 0, model->d_x.size(), (std::size_t) 1, [model](std::size_t i) {
358 const auto &pti = model->getPtId(i);
359 const auto &particle = model->getParticleFromAllList(pti);
360
361 updateBondFractureDataI(i,
362 model->d_xRef,
363 model->d_neighPd,
364 model->d_u,
365 particle->getMaterial(),
366 model->d_fracture_p.get());
367 }
368 ); // for_each
369
370 executor.run(taskflow).get();
371 }
372}
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 util::parallel::getNThreads(), and anonymous_namespace{materialUtil.cpp}::updateBondFractureDataI().

Here is the call graph for this function: