MechanicalFemPhysics
The GeMA Mechanical FEM Physics Plugin
Loading...
Searching...
No Matches
gmpMaterialHyperelastic.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
25#ifndef _GEMA_PLUGIN_MECHANICALMATERIAL_HYPERELASTIC_H_
26#define _GEMA_PLUGIN_MECHANICALMATERIAL_HYPERELASTIC_H_
27
28#include "gmpMechanicalConfig.h"
29#include "gmpFemPhysics.h"
30#include "gmMathUtils.h"
31
33#include "gmpMechanicPoint.h"
34
35class GMP_MECHANICAL_PHYSICS_API_EXPORT GmpMechanicalMaterialHyperelastic : public GmpMechanicalMaterial
36{
37protected:
40 {
43
44 // --- NO ADDING BELOW THIS LINE
46 };
47
48public:
49
51 GmpMechanicalMaterialHyperelastic(int typeIndex, QString typeName, const GmLogCategory& logger)
52 : GmpMechanicalMaterial(typeIndex, typeName, logger) {}
53
56
58 static GmpFemPhysicsCommonMaterial* instance(GmSimulationData* simulation, int typeIndex, QString typeName, const GmLogCategory& logger)
59 {
60 Q_UNUSED(simulation);
61 return new GmpMechanicalMaterialHyperelastic(typeIndex, typeName, logger);
62 }
63
64 // Returns a map with material associated properties.
65 virtual const QVariantMap* materialMetaDataMap();
66
67 // Checks material loaded data.
68 virtual bool checkLoadedData(const GmElement* e) const;
69
70 // Returns the stresses according to the material behavior adopted
71 virtual bool mechanicalConstitutiveModel(const GmElement* e, GmMatrix& Dep, const GmpMechanicPoint* mp, const GmVector* coord, const GmVector& Time, unsigned nc, bool ips) const;
72
74 virtual bool isIsotropic() const { return true; }
75 // Updates deformation gradient F
76 virtual bool updateDeformationGradient(GmMatrix& F, const GmElement* e, const GmVector* coord, int ip, bool ips = false) const;
78 virtual double elasticModulus(const GmElement* e, const GmVector* coord, int ip) const
79 {
80 S_TRACE();
81 GmCellAccessor* eAcc = propertyAc(E_ID);
82 if (eAcc == NULL)
83 {
84 return 0.0;
85 }
86 return propertyAc(E_ID)->scalarValueAt(e, coord, ip);
87 }
89 virtual double poissonRatio(const GmElement* e, const GmVector* coord, int ip) const
90 {
91 S_TRACE();
92 GmCellAccessor* nuAcc = propertyAc(NU_ID);
93 if (nuAcc == NULL)
94 {
95 return 0.0;
96 }
97 return nuAcc->scalarValueAt(e, coord, ip);
98 }
99
100 virtual void materialC(const GmElement* e, unsigned sc, GmMatrix& D, const GmVector* coord, unsigned ips, int ip) const;
101 //virtual void dEGdPK2(const GmElement*, unsigned, GmMatrix&, const GmVector*, unsigned, int) const;
102
103 //virtual void dsdea(const GmMatrix& C, const GmMatrix& F, GmMatrix& c, int d) const;
104 virtual void spatialC(const GmElement* e, unsigned sc, GmMatrix& D, const GmMatrix& F, const GmVector* coord, unsigned ips, int ip) const;
105};
106
107#endif
Definition gmpMechanicPoint.h:33
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.
Definition gmpMaterialHyperelastic.h:36
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 gmpMaterialHyperelastic.h:58
virtual double poissonRatio(const GmElement *e, const GmVector *coord, int ip) const
Returns the material poisson ratio.
Definition gmpMaterialHyperelastic.h:89
virtual bool isIsotropic() const
Returns true if the material is isotropic, false otherwise.
Definition gmpMaterialHyperelastic.h:74
ElementPropertyIds
IDs for material element properties.
Definition gmpMaterialHyperelastic.h:40
@ E_ID
Id for retrieving the Young's Modulus accessor.
Definition gmpMaterialHyperelastic.h:41
@ NU_ID
Id for retrieving the Poisson's ratio accessor.
Definition gmpMaterialHyperelastic.h:42
@ NUM_PROPERTY_IDS
The number of property ids above.
Definition gmpMaterialHyperelastic.h:45
virtual ~GmpMechanicalMaterialHyperelastic()
Virtual destructor.
Definition gmpMaterialHyperelastic.h:55
virtual double elasticModulus(const GmElement *e, const GmVector *coord, int ip) const
Returns the material elastic modulus.
Definition gmpMaterialHyperelastic.h:78
GmpMechanicalMaterialHyperelastic(int typeIndex, QString typeName, const GmLogCategory &logger)
Constructor. Gets as parameters the material index and its name.
Definition gmpMaterialHyperelastic.h:51
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.