MechanicalFemPhysics
The GeMA Mechanical FEM Physics Plugin
Loading...
Searching...
No Matches
gmpMechanicalMaterial.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
26#ifndef _GEMA_PLUGIN_MECHANICAL_MATERIAL_H_
27#define _GEMA_PLUGIN_MECHANICAL_MATERIAL_H_
28
29#include "gmpMechanicalConfig.h"
30
31#include <gmpFemPhysicsCommonMaterial.h>
32#include "gmpFemPhysicsCommon.h"
33#include "gmpMechanicPoint.h"
34#include "gmpFemPhysics.h"
35#include "gmVector.h"
36#include "gmMatrix.h"
37#include <gmTrace.h>
38
39#define SQRT3 1.7320508075688772935274463415059
42class GMP_MECHANICAL_PHYSICS_API_EXPORT GmpMechanicalMaterial : public GmpFemPhysicsCommonMaterial
43{
44public:
45
47 GmpMechanicalMaterial(int typeIndex, QString typeName, const GmLogCategory& logger)
48 : GmpFemPhysicsCommonMaterial(typeIndex, typeName, logger)
49 {
50 }
51
54
56 virtual bool mechanicalConstitutiveModel(const GmElement* e, GmMatrix& Dep, const GmpMechanicPoint* mp, const GmVector* coord, const GmVector& Time, unsigned nc, bool ips = false) const = 0;
57
59 virtual void tangentModulus(const GmElement* e, GmMatrix& Dep, const GmpMechanicPoint* mp, const GmVector* coord, unsigned nc, unsigned ips = false) const
60 {
61 // TODO: Revisar para retirar da barra que ainda usa
62 Q_UNUSED(e); Q_UNUSED(Dep); Q_UNUSED(mp); Q_UNUSED(coord); Q_UNUSED(nc); Q_UNUSED(ips);
63 }
64
66 virtual bool isIsotropic() const = 0;
67
69 virtual bool setInitialConditions(const GmElement* e, GmpMechanicPoint* mp, const GmVector* coord, unsigned sc) const
70 {
71 Q_UNUSED(e); Q_UNUSED(mp); Q_UNUSED(coord); Q_UNUSED(sc);
72 return true;
73 }
74
75 // Updates deformation gradient F according to material requirement
76 virtual bool updateDeformationGradient(GmMatrix& F, const GmElement* e, const GmVector* coord, int ip, bool ips = false) const
77 {
78 S_TRACE();
79 Q_UNUSED(F); Q_UNUSED(ips); Q_UNUSED(e); Q_UNUSED(coord); Q_UNUSED(ip);
80 // To check and implement...
81 // Plane strain condition
82 //F.at(2, 2) = 1;
83 return true;
84 }
85
87 virtual bool calcDerivedResults(const GmElement* e, GmpMechanicPoint* mp, const GmVector* coord, unsigned sc) const
88 {
89 Q_UNUSED(e); Q_UNUSED(mp); Q_UNUSED(coord); Q_UNUSED(sc);
90 return true;
91 }
92};
93
95namespace GmpMechanicUtils
96{
97 //Returns the number of stress componets
98 GMP_MECHANICAL_PHYSICS_API_EXPORT int getNumStressComp(unsigned st);
99 // Returns the Shear modulus
100 double shearModulus(double E, double nu);
101 // Returns the Bulk modulus
102 double bulkModulus(double E, double nu);
103 // Returns the Lame modulus
104 double lameModulus(double E, double nu);
105
106 //stress invariants
107 double stressInvariantI1(const GmVector&, unsigned);
108 double stressInvariantI2(const GmVector&, unsigned);
109 double stressInvariantI3(const GmVector&, unsigned);
110
111 GmVector stressInvariants(const GmVector&, unsigned);
112
113 void stressGradientI1(const GmVector&, unsigned, GmVector&);
114 void stressGradientI2(const GmVector&, unsigned, GmVector&);
115 void stressGradientI3(const GmVector&, unsigned, GmVector&);
116
117 void stressHessianI2(const GmVector&, unsigned, GmMatrix&);
118 void stressHessianI3(const GmVector&, unsigned, GmMatrix&);
119
120 //principal stress
121 GmVector stressPrincipal(const GmVector&, unsigned);
122
123 //hydrostatic stress
124 double hydrostaticStress(const GmVector&, unsigned);
125
126 void hydrostaticGradient(const GmVector&, unsigned);
127
128 //deviatoric stress
129 GmVector deviatoricTensor(const GmVector& s, unsigned st);
130
131 // Deviatoric invariant J2
132 double deviatoricInvariantJ2(const GmVector&, unsigned);
133 // Deviatoric invariant J3
134 double deviatoricInvariantJ3(const GmVector&, unsigned);
135 // Deviatoric invariants J = [J1, J2, J3]'
136 GmVector deviatoricInvariants(const GmVector&, unsigned);
137 // Deviatoric stress gradient dJ2/ds
138 void deviatoricGradientJ2(const GmVector&, unsigned, GmVector&);
139 // Deviatoric stress gradient dJ3/ds
140 void deviatoricGradientJ3(const GmVector&, unsigned, GmVector&);
141 // Deviatoric stress hessian ddJ2/dds
142 void deviatoricHessianJ2(const GmVector&, unsigned, GmMatrix&);
143 // Deviatoric stress hessian ddJ3/dds
144 void deviatoricHessianJ3(const GmVector&, unsigned, GmMatrix&);
145
146 //deviatoric principal
147 GmVector deviatoricPrincipal(const GmVector&, unsigned);
148
149 //von mises stress
150 double vonMisesStress(const GmVector&, unsigned);
151 // Von-Mises stress gradient
152 void vonMisesGradient(const GmVector&, unsigned, GmVector&);
153 // Von-Mises hessian
154 void vonMisesHessian(const GmVector&, unsigned, GmMatrix&);
155
156 // Lode angle
157 double lodeAngle(const GmVector&, unsigned);
158 // Lode coordinates
159 GmVector lodeCoordinates(const GmVector&, unsigned);
160 // Lode MC angle
161 double lodeAngleMC(const GmVector&, unsigned);
162
163 // Isotropic damage matrix
165 // Anisotropic damage matrix
167
168 // Reorganize from vector to tensorial representation and vice versa
169 void vectorialToTensorial(GmVector& Av, GmMatrix& Am, unsigned sc, QString type = "strain", bool mode = true);
170
171 // Fills the vectorial rotation matrix
172 void fillTransformationMatrix(GmMatrix R, GmMatrix& Te, GmMatrix& Tei, int ns);
173
174 // Fills rotation matrix using the angle of dip and strike
175 void fillRotationMatrixFromDip(GmMatrix& R, double dip, double strike);
176
177 // Fills rotation matrix using The Euler's angles
178 void fillRotationMatrixFromEulerAngle(GmMatrix& R, double phi, double theta, double psi);
179
180 // Evaluates pseudo-inverse
181 //void pseudoInverse(GmMatrix& M, double tol = 0.0);
182
183 // Computes the elastic stiffness matrix using E and Nu
184 void elasticStiffness(GmMatrix& De, double E, double nu, unsigned sc, unsigned ips);
185
186 // Computes the elastic stiffness matrix using lame and G
187 void elasticStiffnessLameG(GmMatrix& De, double lame, double G, unsigned sc, unsigned ips);
188
189 // Computes the elastic stiffness matrix using K and G
190 void elasticStiffnessKG(GmMatrix& De, double K, double G, unsigned sc, unsigned ips);
191
192 // Computes the elastic flexibility matrix using E and Nu
193 void elasticFlexibility(GmMatrix& Ce, double E, double nu, unsigned sc, unsigned ips);
194};
195#endif
Definition gmpMechanicPoint.h:33
Basic class providing the interface for a mechanical material.
Definition gmpMechanicalMaterial.h:43
GmpMechanicalMaterial(int typeIndex, QString typeName, const GmLogCategory &logger)
Constructor. Gets as parameters the material index and its name.
Definition gmpMechanicalMaterial.h:47
virtual bool setInitialConditions(const GmElement *e, GmpMechanicPoint *mp, const GmVector *coord, unsigned sc) const
Sets the initial conditions required by Solid materials.
Definition gmpMechanicalMaterial.h:69
virtual ~GmpMechanicalMaterial()
Virtual destructor.
Definition gmpMechanicalMaterial.h:53
virtual bool isIsotropic() const =0
Returns true if the material is isotropic, false otherwise.
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 bool calcDerivedResults(const GmElement *e, GmpMechanicPoint *mp, const GmVector *coord, unsigned sc) const
Calculates the derived results required by materials.
Definition gmpMechanicalMaterial.h:87
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.
Groups utilitary routines for working with stress.
Definition gmpMechanicalMaterial.cpp:65
void elasticFlexibility(GmMatrix &Ce, double E, double nu, unsigned sc, unsigned ips)
Computes the elastic flexibility matrix using E and Nu.
Definition gmpMechanicalMaterial.cpp:1078
void elasticStiffness(GmMatrix &De, double E, double nu, unsigned sc, unsigned ips)
Computes the elastic stiffness matrix using E and Nu.
Definition gmpMechanicalMaterial.cpp:934
double hydrostaticStress(const GmVector &s, unsigned st)
Returns the hydrostatic stress.
Definition gmpMechanicalMaterial.cpp:308
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
GmMatrix anisotropicDamageMatrix(GmVector Sdv)
Fills the anisotropic damage matrix in the local references which is aligned.
Definition gmpMechanicalMaterial.cpp:688
void elasticStiffnessKG(GmMatrix &De, double K, double G, unsigned sc, unsigned ips)
Computes the elastic stiffness matrix using K and G.
Definition gmpMechanicalMaterial.cpp:1041
GmMatrix isotropicDamageMatrix(double d)
Fills the isotropic damage matrix in the local references which is aligned.
Definition gmpMechanicalMaterial.cpp:662
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
void elasticStiffnessLameG(GmMatrix &De, double lame, double G, unsigned sc, unsigned ips)
Computes the elastic stiffness matrix using lame and G.
Definition gmpMechanicalMaterial.cpp:1004
void hydrostaticGradient(const GmVector &, unsigned st, GmVector &dsm)
Returns the hydrostatic pressure gradient dP/ds.
Definition gmpMechanicalMaterial.cpp:315