diff --git a/Geo/MHexahedron.cpp b/Geo/MHexahedron.cpp index 27fa10fb212d19a6f0e508e349e661d55de9d17a..458be4e8253682fbaf1b5e856f26af59af48ba4e 100644 --- a/Geo/MHexahedron.cpp +++ b/Geo/MHexahedron.cpp @@ -411,6 +411,40 @@ int MHexahedronN::getNumFacesRep(bool curved) CTX::instance()->mesh.numSubEdges * 2) : 12; } +int MHexahedron::getNumFacesRep(bool curved) +{ + return 6 * (CTX::instance()->mesh.numSubEdges * + CTX::instance()->mesh.numSubEdges * 2); +} + +void MHexahedron::getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n) +{ +// static const int f[12][3] = { +// {0, 3, 2}, {0, 2, 1}, +// {0, 1, 5}, {0, 5, 4}, +// {0, 4, 7}, {0, 7, 3}, +// {1, 2, 6}, {1, 6, 5}, +// {2, 3, 7}, {2, 7, 6}, +// {4, 5, 6}, {4, 6, 7} +// }; +// _getFaceRep(_v[f[num][0]], _v[f[num][1]], _v[f[num][2]], x, y, z, n); + if (CTX::instance()->mesh.numSubEdges > 1) { + _myGetFaceRep(this, num, x, y, z, n, CTX::instance()->mesh.numSubEdges); + return; + } + static const int f[24][4] = { + {0, 3, 2, 1}, {3, 2, 1, 0}, {2, 1, 0, 3}, {1, 0, 3, 2}, + {0, 1, 5, 4}, {1, 5, 4, 0}, {5, 4, 0, 1}, {4, 0, 1, 5}, + {0, 4, 7, 3}, {4, 7, 3, 0}, {7, 3, 0, 4}, {3, 0, 4, 7}, + {1, 2, 6, 5}, {2, 6, 5, 1}, {6, 5, 1, 2}, {5, 1, 2, 6}, + {2, 3, 7, 6}, {3, 7, 6, 2}, {7, 6, 2, 3}, {6, 2, 3, 7}, + {4, 5, 6, 7}, {5, 6, 7, 4}, {6, 7, 4, 5}, {7, 4, 5, 6} + }; + _getFaceRepQuad(getVertex(f[num][0]), getVertex(f[num][1]), + getVertex(f[num][2]), getVertex(f[num][3]), + x, y, z, n); +} + void _getIndicesReversedHex(int order, indicesReversed &indices) { fullMatrix<double> ref = gmshGenerateMonomialsHexahedron(order); diff --git a/Geo/MHexahedron.h b/Geo/MHexahedron.h index 1ed4c5b5f87105f068003d7702dab1ca47d3cd5d..d65e80ad108d387ccb6bad14c156051c3aba053d 100644 --- a/Geo/MHexahedron.h +++ b/Geo/MHexahedron.h @@ -87,30 +87,8 @@ class MHexahedron : public MElement { virtual double getInnerRadius(); virtual double angleShapeMeasure(); virtual void getFaceInfo(const MFace & face, int &ithFace, int &sign, int &rot) const; - virtual int getNumFacesRep(bool curved){ return 24; } - virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n) - { -// static const int f[12][3] = { -// {0, 3, 2}, {0, 2, 1}, -// {0, 1, 5}, {0, 5, 4}, -// {0, 4, 7}, {0, 7, 3}, -// {1, 2, 6}, {1, 6, 5}, -// {2, 3, 7}, {2, 7, 6}, -// {4, 5, 6}, {4, 6, 7} -// }; -// _getFaceRep(_v[f[num][0]], _v[f[num][1]], _v[f[num][2]], x, y, z, n); - static const int f[24][4] = { - {0, 3, 2, 1}, {3, 2, 1, 0}, {2, 1, 0, 3}, {1, 0, 3, 2}, - {0, 1, 5, 4}, {1, 5, 4, 0}, {5, 4, 0, 1}, {4, 0, 1, 5}, - {0, 4, 7, 3}, {4, 7, 3, 0}, {7, 3, 0, 4}, {3, 0, 4, 7}, - {1, 2, 6, 5}, {2, 6, 5, 1}, {6, 5, 1, 2}, {5, 1, 2, 6}, - {2, 3, 7, 6}, {3, 7, 6, 2}, {7, 6, 2, 3}, {6, 2, 3, 7}, - {4, 5, 6, 7}, {5, 6, 7, 4}, {6, 7, 4, 5}, {7, 4, 5, 6} - }; - _getFaceRepQuad(getVertex(f[num][0]), getVertex(f[num][1]), - getVertex(f[num][2]), getVertex(f[num][3]), - x, y, z, n); - } + virtual int getNumFacesRep(bool curved); + virtual void getFaceRep(bool curved, int num, double *x, double *y, double *z, SVector3 *n); virtual void getFaceVertices(const int num, std::vector<MVertex*> &v) const { v.resize(4);