MechanicalFemPhysics
The GeMA Mechanical FEM Physics Plugin
gmpMaterialElasticInterface.h
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_ELASTICINTERFACE_H_
25 #define _GEMA_PLUGIN_MECHANICALMATERIAL_ELASTICINTERFACE_H_
26 
27 
28 #include "gmpInterfaceMaterial.h"
29 #include "gmpMechanicPoint.h"
30 #include <gmpFemPhysics.h>
31 #include <gmMathUtils.h>
32 #include <gmTrace.h>
33 
34 class GMP_MECHANICAL_PHYSICS_API_EXPORT GmpElasticInterface: public GmpInterfaceMaterial
35 {
36 protected:
39  {
45 
46  // --- NO ADDING BELOW THIS LINE
48  };
49 
52  {
56 
57 
58  // --- NO ADDING BELOW THIS LINE
60  };
61 
62 public:
64  GmpElasticInterface(int typeIndex, QString typeName, const GmLogCategory& logger)
65  :GmpInterfaceMaterial(typeIndex, typeName, logger){}
66 
68  virtual ~GmpElasticInterface() {}
69 
71  static GmpFemPhysicsCommonMaterial* instance(GmSimulationData* simulation, int typeIndex, QString typeName, const GmLogCategory& logger)
72  {
73  Q_UNUSED(simulation);
74  return new GmpElasticInterface(typeIndex, typeName, logger);
75  }
76 
77  // Returns a map with material associated properties.
78  virtual const QVariantMap* materialMetaDataMap();
79 
82  {
84 
85  // ------ NO ADDING BELOW THIS LINE
87  };
88 
94  virtual bool fillElasticStiffnessMatrix(const GmElement* e, GmMatrix& Dep, const GmVector* coord, int ip, double penalty = 1.0) const;
95 
98  virtual bool fillBartonBandisStiffnessMatrix(const GmElement* e, GmMatrix& Dep, const GmpMechanicPoint* mp, const GmVector* coord)const;
99 
102  virtual bool fillBartonBandisStresses(const GmElement* e, GmVector& Snew, const GmpMechanicPoint* mp, const GmVector* coord, GmVector& eNew, GmVector& eOld, GmVector& sOld)const;
103 
106  virtual bool mechanicalConstitutiveModel(const GmElement* e, GmMatrix& Dep, const GmpMechanicPoint* mp, const GmVector* coord, unsigned nc) const;
107 
108  //Sets the initial conditions required by interface materials
109  virtual bool setInitialConditions(const GmElement* e, GmpMechanicPoint* mp, const GmVector* coord, unsigned nc) const;
110 
112  virtual double normalElasticStiffness(const GmElement* e, const GmVector* coord, int ip) const
113  {
114  return propertyAc(Kni_ID)->scalarValueAt(e, coord, ip);
115  }
116 
118  virtual double shearElasticStiffness(const GmElement* e, const GmVector* coord, int ip) const
119  {
120  return propertyAc(Ksi_ID)->scalarValueAt(e, coord, ip);
121  }
122 
124  virtual double shearElasticStiffnessTwo(const GmElement* e, const GmVector* coord, int ip) const
125  {
126  return propertyAc(Kti_ID)->scalarValueAt(e, coord, ip);
127  }
128 
130  virtual double fractureOpening(const GmElement* e, const GmVector* coord, int ip) const
131  {
132  S_TRACE();
133  assert(e);
134  if (propertyAc(GAP_ID) == NULL)
135  {
136  return 0.0;
137  }
138 
139  return propertyAc(GAP_ID)->scalarValueAt(e, coord, ip);
140  }
141 
143  virtual closureModel fractureClosureModel(const GmElement* e, const GmVector* coord, int ip) const
144  {
145  S_TRACE();
146  assert(e);
148 
149  if (propertyAc(Closure_ID) == NULL)
150  {
151  return GmpElasticInterface::closureModel::normal;
152  }
153 
154  int closureType = propertyAc(Closure_ID)->scalarValueAt(e, coord, ip);
155  //
156  if (closureType == 1)
157  {
158  type = GmpElasticInterface::closureModel::hardStiffness;
159  }
160  else if (closureType == 2)
161  {
162  type = GmpElasticInterface::closureModel::bartonBandis;
163  }
164  else
165  {
166  type = GmpElasticInterface::closureModel::normal;
167  }
168 
169  return type;
170  }
171 };
172 #endif
Id for retrieving the shear elastic stiffness accessor.
Definition: gmpMaterialElasticInterface.h:41
The number of property ids above.
Definition: gmpMaterialElasticInterface.h:47
The number of gauss attributes.
Definition: gmpMaterialElasticInterface.h:86
virtual double shearElasticStiffness(const GmElement *e, const GmVector *coord, int ip) const
Returns the shear elastic stiffness of the interface element.
Definition: gmpMaterialElasticInterface.h:118
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: gmpMaterialElasticInterface.h:124
#define S_TRACE()
elasticInterfaceGaussAttrIds
IDs for Gauss attributes of elastic interface material.
Definition: gmpMaterialElasticInterface.h:81
Declaration of the GmpInterfaceMaterial classes.
virtual double fractureOpening(const GmElement *e, const GmVector *coord, int ip) const
Returns the initial fracture opening.
Definition: gmpMaterialElasticInterface.h:130
Fracture closure considering Hard Stiffness.
Definition: gmpMaterialElasticInterface.h:54
Definition: gmpMechanicPoint.h:32
Definition: gmpMaterialElasticInterface.h:34
Id for retrieving the normal elastic stiffness accessor.
Definition: gmpMaterialElasticInterface.h:40
The number of fracture closure models.
Definition: gmpMaterialElasticInterface.h:59
virtual double normalElasticStiffness(const GmElement *e, const GmVector *coord, int ip) const
Returns the normal elastic stiffness of the interface element.
Definition: gmpMaterialElasticInterface.h:112
Base Id for Gauss attribute(s) used to store the maximum.
Definition: gmpMaterialElasticInterface.h:83
Declaration of the GmpMechanicPoint class.
Definition: gmpInterfaceMaterial.h:34
virtual bool setInitialConditions(const GmElement *e, GmpMechanicPoint *mp, const GmVector *coord, unsigned nc) const
Set the initial conditions required by the material.
Definition: gmpInterfaceMaterial.cpp:117
GmpElasticInterface(int typeIndex, QString typeName, const GmLogCategory &logger)
Constructor. Gets as parameters the material index and its name.
Definition: gmpMaterialElasticInterface.h:64
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: gmpMaterialElasticInterface.h:71
Id for retrieving the initial fracture aperture.
Definition: gmpMaterialElasticInterface.h:43
Normal closure without contact.
Definition: gmpMaterialElasticInterface.h:53
Id for retrieving the shear elastic stiffness accessor at 2nd-direction (3D)
Definition: gmpMaterialElasticInterface.h:42
InterfaceElementPropertyIds
IDs for elastic interface material properties.
Definition: gmpMaterialElasticInterface.h:38
arma::vec GmVector
Fracture closure considering Barton-Bandis model.
Definition: gmpMaterialElasticInterface.h:55
virtual ~GmpElasticInterface()
Virtual destructor.
Definition: gmpMaterialElasticInterface.h:68
arma::mat GmMatrix
Id for retrieving the closure model.
Definition: gmpMaterialElasticInterface.h:44
virtual closureModel fractureClosureModel(const GmElement *e, const GmVector *coord, int ip) const
Returns the type of fracture closure model.
Definition: gmpMaterialElasticInterface.h:143
closureModel
Fracture closure models.
Definition: gmpMaterialElasticInterface.h:51