From 54341e5c5355f61a0b943b6bcaebf90d3cf8afb9 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sun, 19 Jul 2009 17:33:25 +0000 Subject: [PATCH] Netgen/NGSolve interface - Version 2 --- libsrc/include/nginterface_v2.hpp | 3 +++ ng/demoview.hpp | 1 - ng/nginterface_v2.cpp | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/libsrc/include/nginterface_v2.hpp b/libsrc/include/nginterface_v2.hpp index 2f14a882..388496d2 100644 --- a/libsrc/include/nginterface_v2.hpp +++ b/libsrc/include/nginterface_v2.hpp @@ -60,6 +60,9 @@ DLL_HEADER int Ng_GetNElements (); template DLL_HEADER Ng_Element Ng_GetElement (int nr); +template +DLL_HEADER int Ng_GetElementIndex (int nr); + /// Curved Elements: /// xi..... DIM_EL local coordinates diff --git a/ng/demoview.hpp b/ng/demoview.hpp index e00b0420..91ae8fe3 100644 --- a/ng/demoview.hpp +++ b/ng/demoview.hpp @@ -98,7 +98,6 @@ template class InterpolationSpline { protected: - // typedef Vec<3, InterpolationPoint > intpts; // Array < InterpolationPoint[3] > ip; class intpts diff --git a/ng/nginterface_v2.cpp b/ng/nginterface_v2.cpp index 3cd605a3..f1461516 100644 --- a/ng/nginterface_v2.cpp +++ b/ng/nginterface_v2.cpp @@ -154,6 +154,28 @@ template <> DLL_HEADER Ng_Element Ng_GetElement<3> (int nr) } +template <> +DLL_HEADER int Ng_GetElementIndex<1> (int nr) +{ + return (*mesh)[SegmentIndex(nr)].si; +} + +template <> +DLL_HEADER int Ng_GetElementIndex<2> (int nr) +{ + int ind = (*mesh)[SurfaceElementIndex(nr)].GetIndex(); + return mesh->GetFaceDescriptor(ind).BCProperty(); +} + +template <> +DLL_HEADER int Ng_GetElementIndex<3> (int nr) +{ + return (*mesh)[ElementIndex(nr)].GetIndex(); +} + + + + template <> DLL_HEADER void Ng_MultiElementTransformation<3,3> (int elnr, int npts,