NeoPZ
hdiv3dpaper201504.h
Go to the documentation of this file.
1 //
2 // hdiv3dpaper201504.h
3 // PZ
4 //
5 // Created by Douglas Castro on 22/04/15.
6 //
7 //
8 
9 #ifndef __PZ__hdiv3dpaper201504__
10 #define __PZ__hdiv3dpaper201504__
11 
12 #include "pzgmesh.h"
13 #include "pzcmesh.h"
14 #include "pzcompel.h"
15 #include "pzbndcond.h"
16 #include "TPZInterfaceEl.h"
17 
18 #include "TPZRefPattern.h"
19 #include "tpzgeoelrefpattern.h"
20 #include "TPZRefPatternDataBase.h"
21 #include "TPZRefPatternTools.h"
22 #include "pzgeopoint.h"
23 #include "TPZGeoLinear.h"
24 #include "TPZGeoCube.h"
25 #include "tpztriangle.h"
26 #include "pzgeoquad.h"
27 #include "pzgeoelside.h"
28 #include "tpzgeoblend.h"
29 #include "tpzarc3d.h"
30 #include "pzgeotetrahedra.h"
31 #include "pzgeoelrefless.h"
32 #include "tpzquadraticquad.h"
33 #include "tpzquadraticline.h"
34 #include "TPZQuadSphere.h"
35 #include "TPZTriangleSphere.h"
36 
37 #include "tpzchangeel.h"
38 
39 #include "pzvec.h"
40 #include "pzstack.h"
41 #include "pzfmatrix.h"
42 #include "pzfstrmatrix.h"
44 #include "pzskylstrmatrix.h"
45 #include "TPBSpStructMatrix.h"
46 #include "pzbstrmatrix.h"
47 #include "pzstepsolver.h"
50 
51 #include "pzanalysis.h"
52 
53 #include "pzmultiphysicselement.h"
54 #include "pzmultiphysicscompel.h"
57 
58 #include "pzpoisson3d.h"
59 #include "mixedpoisson.h"
60 #include "TPZReadGIDGrid.h"
61 #include "pzanalysis.h"
62 
63 #include "TPZVTKGeoMesh.h"
64 
65 #include "pzlog.h"
66 
67 //#include "pzhdivfull.h"
68 #include "pzelchdiv.h"
69 
70 #include "pzgeopyramid.h"
71 
72 #include "pznumeric.h"
73 
74 #include "TPZExtendGridDimension.h"
75 #include "pzelchdivbound2.h"
76 #include "pzshapequad.h"
77 #include "pzshapelinear.h"
78 #include "pzshapetriang.h"
79 
80 #include "TPZLagrangeMultiplier.h"
81 #include "pzmatmixedpoisson3d.h"
82 
83 
84 #include "tpzhierarquicalgrid.h"
85 #include "pzfunction.h"
86 
87 #include "pzcondensedcompel.h"
88 #include "pzelementgroup.h"
89 
90 
91 #include <iostream>
92 #include <string>
93 #include <sstream>
94 #include <math.h>
95 
96 using namespace std;
97 using namespace pzshape;
98 
99 
100 
106 private:
107  int fDim;
108 
109  int fmatId;
110 
112  int fneumann ;
113 
114  int fbc0;
115  int fbc1;
116  int fbc2;
117  int fbc3;
118  int fbc4;
119  int fbc5 ;
121 
122  bool fisH1;
123 
124  bool ftetra;
125 
126  bool fprisma;
127 
129 
131  //int tetraedra_2[6][4];
132 
133 public:
134 
135  enum ApproximationSpace { EH1, EHDiv, EHDivStar, EHDivStarStar };
136 
137  enum Eltype { ECub, EPrism, ETetra };
138 
140 
142 
143  void Run(ApproximationSpace problem, Eltype element, TPZVec<int> POrderBeginAndEnd, TPZVec<int> ndivinterval, TPZFMatrix< REAL > &errors);
144 
145  void PrintErrors(ApproximationSpace problem, Eltype element, TPZVec<int> POrderBeginAndEnd, TPZVec<int> ndivinterval, TPZVec<REAL> &errors, std::ostream &output);
146 
147 private:
148 
149  TPZGeoMesh *GMeshWithPrism( int ndiv);
150 
151  TPZGeoMesh *CreateOneCuboWithTetraedrons(int64_t nelem);
152 
153  void GenerateNodes(TPZGeoMesh *gmesh, int64_t nelem);
154 
155  TPZGeoMesh *CreateOneCubo(int nref);
156  TPZGeoMesh *CreateOneQuadraticCube(int nref);
157 
158  /* Malhas computacionais */
159  TPZCompMesh *CMeshH1(TPZGeoMesh *gmesh, int pOrder, int dim);
160  TPZCompMesh *CMeshFlux(TPZGeoMesh *gmesh, int pOrder, int dim);
161  TPZCompMesh *CMeshPressure(TPZGeoMesh *gmesh, int pOrder, int dim);
162  TPZCompMesh *CMeshMixed(TPZGeoMesh * gmesh, TPZVec<TPZCompMesh *> meshvec);
163 
164  //solucao exata
165  static void SolExata(const TPZVec<REAL> &pt, TPZVec<STATE> &solp, TPZFMatrix<STATE> &flux);
166  static void SolExataH1(const TPZVec<REAL> &pt, TPZVec<STATE> &solp, TPZFMatrix<STATE> &flux);
167 
168  //lado direito da equacao
169  static void Forcing(const TPZVec<REAL> &pt, TPZVec<STATE> &ff);
170  static void ForcingH1(const TPZVec<REAL> &pt, TPZVec<STATE> &ff, TPZFMatrix<STATE> &flux);
171 
172  //Para condicao de contorno de Dirichlet
173  static void ForcingBC0D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
174  static void ForcingBC1D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
175  static void ForcingBC2D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
176  static void ForcingBC3D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
177  static void ForcingBC4D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
178  static void ForcingBC5D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
179 
180  //Para condicao de contorno de Neumann
181  static void ForcingBC0N(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
182  static void ForcingBC1N(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
183  static void ForcingBC2N(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
184  static void ForcingBC3N(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
185  static void ForcingBC4N(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
186  static void ForcingBC5N(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
187 
188  void ErrorH1(TPZCompMesh *l2mesh, int p, int ndiv, int pos, TPZFMatrix< REAL > &errors );
189  void ErrorH1(TPZCompMesh *l2mesh, int p, int ndiv, std::ostream &out, int DoFT, int DofCond);
190 
191  void ErrorPrimalDual(TPZCompMesh *l2mesh, TPZCompMesh *hdivmesh, int p, int ndiv, int pos, TPZFMatrix< REAL > &errors);
192 
193  void ErrorPrimalDual(TPZCompMesh *l2mesh, TPZCompMesh *hdivmesh, int p, int ndiv, std::ostream &out, int DoFT, int DofCond);
194 
195  void ChangeExternalOrderConnects(TPZCompMesh *mesh);
196 
197  void SolveSyst(TPZAnalysis &an, TPZCompMesh *fCmesh);
198 
199  bool MyDoubleComparer(REAL a, REAL b)
200  {
201  if (IsZero(a-b)){
202  return true;
203  }
204  else{
205  return false;
206  }
207  }
208 
210  {
211  ftetra = true;
212  }
214  {
215  fprisma = true;
216  }
217  void setH1True()
218  {
219  fisH1 = true;
220  }
221  bool getIsH1(bool &EH1){
222  EH1 = fisH1;
223  return EH1;
224  }
225 
226 
227 };
228 
229 #endif /* defined(__PZ__hdiv3dpaper201504__) */
Contains TPZAnalysis class which implements the sequence of actions to perform a finite element analy...
Contains the TPZChangeEl class. It is a special map.
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
Definition: pzreal.h:668
Contains the TPZParSkylineStructMatrix class which defines parallel structural matrix for skyline mat...
Contains declaration of TPZGeoElSide class which represents an element and its side, and TPZGeoElSideIndex class which represents an TPZGeoElSide index.
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
Contains declaration of TPZGeoElRefLess class which implements the mapping between the master element...
bool MyDoubleComparer(REAL a, REAL b)
void SolExata(const TPZVec< REAL > &pt, TPZVec< STATE > &disp, TPZFMatrix< STATE > &flux)
Definition: main.cpp:514
Contains declaration of TPZCompEl class which defines the interface of a computational element...
Templated vector implementation.
Contains the TPZQuadraticQuad class which defines a quadrilateral geometric element with quadratic ma...
Contains the declaration of the TPZElementGroup class, which implements an computational element whic...
groups all classes dedicated to the computation of shape functions
Definition: pzshapeextend.h:16
TPZFMatrix< int > tetraedra_2
Contains the declaration of the TPZMultiphysicsElement class. This class is abstract.
Contains the TPZReadGIDGrid class which implement the interface between TPZGeoMesh and the files in d...
Contains declaration of TPZCompElHDiv class which implements a generic computational element (HDiv sc...
Contains the TPZMatPoisson3d class.
Contains the TPZTriangle class which defines the topology of a triangle.
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
It has the declaration of the TPZMultiphysicsCompEl class.
Contains the TPZFStructMatrix class which implements Full Structural Matrices.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
Implements the sequence of actions to perform a finite element analysis. Analysis.
Definition: pzanalysis.h:32
Contains the TPZGeoBlend class which implements a blending map from curved boundaries to the interior...
Contains the TPZGeoTetrahedra class which implements the geometry of a tetrahedral element...
Contains the TPZBandStructMatrix class which implements Banded Structural Matrices.
Contains TPZMatrixclass which implements full matrix (using column major representation).
Contains declaration of TPZInterfaceElement class which computes the contribution over an interface b...
Contains the TPZSkylineStructMatrix class which implements SkyLine Structural Matrices.
Contains the declaration of the TPZBuildmultiphysicsMesh class.
Contains the declaration of multiphysic interface class.
Contains declaration of TPZGeoElRefPattern class which implements a generic geometric element which i...
Contains the TPZExtendGridDimension class which generates a three dimensional mesh as an extension of...
Contains the TPZQuadraticLine class which defines a linear geometric element with quadratic map...
Contains declaration of TPZCompMesh class which is a repository for computational elements...
Contains the TPZRefPattern class which defines the topology of the current refinement pattern to a me...
Contains the TPZGeoCube class which implements the geometry of hexahedra element. ...
A simple stack.
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
void Forcing(const TPZVec< REAL > &pt, TPZVec< STATE > &disp)
Definition: main.cpp:508
Contains the TPBSpStructMatrix class which assembles on the pair equations.
Contains the TPZRefPatternDataBase class which defines data base of patterns.
Contains the TPZArc3D class which implements three dimensional arc.
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
Contains declaration of TPZCompElHDivBound2 class which implements a generic computational element (H...
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
Contains TPZStepSolver class which defines step solvers class.
Contains the TPZGeoPyramid class which implements the geometry of pyramid element.
Contains declaration of the TPZNumeric class which implements several methods to calculation.
Contains the TPZVTKGeoMesh class which implements the graphical mesh to VTK environment to geometric ...
Contains the declaration of the TPZCondensedCompEl class, which implements an computational element w...
Contains TPZShapeQuad class which implements the shape functions of a quadrilateral element...
Contains the TPZParFrontStructMatrix class which is a structural matrix with parallel techniques incl...
Contains TPZShapeTriang class which implements the shape functions of a triangular element...
Contains the TPZRefPatternTools class which defines tools of pattern.
bool getIsH1(bool &EH1)