MechanicalFemPhysics
The GeMA Mechanical FEM Physics Plugin
gmpMaterialCohesiveExponentialSoftening.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 
25 #ifndef _GEMA_PLUGIN_MECHANICALMATERIAL_COHESIVEEXPONENTIALSOFTENING_H_
26 #define _GEMA_PLUGIN_MECHANICALMATERIAL_COHESIVEEXPONENTIALSOFTENING_H_
27 
28 
30 #include "gmpMaterialElasticInterface.h"
31 #include "gmpMechanicPoint.h"
32 #include "gmpFemPhysics.h"
33 #include "gmMathUtils.h"
34 #include <math.h>
35 
37 {
38 protected:
41  {
43 
44  // --- NO ADDING BELOW THIS LINE
46  };
47 
48  // returns the scalar damage value "Sdvg"
49  virtual double scalarDamageVariable(const GmElement* e, const GmVector* coord, int ip, double de, double di, double df) const
50  {
51  S_TRACE();
52  double alpha = exponentialSofteningParameter(e, coord, ip);
53  double Sdvg = 1.0 - di / de * (1.0 - (1.0 - exp(-alpha*((de - di) / (df - di)))) / (1.0 - exp(-alpha)));
54  return Sdvg;
55  }
56 
57  // returns the gradient of the damage variable in relation to the equivalente displacement
58  // Hd = d(Sdvg)/d(del_e)
59  virtual double deriveDamage(const GmElement* e, const GmVector* coord, int ip, double de, double di, double df) const
60  {
61  S_TRACE();
62  double alpha = exponentialSofteningParameter(e, coord, ip);
63  double Hd = di*(1 - 1 / (1 - exp(-alpha))) / pow(de, 2.0) + (di / pow(de, 2.0) + di*alpha / (de*(df - di)))*
64  exp(-alpha*(de - di) / (df - di)) / (1 - exp(-alpha));
65  return Hd;
66  }
67 
68 public:
70  GmpCohesiveExponentialSoftening(int typeIndex, QString typeName, const GmLogCategory& logger)
71  :GmpCohesiveLinearSoftening(typeIndex, typeName, logger){}
72 
75 
77  static GmpFemPhysicsCommonMaterial* instance(GmSimulationData* simulation, int typeIndex, QString typeName, const GmLogCategory& logger)
78  {
79  Q_UNUSED(simulation);
80  return new GmpCohesiveExponentialSoftening(typeIndex, typeName, logger);
81  }
82 
83  // Returns a map with material associated properties.
84  virtual const QVariantMap* materialMetaDataMap()
85  {
86  S_TRACE();
87  static QVariantMap m;
88  if (m.isEmpty())
89  {
90  // read the material attribute map from elastic interface material
92  // Adds material properties
93  GmpFemPhysicsCommon::ValueList matExpProp = m["properties"].value<GmpFemPhysicsCommon::ValueList>();
94  matExpProp.append(GmpFemPhysicsCommon::ScalarValue(ALPHA_ID, "alpha", QObject::tr("Exponential material parameter"), "", true));
95 
96  m["properties"] = matExpProp;
97  }
98 
99  return &m;
100  }
101 
103  virtual double exponentialSofteningParameter(const GmElement* e, const GmVector* coord, int ip) const
104  {
105  return propertyAc(ALPHA_ID)->scalarValueAt(e, coord, ip);
106  }
107 
108 };
109 #endif
virtual double exponentialSofteningParameter(const GmElement *e, const GmVector *coord, int ip) const
Returns the exponential material parameter.
Definition: gmpMaterialCohesiveExponentialSoftening.h:103
The number of property ids above.
Definition: gmpMaterialCohesiveExponentialSoftening.h:45
Id for retrieving the exponential softening parameter.
Definition: gmpMaterialCohesiveExponentialSoftening.h:42
Definition: gmpMaterialCohesiveLinearSoftening.h:34
CohesiveExpElemPropertyIds
IDs for elastic interface material properties.
Definition: gmpMaterialCohesiveExponentialSoftening.h:40
#define S_TRACE()
QString tr(const char *sourceText, const char *disambiguation, int n)
GmpCohesiveExponentialSoftening(int typeIndex, QString typeName, const GmLogCategory &logger)
Constructor. Gets as parameters the material index and its name.
Definition: gmpMaterialCohesiveExponentialSoftening.h:70
Definition: gmpMaterialCohesiveExponentialSoftening.h:36
virtual ~GmpCohesiveExponentialSoftening()
Virtual destructor.
Definition: gmpMaterialCohesiveExponentialSoftening.h:74
virtual const QVariantMap * materialMetaDataMap()
Returns a pointer to the material attribute map, built when the function is called for the first time...
Definition: gmpMaterialCohesiveExponentialSoftening.h:84
Declaration of the GmpMechanicPoint class.
virtual const QVariantMap * materialMetaDataMap()
Returns a pointer to the material attribute map, built when the function is called for the first time...
Definition: gmpMaterialCohesiveLinearSoftening.cpp:35
Declaration of the GmpMaterialCohesiveLinearSoftening classes.
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: gmpMaterialCohesiveExponentialSoftening.h:77
arma::vec GmVector
The number of property ids above.
Definition: gmpMaterialCohesiveLinearSoftening.h:48