From ed4240b9c60bf295a1d6a4631ce99a6bb4094444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Thu, 10 Jan 2019 09:41:42 +0100 Subject: [PATCH 1/4] singular face --- libsrc/csg/python_csg.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libsrc/csg/python_csg.cpp b/libsrc/csg/python_csg.cpp index 0db96e6d..665a7392 100644 --- a/libsrc/csg/python_csg.cpp +++ b/libsrc/csg/python_csg.cpp @@ -469,6 +469,17 @@ However, when r = 0, the top part becomes a point(tip) and meshing fails! self.AddSplineSurface(surf); }), py::arg("SplineSurface")) + .def("SingularFace", [] (CSGeometry & self, shared_ptr sol, shared_ptr surfaces, double factor) + { + int tlonum = -1; + for (int i = 0; i < self.GetNTopLevelObjects(); i++) + if (self.GetTopLevelObject(i)->GetSolid() == sol->GetSolid()) + tlonum = i; + if (tlonum == -1) throw NgException("not a top-level-object"); + if (!surfaces) surfaces = sol; + auto singface = new SingularFace(tlonum, surfaces->GetSolid(), factor); + self.singfaces.Append(singface); + }, py::arg("solid"), py::arg("surfaces")=nullptr, py::arg("factor")=0.25) .def("SingularEdge", [] (CSGeometry & self, shared_ptr s1,shared_ptr s2, double factor) { auto singedge = new SingularEdge(1, -1, self, s1->GetSolid(), s2->GetSolid(), factor); From 96443e890b86a6e76daed48b228c84286dfbb456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Sat, 12 Jan 2019 08:19:57 +0100 Subject: [PATCH 2/4] timers --- libsrc/meshing/bisect.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libsrc/meshing/bisect.cpp b/libsrc/meshing/bisect.cpp index 9edf90d2..d73718be 100644 --- a/libsrc/meshing/bisect.cpp +++ b/libsrc/meshing/bisect.cpp @@ -3398,6 +3398,7 @@ namespace netgen size_t nsel = mtris.Size(); NgProfiler::StartTimer (timer_bisecttrig); + (*opt.tracer)("Bisect trigs", false); for (size_t i = 0; i < nsel; i++) if (mtris[i].marked) { @@ -3440,7 +3441,7 @@ namespace netgen } NgProfiler::StopTimer (timer_bisecttrig); - + (*opt.tracer)("Bisect trigs", true); int nquad = mquads.Size(); for (int i = 1; i <= nquad; i++) From dbb798936365dbef0485f5f9c4bffe50ee3694ce Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Thu, 3 Jan 2019 15:55:17 +0100 Subject: [PATCH 3/4] [gitlab-ci] Fix builds --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 86105bfb..8c466bbe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,8 +14,8 @@ stages: - x64 before_script: - "echo off" - - 'call "%VS140COMNTOOLS%\..\..\VC\bin\amd64\vcvars64.bat"' - - set CMAKE_GENERATOR=Visual Studio 14 2015 Win64 + - 'call "%VS2017INSTALLDIR%\VC\Auxiliary\Build\vcvars64"' + - set CMAKE_GENERATOR=Visual Studio 15 2017 Win64 - set CI_DIR=C:\ci\%CI_PIPELINE_ID% - set NETGEN_BUILD_DIR=%CI_DIR%\build - set INSTALL_DIR=%CI_DIR%\install From 523b8c086c17074b03cd3579b30bec5141d9b4dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Sat, 12 Jan 2019 14:18:56 +0100 Subject: [PATCH 4/4] GetFaceEdges in new mesh-interface (without global ptr) --- libsrc/include/nginterface_v2.hpp | 21 ++++++++++++++++++--- libsrc/interface/nginterface_v2.cpp | 10 ++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/libsrc/include/nginterface_v2.hpp b/libsrc/include/nginterface_v2.hpp index 33a596db..116219b4 100644 --- a/libsrc/include/nginterface_v2.hpp +++ b/libsrc/include/nginterface_v2.hpp @@ -44,6 +44,19 @@ namespace netgen size_t Size() const { return s; } T * Release() { T * hd = data; data = nullptr; return hd; } }; + + template + class Ng_BufferMS + { + size_t s; + T data[S]; + public: + Ng_BufferMS (size_t as) : s(as) { ; } + size_t Size() const { return s; } + T & operator[] (size_t i) { return data[i]; } + T operator[] (size_t i) const { return data[i]; } + }; + class Ng_Element { @@ -185,6 +198,7 @@ namespace netgen int operator[] (size_t i) const { return ptr[i]-POINTINDEX_BASE; } }; + /* class Ng_Edges { public: @@ -194,11 +208,11 @@ namespace netgen size_t Size() const { return ned; } int operator[] (size_t i) const { return ptr[i]-1; } }; - + */ public: Ng_Vertices vertices; - Ng_Edges edges; + // Ng_Edges edges; int surface_el; // -1 if face not on surface }; @@ -282,7 +296,8 @@ namespace netgen template const Ng_Node GetNode (int nr) const; - + + Ng_BufferMS GetFaceEdges (int fnr) const; template int GetNNodes (); diff --git a/libsrc/interface/nginterface_v2.cpp b/libsrc/interface/nginterface_v2.cpp index fee63976..cb7fd673 100644 --- a/libsrc/interface/nginterface_v2.cpp +++ b/libsrc/interface/nginterface_v2.cpp @@ -717,6 +717,16 @@ namespace netgen return mesh->GetIdentifications().GetType(idnr+1); } + Ng_BufferMS Ngx_Mesh::GetFaceEdges (int fnr) const + { + const MeshTopology & topology = mesh->GetTopology(); + ArrayMem ia; + topology.GetFaceEdges (fnr+1, ia); + Ng_BufferMS res(ia.Size()); + for (size_t i = 0; i < ia.Size(); i++) + res[i] = ia[i]-1; + return res; + }