material.hh
Go to the documentation of this file.
1//==============================================================================
11//==============================================================================
12#ifndef MATERIAL_HH_
13#define MATERIAL_HH_
14
15#include <opm/common/utility/platform_dependent/disable_warnings.h>
16
17#include <dune/common/fmatrix.hh>
18#include <dune/common/dynvector.hh>
19
20#include <opm/common/utility/platform_dependent/reenable_warnings.h>
21
22namespace Opm {
23namespace Elasticity {
24
25
33{
34protected:
36 Material(int ID = 0, double density = 0.0)
37 : id(ID), rho(density)
38 {
39 }
40
42 virtual std::ostream& write(std::ostream& os) const
43 {
44 return os;
45 }
46public:
48 virtual ~Material() {}
49
51 int num() const
52 {
53 return id;
54 }
55
57 virtual int numPar() const = 0;
59 virtual double getPar(int /* ipar */ = 1) const
60 {
61 return double(0);
62 }
63
67 virtual bool getConstitutiveMatrix(Dune::FieldMatrix<double,6,6>& C,
68 bool invers = false) const = 0;
69
73 virtual bool getConstitutiveMatrix(Dune::FieldMatrix<double,3,3>& C,
74 bool invers = false) const = 0;
75
77 double getMassDensity() const
78 {
79 return rho;
80 }
81
83 friend std::ostream& operator<<(std::ostream& os, const Material& m)
84 {
85 return m.write(os);
86 }
87
92 static Material* create(int ID, const Dune::DynamicVector<double>& params);
93
97 static Material* create(int ID, const std::string& file);
98private:
99 int id;
100 double rho;
101};
102
103}
104}
105
106#endif
This is a base class for linear elastic materials.
Definition: material.hh:33
int num() const
Returns the external material id.
Definition: material.hh:51
static Material * create(int ID, const Dune::DynamicVector< double > &params)
Creates a material object of a given type.
virtual bool getConstitutiveMatrix(Dune::FieldMatrix< double, 3, 3 > &C, bool invers=false) const =0
Establishes the full constitutive matrix for this material.
virtual int numPar() const =0
Returns the number of parameters describing this material.
double getMassDensity() const
Returns the mass density of this material.
Definition: material.hh:77
friend std::ostream & operator<<(std::ostream &os, const Material &m)
Global stream operator printing a material properties object.
Definition: material.hh:83
static Material * create(int ID, const std::string &file)
Creates a material object from a rocklist.
Material(int ID=0, double density=0.0)
Default constructor creating an empty material.
Definition: material.hh:36
virtual std::ostream & write(std::ostream &os) const
Prints the material properties to a stream.
Definition: material.hh:42
virtual ~Material()
Empty virtual destructor.
Definition: material.hh:48
virtual bool getConstitutiveMatrix(Dune::FieldMatrix< double, 6, 6 > &C, bool invers=false) const =0
Establishes the full constitutive matrix for this material.
virtual double getPar(int=1) const
Returns the ipar'th parameter describing this material.
Definition: material.hh:59
Definition: ImplicitAssembly.hpp:43