NuTo
Numerics Tool
LocalIsotropicDamage.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "MechanicsInterface.h"
4 #include "LinearElasticDamage.h"
7 
8 namespace NuTo
9 {
10 namespace Laws
11 {
12 template <int TDim>
14 
33 template <int TDim, typename TDamageLaw = Constitutive::DamageLawExponential,
34  typename TEvolution = EvolutionImplicit<TDim>>
36 {
37 public:
38  LocalIsotropicDamage(LinearElasticDamage<TDim> elasticDamage, TDamageLaw damageLaw, TEvolution evolution)
39  : mElasticDamage(elasticDamage)
40  , mDamageLaw(damageLaw)
41  , mEvolution(evolution)
42  {
43  }
44 
46  : mElasticDamage(m, damageApplication)
47  , mDamageLaw(m)
48  , mEvolution(m)
49  {
50  }
51 
53  {
54  double kappa = mEvolution.Kappa(strain, deltaT, ids);
55  double omega = mDamageLaw.Damage(kappa);
56  return mElasticDamage.Stress(strain, omega);
57  }
58 
60  {
61  double kappa = mEvolution.Kappa(strain, deltaT, ids);
62  double omega = mDamageLaw.Damage(kappa);
63  double dOmegadKappa = mDamageLaw.Derivative(kappa);
64 
65  return mElasticDamage.DstressDstrain(strain, omega) +
66  mElasticDamage.DstressDomega(strain, omega) * dOmegadKappa *
67  mEvolution.DkappaDstrain(strain, deltaT, ids);
68  }
69 
70  void Update(EngineeringStrain<TDim> strain, double deltaT, CellIds ids)
71  {
72  mEvolution.Update(strain, deltaT, ids);
73  }
74 
75 public:
76  // Intentionally made public. I assume that we know what we do. And this avoids lots of code, either getters
77  // (possibly nonconst) or forwarding functions like `double Kappa(...), double Damage(...)`
79  TDamageLaw mDamageLaw;
80  TEvolution mEvolution;
81 };
82 
91 template <int TDim>
93 {
94 
95 public:
101  size_t numIpsPerCell = 1)
102  : mStrainNorm(strainNorm)
103  {
104  ResizeHistoryData(numCells, numIpsPerCell);
105  }
106 
111  EvolutionImplicit(Material::Softening m, size_t numCells = 1, size_t numIpsPerCell = 1)
112  : mStrainNorm(m)
113  {
114  ResizeHistoryData(numCells, numIpsPerCell);
115  }
116 
117 
118  double Kappa(EngineeringStrain<TDim> strain, double, CellIds ids) const
119  {
120  return std::max(mStrainNorm.Value(strain), mKappas(ids.cellId, ids.ipId));
121  }
122 
124  {
125  if (mStrainNorm.Value(strain) >= mKappas(ids.cellId, ids.ipId))
126  return mStrainNorm.Derivative(strain).transpose();
128  }
129 
130  void Update(EngineeringStrain<TDim> strain, double deltaT, CellIds ids)
131  {
132  mKappas(ids.cellId, ids.ipId) = Kappa(strain, deltaT, ids);
133  }
134 
135  void ResizeHistoryData(size_t numCells, size_t numIpsPerCell)
136  {
137  mKappas.setZero(numCells, numIpsPerCell);
138  }
139 
140 public:
142  Eigen::MatrixXd mKappas;
143 };
144 
145 } /* Laws */
146 } /* NuTo */
LocalIsotropicDamage(LinearElasticDamage< TDim > elasticDamage, TDamageLaw damageLaw, TEvolution evolution)
Definition: LocalIsotropicDamage.h:38
Definition: LinearElasticDamage.h:16
EngineeringStress< TDim > Stress(EngineeringStrain< TDim > strain, double deltaT, CellIds ids) const override
Definition: LocalIsotropicDamage.h:52
Engineering strain.
Definition: EngineeringStrain.h:33
Local damage law with an isotropic damage variable.
Definition: LocalIsotropicDamage.h:35
named pair for cellId and ipId to make the argument list shorter and avoid accidental mixup of both ...
Definition: CellIds.h:7
Equivalent strain (strain norm) based on the modified mises norm.
Definition: ModifiedMisesStrainNorm.h:31
void Update(EngineeringStrain< TDim > strain, double deltaT, CellIds ids)
Definition: LocalIsotropicDamage.h:130
int ipId
Definition: CellIds.h:10
Constitutive::ModifiedMisesStrainNorm< TDim > mStrainNorm
Definition: LocalIsotropicDamage.h:141
const double omega
Definition: LinearElasticDamageBenchmark.cpp:8
EvolutionImplicit(Material::Softening m, size_t numCells=1, size_t numIpsPerCell=1)
Constructor.
Definition: LocalIsotropicDamage.h:111
void Update(EngineeringStrain< TDim > strain, double deltaT, CellIds ids)
Definition: LocalIsotropicDamage.h:70
double Kappa(EngineeringStrain< TDim > strain, double, CellIds ids) const
Definition: LocalIsotropicDamage.h:118
Explicit evolution equation for the NuTo::LocalIsotropicDamageLaw that implements ...
Definition: LocalIsotropicDamage.h:13
LocalIsotropicDamage(Material::Softening m, eDamageApplication damageApplication=eDamageApplication::FULL)
Definition: LocalIsotropicDamage.h:45
TDamageLaw mDamageLaw
Definition: LocalIsotropicDamage.h:79
Common material parameters for softening materials.
Definition: SofteningMaterial.h:12
exponential damage omega Peerlings, R., De Borst, R., Brekelmans, W., Geers, M.
Definition: DamageLawExponential.h:23
TEvolution mEvolution
Definition: LocalIsotropicDamage.h:80
eDamageApplication
Definition: LinearElasticDamage.h:14
Eigen::Matrix< double, 1, Voigt::Dim(TDim)> DkappaDstrain(EngineeringStrain< TDim > strain, double, CellIds ids) const
Definition: LocalIsotropicDamage.h:123
int cellId
Definition: CellIds.h:9
EngineeringTangent< TDim > Tangent(EngineeringStrain< TDim > strain, double deltaT, CellIds ids) const override
Definition: LocalIsotropicDamage.h:59
Engineering stress.
Definition: EngineeringStress.h:31
Definition: Exception.h:6
Definition: SerializeStreamOut.h:9
Applies an isotropic damage variable to the linear elastic hookes law.
Definition: LinearElasticDamage.h:27
const NuTo::EngineeringStrain< 3 > strain
Definition: LinearElasticDamageBenchmark.cpp:9
void ResizeHistoryData(size_t numCells, size_t numIpsPerCell)
Definition: LocalIsotropicDamage.h:135
EvolutionImplicit(Constitutive::ModifiedMisesStrainNorm< TDim > strainNorm, size_t numCells=1, size_t numIpsPerCell=1)
Constructor.
Definition: LocalIsotropicDamage.h:100
LinearElasticDamage< TDim > mElasticDamage
Definition: LocalIsotropicDamage.h:78
Definition: MechanicsInterface.h:13
Eigen::MatrixXd mKappas
Definition: LocalIsotropicDamage.h:142