52#ifndef MODEL_SOLID_LINEAR_ISOTROPIC_H_
53#define MODEL_SOLID_LINEAR_ISOTROPIC_H_
93 virtual void Print(std::ostream &out)
const override
118 bool planestress =
false;
119 std::pair<std::string, Set::Scalar> moduli[2];
121 pp.
forbid(
"lame",
"Use 'lambda' instead for lame constant");
122 pp.
forbid(
"shear",
"Use 'mu' instead for shear modulus");
123 pp.
forbid(
"bulk",
"Use 'kappa' instead for bulk modulus");
129 pp.
query_exactly<2>({
"lambda",
"mu",
"E",
"nu",
"kappa"}, moduli);
131 if (moduli[0].first ==
"lambda" && moduli[1].first ==
"mu")
133 lambda = moduli[0].second;
134 mu = moduli[1].second;
136 else if (moduli[0].first ==
"lambda" && moduli[1].first ==
"E")
138 lambda = moduli[0].second;
140 mu = (E - 3.0 * lambda + sqrt(E * E + 9.0 * lambda * lambda + 2.0 * E * lambda)) / 4.0;
142 else if (moduli[0].first ==
"lambda" && moduli[1].first ==
"nu")
144 lambda = moduli[0].second;
146 mu = lambda * (1.0 - 2.0 * nu) / 2.0 / nu;
148 else if (moduli[0].first ==
"mu" && moduli[1].first ==
"E")
150 mu = moduli[0].second;
152 lambda = mu * (E - 2.0 * mu) / (3.0 * mu - E);
154 else if (moduli[0].first ==
"mu" && moduli[1].first ==
"nu")
156 mu = moduli[0].second;
158 lambda = 2.0 * mu * nu / (1.0 - 2.0 * nu);
160 else if (moduli[0].first ==
"mu" && moduli[1].first ==
"K")
162 mu = moduli[0].second;
164 lambda = K - (2.0 * mu / 3.0);
166 else if (moduli[0].first ==
"E" && moduli[1].first ==
"nu")
168 Set::Scalar E = moduli[0].second, nu = moduli[1].second;
169 lambda = E * nu / (1.0 + nu) / (1.0 - 2.0 * nu);
170 mu = E / 2.0 / (1.0 + nu);
174 Util::Exception(
INFO,
"Haven't implemented ",moduli[0].first,
" and ",moduli[1].first,
" (sorry!)");
182 if (AMREX_SPACEDIM==2 && planestress)
183 value.
Define(mu,lambda*(1.0 - lambda/(2.*mu + lambda)));
188 #define OP_CLASS Isotropic
189 #define OP_VARS X(ddw)
void forbid(std::string name, std::string explanation, std::string file="", std::string func="", int line=-1)
void query_exactly(std::vector< std::string > names, std::pair< std::string, Set::Scalar > values[N])
int query_default(std::string name, T &value, T defaultvalue, std::string="", std::string="", int=-1)
Set::Matrix4< AMREX_SPACEDIM, Set::Sym::Isotropic > DDW(const Set::Matrix &) const override
Isotropic(Solid< Set::Sym::Isotropic > base)
Set::Matrix DW(const Set::Matrix &gradu) const override
Isotropic(Set::Scalar a_mu, Set::Scalar a_lambda)
static const KinematicVariable kinvar
Set::Scalar W(const Set::Matrix &gradu) const override
static Isotropic Random()
virtual void Print(std::ostream &out) const override
static void Parse(Isotropic &value, IO::ParmParse &pp)
void Define(Set::Scalar a_mu, Set::Scalar a_lambda)
Set::Matrix4< AMREX_SPACEDIM, Set::Sym::Isotropic > ddw
A collection of data types and symmetry-reduced data structures.
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, 1 > Vector
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, AMREX_SPACEDIM > Matrix
void Exception(std::string file, std::string func, int line, Args const &... args)