opm-upscaling
materials.hh
Go to the documentation of this file.
1 //==============================================================================
11 //==============================================================================
12 #ifndef MATERIALS_HH_
13 #define MATERIALS_HH_
14 
15 #include "material.hh"
16 
17 namespace Opm::Elasticity {
18 
23 class Isotropic : public Material
24 {
25 public:
31  Isotropic(int ID, double Emod, double Poisson, double rho_= 0.0)
32  : Material(ID,rho_)
33  {
34  E = Emod;
35  nu = Poisson;
36  }
37 
39  ~Isotropic() override {}
40 
42  int numPar() const override
43  {
44  return 2;
45  }
46 
48  double getPar(int ipar = 1) const override
49  {
50  return ipar == 1 ? E : nu;
51  }
52 
55  void setE(double E_)
56  {
57  E = E_;
58  }
59 
61  double getE() const
62  {
63  return E;
64  }
65 
69  bool getConstitutiveMatrix(Dune::FieldMatrix<double,6,6>& C,
70  bool invers = false) const override;
71 
75  bool getConstitutiveMatrix(Dune::FieldMatrix<double,3,3>& C,
76  bool invers = false) const override;
77 
78 protected:
80  std::ostream& write(std::ostream& os) const override;
81 
82 private:
83  double E;
84  double nu;
85 };
86 
88 class OrthotropicD : public Material
89 {
90 public:
99  OrthotropicD(int ID, double Ex, double Ey, double Ez,
100  double Gxy, double Gxz = double(-1), double Gyz = double(-1));
101 
103  ~OrthotropicD() override {}
104 
106  int numPar() const override
107  {
108  return 6;
109  }
110 
112  double getPar(int ipar = 1) const override;
113 
117  bool getConstitutiveMatrix(Dune::FieldMatrix<double,6,6>& C,
118  bool invers = false) const override;
119 
123  bool getConstitutiveMatrix(Dune::FieldMatrix<double,3,3>& C,
124  bool invers = false) const override;
125 
126 protected:
128  std::ostream& write(std::ostream& os) const override;
129 
130 private:
131  double E[6];
132 };
133 
135 class OrthotropicSym : public Material
136 {
137 public:
141  OrthotropicSym(int ID, const Dune::DynamicVector<double>& Cu);
142 
144  ~OrthotropicSym() override {}
145 
147  int numPar() const override
148  {
149  return 21;
150  }
151 
153  double getPar(int ipar = 1) const override;
154 
158  bool getConstitutiveMatrix(Dune::FieldMatrix<double,6,6>& C,
159  bool invers = false) const override;
160 
164  bool getConstitutiveMatrix(Dune::FieldMatrix<double,3,3>& C,
165  bool invers = false) const override;
166 
167 protected:
169  std::ostream& write(std::ostream& os) const override;
170 
171 private:
172  double Cupper[21];
173 };
174 
175 } // namespace Opm::Elasticity
176 
177 #endif
~Isotropic() override
Empty virtual destructor.
Definition: materials.hh:39
bool getConstitutiveMatrix(Dune::FieldMatrix< double, 6, 6 > &C, bool invers=false) const override
Establishes the full constitutive matrix for this material.
Definition: materials.cpp:47
OrthotropicSym(int ID, const Dune::DynamicVector< double > &Cu)
Constructor creating a new material.
Definition: materials.cpp:155
std::ostream & write(std::ostream &os) const override
Prints the material properties to a stream.
Definition: materials.cpp:111
This is a base class for linear elastic materials.
Definition: material.hh:31
Material interface.
std::ostream & write(std::ostream &os) const override
Prints the material properties to a stream.
Definition: materials.cpp:20
std::ostream & write(std::ostream &os) const override
Prints the material properties to a stream.
Definition: materials.cpp:169
double getPar(int ipar=1) const override
Returns the ipar&#39;th parameter describing this material.
Definition: materials.cpp:176
double getE() const
Returns the E modulus of the material.
Definition: materials.hh:61
double getPar(int ipar=1) const override
Returns the ipar&#39;th parameter describing this material.
Definition: materials.cpp:123
double getPar(int ipar=1) const override
Returns the ipar&#39;th parameter describing this material.
Definition: materials.hh:48
int numPar() const override
Returns the number of parameters describing this material.
Definition: materials.hh:42
bool getConstitutiveMatrix(Dune::FieldMatrix< double, 6, 6 > &C, bool invers=false) const override
Establishes the full constitutive matrix for this material.
Definition: materials.cpp:139
Orthotropic linear elastic material with symmetric constitutive matrix.
Definition: materials.hh:135
int numPar() const override
Returns the number of parameters describing this material.
Definition: materials.hh:106
Orthotropic linear elastic material with diagonal constitutive matrix.
Definition: materials.hh:88
int numPar() const override
Returns the number of parameters describing this material.
Definition: materials.hh:147
~OrthotropicD() override
Empty virtual destructor.
Definition: materials.hh:103
Isotropic linear elastic material.
Definition: materials.hh:23
bool getConstitutiveMatrix(Dune::FieldMatrix< double, 6, 6 > &C, bool invers=false) const override
Establishes the full constitutive matrix for this material.
Definition: materials.cpp:196
Definition: applier.hpp:21
OrthotropicD(int ID, double Ex, double Ey, double Ez, double Gxy, double Gxz=double(-1), double Gyz=double(-1))
Constructor creating a new material.
Definition: materials.cpp:99
Isotropic(int ID, double Emod, double Poisson, double rho_=0.0)
Constructor creating a new isotropic material.
Definition: materials.hh:31
~OrthotropicSym() override
Empty virtual destructor.
Definition: materials.hh:144
void setE(double E_)
Set the E modulus of the material.
Definition: materials.hh:55