From 73292485eb2d42d09d6e787dc74daa5dda9573b4 Mon Sep 17 00:00:00 2001 From: Michael Neunteufel Date: Tue, 7 Aug 2018 11:46:00 +0200 Subject: [PATCH] fix for getsurfpoint for 3d surfacegeometries if no volume elements exist --- libsrc/meshing/meshclass.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index bc79a563..905db79e 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -4327,10 +4327,12 @@ namespace netgen elementsearchtree = NULL; int ne = (dimension == 2) ? GetNSE() : GetNE(); - + if (dimension == 3 && !GetNE() && GetNSE()) + ne = GetNSE(); + if (ne) { - if (dimension == 2) + if (dimension == 2 || (dimension == 3 && !GetNE()) ) { Box<3> box (Box<3>::EMPTY_BOX); for (SurfaceElementIndex sei = 0; sei < ne; sei++) @@ -4834,7 +4836,7 @@ namespace netgen const double pointtol = 1e-12; netgen::Point<3> pmin = p - Vec<3> (pointtol, pointtol, pointtol); netgen::Point<3> pmax = p + Vec<3> (pointtol, pointtol, pointtol); - if (dimension == 2) + if (dimension == 2 || (dimension==3 && !GetNE() && GetNSE())) { int ne; int ps_startelement = 0; // disable global buffering @@ -4988,6 +4990,9 @@ namespace netgen //(*testout) << "p " << p << endl; //(*testout) << "velement " << velement << endl; + if (!GetNE() && GetNSE() ) + return velement; + Array faces; topology.GetElementFaces(velement,faces);