Alamo
Transverse.H
Go to the documentation of this file.
1//
2// Transversely Isotropic Elasticity Model.
3// This file implements a transversely isotropic elasticity model for the materials that exhibit
4// isotropic behavior in a plane and a distinct response in the perpendicular direction.
5// The stiffness tensor is defined using elastic constants (C11, C12, C13, C33, C44) and an
6// orientation provided either by Bunge Euler angles (phi1, Phi, phi2) or a rotation matrix.
7// Reference: http://solidmechanics.org/text/Chapter3_2/Chapter3_2.htm#Sect3_2_16
8//
9
10#ifndef MODEL_SOLID_LINEAR_TRANSVERSE_H_
11#define MODEL_SOLID_LINEAR_TRANSVERSE_H_
12
13#include "Model/Solid/Solid.H"
14// # include "Model/Solid/Linear/Transverse.H"
15#include "IO/ParmParse.H"
16
17namespace Model
18{
19namespace Solid
20{
21namespace Linear
22{
23
24class Transverse : public Solid<Set::Sym::MajorMinor>
25{
26public:
29 : Solid<Set::Sym::MajorMinor>(base){};
30 virtual ~Transverse(){};
31
32 void
34 {
36 C11, C12, C13, C33, C44, phi1, Phi, phi2);
37 }
38
39 void
40 Define(Set::Scalar C11, Set::Scalar C12, Set::Scalar C13, Set::Scalar C33, Set::Scalar C44, Eigen::Matrix3d R = Eigen::Matrix3d::Identity())
41 {
43 C11, C12, C13, C33, C44, R);
44 }
46 W(const Set::Matrix &gradu) const override
47 {
48 return (0.5 * gradu.transpose() * (ddw * gradu)).trace();
49 }
51 DW(const Set::Matrix &gradu) const override
52 {
53 return ddw * gradu;
54 }
56 DDW(const Set::Matrix & /*gradu*/) const override
57 {
58 return ddw;
59 }
60 virtual void
61 Print(std::ostream &out) const override
62 {
63 out << ddw;
64 }
65
66public:
69
70 AMREX_FORCE_INLINE
71 static Transverse
72 Combine(const std::vector<Transverse> &models,
73 const std::vector<Set::Scalar> &eta)
74 {
75 Transverse ret;
77 Set::Scalar etasum = 0.;
78 for (unsigned int n = 0; n < models.size(); n++)
79 etasum += eta[n];
80 for (unsigned int n = 0; n < models.size(); n++)
81 {
82 ret.ddw += models[n].ddw * (eta[n] / etasum);
83 }
84 return ret;
85 }
86
87 static Transverse
89 {
90 Transverse ret;
91 ret.Define(0.0, 0.0, 0.0, 0.0, 0.0);
92 return ret;
93 }
94 static Transverse
99 static Transverse
101 {
102 Transverse ret;
106 ret.Define(C11, C12, C13, C33, C44, phi1, Phi, phi2);
107 return ret;
108 }
109
110 static void
112 {
113 Set::Scalar C11 = NAN, C12 = NAN, C13 = NAN, C33 = NAN, C44 = NAN;
114
115 pp_query_default("C11", C11, 1.68); // Elastic constant
116 pp_query_default("C12", C12, 1.21); // Elastic constant
117 pp_query_default("C13", C13, 0.75); // Elastic constant
118 pp_query_default("C33", C33, 1.68); // Elastic constant
119 pp_query_default("C44", C44, 1.68); // Elastic constant
120
121 if (pp.contains("random"))
122 {
123 value = Transverse::Random(C11, C12, C13, C33, C44);
124 return;
125 }
126
127 Set::Scalar phi1 = NAN, Phi = NAN, phi2 = NAN;
128 Set::Scalar small = 1e-8; // <- Fixed indentation (tab replaced with spaces)
129
130 pp_query_default("phi1", phi1, small); // Bunge Euler angle :math:\phi_1
131 pp_query_default("Phi", Phi, small); // Bunge Euler angle :math:\Phi
132 pp_query_default("phi2", phi2, small); // Bunge Euler angle :math:\phi_2
133 value.Define(C11, C12, C13, C33, C44, phi1, Phi, phi2);
134 }
135
136#define OP_CLASS Transverse
137#define OP_VARS X(ddw)
139};
141
142} // namespace Linear
143} // namespace Solid
144} // namespace Model
145
146#endif
#define pp_query_default(...)
Definition ParmParse.H:100
bool contains(std::string name)
Definition ParmParse.H:172
static Transverse Random(Set::Scalar C11, Set::Scalar C12, Set::Scalar C13, Set::Scalar C33, Set::Scalar C44)
Definition Transverse.H:100
void Define(Set::Scalar C11, Set::Scalar C12, Set::Scalar C13, Set::Scalar C33, Set::Scalar C44, Eigen::Matrix3d R=Eigen::Matrix3d::Identity())
Definition Transverse.H:40
static void Parse(Transverse &value, IO::ParmParse &pp)
Definition Transverse.H:111
Transverse(Solid< Set::Sym::MajorMinor > base)
Definition Transverse.H:28
Set::Matrix DW(const Set::Matrix &gradu) const override
Definition Transverse.H:51
static const KinematicVariable kinvar
Definition Transverse.H:68
Set::Matrix4< AMREX_SPACEDIM, Set::Sym::MajorMinor > DDW(const Set::Matrix &) const override
Definition Transverse.H:56
static AMREX_FORCE_INLINE Transverse Combine(const std::vector< Transverse > &models, const std::vector< Set::Scalar > &eta)
Definition Transverse.H:72
Set::Matrix4< AMREX_SPACEDIM, Set::Sym::MajorMinor > ddw
Definition Transverse.H:67
void Define(Set::Scalar C11, Set::Scalar C12, Set::Scalar C13, Set::Scalar C33, Set::Scalar C44, Set::Scalar phi1, Set::Scalar Phi, Set::Scalar phi2)
Definition Transverse.H:33
Set::Scalar W(const Set::Matrix &gradu) const override
Definition Transverse.H:46
virtual void Print(std::ostream &out) const override
Definition Transverse.H:61
static Transverse Random()
Definition Transverse.H:95
KinematicVariable
Definition Solid.H:26
static const Set::Scalar Pi
Definition Set.H:286
A collection of data types and symmetry-reduced data structures.
Definition Base.H:18
amrex::Real Scalar
Definition Base.H:19
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, 1 > Vector
Definition Base.H:20
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, AMREX_SPACEDIM > Matrix
Definition Base.H:23
Set::Scalar Random()
Definition Set.cpp:9