-
Notifications
You must be signed in to change notification settings - Fork 10
/
MaterialBase.h
109 lines (93 loc) · 4.36 KB
/
MaterialBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// $Id$
//==============================================================================
//!
//! \file MaterialBase.h
//!
//! \date Mar 01 2011
//!
//! \author Knut Morten Okstad / SINTEF
//!
//! \brief Base class for material models.
//!
//==============================================================================
#ifndef _MATERIAL_BASE_H
#define _MATERIAL_BASE_H
#include "MatVec.h"
class Vec3;
class Tensor;
class SymmTensor;
class FiniteElement;
class Field;
namespace tinyxml2 { class XMLElement; }
struct TimeDomain;
/*!
\brief Base class representing a material model of a solid mechanics problem.
*/
class Material
{
protected:
//! \brief The default constructor is protected to allow sub-classes only.
Material() {}
public:
//! \brief Empty destructor.
virtual ~Material() {}
//! \brief Parses material parementers from an XML element.
virtual void parse(const tinyxml2::XMLElement*) {}
//! \brief Prints out material parameters to the log stream.
virtual void printLog() const {}
//! \brief Returns \e false if plane stress in 2D.
virtual bool isPlaneStrain() const { return true; }
//! \brief Initializes the material with the number of integration points.
virtual void initIntegration(size_t) {}
//! \brief Initializes the material model for a new integration loop.
virtual void initIntegration(const TimeDomain&) {}
//! \brief Initializes the material model for a new result point loop.
virtual void initResultPoints() {}
//! \brief Defines a point location with some special material properties.
virtual void addSpecialPoint(const Vec3&) {}
//! \brief Assigns a scalar field defining the material properties.
virtual void assignScalarField(Field*, size_t = 0) {}
//! \brief Evaluates the stiffness at current point.
virtual double getStiffness(const Vec3&) const { return 1.0; }
//! \brief Evaluates the plate stiffness parameter at current point.
virtual double getPlateStiffness(const Vec3&, double) const { return 0.0; }
//! \brief Evaluates the mass density at current point.
virtual double getMassDensity(const Vec3&) const { return 0.0; }
//! \brief Evaluates the heat capacity for given temperature.
virtual double getHeatCapacity(double) const { return 1.0; }
//! \brief Evaluates the thermal conductivity for given temperature.
virtual double getThermalConductivity(double) const { return 1.0; }
//! \brief Evaluates the thermal expansion coefficient for given temperature.
virtual double getThermalExpansion(double) const { return 0.0; }
//! \brief Evaluates the constitutive relation at an integration point.
//! \param[out] C Constitutive matrix at current point
//! \param[out] sigma Stress tensor at current point
//! \param[out] U Strain energy density at current point
//! \param[in] fe Finite element quantities at current point
//! \param[in] X Cartesian coordinates of current point
//! \param[in] F Deformation gradient at current point
//! \param[in] eps Strain tensor at current point
//! \param[in] iop Calculation option;
//! -1 : Calculate the inverse constitutive matrix only,
//! 0 : Calculate the consitutive matrix only,
//! 1 : Calculate Cauchy stresses and the tangent constitutive matrix,
//! 2 : 2nd Piola-Kirchhoff stresses and tangent constitutive matrix,
//! 3 : Calculate the strain energy density only.
//! \param[in] prm Nonlinear solution algorithm parameters
//! \param[in] Fpf Deformation gradient for push-forward transformation
virtual bool evaluate(Matrix& C, SymmTensor& sigma, double& U,
const FiniteElement& fe, const Vec3& X,
const Tensor& F, const SymmTensor& eps,
char iop = 1, const TimeDomain* prm = nullptr,
const Tensor* Fpf = nullptr) const = 0;
//! \brief Evaluates the Lame-parameters at an integration point.
virtual bool evaluate(double&, double&, const FiniteElement&,
const Vec3&) const { return false; }
//! \brief Returns number of internal result variables of the material model.
virtual int getNoIntVariables() const { return 0; }
//! \brief Returns an internal variable associated with the material model.
virtual double getInternalVariable(int, char*, size_t=0) const { return 0.0; }
//! \brief Returns whether the material model has diverged.
virtual bool diverged(size_t = 0) const { return false; }
};
#endif