Lem
The Lem Plugin
lemMechanicalPhysics.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 
25 #ifndef _GEMA_LEM_MECHANICAL_PHYSICS_H_
26 #define _GEMA_LEM_MECHANICAL_PHYSICS_H_
27 
28 #include <gmpFemPhysicsCommon.h>
29 #include <gmSimulationData.h>
30 #include "lemMechanicPoint.h"
31 
32 
35 class LemMechanicalPhysics : public GmpFemPhysicsCommon
36 {
37 public:
38 
39  // constructor
40  LemMechanicalPhysics(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
41  const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger);
42  // destructor
43  virtual ~LemMechanicalPhysics();
44 
45  // Comments on the base class
46  virtual const char* pluginName() const { return "Lem"; }
47 
48  // Comments on the base class
49  virtual const char* pluginType() const { return _pluginType; }
50 
51  virtual const QVariantMap* physicsMetaDataMap();
52 
53  virtual FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors) = 0;
54  virtual bool fixedNodalForcesBc(QList<int>& nodes, QList<int>&dof, QList<double>& values) const;
55  virtual bool fixedNodalDofsBc (QList<int>& nodes, QList<int>&dof, QList<double>& values, bool* constantValues) const;
56 
57  virtual bool calcDerivedResults(bool nonLinearSolver);
58 
61  {
63 
64  // ------ NO ADDING BELOW THIS LINE
66  };
67 
70  {
71  U_ID,
72  W_ID,
73 
74  // ------ NO ADDING BELOW THIS LINE
76  };
77 
80  {
83 
84  // ------ NO ADDING BELOW THIS LINE
86  };
87 
90  {
97 
98  // ------ NO ADDING BELOW THIS LINE
100  };
101 
104  {
106 
107  // --- NO ADDING BELOW THIS LINE
109  };
110 
113  {
116 
117  // ------ NO ADDING BELOW THIS LINE
119  };
120 
123  {
128 
129  // ------ NO ADDING BELOW THIS LINE
131  };
132 
144  virtual double fillBuMatrix(const GmElement* e, const GmShape* shape, const GmVector& ncoord, const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bp) = 0;
145 
152  void fillElementDisplacements(const GmElement* e, GmVector& ue);
153 
154  // fills middle coordinates
155  virtual void fillMiddleCoordinates(const GmElement* e, GmMatrix Xnode, GmMatrix& MX) const { Q_UNUSED(e); Q_UNUSED(MX); }
156 
157  // computes external load contribution at specific integration point
158  //virtual bool externalLoadContribution(const GmElement* e, GmVector& load, QString sVar, const GmVector& ncoord);
159 
161  virtual double axisSymetricFactor(const GmElement* e, const GmMatrix& X, const GmVector& N) { Q_UNUSED(e); Q_UNUSED(X); Q_UNUSED(N); return 1.0; }
162 
164  virtual bool isPlaneStress() const;
165 
168  virtual unsigned stress_state(void);
169 
171  GmMatrix& dep() { return _Dep; }
172 
173 protected:
174 
177 
178 private:
179  const char* _pluginType;
180 };
181 
182 #endif
const char * _pluginType
The plugin type name.
Definition: lemMechanicalPhysics.h:179
The number of state var ids above.
Definition: lemMechanicalPhysics.h:75
Id for retrieving the isoParametric physics attribute.
Definition: lemMechanicalPhysics.h:62
The number of physics attribute ids above.
Definition: lemMechanicalPhysics.h:65
Base Id for node attribute(s) used to store the calculated stress.
Definition: lemMechanicalPhysics.h:81
The number of boundary conditions ids above.
Definition: lemMechanicalPhysics.h:118
BoundaryConditionValueIds
IDs for property values from accepted boundary condition types.
Definition: lemMechanicalPhysics.h:122
ElementPropertyIds
IDs for physics element properties.
Definition: lemMechanicalPhysics.h:103
Basic class for the mechanical physics plugin object.
Definition: lemMechanicalPhysics.h:35
virtual double axisSymetricFactor(const GmElement *e, const GmMatrix &X, const GmVector &N)
Returns the factor that should be applied when using axis symetric elements. 1.0 for other etypes.
Definition: lemMechanicalPhysics.h:161
The number of boundary conditions value ids above.
Definition: lemMechanicalPhysics.h:130
Nodal displacement for fixed node displacement boundary condition.
Definition: lemMechanicalPhysics.h:126
Base Id for Gauss attribute(s) used to store the calculated strain at the current state.
Definition: lemMechanicalPhysics.h:93
The number of Gauss attribute ids above.
Definition: lemMechanicalPhysics.h:99
Base Id for Gauss attribute(s) used to store the calculated stress at the current state.
Definition: lemMechanicalPhysics.h:91
GaussAttributeIds
IDs for physics Gauss attributes.
Definition: lemMechanicalPhysics.h:89
virtual ~LemMechanicalPhysics()
Destructor.
Definition: lemMechanicalPhysics.cpp:51
Definition: lemMechanicPoint.h:30
StateVarIds
IDs for Mechanical physics state vars.
Definition: lemMechanicalPhysics.h:69
Nodal displacement for fixed node displacement boundary condition.
Definition: lemMechanicalPhysics.h:125
Nodal displacement for fixed node displacement boundary condition.
Definition: lemMechanicalPhysics.h:124
PhysicsAttributeIds
IDs for physics attributes.
Definition: lemMechanicalPhysics.h:60
The number of property ids above.
Definition: lemMechanicalPhysics.h:108
lemMechanicPoint * _mechanicPoint
Access to mechanical material point.
Definition: lemMechanicalPhysics.h:175
void fillElementDisplacements(const GmElement *e, GmVector &ue)
Given an element, fills the vector 'ue' with nodal displacements. The vector should have size equal t...
Definition: lemMechanicalPhysics.cpp:164
virtual unsigned stress_state(void)
Returns the number of stress components.
Definition: lemMechanicalPhysics.cpp:190
virtual bool fixedNodalDofsBc(QList< int > &nodes, QList< int > &dof, QList< double > &values, bool *constantValues) const
See comments on base class. Fills vectors with prescribed node displacements.
Definition: lemMechanicalPhysics.cpp:138
Base Id for node attribute(s) used to store the calculated strain.
Definition: lemMechanicalPhysics.h:82
virtual bool isPlaneStress() const
Returns TRUE for plane stress analysis and FALSE in other cases.
Definition: lemMechanicalPhysics.cpp:174
Id for fixed concentrated node force boundary condition.
Definition: lemMechanicalPhysics.h:115
Id for fixed node displacement boundary condition.
Definition: lemMechanicalPhysics.h:114
GmMatrix _Dep
Constitutive tangent matrix (2 x 2)
Definition: lemMechanicalPhysics.h:176
Nodal force for fixed node force boundary condition.
Definition: lemMechanicalPhysics.h:127
Id for retrieving the stress accessor at the previous state (old stress)
Definition: lemMechanicalPhysics.h:92
Id for retrieving the material point state accessor at the current state.
Definition: lemMechanicalPhysics.h:95
virtual const QVariantMap * physicsMetaDataMap()
Returns a reference for the single mechanical physics attribute map, built when the function is calle...
Definition: lemMechanicalPhysics.cpp:59
Id for retrieving the accessor to the rotation state var.
Definition: lemMechanicalPhysics.h:72
Id for retrieving the material point state accessor at the previous state.
Definition: lemMechanicalPhysics.h:96
Id for retrieving the strain accessor at the previous state (old strain)
Definition: lemMechanicalPhysics.h:94
LemMechanicalPhysics(const char *pluginType, GmSimulationData *simulation, QString id, QString description, const GmpFemPhysicsCommonMaterialFactory *matFactory, const GmLogCategory &logger)
Constructor. Will be called by the plugin loading code.
Definition: lemMechanicalPhysics.cpp:39
virtual double fillBuMatrix(const GmElement *e, const GmShape *shape, const GmVector &ncoord, const GmMatrix &X, const GmVector &N, const GmMatrix &J, GmMatrix &Bp)=0
Given a point 'ncood', the element coordinate matrix 'X', the point shape functions 'N' and the trans...
Declaration of the lemMechanicPoint class.
The number of node attribute ids above.
Definition: lemMechanicalPhysics.h:85
Id for retrieving the accessor to the displacement state var.
Definition: lemMechanicalPhysics.h:71
GmMatrix & dep()
Returns a reference to the physics constitutive tangent matrox.
Definition: lemMechanicalPhysics.h:171
Id for retrieving the plane width accessor.
Definition: lemMechanicalPhysics.h:105
virtual bool fixedNodalForcesBc(QList< int > &nodes, QList< int > &dof, QList< double > &values) const
See comments on base class. Fills vectors with prescribed nodal concentrated forces.
Definition: lemMechanicalPhysics.cpp:156
BoundaryConditionIds
IDs for accepted boundary condition types.
Definition: lemMechanicalPhysics.h:112
arma::vec GmVector
NodeAttributeIds
IDs for physics node attributes.
Definition: lemMechanicalPhysics.h:79
arma::mat GmMatrix
virtual bool calcDerivedResults(bool nonLinearSolver)
Calc stress component on nodes and/or Gauss points, ADDING the calculated value to the current result...
Definition: lemMechanicalPhysics.cpp:223