HydroFemPhysics
The GeMA Hydraulic FEM Physics Plugin
Loading...
Searching...
No Matches
gmpHydraulic.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_HYDRAULICS_H_
25#define _GEMA_PLUGIN_HYDRAULICS_H_
26
27
28#include "gmpHydraulicConfig.h"
29
30#include <gmpFemPhysicsCommon.h>
31#include <gmGaussAccessor.h>
32#include <gmMathUtils.h>
33
34class GmGaussAccessor;
35
38class GMP_HYDRAULIC_PHYSICS_API_EXPORT GmpHydraulic : public GmpFemPhysicsCommon
39{
40public:
41 enum HMaterialPointStates{
42 saturated,
43 unsaturated
44 };
45
47 {
48 GmGaussAccessor* newState;
49 GmGaussAccessor* oldState;
50 };
51
52 // constructor
53 GmpHydraulic(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
54 const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger);
55 // destructor
56 virtual ~GmpHydraulic();
57
58 // Comments on the base class
59 virtual const char* pluginName() const { return "HydroFemPhysics"; }
60
61 // Comments on the base class
62 virtual const char* pluginType() const { return _pluginType; }
63
64 virtual const QVariantMap* physicsMetaDataMap();
65
66 // See comments on the base class
67 //virtual bool checkLoadedData();
68
69 // See comments on the base class
70 //virtual bool addStateItemsToGroup(GmStateDump* state, bool fixedHint, int groupId);
71
72 // \brief Tell the world that the hydraulic physics supports state dumping.
73 virtual bool supportsStateDumping() { return true; }
74
75 virtual FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
76
77 virtual bool fixedNodalForcesBc(QVector<int>& nodes, QVector<int>&dof, QVector<double>& values) const;
78 virtual bool fixedNodalDofsBc (QVector<int>& nodes, QVector<int>&dof, QVector<double>& values, bool* constantValues) const;
79 // Comments on the base class
80 virtual FemResultType fillElementDataForBc(const GmElement* e, const GmBoundaryCondition* bc, int bcIndex, int bcListIndex,
81 int border, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
82 virtual FemResultType fillElementDataBc(const GmElement* e, const GmBoundaryCondition* bc, int bcIndex, int bcListIndex,
83 int border, GmMatrix& elemMat, GmVector& elemVec);
84
85 virtual bool calcDerivedResults(bool nonLinearSolver);
86
87 virtual void fillStorageCompMatrix(const GmElement* e, const GmVector* coord, int ip, GmMatrix& Sc, const GmVector& N, double c);
88
89 virtual void fillFlowMatrix(const GmElement* e, const GmVector* coord, int ip, GmMatrix& Kc, const GmMatrix& Bp, double c) const;
90
91 virtual void fillFluidVelocity(const GmElement* e, const GmVector* coord, int ip, GmVector& Vip, const GmVector& Pe, const GmMatrix& Bp) const;
92
93
94 virtual void fillElementPorePressure(const GmElement* e, GmVector& pe);
95
96 virtual void gravitySupplyFluid(const GmElement* e, const GmVector* coord, int ip, GmVector& qext_gsf, GmMatrix& Bp, double c);
97
98 virtual void fillSourceTermVector(const GmElement* e, const GmVector* coord, int ip, GmVector& St, const GmVector& N, double c);
99
111 virtual double fillBpMatrix(const GmShape* shape, const GmVector& ncoord, const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bp) = 0;
112
113 virtual void gravityVector(const GmElement* e, const GmVector* coord, int ip, GmVector& grav) const;
114
116 virtual bool isAxisymmetric() { return false; }
117
119 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; }
120
122 HMaterialPointAccessors& hydraulicMaterialPoint(){ return _hmaterialPointAccessor; }
123
140
143 {
145
146 // --- NO ADDING BELOW THIS LINE
148 };
149
152 {
156
157 // ------ NO ADDING BELOW THIS LINE
159 };
160
163 {
164
165 // --- NO ADDING BELOW THIS LINE
167 };
168
171 {
176
177 // --- NO ADDING BELOW THIS LINE
179 };
180
183 {
187
188 // --- NO ADDING BELOW THIS LINE
190 };
191
194 {
198
199 // --- NO ADDING BELOW THIS LINE
201 };
202
205 {
209
210 // --- NO ADDING BELOW THIS LINE
212 };
213
214protected:
215 virtual bool checkAndLoadAttributeAccessors(LuaTable& nodeTable, LuaTable& cellTable, LuaTable& gaussTable);
216 virtual void calcElementDerivedResultAtPoints(const GmElement* e, int resultId, const GmMatrix& evalPoints, bool evalAtIp, GmMatrix& result);
217 void calcElementVelocityAtPoints(const GmElement* e, const GmMatrix& evalPoints, GmMatrix& v);
218 void calcElementFlowAtPoints (const GmElement* e, const GmMatrix& evalPoints, bool evalAtIp, GmMatrix& q);
219
222
223private:
224 const char* _pluginType;
225
226};
227
228#endif
Basic class for the hydraulic physics plugin object.
Definition gmpHydraulic.h:39
GaussAttributeIds
IDs for physics Gauss attributes.
Definition gmpHydraulic.h:171
@ Q_GA_ID
Base Id for Gauss attribute(s) used to store the calculated flow.
Definition gmpHydraulic.h:173
@ NUM_GA_IDS
The number of Gauss attribute ids above.
Definition gmpHydraulic.h:178
@ V_GA_ID
Base Id for Gauss attribute(s) used to store the calculated velocity.
Definition gmpHydraulic.h:172
@ FTOLD_GA_ID
Id for retrieving the material point state accessor at the previous state.
Definition gmpHydraulic.h:175
@ FT_GA_ID
Id for retrieving the material point state accessor at the current state.
Definition gmpHydraulic.h:174
NodeAttributeIds
IDs for physics node attributes.
Definition gmpHydraulic.h:152
@ Q_NA_ID
Base Id for node attribute(s) used to store the calculated flow.
Definition gmpHydraulic.h:154
@ V_NA_ID
Base Id for node attribute(s) used to store the calculated velocity.
Definition gmpHydraulic.h:153
@ NUM_NA_IDS
The number of node attribute ids above.
Definition gmpHydraulic.h:158
@ VF_NA_ID
Base Id for node attribute(s) used to store the calculated reaction volume flux.
Definition gmpHydraulic.h:155
const char * _pluginType
The plugin type name.
Definition gmpHydraulic.h:224
PhysicsAttributeIds
IDs for physics attributes.
Definition gmpHydraulic.h:126
@ PERMEABILITY_UPDATE_ID
Id for retrieving the permeabilityUpdate physics attribute.
Definition gmpHydraulic.h:129
@ FLOW_MODE_ID
Id for retrieving the flowMode physics attribute.
Definition gmpHydraulic.h:132
@ CGRAV_ID
Id for retrieving the gravity attribute.
Definition gmpHydraulic.h:134
@ NUM_ATTRI_IDS
The number of physics attribute ids above.
Definition gmpHydraulic.h:138
@ USE_CONSISTENT_MATRIX_ID
Id for retrieving the useConsistentMatrix physics attribute.
Definition gmpHydraulic.h:130
@ VELOCITY_MODE_ID
Id for retrieving the heatFluxMode physics attribute.
Definition gmpHydraulic.h:131
@ POROSITY_UPDATE_ID
Id for retrieving the porosityUpdate physics attribute.
Definition gmpHydraulic.h:128
@ DIRECT_ID
Id for retrieving the directNodeEvaluation physics attribute.
Definition gmpHydraulic.h:133
@ VF_MODE_ID
Id for retrieving the volumeFluxMode physics atribute.
Definition gmpHydraulic.h:135
@ ISOPARAMETRIC_ID
Id for retrieving the isoParametric physics attribute.
Definition gmpHydraulic.h:127
HMaterialPointAccessors & hydraulicMaterialPoint()
Returns the hydraulic material point accessor.
Definition gmpHydraulic.h:122
BoundaryConditionIds
IDs for accepted boundary condition types.
Definition gmpHydraulic.h:194
@ FIXED_SPF_BC_ID
Id for prescribed surface flow boundary condition.
Definition gmpHydraulic.h:197
@ FIXED_Q_BC_ID
Id for fixed node flow boundary condition.
Definition gmpHydraulic.h:196
@ FIXED_P_BC_ID
Id for fixed node pore pressure boundary condition.
Definition gmpHydraulic.h:195
@ NUM_BC_IDS
The number of boundary conditions ids above.
Definition gmpHydraulic.h:200
ElementPropertyIds
IDs for physics element properties.
Definition gmpHydraulic.h:183
@ SOURTERM_ID
Id for retrieving the source term accessor.
Definition gmpHydraulic.h:186
@ THICKNESS_ID
Id for retrieving the plane width accessor.
Definition gmpHydraulic.h:184
@ NUM_PROPER_IDS
The number of property ids above.
Definition gmpHydraulic.h:189
@ GRAV_ID
Id for retrieving the gravity accessor.
Definition gmpHydraulic.h:185
StateVarIds
IDs fo physics state vars.
Definition gmpHydraulic.h:143
@ P_ID
Id for retrieving the accessor to the pore pressure state var.
Definition gmpHydraulic.h:144
@ NUM_STATEVAR_IDS
The number of property ids above.
Definition gmpHydraulic.h:147
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 gmpHydraulic.h:119
virtual double fillBpMatrix(const GmShape *shape, const GmVector &ncoord, const GmMatrix &X, const GmVector &N, const GmMatrix &J, GmMatrix &Bp)=0
Given a point 'ncoord', the element coordinate matrix 'X', the point shape functions 'N' and the tran...
cellAttributeIds
IDs for physics Cell attributes.
Definition gmpHydraulic.h:163
@ NUM_CA_IDS
The number of cell attribute ids above.
Definition gmpHydraulic.h:166
virtual bool isAxisymmetric()
Returns TRUE only for axisymmetric models.
Definition gmpHydraulic.h:116
bool _setInitialCond
Sets the initial conditions required by the physics.
Definition gmpHydraulic.h:221
BoundaryConditionValueIds
IDs for property values from accepted boundary condition types.
Definition gmpHydraulic.h:205
@ BC_QW_ID
Nodal pore flow for fixed node pore flow boundary condition.
Definition gmpHydraulic.h:207
@ BC_P_ID
Nodal pore pressure for fixed node pore pressure boundary condition.
Definition gmpHydraulic.h:206
@ NUM_BCV_IDS
The number of boundary conditions value ids above.
Definition gmpHydraulic.h:211
@ BC_IF_ID
surface pore flow for prescribed edge or face pore flow boundary conditions - inflow/outflow
Definition gmpHydraulic.h:208
HMaterialPointAccessors _hmaterialPointAccessor
Access to hydraulic material point.
Definition gmpHydraulic.h:220
arma::mat GmMatrix
arma::vec GmVector
Declaration of useful configuration definitions for the plugin library.
Definition gmpHydraulic.h:47