From 5413493c64337ca740e6f2436e3a352bc0dd8d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Thu, 18 Aug 2016 09:50:11 +0200 Subject: [PATCH] vertex2pointelement ... 0 based --- libsrc/interface/nginterface_v2.cpp | 2 +- libsrc/meshing/topology.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libsrc/interface/nginterface_v2.cpp b/libsrc/interface/nginterface_v2.cpp index a0425c42..92c1bbee 100644 --- a/libsrc/interface/nginterface_v2.cpp +++ b/libsrc/interface/nginterface_v2.cpp @@ -526,7 +526,7 @@ namespace netgen double * x, double * dxdxi) const { - PointIndex pnum = mesh->pointelements[elnr-1].pnum; + PointIndex pnum = mesh->pointelements[elnr].pnum; if (x) x[0] = (*mesh)[pnum](0); // if (dxdxi) dxdxi[0] = 0; // Jacobi-matrix is 1 x 0 !!! diff --git a/libsrc/meshing/topology.cpp b/libsrc/meshing/topology.cpp index 9e393c43..09a619e6 100644 --- a/libsrc/meshing/topology.cpp +++ b/libsrc/meshing/topology.cpp @@ -377,17 +377,17 @@ namespace netgen cnt = 0; - for (int pi = 0; pi < mesh.pointelements.Size(); pi++) + for (int pei = 0; pei < mesh.pointelements.Size(); pei++) { - const Element0d & pointel = mesh.pointelements[pi]; + const Element0d & pointel = mesh.pointelements[pei]; cnt[pointel.pnum]++; } vert2pointelement = new TABLE (cnt); - for (int pi = 0; pi < mesh.pointelements.Size(); pi++) + for (int pei = 0; pei < mesh.pointelements.Size(); pei++) { - const Element0d & pointel = mesh.pointelements[pi]; - vert2pointelement->AddSave (pointel.pnum, pi+1); + const Element0d & pointel = mesh.pointelements[pei]; + vert2pointelement->AddSave (pointel.pnum, pei); }