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

A class providing methods to compute energy density and force of peridynamic material. More...

#include <material.h>

Inheritance diagram for material::PdElastic:
Collaboration diagram for material::PdElastic:

Public Member Functions

 PdElastic (inp::MaterialDeck &deck, const size_t &dim, const double &horizon)
 Constructor.
 
bool isStateActive () const override
 Returns true if state-based potential is active.
 
std::pair< double, double > getBondEF (const double &r, const double &s, bool &fs, const bool &break_bonds) const override
 Returns energy and force between bond due to pairwise interaction.
 
std::pair< double, double > getBondEF (const double &r, const double &s, bool &fs, const double &mx, const double &thetax) const override
 Returns energy and force between bond due to state-based model.
 
util::Point getBondForceDirection (const util::Point &dx, const util::Point &du) const override
 Returns the unit vector along which bond-force acts.
 
double getS (const util::Point &dx, const util::Point &du) const override
 Returns the bond strain.
 
double getSc (const double &r) const override
 Returns critical bond strain.
 
double getDensity () const override
 Returns the density of the material.
 
double getInfFn (const double &r) const override
 Returns the value of influence function.
 
double getMoment (const size_t &i) const override
 Returns the moment of influence function.
 
double getHorizon () const override
 Returns horizon.
 
inp::MatData computeMaterialProperties (const size_t &dim) const override
 Computes elastic and fracture material properties and returns the data.
 
std::string printStr (int nt, int lvl) const override
 Returns the string containing printable information about the object.
 
void print (int nt, int lvl) const override
 Prints the information about the object.
 
void print () const override
 Prints the information about the object.
 
- Public Member Functions inherited from material::Material
 Material (std::string name="")
 Constructor.
 
virtual ~Material ()
 Destructor.
 
std::string name ()
 Returns name of the material.
 
size_t getDimension () const
 Returns dimension of the problem.
 
bool isPlaneStrain () const
 Returns plane-strain condition.
 
virtual double getBreakSc (const double &r) const
 Returns bond strain beyond which the bond is marked broken.
 
virtual double getDilatationEnergyDensity (const double &thetax) const
 Returns the dilatational part of the strain energy density.
 

Private Member Functions

void computeParameters (inp::MaterialDeck &deck, const size_t &dim)
 Compute material model parameters.
 

Private Attributes

double d_horizon
 Horizon.
 
double d_density
 Density.
 
Material parameters
double d_c
 Parameter C.
 

Detailed Description

A class providing methods to compute energy density and force of peridynamic material.

Definition at line 1120 of file material.h.

Constructor & Destructor Documentation

◆ PdElastic()

material::PdElastic::PdElastic ( inp::MaterialDeck &  deck,
const size_t &  dim,
const double &  horizon 
)
inline

Constructor.

Parameters
deckInput deck which contains user-specified information
dimDimension
horizonHorizon

Definition at line 1129 of file material.h.

1130 : Material("PDElasticBond"), d_horizon(horizon),
1131 d_density(deck.d_density), d_c(0.) {
1132
1133 // set global fields
1134 if (dimension != dim)
1135 dimension = dim;
1136
1137 if (is_plane_strain != deck.d_isPlaneStrain)
1139
1140 // create influence function
1141 if (deck.d_influenceFnType == 0) {
1142 if (influence_fn == nullptr)
1143 influence_fn = std::make_shared<material::ConstInfluenceFn>(
1144 deck.d_influenceFnParams, dim);
1145 }
1146 else if (deck.d_influenceFnType == 1) {
1147 if (influence_fn == nullptr)
1148 influence_fn = std::make_shared<material::LinearInfluenceFn>(
1149 deck.d_influenceFnParams, dim);
1150 }
1151 else if (deck.d_influenceFnType == 2) {
1152 if (influence_fn == nullptr)
1153 influence_fn = std::make_shared<material::GaussianInfluenceFn>(
1154 deck.d_influenceFnParams, dim);
1155 }
1156 else {
1157 throw std::runtime_error(
1159 << "Error: Influence function type = "
1160 << deck.d_influenceFnType
1161 << " is invalid.\n");
1162 }
1163
1164 // check if we need to compute the material parameters
1166 computeParameters(deck, dim);
1167 else
1168 d_c = deck.d_bondPotentialParams[0];
1169 };
Material(std::string name="")
Constructor.
Definition material.h:105
double d_density
Density.
Definition material.h:1412
double d_horizon
Horizon.
Definition material.h:1409
double d_c
Parameter C.
Definition material.h:1420
void computeParameters(inp::MaterialDeck &deck, const size_t &dim)
Compute material model parameters.
Definition material.h:1357
Collects a message with stream syntax for use in an exception.
Definition io.h:52
bool is_plane_strain
Is plane-stress condition active.
Definition material.h:31
size_t dimension
Dimension of the domain.
Definition material.h:28
std::shared_ptr< material::BaseInfluenceFn > influence_fn
Store pointer to influence function globally.
Definition material.h:34
bool d_isPlaneStrain
Indicates if the 2-d simulation is of plane-strain type (thick material) or plane-stress type (thin m...
double d_density
Density of material.
size_t d_influenceFnType
Type of influence function.
std::vector< double > d_bondPotentialParams
List of parameters for pairwise potential.
bool d_computeParamsFromElastic
Compute Peridynamic material properties from elastic properties.
std::vector< double > d_influenceFnParams
List of parameters for influence function.

References computeParameters(), inp::MaterialDeck::d_bondPotentialParams, d_c, inp::MaterialDeck::d_computeParamsFromElastic, inp::MaterialDeck::d_influenceFnParams, inp::MaterialDeck::d_influenceFnType, and inp::MaterialDeck::d_isPlaneStrain.

Here is the call graph for this function:

Member Function Documentation

◆ computeMaterialProperties()

inp::MatData material::PdElastic::computeMaterialProperties ( const size_t &  dim) const
inlineoverridevirtual

Computes elastic and fracture material properties and returns the data.

Parameters
dimDimension of the problem
Returns
Data Material data

Implements material::Material.

Definition at line 1285 of file material.h.

1285 {
1286
1287 auto data = inp::MatData();
1288
1289 if (dim == 2 && !is_plane_strain)
1290 data.d_nu = 1.0 / 3.0;
1291 else
1292 data.d_nu = 0.25;
1293
1294 const double h = d_horizon;
1295 if (dim == 2 && !is_plane_strain) {
1296 data.d_E = d_c * (M_PI * std::pow(h, 3.0)) / 9.0;
1297 } else if (dim == 2 && is_plane_strain) {
1298 data.d_E = d_c * (5.0 * M_PI * std::pow(h, 3.0)) / 48.0;
1299 } else if (dim == 3) {
1300 data.d_K = d_c * (M_PI * std::pow(h, 4.0)) / 18.0;
1301 data.d_E = data.toE(data.d_K, data.d_nu);
1302 }
1303 if (dim == 2)
1304 data.d_K = data.toK(data.d_E, data.d_nu);
1305 data.d_lambda = data.toLambdaE(data.d_E, data.d_nu);
1306 data.d_mu = data.toGE(data.d_E, data.d_nu);
1307 data.d_G = data.d_mu;
1308
1309 return data;
1310 };
Definition contact.h:20
Structure for elastic properties and fracture properties.

References d_c, and d_horizon.

◆ computeParameters()

void material::PdElastic::computeParameters ( inp::MaterialDeck &  deck,
const size_t &  dim 
)
inlineprivate

Compute material model parameters.

Parameters
deckMaterialDeck
dimDimension of the domain

Definition at line 1357 of file material.h.

1357 {
1358 // Elastic-only bond-based micromodulus (same δ powers as PMB).
1359 if (util::isLess(deck.d_matData.d_E, 0.) &&
1360 util::isLess(deck.d_matData.d_K, 0.)) {
1361 throw std::runtime_error(
1363 << "Error: Require either Young's modulus E or Bulk modulus K"
1364 " to compute the PdElastic parameters.\n");
1365 }
1366 if (util::isGreater(deck.d_matData.d_E, 0.) &&
1367 util::isGreater(deck.d_matData.d_K, 0.)) {
1368 std::cout << "Warning: Both E and K provided; selecting E for PdElastic.\n";
1369 }
1370
1371 // Emmrich / Trask micromodulus (J≡1). Scale if ConstInfluence a0≠1.
1372 deck.d_matData.d_nu = 0.25;
1373 if (deck.d_matData.d_E < 0. && deck.d_matData.d_K > 0.)
1374 deck.d_matData.d_E =
1375 deck.d_matData.toE(deck.d_matData.d_K, deck.d_matData.d_nu);
1376 if (deck.d_matData.d_E > 0.)
1377 deck.d_matData.d_K =
1378 deck.d_matData.toK(deck.d_matData.d_E, deck.d_matData.d_nu);
1379 deck.d_matData.d_lambda =
1380 deck.d_matData.toLambdaE(deck.d_matData.d_E, deck.d_matData.d_nu);
1381 deck.d_matData.d_G =
1382 deck.d_matData.toGE(deck.d_matData.d_E, deck.d_matData.d_nu);
1383 deck.d_matData.d_mu = deck.d_matData.d_G;
1384
1385 double J_scale = 1.0;
1386 if (deck.d_influenceFnType == 0)
1387 J_scale = deck.d_influenceFnParams.empty() ? double(dim + 1)
1388 : deck.d_influenceFnParams[0];
1389 else if (deck.d_influenceFnType == 1 || deck.d_influenceFnType == 2)
1390 J_scale = std::max(getMoment(0), 1.0e-30);
1391
1392 const double h = d_horizon;
1393 const double kappa = deck.d_matData.d_K;
1394 if (dim == 2)
1395 d_c = 72.0 * kappa / (5.0 * M_PI * std::pow(h, 3.0));
1396 else if (dim == 3)
1397 d_c = 18.0 * kappa / (M_PI * std::pow(h, 4.0));
1398 else {
1399 throw std::runtime_error(
1401 << "Error: PdElastic computeParameters: unsupported dim=" << dim
1402 << "\n");
1403 }
1404 d_c /= J_scale;
1405 };
double getMoment(const size_t &i) const override
Returns the moment of influence function.
Definition material.h:1267
bool isGreater(const double &a, const double &b)
Returns true if a > b.
Definition function.cpp:17
bool isLess(const double &a, const double &b)
Returns true if a < b.
Definition function.cpp:22
double toLambdaE(double E, double nu)
Compute Lame first parameter lambda from Young's modulus E and Poisson's ratio nu.
double d_mu
Lame second parameter.
double toK(double E, double nu)
Compute Bulk modulus K from Young's modulus K and Poisson's ratio nu.
double d_K
Bulk modulus.
double d_lambda
Lame first parameter.
double toGE(double E, double nu)
Compute shear modulus from Young's modulus E and Poisson's ratio nu.
double d_nu
Poisson's ratio.
double d_G
Shear modulus or Lame second parameter.
double d_E
Young's elastic modulus.
double toE(double K, double nu)
Compute Young's modulus E from Bulk modulus K and Poisson's ratio nu.
inp::MatData d_matData
List of elastic and fracture properties.

References d_c, inp::MatData::d_E, inp::MatData::d_G, d_horizon, inp::MaterialDeck::d_influenceFnParams, inp::MaterialDeck::d_influenceFnType, inp::MatData::d_K, inp::MatData::d_lambda, inp::MaterialDeck::d_matData, inp::MatData::d_mu, inp::MatData::d_nu, getMoment(), util::isGreater(), util::isLess(), inp::MatData::toE(), inp::MatData::toGE(), inp::MatData::toK(), and inp::MatData::toLambdaE().

Referenced by PdElastic().

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

◆ getBondEF() [1/2]

std::pair< double, double > material::PdElastic::getBondEF ( const double &  r,
const double &  s,
bool &  fs,
const bool &  break_bonds 
) const
inlineoverridevirtual

Returns energy and force between bond due to pairwise interaction.

Parameters
rReference (initial) bond length
sBond strain
fsBond fracture state
break_bondsFlag to specify whether bonds are allowed to break or not
Returns
value Pair of energy and force

Implements material::Material.

Definition at line 1186 of file material.h.

1188 {
1189
1190 return std::make_pair(getInfFn(r) * 0.5 * d_c * s *
1191 s * r,
1192 getInfFn(r) * d_c * s);
1193 };
double getInfFn(const double &r) const override
Returns the value of influence function.
Definition material.h:1254

References d_c, and getInfFn().

Referenced by getBondEF().

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

◆ getBondEF() [2/2]

std::pair< double, double > material::PdElastic::getBondEF ( const double &  r,
const double &  s,
bool &  fs,
const double &  mx,
const double &  thetax 
) const
inlineoverridevirtual

Returns energy and force between bond due to state-based model.

Parameters
rReference (initial) bond length
sBond strain
fsBond fracture state
mxWeighted volume at node
thetaxDilation
Returns
value Pair of energy and force

Implements material::Material.

Definition at line 1206 of file material.h.

1207 {
1208
1209 return this->getBondEF(r, s, fs, true);
1210 };
std::pair< double, double > getBondEF(const double &r, const double &s, bool &fs, const bool &break_bonds) const override
Returns energy and force between bond due to pairwise interaction.
Definition material.h:1186

References getBondEF().

Here is the call graph for this function:

◆ getBondForceDirection()

util::Point material::PdElastic::getBondForceDirection ( const util::Point &  dx,
const util::Point &  du 
) const
inlineoverridevirtual

Returns the unit vector along which bond-force acts.

Parameters
dxReference bond vector
duDifference of displacement
Returns
vector Unit vector

Implements material::Material.

Definition at line 1219 of file material.h.

1220 {
1221 return (dx + du) / (dx + du).length();
1222 };

◆ getDensity()

double material::PdElastic::getDensity ( ) const
inlineoverridevirtual

Returns the density of the material.

Returns
density Density of the material

Implements material::Material.

Definition at line 1246 of file material.h.

1246{ return d_density; };

References d_density.

◆ getHorizon()

double material::PdElastic::getHorizon ( ) const
inlineoverridevirtual

Returns horizon.

Returns
horizon Horizon

Implements material::Material.

Definition at line 1276 of file material.h.

1276{ return d_horizon; };

References d_horizon.

◆ getInfFn()

double material::PdElastic::getInfFn ( const double &  r) const
inlineoverridevirtual

Returns the value of influence function.

Parameters
rReference (initial) bond length
Returns
value Influence function at r

Implements material::Material.

Definition at line 1254 of file material.h.

1254 {
1255 return getGlobalInfFn(r / d_horizon);
1256 };
double getGlobalInfFn(const double &r)
Returns the value of influence function.
Definition material.h:42

References d_horizon.

Referenced by getBondEF().

Here is the caller graph for this function:

◆ getMoment()

double material::PdElastic::getMoment ( const size_t &  i) const
inlineoverridevirtual

Returns the moment of influence function.

If \( J(r) \) is the influence function for \( r\in [0,1)\) then \( i^{th}\) moment is given by

\[ M_i = \int_0^1 J(r) r^i dr. \]

Parameters
iith moment
Returns
value Moment

Implements material::Material.

Definition at line 1267 of file material.h.

1267 {
1268 return getGlobalMoment(i);
1269 };
double getGlobalMoment(const size_t &i)
Returns the moment of influence function.
Definition material.h:55

Referenced by computeParameters().

Here is the caller graph for this function:

◆ getS()

double material::PdElastic::getS ( const util::Point &  dx,
const util::Point &  du 
) const
inlineoverridevirtual

Returns the bond strain.

Parameters
dxReference bond vector
duDifference of displacement
Returns
strain Bond strain \( S = \frac{du \cdot dx}{|dx|^2} \)

Implements material::Material.

Definition at line 1230 of file material.h.

1230 {
1231 return ((dx + du).length() - dx.length()) / dx.length();
1232 };
double length() const
Computes the Euclidean length of the vector.
Definition point.h:124

References util::Point::length().

Here is the call graph for this function:

◆ getSc()

double material::PdElastic::getSc ( const double &  r) const
inlineoverridevirtual

Returns critical bond strain.

Parameters
rReference length of bond
Returns
strain Critical strain

Implements material::Material.

Definition at line 1240 of file material.h.

1240{ return std::numeric_limits<double>::max(); };

◆ isStateActive()

bool material::PdElastic::isStateActive ( ) const
inlineoverridevirtual

Returns true if state-based potential is active.

Returns
bool True/false

Implements material::Material.

Definition at line 1175 of file material.h.

1175{ return false; };

◆ print() [1/2]

void material::PdElastic::print ( ) const
inlineoverridevirtual

Prints the information about the object.

Reimplemented from material::Material.

Definition at line 1348 of file material.h.

1348{ print(0, 0); };
void print() const override
Prints the information about the object.
Definition material.h:1348

References print().

Referenced by print().

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

◆ print() [2/2]

void material::PdElastic::print ( int  nt,
int  lvl 
) const
inlineoverridevirtual

Prints the information about the object.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)

Reimplemented from material::Material.

Definition at line 1343 of file material.h.

1343 {
1344 std::cout << printStr(nt, lvl);
1345 };
std::string printStr(int nt, int lvl) const override
Returns the string containing printable information about the object.
Definition material.h:1319

References printStr().

Here is the call graph for this function:

◆ printStr()

std::string material::PdElastic::printStr ( int  nt,
int  lvl 
) const
inlineoverridevirtual

Returns the string containing printable information about the object.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)
Returns
string String containing printable information about the object

Reimplemented from material::Material.

Definition at line 1319 of file material.h.

1319 {
1320
1321 auto tabS = util::io::getTabS(nt);
1322 std::ostringstream oss;
1323 oss << tabS << "------- particle::PdElastic --------" << std::endl
1324 << std::endl;
1325 oss << tabS << "State active = " << 0 << std::endl;
1326 oss << tabS << "Horizon = " << d_horizon << std::endl;
1327 oss << tabS << "Influence fn address = " << influence_fn.get() << std::endl;
1328 oss << tabS << "Influence fn info: " << std::endl;
1329 oss << influence_fn->printStr(nt + 1, lvl);
1330 oss << tabS << "Peridynamic parameters: " << std::endl;
1331 oss << tabS << " c = " << d_c << std::endl;
1332 oss << tabS << std::endl;
1333
1334 return oss.str();
1335 };
std::string getTabS(int nt)
Returns tab spaces of a given size.
Definition io.h:82

References d_c, d_horizon, and util::io::getTabS().

Referenced by print().

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

Field Documentation

◆ d_c

double material::PdElastic::d_c
private

Parameter C.

Definition at line 1420 of file material.h.

Referenced by computeMaterialProperties(), computeParameters(), getBondEF(), PdElastic(), and printStr().

◆ d_density

double material::PdElastic::d_density
private

Density.

Definition at line 1412 of file material.h.

Referenced by getDensity().

◆ d_horizon

double material::PdElastic::d_horizon
private

Horizon.

Definition at line 1409 of file material.h.

Referenced by computeMaterialProperties(), computeParameters(), getHorizon(), getInfFn(), and printStr().


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