order elements (for TP)

This commit is contained in:
Joachim Schöberl 2016-05-13 12:06:12 +02:00
parent 0e32696492
commit a53149131e
3 changed files with 22 additions and 0 deletions

View File

@ -587,6 +587,7 @@ namespace netgen
mp.optsteps2d = hsteps;
mesh->Compress();
mesh->OrderElements();
mesh -> SetNextMajorTimeStamp();
mp.Render();

View File

@ -3245,6 +3245,24 @@ namespace netgen
timestamp = NextTimeStamp();
}
void Mesh :: OrderElements()
{
for (auto & el : surfelements)
{
if (el.GetType() == TRIG)
while (el[0] > el[1] || el[0] > el[2])
{ // rotate element
auto hp = el[0];
el[0] = el[1];
el[1] = el[2];
el[2] = hp;
auto hgi = el.GeomInfoPi(1);
el.GeomInfoPi(1) = el.GeomInfoPi(2);
el.GeomInfoPi(2) = el.GeomInfoPi(3);
el.GeomInfoPi(3) = hgi;
}
}
}
int Mesh :: CheckConsistentBoundary () const
{

View File

@ -470,6 +470,9 @@ namespace netgen
*/
DLL_HEADER void Compress ();
/// first vertex has lowest index
void OrderElements();
///
DLL_HEADER void Save (ostream & outfile) const;
///