From ee833ff36260e0c067a50bf0f506f46dd85bf05a Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Fri, 2 Dec 2016 19:00:34 +0100 Subject: [PATCH] add onlySurface to generate only surface mesh --- libsrc/csg/csgeom.cpp | 3 +-- libsrc/csg/genmesh.cpp | 2 ++ libsrc/meshing/meshtype.hpp | 1 + libsrc/meshing/python_mesh.cpp | 6 ++++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libsrc/csg/csgeom.cpp b/libsrc/csg/csgeom.cpp index fb89cd46..61950649 100644 --- a/libsrc/csg/csgeom.cpp +++ b/libsrc/csg/csgeom.cpp @@ -138,8 +138,7 @@ namespace netgen { return CSGGenerateMesh (*this, mesh, mparam, perfstepsstart, perfstepsend); } - - + const Refinement & CSGeometry :: GetRefinement () const { // cout << "get CSGeometry - Refinement" << endl; diff --git a/libsrc/csg/genmesh.cpp b/libsrc/csg/genmesh.cpp index ad67151f..49d671d3 100644 --- a/libsrc/csg/genmesh.cpp +++ b/libsrc/csg/genmesh.cpp @@ -794,6 +794,8 @@ namespace netgen if (multithread.terminate || perfstepsend <= MESHCONST_OPTSURFACE) return TCL_OK; + if(mparam.onlySurface) + return TCL_OK; if (perfstepsstart <= MESHCONST_MESHVOLUME) { diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index b3950237..2b8d816a 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -1112,6 +1112,7 @@ namespace netgen bool check_impossible = 0; int only3D_domain_nr = -1; + bool onlySurface = false; /// int secondorder = 0; diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index c2923dab..6c5d949a 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -591,7 +591,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) .def(py::init<>()) .def("__init__", [](MP *instance, double maxh, bool quad_dominated, int optsteps2d, int optsteps3d, - int only3D_domain) + int only3D_domain, bool onlySurface) { new (instance) MeshingParameters; instance->maxh = maxh; @@ -599,12 +599,14 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) instance->optsteps2d = optsteps2d; instance->optsteps3d = optsteps3d; instance->only3D_domain_nr = only3D_domain; + instance->onlySurface = onlySurface; }, py::arg("maxh")=1000, py::arg("quad_dominated")=false, py::arg("optsteps2d") = 3, py::arg("optsteps3d") = 3, - py::arg("only3D_domain") = 0 + py::arg("only3D_domain") = 0, + py::arg("onlySurface") = false , "create meshing parameters" )