DGFemPhysics
The GeMA Discontinuous Galerkin FEM Physics Plugin
Loading...
Searching...
No Matches
gmpDGFemPhysics.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_DG_FEM_PHYSICS_H_
25#define _GEMA_PLUGIN_DG_FEM_PHYSICS_H_
26
27#include "gmpDGConfig.h"
28#include <gmpFemPhysicsCommon.h>
29
30#include <gmCellAccessor.h>
32#include <gmGaussAccessor.h>
33#include <gmIntegrationRule.h>
34#include <gmElement.h>
35#include <gmCellGroupSet.h>
36#include <gmElementDof.h>
37#include <gmShapeH.h>
38
39#include <luaTable.h>
40#include <luaStackBalancer.h>
41#include <gmModelData.h>
42
43#include <gmTrace.h>
44
47class GMP_DG_FEM_PHYSICS_API_EXPORT GmpDGFemPhysics : public GmpFemPhysicsCommon
48{
49
50public:
51 GmpDGFemPhysics(GmSimulationData* simulation, QString id, QString description, const GmLogCategory& logger);
52 virtual ~GmpDGFemPhysics();
53
54 // Comments on the base class
55 virtual const char * pluginName() const { return "DGFemPhysics"; }
56 virtual const char * pluginType() const { return "Galerkin"; };
57
60 {
62 };
63
65
78
87
90 {
92 C_D_ID,
93 };
94
104
105 enum BoundaryConditionsValueIds {
106 BC_CELL_1D_ID,
107 BC_C_CELL_ID,
108 BC_CELL_FREE_1D_ID,
109 BC_C_FREE_CELL_ID,
110 BC_C_PERIODIC_1D_ID,
111 BC_C_PERIODIC_CELL_ID,
112 BC_C_ID,
113 BC_C_FREE_ID,
114 BC_C_PERIODIC_ID,
115 BC_C_NODE_V_ID,
116 };
117
118 virtual bool loadPrivateData(LuaTable & table);
119 virtual const GmElementDof * dofMapping(const GmElement * e) const;
120 virtual const QVariantMap* physicsMetaDataMap();
121 virtual FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
122 virtual FemResultType fillElementDataForBc(const GmElement* e, const GmBoundaryCondition* bc, int bcIndex, int bcListIndex,
123 int border, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
124 virtual bool fixedNodalDofsBc(QList<int>& nodes, QList<int>&dof, QList<double>& values, bool* constantValues) const;
125 bool calcDerivedResults(bool);
126 bool calcElementDerivedResults();
127
128protected:
129 int BndIndex = -1;
130 double TOLERANCE = +1.e-3;
131
132private:
137 GmMatrix MatFaceIntPoint;
138
142
143 bool setNumFunctions();
144
145 //<! Get of number of shape functions for each element
146 int getNumFunctions()const { return numShapeFunctions;};
147 //<! Get of Affine Transform Matrix
148 GmMatrix getAffineTransformationMAT() { return AffineTransformationMAT; };
149 //<! Get of Inverse Affine Transform Matrix
150 GmMatrix getInvAffineTransformationMAT() { return InvAffineTransformationMAT; };
151 //<! Get of Determinant of Affine Transform Matrix
152 double getDetAffineTransformMatrix() { return detAffineTransformationMAT; };
153
154 bool TopologyMeshSetup();
155 bool TopologyMeshSetup1D();
156 bool TopologyMeshSetup2D();
157 bool TopologyMeshSetup3D();
158
159 bool AffineTransformationSetup();
160 bool InitialConditionProjection();
161
162 /*<! Set up Numerical Flux approximation used in Discontinuous Galerkin Methods apply to Advective Boundary-Value Problems
163 User can choose two classical numerical flux, Upwind Numerical or Lax-Wendrolf schemes. */
164 bool NumericalFlux(const GmElement * e, int borderE, GmMatrix &MFluxBorderE, GmMatrix &MFluxBorderN);
165
166 bool LinearLimeter(); //<! Linear Reconstruction function.
167 GmMatrix MatAvrgCalc(const GmElement *e);
168
169 int TClassicElementToHigher(const GmElement * e, int)const; //<! Geometric Transformation between Classical Geometric Elemento to Hierarchical.
170 int ElemPosition(int i, int j, int k); //<! Auxiliar Function to 3D Topology Mesh. (i,j,k) Index.
171 int Edge_Face_Ngh(int border); //<! Return of Edge/Face Neighbor to border.
172 GmVector DofEdge_Face(const GmElement * e,int border)const; //<! Auxiliar function for identify to edge/face functions defined on boundary element.
173 bool PrintResult(); //<! Print Result function.
174 bool ErrorAnalysis(); //<! Error Analysis.
175 bool PeriodicBND();
176 bool Projection(void);
177 int EdgeVd(int i, int border);
178};
179
180#endif
Basic class for discontinuous Galerkin fem physics.
Definition gmpDGFemPhysics.h:48
BoundaryContidionsIds
Definition gmpDGFemPhysics.h:95
@ BC_C_Inflow_ID
Id for retrieving the acessor to the Inflow Boundary Condition Type.
Definition gmpDGFemPhysics.h:99
@ BC_C_Outflow_ID
Id for retrieving the acessor to the Concentration Free Boundary Condition.
Definition gmpDGFemPhysics.h:100
@ BC_C_Inflow_1D_ID
Id for retrieving the acesso to the Inflow Boundary Condition in 1D Domain.
Definition gmpDGFemPhysics.h:96
@ BC_C_Outflow_1D_ID
Id for retrieving the acessor to the Concentration Free Boundary in 1D Domain.
Definition gmpDGFemPhysics.h:97
@ BC_Periodic_ID
Id for retrieving the acessor to the Periodic Boundary Condtion.
Definition gmpDGFemPhysics.h:101
int numShapeFunctions
Number of Shape functions for each element.
Definition gmpDGFemPhysics.h:133
QList< GmVector > SNeighborhood
Set of Element CellId's ... Please see DG Fem Physics Documentation.
Definition gmpDGFemPhysics.h:140
StateVarIds
IDs fo physics state vars.
Definition gmpDGFemPhysics.h:60
@ C_ID
Id for retrieving the acessor to the concentration state var.
Definition gmpDGFemPhysics.h:61
QList< GmVector > TNeighborhood
Set of Element CellId's ... Please see DG Fem Physics Documentation.
Definition gmpDGFemPhysics.h:141
PhysicsAttributeIds
IDs for physics attributes.
Definition gmpDGFemPhysics.h:67
@ Periodic_Bnd_ID
Id for retrieving if there is a Periodic Bnd Condition.
Definition gmpDGFemPhysics.h:75
@ Upwind_ID
Id for retrieving if is Upwind Numerical Flux.
Definition gmpDGFemPhysics.h:71
@ NodsX_ID
Id for retrieving the number of nods in the x direction.
Definition gmpDGFemPhysics.h:68
@ Regular_Mesh_ID
Id for retrieving if is a regular mesh of elements.
Definition gmpDGFemPhysics.h:74
@ Implicit_ID
Id for retrieving if of temporal solver is or not implicit.
Definition gmpDGFemPhysics.h:72
@ Limiter_ID
Id for retrieving if limiter of coefficient is setup.
Definition gmpDGFemPhysics.h:73
@ Couple_ID
Id for retrieving if there a coupled with diffusive physics.
Definition gmpDGFemPhysics.h:76
@ NodsZ_ID
Id for retrieving the number of nods in the z direction.
Definition gmpDGFemPhysics.h:70
@ NodsY_ID
Id for retrieving the number of nods in the y direction.
Definition gmpDGFemPhysics.h:69
double detAffineTransformationMAT
Determinant of Affine Transformation Matrix.
Definition gmpDGFemPhysics.h:134
GaussAttributeIds
IDs for physics Gauss attributes.
Definition gmpDGFemPhysics.h:90
@ V_D_ID
Id for retrieving the Gauss attribute providing the Darcy fluid velocity.
Definition gmpDGFemPhysics.h:91
ElementPropertyIds
Definition gmpDGFemPhysics.h:79
@ PHI_ID
Id for retrieving the acessor to the Porosity Scalar Value Function
Definition gmpDGFemPhysics.h:80
@ R_ID
Id for retrieving the accesor to the Reaction Scalar Value Function.
Definition gmpDGFemPhysics.h:82
@ F_ID
Id for retrieving the acessor to Source/Sink term
Definition gmpDGFemPhysics.h:83
@ A_ID
Id for retrieving the accesor to Analytic Solution
Definition gmpDGFemPhysics.h:85
@ IC_ID
Id for retrieving the accesor to Initial condition.
Definition gmpDGFemPhysics.h:84
@ V_ID
Id for retrieving the acessor to the Velocity Vector Value Function.
Definition gmpDGFemPhysics.h:81
GmMatrix InvAffineTransformationMAT
Inverse of Affine Transformation Matrix used in regular mesh.
Definition gmpDGFemPhysics.h:136
QList< GmVector > FNeighborhood
Set of Element CellId's closest to geometric element E, using the euclidian norm.
Definition gmpDGFemPhysics.h:139
GmMatrix AffineTransformationMAT
Affine Transformation Matrix used in regular mesh.
Definition gmpDGFemPhysics.h:135
arma::mat GmMatrix
arma::vec GmVector
Declaration of useful configuration definitions for the plugin library.