From bc836f87ef7a860df3bf2cbb3d0a76176b88acc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Mon, 3 Jun 2019 09:04:33 +0200 Subject: [PATCH] facet curving using GeomInfo, adding overrides --- libsrc/csg/meshsurf.hpp | 18 +++++++++--------- libsrc/meshing/bisect.hpp | 2 +- libsrc/meshing/curvedelems.cpp | 10 ++++++++-- libsrc/occ/occmeshsurf.hpp | 8 ++++---- libsrc/stlgeom/meshstlsurface.hpp | 8 ++++---- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/libsrc/csg/meshsurf.hpp b/libsrc/csg/meshsurf.hpp index 39fb24bb..3d606793 100644 --- a/libsrc/csg/meshsurf.hpp +++ b/libsrc/csg/meshsurf.hpp @@ -51,11 +51,11 @@ namespace netgen MeshOptimize2dSurfaces (const CSGeometry & ageometry); /// - virtual void ProjectPoint (INDEX surfind, Point<3> & p) const; + virtual void ProjectPoint (INDEX surfind, Point<3> & p) const override; /// - virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point<3> & p) const; + virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point<3> & p) const override; /// - virtual void GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const; + virtual void GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const override; }; @@ -72,24 +72,24 @@ namespace netgen int surfi, const PointGeomInfo & gi1, const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const; + Point<3> & newp, PointGeomInfo & newgi) const override; virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, int surfi1, int surfi2, const EdgePointGeomInfo & ap1, const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const; + Point<3> & newp, EdgePointGeomInfo & newgi) const override; virtual Vec<3> GetTangent (const Point<3> & p, int surfi1, int surfi2, - const EdgePointGeomInfo & ap1) const; + const EdgePointGeomInfo & ap1) const override; virtual Vec<3> GetNormal (const Point<3> & p, int surfi1, - const PointGeomInfo & gi) const; + const PointGeomInfo & gi) const override; - virtual void ProjectToSurface (Point<3> & p, int surfi) const; + virtual void ProjectToSurface (Point<3> & p, int surfi) const override; - virtual void ProjectToEdge (Point<3> & p, int surfi1, int surfi2, const EdgePointGeomInfo & egi) const; + virtual void ProjectToEdge (Point<3> & p, int surfi1, int surfi2, const EdgePointGeomInfo & egi) const override; }; diff --git a/libsrc/meshing/bisect.hpp b/libsrc/meshing/bisect.hpp index 3fe0e85f..4fa61a93 100644 --- a/libsrc/meshing/bisect.hpp +++ b/libsrc/meshing/bisect.hpp @@ -72,7 +72,7 @@ public: virtual void ProjectToSurface (Point<3> & p, int surfi) const; - virtual void ProjectToSurface (Point<3> & p, int surfi, const PointGeomInfo & /* gi */) const + virtual void ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & /* gi */) const { ProjectToSurface (p, surfi); } diff --git a/libsrc/meshing/curvedelems.cpp b/libsrc/meshing/curvedelems.cpp index 83c5211f..53c8dc43 100644 --- a/libsrc/meshing/curvedelems.cpp +++ b/libsrc/meshing/curvedelems.cpp @@ -732,6 +732,7 @@ namespace netgen if (mesh.GetDimension() == 3 || rational) { + static Timer tce("curve edges"); RegionTimer reg(tce); Array surfnr(nedges); Array gi0(nedges); Array gi1(nedges); @@ -1206,7 +1207,8 @@ namespace netgen #endif if (mesh.GetDimension() == 3 && working) - { + { + static Timer tcf("curve faces"); RegionTimer reg(tcf); for (int f = 0; f < nfaces; f++) { int facenr = f; @@ -1293,7 +1295,11 @@ namespace netgen Point<3> pp = xa[jj]; // ref -> ProjectToSurface (pp, mesh.GetFaceDescriptor(el.GetIndex()).SurfNr()); - ref -> ProjectToSurface (pp, surfnr[facenr]); + SurfaceElementIndex sei = top.GetFace2SurfaceElement (f+1)-1; + PointGeomInfo gi = mesh[sei].GeomInfoPi(1); + + ref -> ProjectToSurface (pp, surfnr[facenr], gi); + Vec<3> dist = pp-xa[jj]; CalcTrigShape (order1, lami[fnums[1]]-lami[fnums[0]], diff --git a/libsrc/occ/occmeshsurf.hpp b/libsrc/occ/occmeshsurf.hpp index 38172072..37eb230b 100644 --- a/libsrc/occ/occmeshsurf.hpp +++ b/libsrc/occ/occmeshsurf.hpp @@ -182,17 +182,17 @@ public: int surfi, const PointGeomInfo & gi1, const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const; + Point<3> & newp, PointGeomInfo & newgi) const override; virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, int surfi1, int surfi2, const EdgePointGeomInfo & ap1, const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const; + Point<3> & newp, EdgePointGeomInfo & newgi) const override; - virtual void ProjectToSurface (Point<3> & p, int surfi) const; + virtual void ProjectToSurface (Point<3> & p, int surfi) const override; - virtual void ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi) const; + virtual void ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi) const override; }; diff --git a/libsrc/stlgeom/meshstlsurface.hpp b/libsrc/stlgeom/meshstlsurface.hpp index 4e678439..ae0855f9 100644 --- a/libsrc/stlgeom/meshstlsurface.hpp +++ b/libsrc/stlgeom/meshstlsurface.hpp @@ -103,16 +103,16 @@ public: int surfi, const PointGeomInfo & gi1, const PointGeomInfo & gi2, - Point<3> & newp, PointGeomInfo & newgi) const; + Point<3> & newp, PointGeomInfo & newgi) const override; virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint, int surfi1, int surfi2, const EdgePointGeomInfo & ap1, const EdgePointGeomInfo & ap2, - Point<3> & newp, EdgePointGeomInfo & newgi) const; + Point<3> & newp, EdgePointGeomInfo & newgi) const override; - virtual void ProjectToSurface (Point<3> & p, int surfi) const; - virtual void ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi) const; + virtual void ProjectToSurface (Point<3> & p, int surfi) const override; + virtual void ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi) const override; };