From 1ebe4a3f6b222d8bc7cb7868a0956cefdd088eba Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Jan 2015 14:48:49 +0000 Subject: [PATCH] GetIndex - 0-based --- libsrc/include/nginterface_v2.hpp | 2 +- libsrc/include/nginterface_v2_impl.hpp | 6 ++++++ libsrc/interface/nginterface_v2.cpp | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libsrc/include/nginterface_v2.hpp b/libsrc/include/nginterface_v2.hpp index 0cfb744b..5c5db905 100644 --- a/libsrc/include/nginterface_v2.hpp +++ b/libsrc/include/nginterface_v2.hpp @@ -76,7 +76,7 @@ namespace netgen int index; // material / boundary condition NG_ELEMENT_TYPE GetType() const { return type; } - int GetIndex() const { return index; } + int GetIndex() const { return index-1; } Ng_Points points; // all points Ng_Vertices vertices; Ng_Edges edges; diff --git a/libsrc/include/nginterface_v2_impl.hpp b/libsrc/include/nginterface_v2_impl.hpp index bf34eba3..7495d7bb 100644 --- a/libsrc/include/nginterface_v2_impl.hpp +++ b/libsrc/include/nginterface_v2_impl.hpp @@ -4,6 +4,12 @@ NGX_INLINE DLL_HEADER Ng_Point Ngx_Mesh :: GetPoint (int nr) const } +template <> +NGX_INLINE DLL_HEADER int Ngx_Mesh :: GetElementIndex<0> (int nr) const +{ + return 0; +} + template <> NGX_INLINE DLL_HEADER int Ngx_Mesh :: GetElementIndex<1> (int nr) const { diff --git a/libsrc/interface/nginterface_v2.cpp b/libsrc/interface/nginterface_v2.cpp index 2e191146..b1fcbc87 100644 --- a/libsrc/interface/nginterface_v2.cpp +++ b/libsrc/interface/nginterface_v2.cpp @@ -226,13 +226,14 @@ namespace netgen } */ + + /* template <> DLL_HEADER int Ngx_Mesh :: GetElementIndex<0> (int nr) const { return 0; } - /* template <> DLL_HEADER int Ngx_Mesh :: GetElementIndex<1> (int nr) const {