NeoPZ
hdivCurvedJCompAppMath.h
Go to the documentation of this file.
1 //
2 // hdivCurvedJCompAppMath.cpp
3 // PZ
4 //
5 // Created by Douglas Castro on 18/06/15.
6 //
7 //
8 
9 #ifndef __PZ__hdivCurvedJCompAppMath__
10 #define __PZ__hdivCurvedJCompAppMath__
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 #include "tpzquadratictrig.h"
37 
38 #include "tpzchangeel.h"
39 
40 #include "pzvec.h"
41 #include "pzstack.h"
42 #include "pzfmatrix.h"
43 #include "pzfstrmatrix.h"
45 #include "pzskylstrmatrix.h"
46 #include "TPBSpStructMatrix.h"
47 #include "pzbstrmatrix.h"
48 #include "pzstepsolver.h"
51 
52 #include "pzanalysis.h"
53 
54 #include "pzmultiphysicselement.h"
55 #include "pzmultiphysicscompel.h"
58 
59 #include "pzpoisson3d.h"
60 #include "mixedpoisson.h"
61 #include "TPZReadGIDGrid.h"
62 #include "pzanalysis.h"
63 
64 #include "TPZVTKGeoMesh.h"
65 
66 #include "pzlog.h"
67 
68 //#include "pzhdivfull.h"
69 #include "pzelchdiv.h"
70 
71 #include "pzgeopyramid.h"
72 
73 #include "pznumeric.h"
74 
75 #include "TPZExtendGridDimension.h"
76 #include "pzelchdivbound2.h"
77 #include "pzshapequad.h"
78 #include "pzshapelinear.h"
79 #include "pzshapetriang.h"
80 
81 #include "TPZLagrangeMultiplier.h"
82 #include "pzmatmixedpoisson3d.h"
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 
100 
101 private:
102  int fDim;
103 
104  int fmatId;
105 
107  int fneumann;
108 
109  int fbc0;
110  int fbc1;
111  int fbc2;
112  int fbc3;
113  int fbc4;
114  int fbc5;
115 
116  static bool probAtCircle;
117  static bool probAtCylinder;
118  static bool probAtSphere;
119 
121 
122  bool ftriang;
123 
125 
126 public:
127 
128  enum ApproximationSpace { EH1, EHDiv, EHDivStar, EHDivStarStar };
129 
130  enum Eltype { EQuad, ETriang };
131 
132  enum geomDomain {ECircle, ECylinder, ESphere};
133 
136 
138 
139  void Run(geomDomain geodomain, ApproximationSpace problem, Eltype element, TPZVec<int> POrderBeginAndEnd, TPZVec<int> ndivinterval, TPZFMatrix< REAL > &errors);
140 
141  void PrintErrors(geomDomain geodomain, ApproximationSpace problem, Eltype element, TPZVec<int> POrderBeginAndEnd, TPZVec<int> ndivinterval, TPZVec<REAL> &errors, std::ostream &output);
142 
143 private:
144 
145  /* Geometrical meshes */
146  TPZGeoMesh *MakeCircle( int ndiv);
147  TPZManVector<REAL,3> ParametricCircle(REAL radius,REAL theta);
148  TPZManVector<REAL,3> ParametricSphere(REAL radius,REAL phi,REAL theta);
149  TPZGeoMesh *MakeSphereFromQuadrilateral(int dimensao, bool triang, int ndiv);
150  void RotateNode(TPZVec<REAL> &iCoords, REAL CounterClockwiseAngle, int &Axis);
151  TPZGeoMesh *GMeshCilindricalMesh( int ndiv);
152  void RotateGeomesh(TPZGeoMesh *gmesh, REAL CounterClockwiseAngle, int &Axis);
153 
154  /* Computational meshes */
155  TPZCompMesh *CMeshH1(TPZGeoMesh *gmesh, int pOrder, int dim);
156  TPZCompMesh *CMeshFlux(TPZGeoMesh *gmesh, int pOrder, int dim);
157  TPZCompMesh *CMeshPressure(TPZGeoMesh *gmesh, int pOrder, int dim);
158  TPZCompMesh *CMeshMixed(TPZGeoMesh * gmesh, TPZVec<TPZCompMesh *> meshvec);
159  void SetupDisconnectedHdivboud(const int left,const int rigth, TPZCompMesh * cmesh);
160 
161  //Exact Solution
162  static void SolExata(const TPZVec<REAL> &pt, TPZVec<STATE> &solp, TPZFMatrix<STATE> &flux);
163  static void SolExataH1(const TPZVec<REAL> &pt, TPZVec<STATE> &solp, TPZFMatrix<STATE> &flux);
164 
165  //Force function
166  static void Forcing(const TPZVec<REAL> &pt, TPZVec<STATE> &ff);
167  static void ForcingH1(const TPZVec<REAL> &pt, TPZVec<STATE> &ff, TPZFMatrix<STATE> &flux);
168 
169  //Dirichlet B. Conditions
170  static void ForcingBC1D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
171  static void ForcingBC2D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
172  static void ForcingBC3D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
173  static void ForcingBC4D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
174  static void ForcingBC5D(const TPZVec<REAL> &pt, TPZVec<STATE> &solp);
175 
176 
177  void ErrorH1(TPZCompMesh *l2mesh, int p, int ndiv, int pos, TPZFMatrix< REAL > &errors );
178  void ErrorH1(TPZCompMesh *l2mesh, int p, int ndiv, std::ostream &out, int DoFT, int DofCond);
179 
180  void ErrorPrimalDual(TPZCompMesh *l2mesh, TPZCompMesh *hdivmesh, int p, int ndiv, int pos, TPZFMatrix< REAL > &errors);
181 
182  void ErrorPrimalDual(TPZCompMesh *l2mesh, TPZCompMesh *hdivmesh, int p, int ndiv, std::ostream &out, int DoFT, int DofCond);
183 
184  void ChangeExternalOrderConnects(TPZCompMesh *mesh);
185 
186  void SolveSyst(TPZAnalysis &an, TPZCompMesh *fCmesh);
187 
189  {
190  ftriang = true;
191  }
192 
193  void setDimension(geomDomain geodomain)
194  {
195  switch(geodomain){
196  case ECircle:
197  {
198  fDim = 2;
199  }
200  break;
201  case ECylinder:
202  {
203  fDim = 2;
204  }
205  break;
206  case ESphere:
207  {
208  fDim = 3;
209  }
210  break;
211  default:
212  break;
213  }
214 
215 
216  }
217 
218 
219 };
220 
221 
222 #endif /* defined(__PZ__hdivCurvedJCompAppMath__) */
Contains TPZAnalysis class which implements the sequence of actions to perform a finite element analy...
Contains the TPZChangeEl class. It is a special map.
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...
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
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.
void setDimension(geomDomain geodomain)
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. ...
Contains the TPZQuadraticTrig class which defines a triangular geometric element with quadratic map...
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.