From caf7a0dd8d40166bfc287c00a213385e0f7aece1 Mon Sep 17 00:00:00 2001 From: Gauthier Becker <gauthierbecker@gmail.com> Date: Mon, 7 Oct 2013 22:56:48 +0000 Subject: [PATCH] Fix a bug in MHexahedron::getFaceVertices() and overload the isInside() method in MTetrahedron10 and MTetrahedronN to account for the curvature of the element --- Geo/MHexahedron.h | 6 +++--- Geo/MTetrahedron.h | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Geo/MHexahedron.h b/Geo/MHexahedron.h index b128eb2680..d2f460d102 100644 --- a/Geo/MHexahedron.h +++ b/Geo/MHexahedron.h @@ -511,9 +511,9 @@ class MHexahedronN : public MHexahedron { for (int i = 0; i < 4; i++){ for (int j = 0; j < _order - 1; j++) v[count++] = _vs[(_order-1)*f[num][i]+j]; } - for (int i = 0; i < (_order + 1) * (_order + 1); i++){ - int N = _order - 1; - int start = 8 + 12 * N + num * (_order - 1) * (_order - 1); + int N = _order - 1; + int start = 8 + 12 * N + num * (_order - 1) * (_order - 1); + for (int i = 0; i < (_order - 1) * (_order - 1); i++){ v[count++] = _vs[start + i]; } } diff --git a/Geo/MTetrahedron.h b/Geo/MTetrahedron.h index 30dedd4316..8ac0f1e003 100644 --- a/Geo/MTetrahedron.h +++ b/Geo/MTetrahedron.h @@ -128,7 +128,7 @@ class MTetrahedron : public MElement { virtual double getInnerRadius(); virtual double getCircumRadius(); virtual double etaShapeMeasure(); - void xyz2uvw(double xyz[3], double uvw[3]) const; + virtual void xyz2uvw(double xyz[3], double uvw[3]) const; virtual const nodalBasis* getFunctionSpace(int o=-1) const; virtual const JacobianBasis* getJacobianFuncSpace(int o=-1) const; virtual void getNode(int num, double &u, double &v, double &w) const @@ -273,6 +273,10 @@ class MTetrahedron10 : public MTetrahedron { { num < 4 ? MTetrahedron::getNode(num, u, v, w) : MElement::getNode(num, u, v, w); } + void xyz2uvw(double xyz[3], double uvw[3]) const + { + return MElement::xyz2uvw(xyz,uvw); + } }; /* tet order 3 FIXME: check the plot @@ -393,6 +397,10 @@ class MTetrahedronN : public MTetrahedron { { num < 4 ? MTetrahedron::getNode(num, u, v, w) : MElement::getNode(num, u, v, w); } + void xyz2uvw(double xyz[3], double uvw[3]) const + { + return MElement::xyz2uvw(xyz,uvw); + } }; #endif -- GitLab