Loading...
Searching...
No Matches
material.hh
Go to the documentation of this file.
//==============================================================================
//==============================================================================
#ifndef MATERIAL_HH_
#define MATERIAL_HH_
#include <opm/common/utility/platform_dependent/disable_warnings.h>
#include <dune/common/fmatrix.hh>
#include <dune/common/dynvector.hh>
#include <opm/common/utility/platform_dependent/reenable_warnings.h>
namespace Opm::Elasticity {
class Material
{
protected:
Material(int ID = 0, double density = 0.0)
: id(ID), rho(density)
{
}
virtual std::ostream& write(std::ostream& os) const
{
return os;
}
public:
virtual ~Material() {}
int num() const
{
return id;
}
virtual int numPar() const = 0;
virtual double getPar(int /* ipar */ = 1) const
{
return double(0);
}
virtual bool getConstitutiveMatrix(Dune::FieldMatrix<double,6,6>& C,
bool invers = false) const = 0;
virtual bool getConstitutiveMatrix(Dune::FieldMatrix<double,3,3>& C,
bool invers = false) const = 0;
double getMassDensity() const
{
return rho;
}
friend std::ostream& operator<<(std::ostream& os, const Material& m)
{
return m.write(os);
}
static Material* create(int ID, const Dune::DynamicVector<double>& params);
static Material* create(int ID, const std::string& file);
private:
int id;
double rho;
};
} // namespace Opm::Elasticity
#endif
Opm::Elasticity::Material
This is a base class for linear elastic materials.
Definition material.hh:32
Opm::Elasticity::Material::create
static Material * create(int ID, const Dune::DynamicVector< double > &params)
Creates a material object of a given type.
Definition material.cpp:23
Opm::Elasticity::Material::num
int num() const
Returns the external material id.
Definition material.hh:51
Opm::Elasticity::Material::getConstitutiveMatrix
virtual bool getConstitutiveMatrix(Dune::FieldMatrix< double, 3, 3 > &C, bool invers=false) const =0
Establishes the full constitutive matrix for this material.
Opm::Elasticity::Material::numPar
virtual int numPar() const =0
Returns the number of parameters describing this material.
Opm::Elasticity::Material::getMassDensity
double getMassDensity() const
Returns the mass density of this material.
Definition material.hh:77
Opm::Elasticity::Material::operator<<
friend std::ostream & operator<<(std::ostream &os, const Material &m)
Global stream operator printing a material properties object.
Definition material.hh:83
Opm::Elasticity::Material::Material
Material(int ID=0, double density=0.0)
Default constructor creating an empty material.
Definition material.hh:35
Opm::Elasticity::Material::write
virtual std::ostream & write(std::ostream &os) const
Prints the material properties to a stream.
Definition material.hh:41
Opm::Elasticity::Material::~Material
virtual ~Material()
Empty virtual destructor.
Definition material.hh:48
Opm::Elasticity::Material::getConstitutiveMatrix
virtual bool getConstitutiveMatrix(Dune::FieldMatrix< double, 6, 6 > &C, bool invers=false) const =0
Establishes the full constitutive matrix for this material.
Opm::Elasticity::Material::getPar
virtual double getPar(int=1) const
Returns the ipar'th parameter describing this material.
Definition material.hh:59