MechanicalFemPhysics
The GeMA Mechanical FEM Physics Plugin
Loading...
Searching...
No Matches
gmpMaterialElastic.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_PLUGIN_MECHANICALMATERIAL_ELASTIC_H_
25#define _GEMA_PLUGIN_MECHANICALMATERIAL_ELASTIC_H_
26
27#include "gmpMechanicalConfig.h"
28#include "gmpFemPhysics.h"
29#include "gmMathUtils.h"
30
32#include "gmpMechanicPoint.h"
33
34class GMP_MECHANICAL_PHYSICS_API_EXPORT GmpMechanicalMaterialElastic : public GmpMechanicalMaterial
35{
36protected:
39 {
44
45 // --- NO ADDING BELOW THIS LINE
47 };
48
49public:
50
52 GmpMechanicalMaterialElastic(int typeIndex, QString typeName, const GmLogCategory& logger)
53 : GmpMechanicalMaterial(typeIndex, typeName, logger) {}
54
57
59 static GmpFemPhysicsCommonMaterial* instance(GmSimulationData* simulation, int typeIndex, QString typeName, const GmLogCategory& logger)
60 {
61 Q_UNUSED(simulation);
62 return new GmpMechanicalMaterialElastic(typeIndex, typeName, logger);
63 }
64
65 // Returns a map with material associated properties.
66 virtual const QVariantMap* materialMetaDataMap();
67
68 // Checks material loaded data.
69 virtual bool checkLoadedData(const GmElement* e) const;
70
71 // Returns the stresses according to the material behavior adopted
72 virtual bool mechanicalConstitutiveModel(const GmElement* e, GmMatrix& Dep, const GmpMechanicPoint* mp, const GmVector* coord, const GmVector& Time, unsigned nc, bool ips) const;
73
74 // Returns the constitutive tangent matrix
75 virtual void tangentModulus(const GmElement* e, GmMatrix& Dep, const GmpMechanicPoint* mp, const GmVector* coord, unsigned nc, unsigned ips) const;
76
78 virtual bool isIsotropic() const { return true; }
79
81 virtual double elasticModulus(const GmElement* e, const GmVector* coord, int ip) const
82 {
83 S_TRACE();
84 GmCellAccessor* eAcc = propertyAc(E_ID);
85 if (eAcc == NULL)
86 {
87 return 0.0;
88 }
89 return propertyAc(E_ID)->scalarValueAt(e, coord, ip);
90 }
91
93 virtual double poissonRatio(const GmElement* e, const GmVector* coord, int ip) const
94 {
95 S_TRACE();
96 GmCellAccessor* nuAcc = propertyAc(NU_ID);
97 if (nuAcc == NULL)
98 {
99 return 0.0;
100 }
101 return nuAcc->scalarValueAt(e, coord, ip);
102 }
103
104 virtual void stiffness(const GmElement*, unsigned, GmMatrix&, const GmVector*, unsigned, int) const;
105 virtual void flexibility(const GmElement*, unsigned, GmMatrix&, const GmVector*, unsigned, int) const;
106
108 double bulkModulus(const GmElement* e, const GmVector* coord, int ip) const
109 {
110 return GmpMechanicUtils::bulkModulus(elasticModulus(e, coord, ip), poissonRatio(e, coord, ip));
111 }
112
114 double shearModulus(const GmElement* e, const GmVector* coord, int ip) const
115 {
116 return GmpMechanicUtils::shearModulus(elasticModulus(e, coord, ip), poissonRatio(e, coord, ip));
117 }
118
120 double lameModulus(const GmElement* e, const GmVector* coord, int ip) const
121 {
122 return GmpMechanicUtils::lameModulus(elasticModulus(e, coord, ip), poissonRatio(e, coord, ip));
123 }
124
125 virtual void spatialc(const GmMatrix& C, const GmMatrix& F, GmMatrix& c, int d) const;
126};
127
128#endif
Definition gmpMechanicPoint.h:33
Definition gmpMaterialElastic.h:35
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpMaterialElastic.h:59
GmpMechanicalMaterialElastic(int typeIndex, QString typeName, const GmLogCategory &logger)
Constructor. Gets as parameters the material index and its name.
Definition gmpMaterialElastic.h:52
virtual bool isIsotropic() const
Returns true if the material is isotropic, false otherwise.
Definition gmpMaterialElastic.h:78
virtual ~GmpMechanicalMaterialElastic()
Virtual destructor.
Definition gmpMaterialElastic.h:56
double lameModulus(const GmElement *e, const GmVector *coord, int ip) const
Returns the lame modulus(lame) from Young's modulus (E) and Poisson's Coefficient(nu)
Definition gmpMaterialElastic.h:120
virtual double poissonRatio(const GmElement *e, const GmVector *coord, int ip) const
Returns the material poisson ratio.
Definition gmpMaterialElastic.h:93
virtual double elasticModulus(const GmElement *e, const GmVector *coord, int ip) const
Returns the material elastic modulus.
Definition gmpMaterialElastic.h:81
ElementPropertyIds
IDs for material element properties.
Definition gmpMaterialElastic.h:39
@ E_ID
Id for retrieving the Young's Modulus accessor.
Definition gmpMaterialElastic.h:40
@ NUM_PROPERTY_IDS
The number of property ids above.
Definition gmpMaterialElastic.h:46
@ DM_ID
Id for retrieving the stress strain matrix accessor.
Definition gmpMaterialElastic.h:42
@ NU_ID
Id for retrieving the Poisson's ratio accessor.
Definition gmpMaterialElastic.h:41
@ K0_ID
Id for retrieving the K0 value accessor.
Definition gmpMaterialElastic.h:43
double shearModulus(const GmElement *e, const GmVector *coord, int ip) const
Returns the shear modulus (G) from Young's modulus (E) and Poisson's Coefficient (nu)
Definition gmpMaterialElastic.h:114
double bulkModulus(const GmElement *e, const GmVector *coord, int ip) const
Returns the bulk modulus (K) from Young's modulus (E) and Poisson's Coefficient (nu)
Definition gmpMaterialElastic.h:108
Basic class providing the interface for a mechanical material.
Definition gmpMechanicalMaterial.h:43
virtual bool mechanicalConstitutiveModel(const GmElement *e, GmMatrix &Dep, const GmpMechanicPoint *mp, const GmVector *coord, const GmVector &Time, unsigned nc, bool ips=false) const =0
Evaluates stress and tangent matrix according to the material behavior adopted.
virtual void tangentModulus(const GmElement *e, GmMatrix &Dep, const GmpMechanicPoint *mp, const GmVector *coord, unsigned nc, unsigned ips=false) const
Returns the constitutive tangent matrix.
Definition gmpMechanicalMaterial.h:59
arma::mat GmMatrix
#define S_TRACE()
arma::vec GmVector
Declaration of the GmpMechanicPoint class.
Declaration of useful configuration definitions for the plugin library.
Declaration of the GmpMechanicalMaterial class.
double bulkModulus(double E, double nu)
Returns the bulk modulus (K) from Young's modulus (E) and Poisson's Coefficient (nu)
Definition gmpMechanicalMaterial.cpp:75
double shearModulus(double E, double nu)
Returns the shear modulus (G) from Young's modulus (E) and Poisson's Coefficient (nu)
Definition gmpMechanicalMaterial.cpp:68
double lameModulus(double E, double nu)
Returns the lame modulus (lame) from Young's modulus (E) and Poisson's Coefficient (nu)
Definition gmpMechanicalMaterial.cpp:82