36 static REAL
fx(REAL x, REAL x0, REAL eps) {
37 REAL a = x*x*(1-x)*(1-x)*
exp(-(x-x0)*(x-x0)/eps);
42 static REAL
dfx(REAL x, REAL x0, REAL eps) {
43 REAL a = 2*x*(1-x)*(1-x)*
exp(-(x-x0)*(x-x0)/eps);
44 REAL b = -2*(1-x)*x*x*
exp(-(x-x0)*(x-x0)/eps);
45 REAL c = -2.*(x-x0)*x*x*(1-x)*(1-x)*
exp(-(x-x0)*(x-x0)/eps)/eps;
51 static REAL
d2fx(REAL x, REAL x0, REAL eps) {
53 REAL result = 2*
pow(M_E,((x - x0)*(-x + x0))/eps)*(1 - x)*(1-x) -
54 8*
pow(M_E,((x - x0)*(-x + x0))/eps)*(1 - x)*x +
55 2*
pow(M_E,((x - x0)*(-x + x0))/eps)*(x*x) -
56 (2*
pow(M_E,((x - x0)*(-x + x0))/eps)*(1 - x)*(1-x)*x*x)/eps +
57 4*
pow(M_E,((x - x0)*(-x + x0))/eps)*(1 - x)*(1-x)*x*
58 (-((x - x0)/eps) + (-x + x0)/eps) -
59 4*
pow(M_E,((x - x0)*(-x + x0))/eps)*(1 - x)*(x*x)*
60 (-((x - x0)/eps) + (-x + x0)/eps) +
61 pow(M_E,((x - x0)*(-x + x0))/eps)*(1 - x)*(1-x)*(x*x)*
62 (-((x - x0)/eps) + (-x + x0)/eps)*(-((x - x0)/eps) + (-x + x0)/eps);
68 REAL v[3] = {
fx(x[0],fX0[0],fEps[0]),
fx(x[1],fX0[1],fEps[1]),
fx(x[2],fX0[2],fEps[2])};
69 func[0] = v[0]*v[1]*v[2];
70 for(
int i=0;i<3;i++) {
71 REAL dvz =
dfx(x[i],fX0[i],fEps[i]);
72 deriv(i,0) = dvz*v[(i+1)%3]*v[(i+2)%3];
82 void Run(
int nsubdivisions,
int geocase,
int POrder,
int MaterialId,std::ostream &out=std::cout);
86 void InterpolationError(
int nsubdivisions,
int geocase,
int MaterialId,std::ostream &out);
TPZGeoMesh * HexahedralMesh(int64_t nelem, int MaterialId)
int AddBoundaryElements(TPZGeoMesh *gmesh)
static REAL d2fx(REAL x, REAL x0, REAL eps)
TPZGeoMesh * TetrahedralMesh(int64_t nelem, int MaterialId)
void CheckConsistency(TPZGeoMesh *mesh)
verify if the faces without neighbour should be orthogonal to the main planes
void LoadInterpolation(TPZCompMesh *cmesh)
static void Exact(const TPZVec< REAL > &x, TPZVec< STATE > &func, TPZFMatrix< STATE > &deriv)
static REAL dfx(REAL x, REAL x0, REAL eps)
void GenerateNodes(TPZGeoMesh *gmesh, int64_t nelem)
void DeformGMesh(TPZGeoMesh &gmesh)
Deform the geometric mesh according to the coordinates of fDeformed.
static TPZManVector< REAL, 3 > fEps
void Run(int nsubdivisions, int geocase, int POrder, int MaterialId, std::ostream &out=std::cout)
TPZGeoMesh * PyramidalAndTetrahedralMesh(int64_t nelem, int MaterialId)
TPZGeoMesh * TetrahedralMeshUsingRefinement(int64_t nelem, int MaterialId)
void InterpolationError(int nsubdivisions, int geocase, int MaterialId, std::ostream &out)
Contains TPZMatrixclass which implements full matrix (using column major representation).
Free store vector implementation.
static TPZManVector< REAL, 3 > fX0
Contains declaration of TPZCompMesh class which is a repository for computational elements...
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
void CreateCondensedElements(TPZCompMesh *cmesh)
void UnwrapElements(TPZCompMesh *cmesh)
This class implements a geometric mesh for the pz environment. Geometry.
Implements computational mesh. Computational Mesh.
TPZCompMesh * GenerateCompMesh(TPZGeoMesh *gmesh)
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ exp
static REAL fx(REAL x, REAL x0, REAL eps)