From 9c151ce2744dbec13e34504a36264315b55e8af4 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Fri, 19 Oct 2012 08:46:46 +0000 Subject: [PATCH] thread save geometry check --- libsrc/gprim/geomtest3d.cpp | 13 +++++++++---- libsrc/meshing/msghandler.cpp | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libsrc/gprim/geomtest3d.cpp b/libsrc/gprim/geomtest3d.cpp index bb4000b3..5036d2a7 100644 --- a/libsrc/gprim/geomtest3d.cpp +++ b/libsrc/gprim/geomtest3d.cpp @@ -6,6 +6,7 @@ namespace netgen { + int IntersectTriangleLine (const Point<3> ** tri, const Point<3> ** line) { @@ -14,8 +15,10 @@ IntersectTriangleLine (const Point<3> ** tri, const Point<3> ** line) Vec3d vt2(*tri[0], *tri[2]); Vec3d vrs(*tri[0], *line[0]); - static DenseMatrix a(3), ainv(3); - static Vector rs(3), lami(3); + // static DenseMatrix a(3), ainv(3); + // static Vector rs(3), lami(3); + Mat<3,3> a, ainv; + Vec<3> rs, lami; int i; /* @@ -31,7 +34,8 @@ IntersectTriangleLine (const Point<3> ** tri, const Point<3> ** line) rs(i) = vrs.X(i+1); } - double det = a.Det(); + // double det = a.Det(); + double det = Det(a); double arel = vl.Length() * vt1.Length() * vt2.Length(); /* @@ -64,7 +68,8 @@ IntersectTriangleLine (const Point<3> ** tri, const Point<3> ** line) } CalcInverse (a, ainv); - ainv.Mult (rs, lami); + // ainv.Mult (rs, lami); + lami = ainv * rs; // (*testout) << "lami = " << lami << endl; diff --git a/libsrc/meshing/msghandler.cpp b/libsrc/meshing/msghandler.cpp index e2818858..20393c78 100644 --- a/libsrc/meshing/msghandler.cpp +++ b/libsrc/meshing/msghandler.cpp @@ -151,7 +151,8 @@ void PopStatus() if (msgstatus_stack.Size()) { if (msgstatus_stack.Size() > 1) - SetStatMsg (*msgstatus_stack.Last()); + // SetStatMsg (*msgstatus_stack.Last()); + SetStatMsg (*msgstatus_stack[msgstatus_stack.Size()-2]); else SetStatMsg (""); delete msgstatus_stack.Last();