MechanicalFemPhysics
The GeMA Mechanical FEM Physics Plugin
Loading...
Searching...
No Matches
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"
34
37class GMP_MECHANICAL_PHYSICS_API_EXPORT GmpMechanicalPhysics : public GmpFemPhysicsCommon
38{
39public:
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) const;
63
64 virtual FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors) = 0;
65 virtual bool fixedNodalForcesBc(QVector<int>& nodes, QVector<int>&dof, QVector<double>& values) const;
66 virtual bool fixedNodalDofsBc (QVector<int>& nodes, QVector<int>&dof, QVector<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;
104
107 {
109
110 // ------ NO ADDING BELOW THIS LINE
112 };
113
116 {
120
121 // ------ NO ADDING BELOW THIS LINE
123 };
124
139
163
166 {
173
174 // --- NO ADDING BELOW THIS LINE
176 };
177
180 {
186
187 // ------ NO ADDING BELOW THIS LINE
189 };
190
207
210 {
213
214 // ------ NO ADDING BELOW THIS LINE
216 };
217
220 {
224
225 // ------ NO ADDING BELOW THIS LINE
227 };
228
240 virtual double fillBuMatrix(const GmElement* e, const GmShape* shape, const GmVector& ncoord,
241 const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bu) = 0;
242
249 void fillElementDisplacements(const GmElement* e, GmVector& ue);
250
251 // fills nodal thermal increment
252 void fillElementThermalIncrement(const GmElement* e, GmVector& dTe);
253
254 // computes external load contribution at specific integration point
255 //virtual bool externalLoadContribution(const GmElement* e, GmVector& load, QString sVar, const GmVector& ncoord);
256
258 virtual double axisymmetricFactor(const GmElement* e, const GmMatrix& X, const GmVector& N) const { Q_UNUSED(e); Q_UNUSED(X); Q_UNUSED(N); return 1.0; }
259
261 virtual bool isPlaneStress() { return false; }
262
264 virtual bool isAxisymmetric() { return false; }
265
267 GmpMechanicPoint* mechanicPoint() { return _mechanicPoint; }
268
270 virtual bool evaluatesThermalStrain(const GmElement* e, GmVector& strainT, GmVector& NT, GmVector& dT, double alpha) const;
271
273 inline GmMatrix& dep() { return _Dep.localData(); }
274
275protected:
279
280private:
281 const char* _pluginType;
282};
283
284#endif
Definition gmpMechanicPoint.h:33
Basic class for the mechanical physics plugin object.
Definition gmpMechanicalPhysics.h:38
GmpMechanicPoint * mechanicPoint()
Returns the physics mechanical material point.
Definition gmpMechanicalPhysics.h:267
GmpMechanicPoint * _mechanicPoint
Access to mechanical material point.
Definition gmpMechanicalPhysics.h:276
PhysicsAttributeIds
IDs for physics attributes.
Definition gmpMechanicalPhysics.h:86
@ NUM_ATTRI_IDS
The number of physics attribute ids above.
Definition gmpMechanicalPhysics.h:102
@ BODY_FORCE_ID
Id for retreiving the body force enabled attribute.
Definition gmpMechanicalPhysics.h:91
@ P_STRAIN_MODE_ID
Id for retrieving the plastic strain physics attribute.
Definition gmpMechanicalPhysics.h:90
@ CGRAV_ID
Id for retrieving the gravity attribute.
Definition gmpMechanicalPhysics.h:92
@ GEOMETRIC_ID
Id for retrieving the geometric attribute.
Definition gmpMechanicalPhysics.h:93
@ ISOPARAMETRIC_ID
Id for retrieving the isoParametric physics attribute.
Definition gmpMechanicalPhysics.h:87
@ STRAIN_T_ID
Id for retrieving the Thermal strain attribute.
Definition gmpMechanicalPhysics.h:99
@ RF_MODE_ID
Id for retrieving the reactionForceMode physics attribute.
Definition gmpMechanicalPhysics.h:94
@ STRESS_MODE_ID
Id for retrieving the stress physics attribute.
Definition gmpMechanicalPhysics.h:88
@ RMAPPINGINFO_ID
Id for retrieving the return mapping info physics attribute.
Definition gmpMechanicalPhysics.h:95
@ STRAIN_RESET_ID
Id for retrieving the strain reset attribute
Definition gmpMechanicalPhysics.h:97
@ STRAIN_MODE_ID
Id for retrieving the strain physics attribute.
Definition gmpMechanicalPhysics.h:89
@ CONTACT_ID
Id for retrieving the strain reset attribute.
Definition gmpMechanicalPhysics.h:98
@ K0MODE_ID
Id for retrieving the K0 mode attribute.
Definition gmpMechanicalPhysics.h:96
StateVarIds
IDs for Mechanical physics state vars.
Definition gmpMechanicalPhysics.h:107
@ U_ID
Id for retrieving the accessor to the displacement state var.
Definition gmpMechanicalPhysics.h:108
@ NUM_STATEVAR_IDS
The number of state var ids above.
Definition gmpMechanicalPhysics.h:111
GmMatrix & dep()
Returns a reference to the physics constitutive tangent matrix.
Definition gmpMechanicalPhysics.h:273
const char * _pluginType
The plugin type name.
Definition gmpMechanicalPhysics.h:281
ElementPropertyIds
IDs for physics element properties.
Definition gmpMechanicalPhysics.h:166
@ BF_ID
Id for retrieving the self weight for body force.
Definition gmpMechanicalPhysics.h:168
@ GRAV_ID
Id for retrieving the gravity accessor.
Definition gmpMechanicalPhysics.h:169
@ THICKNESS_ID
Id for retrieving the plane width accessor.
Definition gmpMechanicalPhysics.h:167
@ NUM_PROPER_IDS
The number of property ids above.
Definition gmpMechanicalPhysics.h:175
@ DENSB_ID
Id for retrieving the bulk density accessor.
Definition gmpMechanicalPhysics.h:171
@ DENS_ID
Id for retrieving the dry density accessor.
Definition gmpMechanicalPhysics.h:170
@ ALPHA_ID
Id for retrieving the expansion factor accessor.
Definition gmpMechanicalPhysics.h:172
BoundaryConditionValueIds
IDs for property values from accepted boundary condition types.
Definition gmpMechanicalPhysics.h:193
@ BC_HL_ID
edge or
Definition gmpMechanicalPhysics.h:200
@ BC_CF_ID
Nodal force for fixed node force boundary condition.
Definition gmpMechanicalPhysics.h:197
@ NUM_BCV_IDS
The number of boundary conditions value ids above.
Definition gmpMechanicalPhysics.h:205
@ BC_UX_ID
Nodal displacement for fixed node displacement boundary condition.
Definition gmpMechanicalPhysics.h:194
@ BC_PL_ID
edge or face pressure load boundary condition
Definition gmpMechanicalPhysics.h:198
@ BC_UZ_ID
Nodal displacement for fixed node displacement boundary condition.
Definition gmpMechanicalPhysics.h:196
@ BC_NRL_ID
Nivel of reference level of water.
Definition gmpMechanicalPhysics.h:201
@ BC_SWF_ID
Specific weight of fluid.
Definition gmpMechanicalPhysics.h:202
@ BC_UY_ID
Nodal displacement for fixed node displacement boundary condition.
Definition gmpMechanicalPhysics.h:195
@ BC_HLR_ID
Reference of hydraulic load boundary condition.
Definition gmpMechanicalPhysics.h:199
ContactBCValueIds
IDs for property values from accepted Contact boundary condition (CBC)
Definition gmpMechanicalPhysics.h:220
@ CBC_KCN_ID
Normal elastic stiffness of contact boundary.
Definition gmpMechanicalPhysics.h:221
@ NUM_CBCV_IDS
The number of boundary conditions value ids above.
Definition gmpMechanicalPhysics.h:226
@ CBC_KSN_ID
Shear elastic stiffness of contact boundary.
Definition gmpMechanicalPhysics.h:222
@ CBC_MU_ID
Friction coefficient of contact boundary surface.
Definition gmpMechanicalPhysics.h:223
virtual bool isAxisymmetric()
Returns TRUE only for axisymmetric models.
Definition gmpMechanicalPhysics.h:264
GmTLS< GmMatrix, true > _Dep
Constitutive tangent matrix (2 x 2)
Definition gmpMechanicalPhysics.h:277
virtual double axisymmetricFactor(const GmElement *e, const GmMatrix &X, const GmVector &N) const
Returns the factor that should be applied when using axis symetric elements. 1.0 for other etypes.
Definition gmpMechanicalPhysics.h:258
ExternalLoadsIds
IDs for Mechanical physics state vars.
Definition gmpMechanicalPhysics.h:116
@ PRESSURE_ID
Id for retrieving the accessor to the pressure state var.
Definition gmpMechanicalPhysics.h:117
@ NUM_EXTLOADS_IDS
The number of state var ids above.
Definition gmpMechanicalPhysics.h:122
@ TREF_ID
Id for retrieving the accessor to the reference temperature var.
Definition gmpMechanicalPhysics.h:119
@ THERMAL_ID
Id for retrieving the accessor to the temperature state var.
Definition gmpMechanicalPhysics.h:118
BoundaryConditionIds
IDs for accepted boundary condition types.
Definition gmpMechanicalPhysics.h:180
@ FIXED_CF_BC_ID
Id for fixed concentrated node force boundary condition.
Definition gmpMechanicalPhysics.h:182
@ HL_BC_ID
Id for hydraulic pressure load boundary condition.
Definition gmpMechanicalPhysics.h:184
@ WP_BC_ID
Id for water pressure on the seabed or water sheet pressure boundary condition.
Definition gmpMechanicalPhysics.h:185
@ NUM_BC_IDS
The number of boundary conditions ids above.
Definition gmpMechanicalPhysics.h:188
@ PL_BC_ID
Id for pressure load boundary condition.
Definition gmpMechanicalPhysics.h:183
@ FIXED_U_BC_ID
Id for fixed node displacement boundary condition.
Definition gmpMechanicalPhysics.h:181
virtual double fillBuMatrix(const GmElement *e, const GmShape *shape, const GmVector &ncoord, const GmMatrix &X, const GmVector &N, const GmMatrix &J, GmMatrix &Bu)=0
Given a point 'ncood', the element coordinate matrix 'X', the point shape functions 'N' and the trans...
GaussAttributeIds
IDs for physics Gauss attributes.
Definition gmpMechanicalPhysics.h:142
@ ST_GA_ID
Id for retrieving the material point state accessor at the current state.
Definition gmpMechanicalPhysics.h:150
@ S_GA_ID
Base Id for Gauss attribute(s) used to store the calculated stress at the current state.
Definition gmpMechanicalPhysics.h:143
@ NUM_GA_IDS
The number of Gauss attribute ids above.
Definition gmpMechanicalPhysics.h:161
@ ITER_GA_ID
Id for retrieving the iteration numbers of the return mapping.
Definition gmpMechanicalPhysics.h:152
@ STOLD_GA_ID
Id for retrieving the material point state accessor at the previous state.
Definition gmpMechanicalPhysics.h:151
@ LINESEARCHOLD_GA_ID
Id for retrieving the line search numbers of the return mapping at the previous state.
Definition gmpMechanicalPhysics.h:157
@ LINESEARCH_GA_ID
Id for retrieving the line search numbers of the return mapping.
Definition gmpMechanicalPhysics.h:156
@ SUBSTEPOLD_GA_ID
Id for retrieving the substep numbers of the return mapping at the previous state.
Definition gmpMechanicalPhysics.h:155
@ SOLD_GA_ID
Id for retrieving the stress accessor at the previous state (old stress)
Definition gmpMechanicalPhysics.h:144
@ YSROLD_GA_ID
Id for retrieving the yield strength ratio at the previous state.
Definition gmpMechanicalPhysics.h:149
@ RS_GA_ID
Id for retrieving the stress accessor at the residual state.
Definition gmpMechanicalPhysics.h:145
@ E_GA_ID
Base Id for Gauss attribute(s) used to store the calculated strain at the current state.
Definition gmpMechanicalPhysics.h:146
@ SUBSTEP_GA_ID
Id for retrieving the substep numbers of the return mapping.
Definition gmpMechanicalPhysics.h:154
@ EOLD_GA_ID
Id for retrieving the strain accessor at the previous state (old strain)
Definition gmpMechanicalPhysics.h:147
@ YSR_GA_ID
Id for retrieving the yield strength ratio at the current state.
Definition gmpMechanicalPhysics.h:148
@ ITEROLD_GA_ID
Id for retrieving the iteration numbers of the return mapping at the previous state.
Definition gmpMechanicalPhysics.h:153
@ ET_GA_ID
Base Id for Gauss attribute(s) used to store the thermal strain at the current state.
Definition gmpMechanicalPhysics.h:158
NodeAttributeIds
IDs for physics node attributes.
Definition gmpMechanicalPhysics.h:127
@ CD_NA_ID
Base Id for node attribute used to store the calculated contact Displacement.
Definition gmpMechanicalPhysics.h:132
@ CF_NA_ID
Base Id for node attribute used to store the calculated contact Force.
Definition gmpMechanicalPhysics.h:131
@ CIVOLD_NA_ID
Id for retrieving the contact internal variale accessor at the previous state (old contact displaceme...
Definition gmpMechanicalPhysics.h:134
@ S_NA_ID
Base Id for node attribute(s) used to store the calculated stress.
Definition gmpMechanicalPhysics.h:128
@ NUM_NA_IDS
The number of node attribute ids above.
Definition gmpMechanicalPhysics.h:137
@ CIV_NA_ID
Base Id for node attribute used to store the calculated contact internal variables.
Definition gmpMechanicalPhysics.h:133
@ RF_NA_ID
Base Id for node attribute used to store the calculated Reaction Force.
Definition gmpMechanicalPhysics.h:130
@ E_NA_ID
Base Id for node attribute(s) used to store the calculated strain.
Definition gmpMechanicalPhysics.h:129
virtual bool isPlaneStress()
Returns the factor that should be applied when using axis symetric elements. 1.0 for other etypes.
Definition gmpMechanicalPhysics.h:261
ContactBCIds
IDs for accepted contact boundary conditions.
Definition gmpMechanicalPhysics.h:210
@ NUM_CBC_IDS
The number of boundary conditions ids above.
Definition gmpMechanicalPhysics.h:215
@ LOCAL_CBC_ID
Id for local contact boundary.
Definition gmpMechanicalPhysics.h:211
@ GLOBAL_CBC_ID
Id for global contact boundary.
Definition gmpMechanicalPhysics.h:212
bool _setInitialCond
Sets the initial conditions required by the physics.
Definition gmpMechanicalPhysics.h:278
arma::mat GmMatrix
arma::vec GmVector
Declaration of the GmpMechanicPoint class.
Declaration of useful configuration definitions for the plugin library.
Declaration of the GmpMechanicalContact class.