NeoPZ
hdiv2dpaper201504.h
Go to the documentation of this file.
1 //
2 // Hdiv2dPaper201504.cpp
3 // PZ
4 //
5 // Created by Douglas Castro on 18/03/15.
6 //
7 //
8 
9 #ifndef __PZ__hdiv2dpaper201504__
10 #define __PZ__hdiv2dpaper201504__
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 #include "tpzhierarquicalgrid.h"
84 #include "pzfunction.h"
85 
86 #include "pzcondensedcompel.h"
87 #include "pzelementgroup.h"
88 
89 
90 #include <iostream>
91 #include <string>
92 #include <sstream>
93 #include <math.h>
94 
95 using namespace std;
96 using namespace pzshape;
97 
99 
100 private:
101  int fDim;
102 
103  int fmatId;
104 
106  int fneumann;
107 
108  int fbc1;
109  int fbc2;
110  int fbc3;
111  int fbc4;
112 
114 
115  bool ftriang;
116 
117 public:
118 
119  enum ApproximationSpace { EH1, EHDiv, EHDivStar, EHDivStarStar };
120 
121  enum Eltype { EQuad, ETriangle };
122 
124 
126 
127  void Run(ApproximationSpace problem, Eltype element, TPZVec<int> POrderBeginAndEnd, TPZVec<int> ndivinterval, TPZFMatrix< REAL > &errors);
128 
129  void PrintErrors(ApproximationSpace problem, Eltype element, TPZVec<int> POrderBeginAndEnd, TPZVec<int> ndivinterval, TPZVec<REAL> &errors, std::ostream &output);
130 
131 private:
132 
133  /* Geometrical meshes */
134  TPZGeoMesh *GMesh(int dim, bool ftriang, int ndiv);
135 
136  /* Computational meshes */
137  TPZCompMesh *CMeshH1(TPZGeoMesh *gmesh, int pOrder, int dim);
138  TPZCompMesh *CMeshFlux(TPZGeoMesh *gmesh, int pOrder, int dim);
139  TPZCompMesh *CMeshPressure(TPZGeoMesh *gmesh, int pOrder, int dim);
140  TPZCompMesh *CMeshMixed(TPZGeoMesh * gmesh, TPZVec<TPZCompMesh *> meshvec);
141 
142  //Exact Solution
143  static void SolExata(const TPZVec<REAL> &pt, TPZVec<STATE> &solp, TPZFMatrix<STATE> &flux);
144  static void SolExataH1(const TPZVec<REAL> &pt, TPZVec<STATE> &solp, TPZFMatrix<STATE> &flux);
145 
146  //Force function
147  static void Forcing(const TPZVec<REAL> &pt, TPZVec<STATE> &ff);
148  static void ForcingH1(const TPZVec<REAL> &pt, TPZVec<STATE> &ff, TPZFMatrix<STATE> &flux);
149 
150  //Dirichlet B. Conditions
151  static void ForcingBC1D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
152  static void ForcingBC2D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
153  static void ForcingBC3D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
154  static void ForcingBC4D(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
155 
156 
157  void ErrorH1(TPZCompMesh *l2mesh, int p, int ndiv, int pos, TPZFMatrix< REAL > &errors );
158  void ErrorH1(TPZCompMesh *l2mesh, int p, int ndiv, std::ostream &out, int DoFT, int DofCond);
159 
160  void ErrorPrimalDual(TPZCompMesh *l2mesh, TPZCompMesh *hdivmesh, int p, int ndiv, int pos, TPZFMatrix< REAL > &errors);
161 
162  void ErrorPrimalDual(TPZCompMesh *l2mesh, TPZCompMesh *hdivmesh, int p, int ndiv, std::ostream &out, int DoFT, int DofCond);
163 
164  void ChangeExternalOrderConnects(TPZCompMesh *mesh);
165 
166  void SolveSyst(TPZAnalysis &an, TPZCompMesh *fCmesh);
167 
169  {
170  ftriang = true;
171  }
172 
173 
174 };
175 
176 
177 #endif /* defined(__PZ__LaplaceInQuadrilateral__) */
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.
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.