element index

This commit is contained in:
Joachim Schoeberl 2014-12-04 12:39:12 +00:00
parent 8f13c6828e
commit b611150ed3
2 changed files with 6 additions and 2 deletions

View File

@ -73,8 +73,10 @@ namespace netgen
public: public:
NG_ELEMENT_TYPE type; NG_ELEMENT_TYPE type;
NG_ELEMENT_TYPE GetType() const { return type; } int index; // material / boundary condition
NG_ELEMENT_TYPE GetType() const { return type; }
int GetIndex() const { return index; }
Ng_Points points; // all points Ng_Points points; // all points
Ng_Vertices vertices; Ng_Vertices vertices;
Ng_Edges edges; Ng_Edges edges;

View File

@ -30,7 +30,7 @@ NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<1> (int nr) const
Ng_Element ret; Ng_Element ret;
ret.type = NG_ELEMENT_TYPE(el.GetType()); ret.type = NG_ELEMENT_TYPE(el.GetType());
ret.index = el.si;
ret.points.num = el.GetNP(); ret.points.num = el.GetNP();
ret.points.ptr = (int*)&(el[0]); ret.points.ptr = (int*)&(el[0]);
@ -53,6 +53,7 @@ NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<2> (int nr) const
Ng_Element ret; Ng_Element ret;
ret.type = NG_ELEMENT_TYPE(el.GetType()); ret.type = NG_ELEMENT_TYPE(el.GetType());
ret.index = mesh->GetFaceDescriptor(el.GetIndex()).BCProperty();
ret.points.num = el.GetNP(); ret.points.num = el.GetNP();
ret.points.ptr = (int*)&el[0]; ret.points.ptr = (int*)&el[0];
@ -75,6 +76,7 @@ NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<3> (int nr) const
Ng_Element ret; Ng_Element ret;
ret.type = NG_ELEMENT_TYPE(el.GetType()); ret.type = NG_ELEMENT_TYPE(el.GetType());
ret.index = el.GetIndex();
ret.points.num = el.GetNP(); ret.points.num = el.GetNP();
ret.points.ptr = (int*)&el[0]; ret.points.ptr = (int*)&el[0];