diff --git a/Geo/MElement.h b/Geo/MElement.h index 22133a09f4126df8fc54324d0941f2484d1114e4..0ef83ff58495d2a0ef95507fce82e0bf6adea3a4 100644 --- a/Geo/MElement.h +++ b/Geo/MElement.h @@ -224,6 +224,13 @@ class MElement // get the function space for the jacobian of the element virtual const JacobianBasis* getJacobianFuncSpace(int o=-1) const { return 0; } + // return parametric coordinates (u, v, w) of a vertex + virtual void getNode(int num, double &u, double &v, double &w) + { + u = v = w = 0.; + Msg::Error("Node get not available for this element"); + } + // return the interpolating nodal shape functions evaluated at point // (u,v,w) in parametric coordinates (if order == -1, use the // polynomial order of the element) diff --git a/Geo/MHexahedron.h b/Geo/MHexahedron.h index 118e3c750926c07a8cc6b85da8523cddb39e187a..6b6a33f4159b7b0f3af604e91868a6d58fef8b4f 100644 --- a/Geo/MHexahedron.h +++ b/Geo/MHexahedron.h @@ -166,6 +166,20 @@ class MHexahedron : public MElement { s[7][1] = 0.125 * (1. - u) * (1. + w); s[7][2] = 0.125 * (1. - u) * (1. + v); } + void getNode(int num, double &u, double &v, double &w) + { + switch(num) { + case 0 : u = -1.; v = -1.; w = -1.; break; + case 1 : u = 1.; v = -1.; w = -1.; break; + case 2 : u = 1.; v = 1.; w = -1.; break; + case 3 : u = -1.; v = 1.; w = -1.; break; + case 4 : u = -1.; v = -1.; w = 1.; break; + case 5 : u = 1.; v = -1.; w = 1.; break; + case 6 : u = 1.; v = 1.; w = 1.; break; + case 7 : u = -1.; v = 1.; w = 1.; break; + default: u = 0.; v = 0.; w = 0.; break; + } + } virtual bool isInside(double u, double v, double w) { double tol = _isInsideTolerance; diff --git a/Geo/MLine.h b/Geo/MLine.h index d9dfa89a420db875103a87e370a21e0f9de9b67b..b8b8b63d44b8b6a7ea1e602bcba5c167414a4c4d 100644 --- a/Geo/MLine.h +++ b/Geo/MLine.h @@ -78,6 +78,15 @@ class MLine : public MElement { return false; return true; } + void getNode(int num, double &u, double &v, double &w) + { + v = w = 0.; + switch(num) { + case 0 : u = -1.; break; + case 1 : u = 1.; break; + default: u = 0.; break; + } + } virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts); static void registerBindings(binding *b); }; diff --git a/Geo/MPoint.h b/Geo/MPoint.h index e81eaa95fb9eeb20f0c1bdee51542430dc1e3706..c1722087988050ea2aea00a6d67d84bf34e02900 100644 --- a/Geo/MPoint.h +++ b/Geo/MPoint.h @@ -42,6 +42,10 @@ class MPoint : public MElement { virtual int getTypeForMSH() const { return MSH_PNT; } virtual int getTypeForVTK() const { return 1; } virtual const char *getStringForPOS() const { return "SP"; } + void getNode(int num, double &u, double &v, double &w) + { + u = v = w = 0.; + } virtual void getShapeFunctions(double u, double v, double w, double s[], int o) { s[0] = 1.; diff --git a/Geo/MPrism.h b/Geo/MPrism.h index 4b3713ee09bf0b554b4f263e3e6d8c19007015ab..7f1d4a8e8afac3b57bb0774f4350f5a2e9d73c1b 100644 --- a/Geo/MPrism.h +++ b/Geo/MPrism.h @@ -165,6 +165,18 @@ class MPrism : public MElement { s[5][1] = 0.5 * (1. + w) ; s[5][2] = 0.5 * v ; }*/ + void getNode(int num, double &u, double &v, double &w) + { + switch(num) { + case 0 : u = 0.; v = 0.; w = -1.; break; + case 1 : u = 1.; v = 0.; w = -1.; break; + case 2 : u = 0.; v = 1.; w = -1.; break; + case 3 : u = 0.; v = 0.; w = 1.; break; + case 4 : u = 1.; v = 0.; w = 1.; break; + case 5 : u = 0.; v = 1.; w = 1.; break; + default: u = 0.; v = 0.; w = 0.; break; + } + } virtual bool isInside(double u, double v, double w) { double tol = _isInsideTolerance; diff --git a/Geo/MPyramid.h b/Geo/MPyramid.h index b955baad16b175448bbe8e1948f83539e7590fdb..bd63e67f45b7c9339142f22a761cff19a65984f0 100644 --- a/Geo/MPyramid.h +++ b/Geo/MPyramid.h @@ -170,6 +170,17 @@ class MPyramid : public MElement { s[4][1] = 0.; s[4][2] = 1.; } + void getNode(int num, double &u, double &v, double &w) + { + switch(num) { + case 0 : u = -1.; v = -1.; w = 0.; break; + case 1 : u = 1.; v = -1.; w = 0.; break; + case 2 : u = 1.; v = 1.; w = 0.; break; + case 3 : u = -1.; v = 1.; w = 0.; break; + case 4 : u = 0.; v = 0.; w = 1.; break; + default: u = 0.; v = 0.; w = 0.; break; + } + } virtual bool isInside(double u, double v, double w) { double tol = _isInsideTolerance; diff --git a/Geo/MQuadrangle.h b/Geo/MQuadrangle.h index 8de5e45fcb021fc86e391da9581124751dafa48a..adb67da138855f6412f0666eb54f98f264373fec 100644 --- a/Geo/MQuadrangle.h +++ b/Geo/MQuadrangle.h @@ -123,6 +123,17 @@ void projectInMeanPlane(double *xn, double *yn); virtual const char *getStringForINP() const { return "C2D4"; } virtual const polynomialBasis* getFunctionSpace(int o=-1) const; virtual const JacobianBasis* getJacobianFuncSpace(int o=-1) const; + void getNode(int num, double &u, double &v, double &w) + { + w = 0.; + switch(num) { + case 0 : u = -1.; v = -1.; break; + case 1 : u = 1.; v = -1.; break; + case 2 : u = 1.; v = 1.; break; + case 3 : u = -1.; v = 1.; break; + default: u = 0.; v = 0.; break; + } + } virtual void revert() { MVertex *tmp = _v[1]; _v[1] = _v[3]; _v[3] = tmp; diff --git a/Geo/MTetrahedron.h b/Geo/MTetrahedron.h index 10c6f8df36dc5b8f9c8d05d56a1bd603565b865d..599e44163b95a04e89293f3308cdc31cf815ea22 100644 --- a/Geo/MTetrahedron.h +++ b/Geo/MTetrahedron.h @@ -135,6 +135,16 @@ class MTetrahedron : public MElement { void xyz2uvw(double xyz[3], double uvw[3]); virtual const polynomialBasis* getFunctionSpace(int o=-1) const; virtual const JacobianBasis* getJacobianFuncSpace(int o=-1) const; + void getNode(int num, double &u, double &v, double &w) + { + switch(num) { + case 0 : u = 0.; v = 0.; w = 0.; break; + case 1 : u = 1.; v = 0.; w = 0.; break; + case 2 : u = 0.; v = 1.; w = 0.; break; + case 3 : u = 0.; v = 0.; w = 1.; break; + default: u = 0.; v = 0.; w = 0.; break; + } + } virtual bool isInside(double u, double v, double w) { double tol = _isInsideTolerance; diff --git a/Geo/MTriangle.h b/Geo/MTriangle.h index f749d2933ea0d7f046ede59253edee27727cd151..4dc273298a2d0444e48950d1b2dbaccb87fa559b 100644 --- a/Geo/MTriangle.h +++ b/Geo/MTriangle.h @@ -130,6 +130,16 @@ class MTriangle : public MElement { } virtual const polynomialBasis* getFunctionSpace(int o=-1) const; virtual const JacobianBasis* getJacobianFuncSpace(int o=-1) const; + void getNode(int num, double &u, double &v, double &w) + { + w = 0.; + switch(num) { + case 0 : u = 0.; v = 0.; break; + case 1 : u = 1.; v = 0.; break; + case 2 : u = 0.; v = 1.; break; + default: u = 0.; v = 0.; break; + } + } virtual bool isInside(double u, double v, double w) { double tol = _isInsideTolerance;