Xfem
The Xfem Plugin
Loading...
Searching...
No Matches
xfemMaterial.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2017 by Geomechanic group - Tecgraf/Puc-Rio
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_XFEM_MATERIAL_H_
26#define _GEMA_XFEM_MATERIAL_H_
27
28#include <gmpHydraulicMaterial.h>
29#include <gmpMechanicalMaterial.h>
30#include <gmpInterfaceMaterial.h>
31
34class XfemMaterial : public GmpFemPhysicsCommonMaterial
35{
36public:
37
39 XfemMaterial(int typeIndex, QString typeName, const GmLogCategory& logger)
40 : GmpFemPhysicsCommonMaterial(typeIndex, typeName, logger)
41 {
42 _hydroMaterial = NULL;
43 _mechanoMaterial = NULL;
44 _mechDiscontinuityMaterial = NULL;
45 _hydroDiscontinuityMaterial = NULL;
46
47 }
48
49 // destructor
50 virtual ~XfemMaterial(){};
51
53 static GmpFemPhysicsCommonMaterial* instance(GmSimulationData* simulation, int typeIndex, QString typeName, const GmLogCategory& logger)
54 {
55 Q_UNUSED(simulation);
56 return new XfemMaterial(typeIndex, typeName, logger);
57 }
58
59 // Returns a map with material associated properties.
60 virtual const QVariantMap* materialMetaDataMap();
61
62 // Returns the constitutive tangent matrix
63 virtual void tangentModulus(const GmElement* e, GmMatrix& Dep, const GmpMechanicPoint* mp, const GmVector* coord, unsigned nc, unsigned ips) const;
64
65 // Returns the stresses according to the material behavior adopted
66 virtual void returnMapping(const GmElement* e, GmMatrix& Dep, const GmpMechanicPoint* mp, const GmVector* coord, unsigned nc, unsigned ips) const;
67
69 void setPhysicsMaterials(GmpFemPhysicsCommonMaterial* hydro, GmpFemPhysicsCommonMaterial* mechano)
70 {
72 _mechanoMaterial = mechano;
73 }
74
76 void setPhysicsDiscontinuityMaterials(GmpFemPhysicsCommonMaterial* hydro, GmpFemPhysicsCommonMaterial* mechano)
77 {
78 _hydroDiscontinuityMaterial = hydro;
79 _mechDiscontinuityMaterial = mechano;
80 }
81
83 GmpHydraulicMaterial* hydro() const { return dynamic_cast<GmpHydraulicMaterial*>(_hydroMaterial); }
84
86 GmpMechanicalMaterial* mechanical() const { return dynamic_cast<GmpMechanicalMaterial*>(_mechanoMaterial); }
87
89 GmpInterfaceMaterial* mechanicalDiscontinuity() const { return dynamic_cast<GmpInterfaceMaterial*>(_mechDiscontinuityMaterial); }
90
92 virtual double maximumPrincipalStress(const GmElement* e, const GmVector* coord, int ip) const
93 {
94 return propertyAc(SPMax_ID)->scalarValueAt(e, coord, ip);
95 }
96
98 virtual double fractureOpening(const GmElement* e, const GmVector* coord, int ip) const
99 {
100 S_TRACE();
101 assert(e);
102 return propertyAc(GAP_ID)->scalarValueAt(e, coord, ip);
103 }
104
106 virtual double normalElasticStiffness(const GmElement* e, const GmVector* coord, int ip) const
107 {
108 return propertyAc(Kni_ID)->scalarValueAt(e, coord, ip);
109 }
110
112 virtual double shearElasticStiffness(const GmElement* e, const GmVector* coord, int ip) const
113 {
114 return propertyAc(Ksi_ID)->scalarValueAt(e, coord, ip);
115 }
116
118 virtual double shearElasticStiffnessTwo(const GmElement* e, const GmVector* coord, int ip) const
119 {
120 return propertyAc(Kti_ID)->scalarValueAt(e, coord, ip);
121 }
122
124 virtual double faultCohesion(const GmElement* e, const GmVector* coord, int ip) const
125 {
126 return propertyAc(CF_ID)->scalarValueAt(e, coord, ip);
127 }
128
130 virtual double faultFrictionAngle(const GmElement* e, const GmVector* coord, int ip) const
131 {
132 return propertyAc(PHIF_ID)->scalarValueAt(e, coord, ip);
133 }
134
136 virtual double faultDilationAngle(const GmElement* e, const GmVector* coord, int ip) const
137 {
138 return propertyAc(PSIF_ID)->scalarValueAt(e, coord, ip);
139 }
140
142 virtual double cutOffTension(const GmElement* e, const GmVector* coord, int ip) const
143 {
144 return propertyAc(TCUT_ID)->scalarValueAt(e, coord, ip);
145 }
146
148 virtual double fractureEnergy(const GmElement* e, const GmVector* coord, int ip) const
149 {
150 return propertyAc(Gf_ID)->scalarValueAt(e, coord, ip);
151 }
152
154 virtual double shearModulus(const GmElement* e, const GmVector* coord, int ip) const
155 {
156 return propertyAc(G_ID)->scalarValueAt(e, coord, ip);
157 }
158
160 virtual double gravitationalAcceleration(const GmElement* e, const GmVector* coord, int ip) const
161 {
162 return propertyAc(GRAV_ID)->scalarValueAt(e, coord, ip);
163 }
164
165protected:
185
186private:
187 GmpFemPhysicsCommonMaterial* _hydroMaterial;
188 GmpFemPhysicsCommonMaterial* _mechanoMaterial;
189 GmpFemPhysicsCommonMaterial* _mechDiscontinuityMaterial; // TODO: Try to avoid this
190 GmpFemPhysicsCommonMaterial* _hydroDiscontinuityMaterial; // TODO: Try to avoid this
191};
192#endif
Basic class for the elastic xfem material plugin object.
Definition xfemMaterial.h:35
virtual double shearElasticStiffnessTwo(const GmElement *e, const GmVector *coord, int ip) const
Returns the shear elastic stiffness 2 of the interface element (required in 3D)
Definition xfemMaterial.h:118
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 xfemMaterial.h:53
virtual double gravitationalAcceleration(const GmElement *e, const GmVector *coord, int ip) const
Returns the Fracture energy.
Definition xfemMaterial.h:160
virtual double normalElasticStiffness(const GmElement *e, const GmVector *coord, int ip) const
Returns the normal elastic stiffness of the interface element.
Definition xfemMaterial.h:106
virtual double faultDilationAngle(const GmElement *e, const GmVector *coord, int ip) const
Returns the dilation angle of the discontinuity.
Definition xfemMaterial.h:136
virtual double faultFrictionAngle(const GmElement *e, const GmVector *coord, int ip) const
Returns the friction angle of the discontinuity.
Definition xfemMaterial.h:130
ElemXfemPropertyIds
IDs for material element properties.
Definition xfemMaterial.h:168
@ G_ID
Id for retrieving the Shear Modulus accessor.
Definition xfemMaterial.h:179
@ CF_ID
Id for retrieving the fault cohesion accessor.
Definition xfemMaterial.h:174
@ TCUT_ID
Id for retrieving the cut-off tension accessor.
Definition xfemMaterial.h:177
@ Gf_ID
Id for retrieving the Fracture Energy accessor.
Definition xfemMaterial.h:178
@ NUM_PROPERTY_IDS
The number of property ids above.
Definition xfemMaterial.h:183
@ PHIF_ID
Id for retrieving the fault friction angle accessor.
Definition xfemMaterial.h:175
@ PSIF_ID
Id for retrieving the fault dilation angle accessor.
Definition xfemMaterial.h:176
@ SPMax_ID
Id for retrieving the maximum principal stress accessor.
Definition xfemMaterial.h:169
@ Kti_ID
Id for retrieving the shear elastic stiffness accessor at 2nd-direction (3D)
Definition xfemMaterial.h:173
@ GRAV_ID
Id for retrieving the gravity accessor.
Definition xfemMaterial.h:180
@ GAP_ID
Id for retrieving the initial fracture opening.
Definition xfemMaterial.h:170
@ Ksi_ID
Id for retrieving the shear elastic stiffness accessor.
Definition xfemMaterial.h:172
@ Kni_ID
Id for retrieving the normal elastic stiffness accessor.
Definition xfemMaterial.h:171
void setPhysicsMaterials(GmpFemPhysicsCommonMaterial *hydro, GmpFemPhysicsCommonMaterial *mechano)
Sets the hydraulic and mechanical materials for this material. Materials CAN be NULL for a physics.
Definition xfemMaterial.h:69
virtual double shearElasticStiffness(const GmElement *e, const GmVector *coord, int ip) const
Returns the shear elastic stiffness of the interface element.
Definition xfemMaterial.h:112
GmpFemPhysicsCommonMaterial * _mechanoMaterial
Mechanical material. Ps: The mechanical plugin does not have a base class common to all materials.
Definition xfemMaterial.h:188
virtual double fractureOpening(const GmElement *e, const GmVector *coord, int ip) const
Returns the initial fracture opening.
Definition xfemMaterial.h:98
GmpFemPhysicsCommonMaterial * _hydroMaterial
Hydraulic material.
Definition xfemMaterial.h:187
GmpMechanicalMaterial * mechanical() const
Returns the mechancial material or NULL if none was configured or if the material is an interface mat...
Definition xfemMaterial.h:86
virtual double maximumPrincipalStress(const GmElement *e, const GmVector *coord, int ip) const
Returns the maximum principal stress.
Definition xfemMaterial.h:92
virtual double cutOffTension(const GmElement *e, const GmVector *coord, int ip) const
Returns the cut-off tension of the discontinuity.
Definition xfemMaterial.h:142
virtual double faultCohesion(const GmElement *e, const GmVector *coord, int ip) const
Returns the cohesion of the discontinuity.
Definition xfemMaterial.h:124
XfemMaterial(int typeIndex, QString typeName, const GmLogCategory &logger)
Constructor. Gets as parameters the material index and its name.
Definition xfemMaterial.h:39
void setPhysicsDiscontinuityMaterials(GmpFemPhysicsCommonMaterial *hydro, GmpFemPhysicsCommonMaterial *mechano)
Sets the hydraulic and mechanical materials for this discontinuity material. Materials CAN be NULL fo...
Definition xfemMaterial.h:76
virtual double shearModulus(const GmElement *e, const GmVector *coord, int ip) const
Returns the Fracture energy.
Definition xfemMaterial.h:154
GmpHydraulicMaterial * hydro() const
Returns the hydraulic material or NULL if none was configured.
Definition xfemMaterial.h:83
GmpInterfaceMaterial * mechanicalDiscontinuity() const
Returns the mechancial material or NULL if none was configured or if the material is an interface mat...
Definition xfemMaterial.h:89
virtual const QVariantMap * materialMetaDataMap()
Returns a pointer to the material attribute map, built when the function is called for the first time...
Definition xfemMaterial.cpp:40
virtual double fractureEnergy(const GmElement *e, const GmVector *coord, int ip) const
Returns the Fracture energy.
Definition xfemMaterial.h:148
arma::mat GmMatrix
#define S_TRACE()
arma::vec GmVector