MechanicalFemPhysics
The GeMA Mechanical FEM Physics Plugin
gmpMechanicalPhysics.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_PLUGIN_MECHANICAL_PHYSICS_H_
25 #define _GEMA_PLUGIN_MECHANICAL_PHYSICS_H_
26 
27 #include "gmpMechanicalConfig.h"
28 #include <gmpFemPhysicsCommon.h>
29 #include <gmSimulationData.h>
30 #include <gmStateDump.h>
31 
32 #include "gmpMechanicPoint.h"
33 #include "gmpMechanicalContact.h"
34 
37 class GMP_MECHANICAL_PHYSICS_API_EXPORT GmpMechanicalPhysics : public GmpFemPhysicsCommon
38 {
39 public:
40 
41  // constructor
42  GmpMechanicalPhysics(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
43  const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger);
44  // destructor
45  virtual ~GmpMechanicalPhysics();
46 
47  // Comments on the base class
48  virtual const char* pluginName() const { return "MechanicalFemPhysics"; }
49 
50  // Comments on the base class
51  virtual const char* pluginType() const { return _pluginType; }
52  // Comments on the base class
53  virtual const QVariantMap* physicsMetaDataMap();
54 
55  // \brief Tell the world that the mechanical physics supports state dumping.
56  virtual bool supportsStateDumping() { return true; }
57 
58  // supported bc
59  //virtual bool supportsBcType(GmBcType type) const { assert(_attrMap); return _supportedTypes[type]; }
60 
62  virtual unsigned stress_state(void);
63 
64  virtual FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors) = 0;
65  virtual bool fixedNodalForcesBc(QList<int>& nodes, QList<int>&dof, QList<double>& values) const;
66  virtual bool fixedNodalDofsBc (QList<int>& nodes, QList<int>&dof, QList<double>& values, bool* constantValues) const;
67  virtual FemResultType fillElementDataForBc(const GmElement* e, const GmBoundaryCondition* bc, int bcIndex, int bcListIndex,
68  int border, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
69  virtual FemResultType fillElementDataForLoads(const GmElement* e, int loadId, GmpFemVectorSet& elemVectors);
70 
71  virtual FemResultType fillElementDataPressBc(const GmElement* e, const GmBoundaryCondition* bc, int bcIndex, int bcListIndex,
72  int border, GmMatrix& elemMat, GmVector& elemVec);
73  virtual FemResultType fillElementDataHydPressBc(const GmElement* e, const GmBoundaryCondition* bc, int bcIndex, int bcListIndex,
74  int border, GmMatrix& elemMat, GmVector& elemVec);
75  virtual FemResultType fillElementDataWaterSheepPressBc(const GmElement* e, const GmBoundaryCondition* bc, int bcIndex, int bcListIndex,
76  int border, GmMatrix& elemMat, GmVector& elemVec);
78  virtual FemResultType fillContactData(const GmContactBoundaryCondition* cbc, int bcIndex1, int bcIndex2,
79  GmMatrixDof& dofMap, GmpFemMatrixSet& matrixSet, GmpFemVectorSet& vecSet);
80  // Calculates derived results
81  virtual bool calcDerivedResults(bool nonLinearSolver);
82  // Calculate material derived results
83  virtual bool calcMaterialDerivedResults() const;
86  {
99 
100  // ------ NO ADDING BELOW THIS LINE
102  };
103 
106  {
108 
109  // ------ NO ADDING BELOW THIS LINE
111  };
112 
115  {
118 
119  // ------ NO ADDING BELOW THIS LINE
121  };
122 
125  {
133 
134  // ------ NO ADDING BELOW THIS LINE
136  };
137 
140  {
156 
157  // ------ NO ADDING BELOW THIS LINE
159  };
160 
163  {
169 
170  // --- NO ADDING BELOW THIS LINE
172  };
173 
176  {
182 
183  // ------ NO ADDING BELOW THIS LINE
185  };
186 
189  {
199 
200  // ------ NO ADDING BELOW THIS LINE
202  };
203 
206  {
209 
210  // ------ NO ADDING BELOW THIS LINE
212  };
213 
216  {
220 
221  // ------ NO ADDING BELOW THIS LINE
223  };
224 
236  virtual double fillBuMatrix(const GmElement* e, const GmShape* shape, const GmVector& ncoord,
237  const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bu) = 0;
238 
245  void fillElementDisplacements(const GmElement* e, GmVector& ue);
246 
247  // fills middle coordinates
248  virtual void fillMiddleCoordinates(const GmElement* e, GmMatrix Xnode, GmMatrix& MX) const { Q_UNUSED(e); Q_UNUSED(MX); }
249 
250  // computes external load contribution at specific integration point
251  //virtual bool externalLoadContribution(const GmElement* e, GmVector& load, QString sVar, const GmVector& ncoord);
252 
254  virtual double axisymmetricFactor(const GmElement* e, const GmMatrix& X, const GmVector& N) { Q_UNUSED(e); Q_UNUSED(X); Q_UNUSED(N); return 1.0; }
255 
257  virtual bool isPlaneStress() { return false; }
258 
260  virtual bool isAxisymmetric() { return false; }
261 
263  GmpMechanicPoint* mechanicPoint() { return _mechanicPoint; }
264 
266  GmMatrix& dep() { return _Dep; }
267 
269  virtual GmVector timeSim() const;
270 
271 protected:
276 
277 private:
278  const char* _pluginType;
279 };
280 
281 #endif
Id for fixed concentrated node force boundary condition.
Definition: gmpMechanicalPhysics.h:178
The number of physics attribute ids above.
Definition: gmpMechanicalPhysics.h:101
Id for retrieving the plastic strain physics attribute.
Definition: gmpMechanicalPhysics.h:90
Friction coefficient of contact boundary surface.
Definition: gmpMechanicalPhysics.h:219
The number of property ids above.
Definition: gmpMechanicalPhysics.h:171
Id for retreiving the body force enabled attribute.
Definition: gmpMechanicalPhysics.h:91
PhysicsAttributeIds
IDs for physics attributes.
Definition: gmpMechanicalPhysics.h:85
GmMatrix & dep()
Returns a reference to the physics constitutive tangent matrix.
Definition: gmpMechanicalPhysics.h:266
Base Id for node attribute used to store the calculated Reaction Force.
Definition: gmpMechanicalPhysics.h:128
Id for retrieving the strain reset attribute.
Definition: gmpMechanicalPhysics.h:97
edge or
Definition: gmpMechanicalPhysics.h:196
Id for retrieving the strain reset attribute.
Definition: gmpMechanicalPhysics.h:98
Id for retrieving the dry density accessor.
Definition: gmpMechanicalPhysics.h:167
Id for retrieving the line search numbers of the return mapping at the previous state.
Definition: gmpMechanicalPhysics.h:155
NodeAttributeIds
IDs for physics node attributes.
Definition: gmpMechanicalPhysics.h:124
Id for fixed node displacement boundary condition.
Definition: gmpMechanicalPhysics.h:177
ElementPropertyIds
IDs for physics element properties.
Definition: gmpMechanicalPhysics.h:162
Base Id for node attribute used to store the calculated contact internal variables.
Definition: gmpMechanicalPhysics.h:131
The number of boundary conditions ids above.
Definition: gmpMechanicalPhysics.h:211
GmpMechanicPoint * mechanicPoint()
Returns the physics mechanical material point.
Definition: gmpMechanicalPhysics.h:263
Specific weight of fluid.
Definition: gmpMechanicalPhysics.h:198
Nodal displacement for fixed node displacement boundary condition.
Definition: gmpMechanicalPhysics.h:192
The number of boundary conditions ids above.
Definition: gmpMechanicalPhysics.h:184
Base Id for Gauss attribute(s) used to store the calculated strain at the current state.
Definition: gmpMechanicalPhysics.h:144
Nivel of reference level of water.
Definition: gmpMechanicalPhysics.h:197
Normal elastic stiffness of contact boundary.
Definition: gmpMechanicalPhysics.h:217
Base Id for node attribute used to store the calculated contact Displacement.
Definition: gmpMechanicalPhysics.h:130
Id for retrieving the return mapping info physics attribute.
Definition: gmpMechanicalPhysics.h:95
GmMatrix _Dep
Constitutive tangent matrix (2 x 2)
Definition: gmpMechanicalPhysics.h:274
Id for retrieving the stress physics attribute.
Definition: gmpMechanicalPhysics.h:88
The number of boundary conditions value ids above.
Definition: gmpMechanicalPhysics.h:222
ContactBCIds
IDs for accepted contact boundary conditions.
Definition: gmpMechanicalPhysics.h:205
Base Id for Gauss attribute(s) used to store the calculated stress at the current state.
Definition: gmpMechanicalPhysics.h:141
Id for retrieving the substep numbers of the return mapping at the previous state.
Definition: gmpMechanicalPhysics.h:153
GmpMechanicalContact _mecContact
Object with general contact methods.
Definition: gmpMechanicalPhysics.h:272
Id for retrieving the bulk density accessor.
Definition: gmpMechanicalPhysics.h:168
Definition: gmpMechanicPoint.h:32
Shear elastic stiffness of contact boundary.
Definition: gmpMechanicalPhysics.h:218
Id for retrieving the geometric attribute.
Definition: gmpMechanicalPhysics.h:93
BoundaryConditionIds
IDs for accepted boundary condition types.
Definition: gmpMechanicalPhysics.h:175
Id for retrieving the iteration numbers of the return mapping.
Definition: gmpMechanicalPhysics.h:150
Id for retrieving the line search numbers of the return mapping.
Definition: gmpMechanicalPhysics.h:154
Id for retrieving the material point state accessor at the previous state.
Definition: gmpMechanicalPhysics.h:149
ExternalLoadsIds
IDs for Mechanical physics state vars.
Definition: gmpMechanicalPhysics.h:114
Id for retrieving the contact internal variale accessor at the previous state (old contact displaceme...
Definition: gmpMechanicalPhysics.h:132
Definition: gmpMechanicalContact.h:31
Id for hydraulic pressure load boundary condition.
Definition: gmpMechanicalPhysics.h:180
Id for pressure load boundary condition.
Definition: gmpMechanicalPhysics.h:179
BoundaryConditionValueIds
IDs for property values from accepted boundary condition types.
Definition: gmpMechanicalPhysics.h:188
Id for water pressure on the seabed or water sheet pressure boundary condition.
Definition: gmpMechanicalPhysics.h:181
ContactBCValueIds
IDs for property values from accepted Contact boundary condition (CBC)
Definition: gmpMechanicalPhysics.h:215
Declaration of the GmpMechanicalContact class.
Nodal displacement for fixed node displacement boundary condition.
Definition: gmpMechanicalPhysics.h:191
The number of state var ids above.
Definition: gmpMechanicalPhysics.h:120
The number of boundary conditions value ids above.
Definition: gmpMechanicalPhysics.h:201
Id for retrieving the accessor to the temperature state var.
Definition: gmpMechanicalPhysics.h:117
Id for retrieving the material point state accessor at the current state.
Definition: gmpMechanicalPhysics.h:148
bool _setInitialCond
Sets the initial conditions required by the physics.
Definition: gmpMechanicalPhysics.h:275
Id for retrieving the plane width accessor.
Definition: gmpMechanicalPhysics.h:164
Declaration of the GmpMechanicPoint class.
Id for retrieving the stress accessor at the previous state (old stress)
Definition: gmpMechanicalPhysics.h:142
const char * _pluginType
The plugin type name.
Definition: gmpMechanicalPhysics.h:278
GaussAttributeIds
IDs for physics Gauss attributes.
Definition: gmpMechanicalPhysics.h:139
Declaration of usefull configuration definitions for the plugin library.
Id for retrieving the gravity attribute.
Definition: gmpMechanicalPhysics.h:92
StateVarIds
IDs for Mechanical physics state vars.
Definition: gmpMechanicalPhysics.h:105
Base Id for node attribute used to store the calculated contact Force.
Definition: gmpMechanicalPhysics.h:129
Id for retrieving the yield strength ratio at the previous state.
Definition: gmpMechanicalPhysics.h:147
Id for retrieving the yield strength ratio at the current state.
Definition: gmpMechanicalPhysics.h:146
Id for retrieving the stress accessor at the residual state.
Definition: gmpMechanicalPhysics.h:143
Id for retrieving the accessor to the displacement state var.
Definition: gmpMechanicalPhysics.h:107
Id for retrieving the gravity accessor.
Definition: gmpMechanicalPhysics.h:166
virtual double axisymmetricFactor(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: gmpMechanicalPhysics.h:254
Reference of hydraulic load boundary condition.
Definition: gmpMechanicalPhysics.h:195
The number of Gauss attribute ids above.
Definition: gmpMechanicalPhysics.h:158
Id for retrieving the reactionForceMode physics attribute.
Definition: gmpMechanicalPhysics.h:94
virtual bool isPlaneStress()
Returns the factor that should be applied when using axis symetric elements. 1.0 for other etypes.
Definition: gmpMechanicalPhysics.h:257
The number of state var ids above.
Definition: gmpMechanicalPhysics.h:110
GmpMechanicPoint * _mechanicPoint
Access to mechanical material point.
Definition: gmpMechanicalPhysics.h:273
Nodal force for fixed node force boundary condition.
Definition: gmpMechanicalPhysics.h:193
Base Id for node attribute(s) used to store the calculated stress.
Definition: gmpMechanicalPhysics.h:126
Id for retrieving the accessor to the pressure state var.
Definition: gmpMechanicalPhysics.h:116
Id for retrieving the K0 mode attribute.
Definition: gmpMechanicalPhysics.h:96
Id for retrieving the strain accessor at the previous state (old strain)
Definition: gmpMechanicalPhysics.h:145
virtual bool isAxisymmetric()
Returns TRUE only for axisymmetric models.
Definition: gmpMechanicalPhysics.h:260
Id for global contact boundary.
Definition: gmpMechanicalPhysics.h:208
edge or face pressure load boundary condition
Definition: gmpMechanicalPhysics.h:194
arma::vec GmVector
Base Id for node attribute(s) used to store the calculated strain.
Definition: gmpMechanicalPhysics.h:127
Id for retrieving the strain physics attribute.
Definition: gmpMechanicalPhysics.h:89
Id for retrieving the substep numbers of the return mapping.
Definition: gmpMechanicalPhysics.h:152
arma::mat GmMatrix
The number of node attribute ids above.
Definition: gmpMechanicalPhysics.h:135
Basic class for the mechanical physics plugin object.
Definition: gmpMechanicalPhysics.h:37
Id for retrieving the isoParametric physics attribute.
Definition: gmpMechanicalPhysics.h:87
Id for retrieving the iteration numbers of the return mapping at the previous state.
Definition: gmpMechanicalPhysics.h:151
Id for retrieving the self weight for body force.
Definition: gmpMechanicalPhysics.h:165
Nodal displacement for fixed node displacement boundary condition.
Definition: gmpMechanicalPhysics.h:190
Id for local contact boundary.
Definition: gmpMechanicalPhysics.h:207