Phyth v0.1.0
A dimensional safe C++ header-only mechanics and electromagnetics simulation library.
Loading...
Searching...
No Matches
IsotropicMaterial.hpp
Go to the documentation of this file.
1#ifndef PHYTH_ISOTROPIC_MATERIAL_HPP
2#define PHYTH_ISOTROPIC_MATERIAL_HPP
3
8
9namespace Phyth {
10
40 public:
47 IsotropicMaterial() = default;
48
63 IsotropicMaterial(const Quantity<Pascal> youngs_modulus, const Scalar poisson_ratio)
64 : youngs_modulus_(youngs_modulus), poisson_ratio_(poisson_ratio) {
66 }
67
85
91
97
103
109
115
136 ) const {
137 const auto trace_strain = strain.Trace();
138
140 for (int i = 0; i < 3; ++i) {
141 for (int j = 0; j < 3; ++j) {
142 stress(i, j) = lame_lambda_ * trace_strain * (i == j ? 1.0 : 0.0)
143 + 2.0 * shear_modulus_ * strain(i, j);
144 }
145 }
146 return stress;
147 }
148
168 ) const {
169 const auto trace_stress = stress.Trace();
170
172 const auto factor1 = (1.0 + poisson_ratio_) / youngs_modulus_;
174 for (int i = 0; i < 3; ++i) {
175 for (int j = 0; j < 3; ++j) {
176 strain(i, j) = factor1 * stress(i, j)
177 - factor2 * trace_stress * (i == j ? 1.0 : 0.0);
178 }
179 }
180 return strain;
181 }
182
183 private:
186
190
207
223 };
224}
225
226#endif //PHYTH_ISOTROPIC_MATERIAL_HPP
Linear elastic isotropic material model.
IsotropicMaterial(const Quantity< Pascal > youngs_modulus, const Scalar poisson_ratio)
Construct from Young's modulus and Poisson's ratio.
Matrix3x3< Scalar > ComputeStrain(const Matrix3x3< Quantity< Pascal > > &stress) const
Compute strain tensor from stress tensor.
void UpdateDerivedParameters()
Update derived parameters from (E, nu)
Quantity< Pascal > lame_lambda_
Quantity< Pascal > GetYoungsModulus() const
Get Young's modulus.
IsotropicMaterial()=default
Default constructor.
Quantity< Pascal > youngs_modulus_
Scalar GetPoissonRatio() const
Get Poisson's ratio.
Matrix3x3< Quantity< Pascal > > ComputeStress(const Matrix3x3< Scalar > &strain) const
Compute stress tensor from strain tensor.
Quantity< Pascal > GetBulkModulus() const
Get bulk modulus.
Quantity< Pascal > shear_modulus_
Quantity< Pascal > bulk_modulus_
IsotropicMaterial(const Quantity< Pascal > shear_modulus, const Quantity< Pascal > bulk_modulus)
Construct from shear modulus and bulk modulus.
Quantity< Pascal > GetLameLambda() const
Get Lame's first parameter.
void UpdateDerivedParametersFromGK()
Update derived parameters from (G, K)
Quantity< Pascal > GetShearModulus() const
Get shear modulus.
constexpr bool is_unit_v
Definition Unit.hpp:79
3x3 matrix with Quantity components
Definition Matrix3x3.hpp:27
Physical quantity with a value and a compile-time unit.
Definition Quantity.hpp:27