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

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

#include <material.h>

Inheritance diagram for material::PmbMaterial:
Collaboration diagram for material::PmbMaterial:

Public Member Functions

 PmbMaterial (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
 Micromodulus c (divided by the constant influence value)
 
double d_s0
 Critical stretch.
 
double d_Jscale
 Constant influence value a0 that c was divided by.
 

Detailed Description

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

Definition at line 731 of file material.h.

Constructor & Destructor Documentation

◆ PmbMaterial()

material::PmbMaterial::PmbMaterial ( 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 740 of file material.h.

741 : Material("PMBBond"), d_horizon(horizon), d_density(deck.d_density),
742 d_c(0.), d_s0(0.), d_Jscale(1.) {
743
744 // set global fields
745 if (dimension != dim)
746 dimension = dim;
747
748 if (is_plane_strain != deck.d_isPlaneStrain)
750
751 // create influence function
752 if (deck.d_influenceFnType == 0) {
753 if (influence_fn == nullptr)
754 influence_fn = std::make_shared<material::ConstInfluenceFn>(
755 deck.d_influenceFnParams, dim);
756 }
757 else if (deck.d_influenceFnType == 1) {
758 if (influence_fn == nullptr)
759 influence_fn = std::make_shared<material::LinearInfluenceFn>(
760 deck.d_influenceFnParams, dim);
761 }
762 else if (deck.d_influenceFnType == 2) {
763 if (influence_fn == nullptr)
764 influence_fn = std::make_shared<material::GaussianInfluenceFn>(
765 deck.d_influenceFnParams, dim);
766 }
767 else {
768 throw std::runtime_error(
770 << "Error: Influence function type = "
771 << deck.d_influenceFnType
772 << " is invalid.\n");
773 }
774
775 // check if we need to compute the material parameters
777 computeParameters(deck, dim);
778 else {
779 d_c = deck.d_bondPotentialParams[0];
780 d_s0 = deck.d_bondPotentialParams[1];
781 }
782 };
Material(std::string name="")
Constructor.
Definition material.h:105
double d_density
Density.
Definition material.h:1097
void computeParameters(inp::MaterialDeck &deck, const size_t &dim)
Compute material model parameters.
Definition material.h:990
double d_s0
Critical stretch.
Definition material.h:1108
double d_horizon
Horizon.
Definition material.h:1094
double d_Jscale
Constant influence value a0 that c was divided by.
Definition material.h:1111
double d_c
Micromodulus c (divided by the constant influence value)
Definition material.h:1105
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, inp::MaterialDeck::d_isPlaneStrain, and d_s0.

Here is the call graph for this function:

Member Function Documentation

◆ computeMaterialProperties()

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

Computes elastic and fracture material properties and returns the data.

Parameters
dimDimension of the problem
Returns
inp::MatData Material data

Implements material::Material.

Definition at line 919 of file material.h.

919 {
920
921 auto data = inp::MatData();
922 data.d_nu = (dim == 2 && !is_plane_strain) ? 1. / 3. : 0.25;
923
924 // inverse of computeParameters, with c for J = 1
925 const double h = d_horizon;
926 const double c = d_c * d_Jscale;
927 if (dim == 2) {
928 data.d_E = is_plane_strain ? 5. * M_PI * std::pow(h, 3) * c / 48.
929 : M_PI * std::pow(h, 3) * c / 9.;
930 data.d_K = data.toK(data.d_E, data.d_nu);
931 data.d_Gc = c * d_s0 * d_s0 * std::pow(h, 4) / 4.;
932 } else if (dim == 3) {
933 data.d_K = M_PI * std::pow(h, 4) * c / 18.;
934 data.d_E = data.toE(data.d_K, data.d_nu);
935 data.d_Gc = M_PI * c * d_s0 * d_s0 * std::pow(h, 5) / 10.;
936 }
937 data.d_G = data.toGE(data.d_E, data.d_nu);
938 data.d_lambda = data.toLambdaE(data.d_E, data.d_nu);
939 data.d_mu = data.d_G;
940 data.d_KIc = data.toKIc(data.d_Gc, data.d_nu, data.d_E);
941 return data;
942 };
Definition contact.h:20
Structure for elastic properties and fracture properties.

References d_c, d_horizon, d_Jscale, and d_s0.

◆ computeParameters()

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

Compute material model parameters.

Parameters
deckMaterialDeck
dimDimension of the domain

Definition at line 990 of file material.h.

990 {
991 //
992 // Need following elastic and fracture properties
993 // 1. E or K
994 // 2. Gc or KIc
995 // Bond-based Poisson ratio is locked by dimension / plane-strain flag
996 // (Silling & Askari 2005; Madenci & Oterkus 2014; Ha & Bobaru 2010).
997 //
998 if (util::isLess(deck.d_matData.d_E, 0.) &&
999 util::isLess(deck.d_matData.d_K, 0.)) {
1000 throw std::runtime_error(
1002 << "Error: Require either Young's modulus E or Bulk modulus K"
1003 " to compute the PMB bond-based peridynamic parameters.\n");
1004 }
1005 if (util::isGreater(deck.d_matData.d_E, 0.) &&
1006 util::isGreater(deck.d_matData.d_K, 0.)) {
1007 std::cout << "Warning: Both Young's modulus E and Bulk modulus K are "
1008 "provided.\n";
1009 std::cout << "Warning: Selecting Young's modulus E for PMB calibration.\n";
1010 }
1011
1012 if (util::isLess(deck.d_matData.d_Gc, 0.) &&
1013 util::isLess(deck.d_matData.d_KIc, 0.)) {
1014 throw std::runtime_error(
1016 << "Error: Require either critical energy release rate Gc or "
1017 "critical stress intensity factor KIc to compute the PMB "
1018 "bond-based peridynamic parameters.\n");
1019 } else if (util::isGreater(deck.d_matData.d_Gc, 0.) &&
1020 util::isGreater(deck.d_matData.d_KIc, 0.)) {
1021 std::cout << "Warning: Both Gc and KIc provided; selecting Gc.\n";
1022 }
1023
1024 // Bond-based PMB fixes nu: 1/4 in 3D and plane strain, 1/3 in plane
1025 // stress. E is matched.
1026 const double nu_pmb = (dim == 2 && !is_plane_strain) ? 1. / 3. : 0.25;
1027 if (util::isGreater(deck.d_matData.d_nu, 0.) &&
1028 std::abs(deck.d_matData.d_nu - nu_pmb) > 1.0e-12)
1029 std::cout << "Warning: PMB bond-based model fixes nu = " << nu_pmb
1030 << "; ignoring nu = " << deck.d_matData.d_nu << ".\n";
1031 deck.d_matData.d_nu = nu_pmb;
1032
1033 // Prefer E; else recover E from K with the fixed nu.
1034 if (deck.d_matData.d_E < 0. && deck.d_matData.d_K > 0.)
1035 deck.d_matData.d_E =
1036 deck.d_matData.toE(deck.d_matData.d_K, deck.d_matData.d_nu);
1037 if (deck.d_matData.d_E > 0.)
1038 deck.d_matData.d_K =
1039 deck.d_matData.toK(deck.d_matData.d_E, deck.d_matData.d_nu);
1040
1041 if (deck.d_matData.d_Gc > 0.)
1042 deck.d_matData.d_KIc = deck.d_matData.toKIc(
1043 deck.d_matData.d_Gc, deck.d_matData.d_nu, deck.d_matData.d_E);
1044
1045 if (deck.d_matData.d_KIc > 0. && deck.d_matData.d_Gc < 0.)
1046 deck.d_matData.d_Gc = deck.d_matData.toGc(
1047 deck.d_matData.d_KIc, deck.d_matData.d_nu, deck.d_matData.d_E);
1048
1049 deck.d_matData.d_lambda =
1050 deck.d_matData.toLambdaE(deck.d_matData.d_E, deck.d_matData.d_nu);
1051 deck.d_matData.d_G =
1052 deck.d_matData.toGE(deck.d_matData.d_E, deck.d_matData.d_nu);
1053 deck.d_matData.d_mu = deck.d_matData.d_G;
1054
1055 // The closed forms for c and s0 hold for a constant influence function.
1056 if (deck.d_influenceFnType != 0) {
1057 throw std::runtime_error(
1059 << "Error: PMB parameters from E and Gc need a constant influence "
1060 "function. Set Influence_Function Type = 0.\n");
1061 }
1062 d_Jscale = deck.d_influenceFnParams.empty() ? double(dim + 1)
1063 : deck.d_influenceFnParams[0];
1064 if (!(d_Jscale > 0.)) {
1065 throw std::runtime_error(
1067 << "Error: PMB influence scale must be > 0.\n");
1068 }
1069
1070 // c and s0 for J = 1: Silling and Askari 2005 (3D), Ha and Bobaru 2010
1071 // (2D plane stress); plane strain uses the same energy match with
1072 // nu = 1/4. Then J = a0 is absorbed into c.
1073 const double Gc = deck.d_matData.d_Gc;
1074 const double E = deck.d_matData.d_E;
1075 const double h = d_horizon;
1076 if (dim == 2) {
1077 d_c = is_plane_strain ? 48. * E / (5. * M_PI * std::pow(h, 3))
1078 : 9. * E / (M_PI * std::pow(h, 3));
1079 d_s0 = std::sqrt(4. * Gc / (d_c * std::pow(h, 4)));
1080 } else if (dim == 3) {
1081 d_c = 18. * deck.d_matData.d_K / (M_PI * std::pow(h, 4));
1082 d_s0 = std::sqrt(10. * Gc / (M_PI * d_c * std::pow(h, 5)));
1083 } else {
1084 throw std::runtime_error(
1086 << "Error: PMB computeParameters: unsupported dim=" << dim
1087 << "\n");
1088 }
1089 d_c /= d_Jscale;
1090 };
float E
Definition problem.py:64
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 toGc(double KIc, double nu, double E)
Compute critical energy release rate Gc from critical stress-intensity factor KIc,...
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 toKIc(double Gc, double nu, double E)
Compute critical stress-intensity factor KIc from critical energy release rate Gc,...
double d_KIc
Critical stress intensity factor.
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 d_Gc
Critical energy release rate.
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, inp::MatData::d_Gc, d_horizon, inp::MaterialDeck::d_influenceFnParams, inp::MaterialDeck::d_influenceFnType, d_Jscale, inp::MatData::d_K, inp::MatData::d_KIc, inp::MatData::d_lambda, inp::MaterialDeck::d_matData, inp::MatData::d_mu, inp::MatData::d_nu, d_s0, util::isGreater(), util::isLess(), inp::MatData::toE(), inp::MatData::toGc(), inp::MatData::toGE(), inp::MatData::toK(), inp::MatData::toKIc(), and inp::MatData::toLambdaE().

Referenced by PmbMaterial().

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

◆ getBondEF() [1/2]

std::pair< double, double > material::PmbMaterial::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.

Micropotential \( w = \frac{1}{2} c s^2 r \) and pair force \( c s \) (Silling and Askari 2005), both times \( J(r/\delta) \). The returned energy is the bond's share of the strain energy density at x, \( W(x) = \frac{1}{2} \int w \, dy \), i.e. \( w/2 \).

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 804 of file material.h.

806 {
807
808 if (!break_bonds)
809 return std::make_pair(getInfFn(r) * 0.25 * d_c * s *
810 s * r,
811 getInfFn(r) * d_c * s);
812
813 // Fracture: literature PMB is tension-only (s > s0). Absolute stretch is
814 // applied in pdForce when Model.Bond_Break = absolute_stretch.
815 if (!fs && util::isGreater(s, d_s0 + 1.0e-10))
816 fs = true;
817
818 // if bond is not fractured, return energy and force from nonlinear
819 // potential otherwise return energy of fractured bond, and zero force
820 if (!fs)
821 return std::make_pair(getInfFn(r) * 0.25 * d_c * s *
822 s * r,
823 getInfFn(r) * d_c * s);
824 else
825 return std::make_pair(
826 getInfFn(r) * 0.25 * d_c * d_s0 * d_s0 * r, 0.);
827 };
double getInfFn(const double &r) const override
Returns the value of influence function.
Definition material.h:888

References d_c, d_s0, getInfFn(), and util::isGreater().

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::PmbMaterial::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 840 of file material.h.

841 {
842
843 return this->getBondEF(r, s, fs, true);
844 };
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:804

References getBondEF().

Here is the call graph for this function:

◆ getBondForceDirection()

util::Point material::PmbMaterial::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 853 of file material.h.

854 {
855 return (dx + du) / (dx + du).length();
856 };

◆ getDensity()

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

Returns the density of the material.

Returns
density Density of the material

Implements material::Material.

Definition at line 880 of file material.h.

880{ return d_density; };

References d_density.

◆ getHorizon()

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

Returns horizon.

Returns
horizon Horizon

Implements material::Material.

Definition at line 910 of file material.h.

910{ return d_horizon; };

References d_horizon.

◆ getInfFn()

double material::PmbMaterial::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 888 of file material.h.

888 {
889 return getGlobalInfFn(r / d_horizon);
890 };
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::PmbMaterial::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 901 of file material.h.

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

◆ getS()

double material::PmbMaterial::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 864 of file material.h.

864 {
865 return ((dx + du).length() - dx.length()) / dx.length();
866 };
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::PmbMaterial::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 874 of file material.h.

874{ return d_s0; };

References d_s0.

◆ isStateActive()

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

Returns true if state-based potential is active.

Returns
bool True/false

Implements material::Material.

Definition at line 788 of file material.h.

788{ return false; };

◆ print() [1/2]

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

Prints the information about the object.

Reimplemented from material::Material.

Definition at line 981 of file material.h.

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

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::PmbMaterial::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 976 of file material.h.

976 {
977 std::cout << printStr(nt, lvl);
978 };
std::string printStr(int nt, int lvl) const override
Returns the string containing printable information about the object.
Definition material.h:951

References printStr().

Here is the call graph for this function:

◆ printStr()

std::string material::PmbMaterial::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 951 of file material.h.

951 {
952
953 auto tabS = util::io::getTabS(nt);
954 std::ostringstream oss;
955 oss << tabS << "------- particle::PmbMaterial --------" << std::endl
956 << std::endl;
957 oss << tabS << "State active = " << 0 << std::endl;
958 oss << tabS << "Horizon = " << d_horizon << std::endl;
959 oss << tabS << "Influence fn address = " << influence_fn.get() << std::endl;
960 oss << tabS << "Influence fn info: " << std::endl;
961 oss << influence_fn->printStr(nt + 1, lvl);
962 oss << tabS << "Peridynamic parameters: " << std::endl;
963 oss << tabS << " c = " << d_c << std::endl;
964 oss << tabS << " s0 = " << d_s0 << std::endl;
965 oss << tabS << std::endl;
966
967 return oss.str();
968 };
std::string getTabS(int nt)
Returns tab spaces of a given size.
Definition io.h:82

References d_c, d_horizon, d_s0, 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::PmbMaterial::d_c
private

Micromodulus c (divided by the constant influence value)

Definition at line 1105 of file material.h.

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

◆ d_density

double material::PmbMaterial::d_density
private

Density.

Definition at line 1097 of file material.h.

Referenced by getDensity().

◆ d_horizon

double material::PmbMaterial::d_horizon
private

Horizon.

Definition at line 1094 of file material.h.

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

◆ d_Jscale

double material::PmbMaterial::d_Jscale
private

Constant influence value a0 that c was divided by.

Definition at line 1111 of file material.h.

Referenced by computeMaterialProperties(), and computeParameters().

◆ d_s0

double material::PmbMaterial::d_s0
private

Critical stretch.

Definition at line 1108 of file material.h.

Referenced by computeMaterialProperties(), computeParameters(), getBondEF(), getSc(), PmbMaterial(), and printStr().


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