anisotrop level possible

This commit is contained in:
Michael Neunteufel 2018-12-06 12:49:38 +01:00
parent 355eed4818
commit d17e6c42bc
2 changed files with 16 additions and 5 deletions

View File

@ -296,7 +296,7 @@ namespace netgen
void (*taskmanager)(function<void(int,int)>) = &DummyTaskManager2,
void (*tracer)(string, bool) = &DummyTracer2);
int GetElementLevel (int ei) const;
int GetHPElementLevel (int ei, int dir) const;
void GetParentNodes (int ni, int * parents) const;
int GetParentElement (int ei) const;

View File

@ -675,9 +675,10 @@ namespace netgen
}
int Ngx_Mesh :: GetElementLevel (int ei) const
int Ngx_Mesh :: GetHPElementLevel (int ei, int dir) const
{
ei++;
int level = -1;
if (mesh->hpelements)
{
@ -687,12 +688,22 @@ namespace netgen
else
hpelnr = mesh->VolumeElement(ei).hp_elnr;
return (*mesh->hpelements)[hpelnr].levelx;
if (hpelnr < 0)
throw NgException("Ngx_Mesh::GetHPElementLevel: Wrong hp-element number!");
if (dir == 1)
level = (*mesh->hpelements)[hpelnr].levelx;
else if (dir == 2)
level = (*mesh->hpelements)[hpelnr].levely;
else if (dir == 3)
level = (*mesh->hpelements)[hpelnr].levelz;
else
throw NgException("Ngx_Mesh::GetHPElementLevel: dir has to be 1, 2 or 3!");
}
//else
// throw NgException("Ngx_Mesh::GetElementLevel only for HPRefinement implemented!");
// throw NgException("Ngx_Mesh::GetHPElementLevel only for HPRefinement implemented!");
return -1;
return level;
}
int Ngx_Mesh :: GetParentElement (int ei) const