Commit 824bc168 authored by Kirill Terekhov's avatar Kirill Terekhov

Fix node ordering

Corrected pyramid node ordering
Added calculation of node ordering for tetrahedron.
parent fc32ba12
......@@ -1420,13 +1420,13 @@ namespace INMOST
}
ElementArray<Node> base_nodes = quad->getNodes();
if( quad->BackCell() == c )
for(ElementArray<Node>::iterator it = base_nodes.begin(); it != base_nodes.end(); it++)
for(ElementArray<Node>::reverse_iterator it = base_nodes.rbegin(); it != base_nodes.rend(); it++)
{
ret.push_back(*it);
it->SetPrivateMarker(mrk);
}
else
for(ElementArray<Node>::reverse_iterator it = base_nodes.rbegin(); it != base_nodes.rend(); it++)
for(ElementArray<Node>::iterator it = base_nodes.begin(); it != base_nodes.end(); it++)
{
ret.push_back(*it);
it->SetPrivateMarker(mrk);
......@@ -1445,6 +1445,43 @@ namespace INMOST
ReleasePrivateMarker(mrk);
break;
}
/*
3
2
0 1
*/
case Element::Tet:
{
ret.reserve(4);
MarkerType mrk = CreatePrivateMarker();
ElementArray<Face> faces = c->getFaces();
ElementArray<Node> base_nodes = faces[0]->getNodes();
if( faces[0]->BackCell() == c )
for(ElementArray<Node>::reverse_iterator it = base_nodes.rbegin(); it != base_nodes.rend(); it++)
{
ret.push_back(*it);
it->SetPrivateMarker(mrk);
}
else
for(ElementArray<Node>::iterator it = base_nodes.begin(); it != base_nodes.end(); it++)
{
ret.push_back(*it);
it->SetPrivateMarker(mrk);
}
ElementArray<Node> tri_nodes = faces[1]->getNodes();
for(ElementArray<Node>::iterator it = tri_nodes.begin(); it != tri_nodes.end(); it++)
{
if( !it->GetPrivateMarker(mrk) )
{
ret.push_back(*it);
break;
}
}
for(ElementArray<Node>::iterator it = ret.begin(); it != ret.end(); it++)
it->RemPrivateMarker(mrk);
ReleasePrivateMarker(mrk);
break;
}
default: //Tet, MultiPolygon, Polyhedron
{
MarkerType mrk = CreatePrivateMarker();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment