NuTo
Numerics Tool
GradientDamage.h
Go to the documentation of this file.
1 #pragma once
2 
7 
8 namespace NuTo
9 {
10 namespace NonlocalInteraction
11 {
12 struct Constant;
13 }
14 
15 namespace Integrands
16 {
23 template <int TDim, typename TInteraction = NonlocalInteraction::Constant,
24  typename TDamageLaw = Constitutive::DamageLawExponential>
26 {
27 public:
36  GradientDamage(DofType disp, ScalarDofType eeq, double c, Laws::LinearElasticDamage<TDim> linearElasticDamage,
37  TDamageLaw damageLaw, Constitutive::ModifiedMisesStrainNorm<TDim> strainNorm,
38  TInteraction interaction = TInteraction())
39  : mDisp(disp)
40  , mEeq(eeq)
41  , mC(c)
42  , mLinearElasticDamage(linearElasticDamage)
43  , mDamageLaw(damageLaw)
44  , mNorm(strainNorm)
45  , mInteraction(interaction)
46  {
47  }
48 
57  TInteraction interaction = TInteraction())
58  : mDisp(disp)
59  , mEeq(eeq)
60  , mC(m.c)
61  , mLinearElasticDamage(m, damageApplication)
62  , mDamageLaw(m)
63  , mNorm(m)
64  , mInteraction(interaction)
65  {
66  }
67 
68  virtual ~GradientDamage() = default;
69 
71  {
73 
74  double eeq = data.Value(mEeq);
75  double omega = mDamageLaw.Damage(Kappa(data));
76 
77  auto eeqGradient = data.Apply(mEeq, Nabla::Gradient());
79 
80  Eigen::MatrixXd Neeq = data.N(mEeq);
81  Eigen::MatrixXd Beeq = data.B(mEeq, Nabla::Gradient());
82  Eigen::MatrixXd Bdisp = data.B(mDisp, Nabla::Strain());
83 
84  double g = mInteraction.Factor(omega);
85 
86  gradient[mDisp] = Bdisp.transpose() * mLinearElasticDamage.Stress(strain, omega);
87  gradient[mEeq] = Neeq.transpose() * (eeq - mNorm.Value(strain)) + Beeq.transpose() * (mC * g * eeqGradient);
88 
89  return gradient;
90  }
91 
93  {
94  DofMatrix<double> hessian0;
95 
96  double kappa = Kappa(data);
97  double omega = mDamageLaw.Damage(kappa);
98  double dKappa_dEeq = DkappaDeeq(data);
99  double dOmega_dKappa = mDamageLaw.Derivative(kappa);
100 
102 
103  Eigen::MatrixXd Neeq = data.N(mEeq);
104  Eigen::MatrixXd Beeq = data.B(mEeq, Nabla::Gradient());
105  Eigen::MatrixXd Bdisp = data.B(mDisp, Nabla::Strain());
106 
107  double g = mInteraction.Factor(omega);
108  double dgdw = mInteraction.Derivative(omega);
109  auto eeqGradient = data.Apply(mEeq, Nabla::Gradient());
110 
111  hessian0(mDisp, mDisp) = Bdisp.transpose() * mLinearElasticDamage.DstressDstrain(strain, omega) * Bdisp;
112  hessian0(mEeq, mDisp) = -Neeq.transpose() * mNorm.Derivative(strain).transpose() * Bdisp;
113  hessian0(mEeq, mEeq) = Neeq.transpose() * Neeq + mC * g * Beeq.transpose() * Beeq +
114  Beeq.transpose() * mC * eeqGradient * dgdw * dOmega_dKappa * dKappa_dEeq * Neeq;
115  hessian0(mDisp, mEeq) = Bdisp.transpose() *
116  (mLinearElasticDamage.DstressDomega(strain, omega) * dOmega_dKappa * dKappa_dEeq) *
117  Neeq;
118 
119  return hessian0;
120  }
121 
122  virtual void Update(const CellIpData& data)
123  {
124  mKappas(data.Ids().cellId, data.Ids().ipId) = Kappa(data);
125  }
126 
127  virtual double Kappa(const CellIpData& data) const
128  {
129  return std::max(mKappas(data.Ids().cellId, data.Ids().ipId), data.Value(mEeq));
130  }
131 
132  virtual double DkappaDeeq(const CellIpData& data) const
133  {
134  return data.Value(mEeq) >= mKappas(data.Ids().cellId, data.Ids().ipId) ? 1 : 0;
135  }
136 
137  Eigen::MatrixXd mKappas;
138 
141  double mC;
143  TDamageLaw mDamageLaw;
145  TInteraction mInteraction;
146 };
147 } /* Integrand */
148 
149 namespace NonlocalInteraction
150 {
151 
153 struct Constant
154 {
155  double Factor(double) const
156  {
157  return 1;
158  }
159  double Derivative(double) const
160  {
161  return 0;
162  }
163 };
164 
167 {
168  Decreasing(double R = 0.005, double eta = 5)
169  : mR(R)
170  , mEta(eta)
171  {
172  }
173 
174  double Factor(double omega) const
175  {
176  return ((1. - mR) * std::exp(-mEta * omega) + mR - std::exp(-mEta)) / (1. - std::exp(-mEta));
177  }
178  double Derivative(double omega) const
179  {
180  return ((1. - mR) * std::exp(-mEta * omega)) / (1. - std::exp(-mEta)) * -mEta;
181  }
182  double mR;
183  double mEta;
184 };
185 } /* NonlocalInteraction */
186 } /* NuTo */
double Derivative(double) const
Definition: GradientDamage.h:159
Definition: LinearElasticDamage.h:16
Engineering strain.
Definition: EngineeringStrain.h:33
double mEta
Definition: GradientDamage.h:183
Implicit gradient enhanced damage model Peerlings RHJ et al.
Definition: GradientDamage.h:25
Equivalent strain (strain norm) based on the modified mises norm.
Definition: ModifiedMisesStrainNorm.h:31
const Eigen::MatrixXd & B(DofType dofType, const Nabla::Interface &b) const
Returns a memoized copy of the B matrix for a given dof type.
Definition: CellIpData.h:89
Eigen::MatrixXd mKappas
Definition: GradientDamage.h:137
double Derivative(double omega) const
Definition: GradientDamage.h:178
GradientDamage(DofType disp, ScalarDofType eeq, Material::Softening m, Laws::eDamageApplication damageApplication=Laws::eDamageApplication::FULL, TInteraction interaction=TInteraction())
ctor
Definition: GradientDamage.h:55
int ipId
Definition: CellIds.h:10
Laws::LinearElasticDamage< TDim > mLinearElasticDamage
Definition: GradientDamage.h:142
const double omega
Definition: LinearElasticDamageBenchmark.cpp:8
Similar to NuTo::CellData.
Definition: CellIpData.h:14
DofMatrix< double > Hessian0(const CellIpData &data)
Definition: GradientDamage.h:92
CellIds Ids() const
Access to the cellId and ipId, compressed in CellIds.
Definition: CellIpData.h:39
Definition: DofType.h:8
TDamageLaw mDamageLaw
Definition: GradientDamage.h:143
Results in the model used by Poh & Sun 2017, IJNME and limits the nonlocal parameter.
Definition: GradientDamage.h:166
Common material parameters for softening materials.
Definition: SofteningMaterial.h:12
Results in the model used by Peerlings et al.
Definition: GradientDamage.h:153
Decreasing(double R=0.005, double eta=5)
Definition: GradientDamage.h:168
double Factor(double omega) const
Definition: GradientDamage.h:174
DofVector< double > Gradient(const CellIpData &data)
Definition: GradientDamage.h:70
GradientDamage(DofType disp, ScalarDofType eeq, double c, Laws::LinearElasticDamage< TDim > linearElasticDamage, TDamageLaw damageLaw, Constitutive::ModifiedMisesStrainNorm< TDim > strainNorm, TInteraction interaction=TInteraction())
ctor
Definition: GradientDamage.h:36
Constitutive::ModifiedMisesStrainNorm< TDim > mNorm
Definition: GradientDamage.h:144
exponential damage omega Peerlings, R., De Borst, R., Brekelmans, W., Geers, M.
Definition: DamageLawExponential.h:23
Eigen::VectorXd Value(DofType dofType, int instance=0) const
Calculates the value of a dof at the integration point.
Definition: CellIpData.h:48
Eigen::VectorXd Apply(DofType dofType, const Nabla::Interface &b, int instance=0) const
Calculates the gradient (derivative of the value with respect to x) for a given dof type at the integ...
Definition: CellIpData.h:70
eDamageApplication
Definition: LinearElasticDamage.h:14
int cellId
Definition: CellIds.h:9
virtual double Kappa(const CellIpData &data) const
Definition: GradientDamage.h:127
virtual void Update(const CellIpData &data)
Definition: GradientDamage.h:122
dof container that is also capable of performing calculations.
Definition: DofMatrixContainer.h:13
Definition: DofType.h:44
ScalarDofType mEeq
Definition: GradientDamage.h:140
DofType mDisp
Definition: GradientDamage.h:139
Definition: DifferentialOperators.h:16
TInteraction mInteraction
Definition: GradientDamage.h:145
Definition: Exception.h:6
virtual double DkappaDeeq(const CellIpData &data) const
Definition: GradientDamage.h:132
Applies an isotropic damage variable to the linear elastic hookes law.
Definition: LinearElasticDamage.h:27
double mR
Definition: GradientDamage.h:182
Definition: DifferentialOperators.h:24
const NuTo::EngineeringStrain< 3 > strain
Definition: LinearElasticDamageBenchmark.cpp:9
gradient
Definition: NeuralNetwork.py:98
double mC
Definition: GradientDamage.h:141
const Eigen::MatrixXd & N(DofType dofType) const
Returns a memoized copy of the N matrix for a given dof type.
Definition: CellIpData.h:77
double Factor(double) const
Definition: GradientDamage.h:155