Lem
The Lem Plugin
lemMaterialElastic.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 
24 #ifndef _GEMA_LEM_MATERIAL_ELASTIC_H_
25 #define _GEMA_LEM_MATERIAL_ELASTIC_H_
26 
27 #include <gmCellAccessor.h>
28 #include <gmpFemPhysics.h>
29 #include <gmMathUtils.h>
30 
31 #include "lemMechanicalMaterial.h"
32 #include "lemMechanicPoint.h"
33 
35 {
36 protected:
39  {
40  E_ID,
42 
43  // --- NO ADDING BELOW THIS LINE
45  };
46 
47 public:
48 
50  LemMaterialElastic(int typeIndex, QString typeName, const GmLogCategory& logger)
51  : LemMechanicalMaterial(typeIndex, typeName, logger) {}
52 
54  virtual ~LemMaterialElastic() {}
55 
57  static GmpFemPhysicsCommonMaterial* instance(GmSimulationData* simulation, int typeIndex, QString typeName, const GmLogCategory& logger)
58  {
59  Q_UNUSED(simulation);
60  return new LemMaterialElastic(typeIndex, typeName, logger);
61  }
62 
63  // Returns a map with material associated properties.
64  virtual const QVariantMap* materialMetaDataMap();
65 
66  // Returns the stresses according to the material behavior adopted
67  virtual bool returnMapping(const GmElement* e, GmMatrix& Dep, const lemMechanicPoint* mp, const GmVector* coord, unsigned nc, unsigned ips) const;
68 
69  // Returns the constitutive tangent matrix
70  virtual void tangentModulus(const GmElement* e, GmMatrix& Dep, const lemMechanicPoint* mp, const GmVector* coord, unsigned nc, unsigned ips) const;
71 
73  virtual bool isIsotropic() const { return true; }
74 
76  virtual double elasticModulus(const GmElement* e, const GmVector* coord, int ip) const
77  {
78  return propertyAc(E_ID)->scalarValueAt(e, coord, ip);
79  }
81  virtual double poissonRatio(const GmElement* e, const GmVector* coord, int ip) const
82  {
83  return propertyAc(NU_ID)->scalarValueAt(e, coord, ip);
84  }
85 
86  //virtual void stiffness(const GmElement*, unsigned, GmMatrix&, const GmVector*, unsigned, int, const GmVector* = NULL) const;
87  //virtual void flexibility(const GmElement*, unsigned, GmMatrix&, const GmVector*, unsigned, int, const GmVector* = NULL) const;
88  virtual double bulkModulus(const GmElement*, const GmVector*, int) const;
89  virtual double shearModulus(const GmElement*, const GmVector*, int) const;
90 };
91 
92 #endif
virtual double poissonRatio(const GmElement *e, const GmVector *coord, int ip) const
Returns the material poisson ratio.
Definition: lemMaterialElastic.h:81
LemMaterialElastic(int typeIndex, QString typeName, const GmLogCategory &logger)
Constructor. Gets as parameters the material index and its name.
Definition: lemMaterialElastic.h:50
virtual bool returnMapping(const GmElement *e, GmMatrix &Dep, const lemMechanicPoint *mp, const GmVector *coord, unsigned nc, unsigned ips) const
Returns the stresses according to the material behavior adopted.
Definition: lemMaterialElastic.cpp:57
The number of property ids above.
Definition: lemMaterialElastic.h:44
Definition: lemMaterialElastic.h:34
virtual const QVariantMap * materialMetaDataMap()
Returns a pointer to the material attribute map, built when the function is called for the first time...
Definition: lemMaterialElastic.cpp:39
virtual bool isIsotropic() const
Returns true if the material is isotropic, false otherwise.
Definition: lemMaterialElastic.h:73
virtual ~LemMaterialElastic()
Virtual destructor.
Definition: lemMaterialElastic.h:54
Id for retrieving the Poisson's ratio accessor.
Definition: lemMaterialElastic.h:41
Definition: lemMechanicPoint.h:30
virtual void tangentModulus(const GmElement *e, GmMatrix &Dep, const lemMechanicPoint *mp, const GmVector *coord, unsigned nc, unsigned ips) const
Returns the constitutive tangent matrix.
Definition: lemMaterialElastic.cpp:84
Declaration of the LemMechanicalMaterial class.
Basic class providing the interface for a mechanical material.
Definition: lemMechanicalMaterial.h:40
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: lemMaterialElastic.h:57
Id for retrieving the Young's Modulus accessor.
Definition: lemMaterialElastic.h:40
Declaration of the lemMechanicPoint class.
ElementPropertyIds
IDs for material element properties.
Definition: lemMaterialElastic.h:38
arma::vec GmVector
virtual double bulkModulus(const GmElement *, const GmVector *, int) const
Returns the bulk modulus from E and nu.
Definition: lemMaterialElastic.cpp:95
arma::mat GmMatrix
virtual double shearModulus(const GmElement *, const GmVector *, int) const
Returns the Shear modulus from E and nu.
Definition: lemMaterialElastic.cpp:104
virtual double elasticModulus(const GmElement *e, const GmVector *coord, int ip) const
Returns the material elastic modulus.
Definition: lemMaterialElastic.h:76