Skip to content
Snippets Groups Projects
Commit c6adfc33 authored by Gauthier Becker's avatar Gauthier Becker
Browse files

Fix the MhexahedronN::getFaceVertices() that now returns the nodes of the face...

Fix the MhexahedronN::getFaceVertices() that now returns the nodes of the face (oriented such a way that an MQuadrangleN can be defined from these vertices) 

Fix a typo reported by Martin Hautefeuille 
parent 80039830
No related branches found
No related tags found
No related merge requests found
......@@ -499,20 +499,38 @@ class MHexahedronN : public MHexahedron {
{
v.resize((_order+1)*(_order+1));
MHexahedron::_getFaceVertices(num, v);
// static const int f[6][4] = {
// {0, 3, 2, 1},
// {0, 1, 5, 4},
// {0, 4, 7, 3},
// {1, 2, 6, 5},
// {2, 3, 7, 6},
// {4, 5, 6, 7}
// };
// this is the local edge number indexed from 1. A minus sign is used to indicate that the nodes of the edge must be inverted in order to obtain a MQuandrangleN
static const int f[6][4] = {
{0, 3, 2, 1},
{0, 1, 5, 4},
{0, 4, 7, 3},
{1, 2, 6, 5},
{2, 3, 7, 6},
{4, 5, 6, 7}
{2,-6,-4,-1},
{1,5,-9,-3},
{3,10,-8,-2},
{4,7,-11,-5},
{6,8,-12,-7},
{9,11,12,-10}
};
int count = 4;
for (int i = 0; i < 4; i++){
for (int j = 0; j < _order - 1; j++) v[count++] = _vs[(_order-1)*f[num][i]+j];
if(f[num][i]>0)
{
int edge_num = f[num][i]-1;
for (int j = 0; j < _order - 1; j++) v[count++] = _vs[(_order-1)*edge_num+j];
}
else
{
int edge_num = -f[num][i]-1;
for (int j = _order-2; j > - 1; j--) v[count++] = _vs[(_order-1)*edge_num+j];
}
}
int N = _order - 1;
int start = 8 + 12 * N + num * (_order - 1) * (_order - 1);
int start = 12 * N + num * (_order - 1) * (_order - 1);// -8 as _vs has not the 8 first order nodes
for (int i = 0; i < (_order - 1) * (_order - 1); i++){
v[count++] = _vs[start + i];
}
......
......@@ -574,7 +574,7 @@ namespace netgen
cout << "Edges : " << nnre << " (" << nre << ")" << endl;
cout << "Vertices : " << nnrv << " (" << nrv << ")" << endl;
cout << endl;
cout << "Totol surface area : " << newsurfacecont << " (" << surfacecont << ")" << endl;
cout << "Total surface area : " << newsurfacecont << " (" << surfacecont << ")" << endl;
cout << endl;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment