From 996d2809c9253b0ab660d78ea2b63e06548fa166 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Feb 2024 09:21:09 +0100 Subject: [PATCH 01/20] no windows specfic includes globally --- libsrc/include/mystdlib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libsrc/include/mystdlib.h b/libsrc/include/mystdlib.h index f79e0ad2..71843a72 100644 --- a/libsrc/include/mystdlib.h +++ b/libsrc/include/mystdlib.h @@ -49,7 +49,7 @@ namespace metis { extern "C" { #define M_PI 3.14159265358979323846 #endif - +#ifdef TESTWITHOUTWIN /*** Windows headers ***/ #ifdef _MSC_VER # define WIN32_LEAN_AND_MEAN @@ -67,6 +67,7 @@ namespace metis { extern "C" { #else // Not using MC VC++ +#endif #endif From 97709fca23a52fa9f506d81d015fa6bff35cea22 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Feb 2024 09:46:53 +0100 Subject: [PATCH 02/20] windows include in python_occ_shapes --- libsrc/occ/python_occ_shapes.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 9c50261c..e1266119 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -1,6 +1,23 @@ #ifdef NG_PYTHON #ifdef OCCGEOMETRY +// for testing: copied from mystdlib.h +#ifdef _MSC_VER +# define WIN32_LEAN_AND_MEAN +# ifndef NO_PARALLEL_THREADS +# ifdef MSVC_EXPRESS +# else +# include +# include +# endif // MSVC_EXPRESS +# endif +# include +# undef WIN32_LEAN_AND_MEAN +# include +#else // Not using MC VC++ +#endif + + #include #include From beed254a7d148f23aa9da7e4880a7e849aa03328 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Feb 2024 09:51:19 +0100 Subject: [PATCH 03/20] windows include in python_occ --- libsrc/occ/python_occ.cpp | 19 +++++++++++++++++++ libsrc/occ/python_occ_basic.cpp | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/libsrc/occ/python_occ.cpp b/libsrc/occ/python_occ.cpp index 48089571..b2370a79 100644 --- a/libsrc/occ/python_occ.cpp +++ b/libsrc/occ/python_occ.cpp @@ -1,6 +1,25 @@ #ifdef NG_PYTHON #ifdef OCCGEOMETRY + +// for testing: copied from mystdlib.h +#ifdef _MSC_VER +# define WIN32_LEAN_AND_MEAN +# ifndef NO_PARALLEL_THREADS +# ifdef MSVC_EXPRESS +# else +# include +# include +# endif // MSVC_EXPRESS +# endif +# include +# undef WIN32_LEAN_AND_MEAN +# include +#else // Not using MC VC++ +#endif + + + #include #include diff --git a/libsrc/occ/python_occ_basic.cpp b/libsrc/occ/python_occ_basic.cpp index d84e78d1..48a9b723 100644 --- a/libsrc/occ/python_occ_basic.cpp +++ b/libsrc/occ/python_occ_basic.cpp @@ -1,6 +1,23 @@ #ifdef NG_PYTHON #ifdef OCCGEOMETRY + +// for testing: copied from mystdlib.h +#ifdef _MSC_VER +# define WIN32_LEAN_AND_MEAN +# ifndef NO_PARALLEL_THREADS +# ifdef MSVC_EXPRESS +# else +# include +# include +# endif // MSVC_EXPRESS +# endif +# include +# undef WIN32_LEAN_AND_MEAN +# include +#else // Not using MC VC++ +#endif + #include #include #include From df7ea2b685120d8647635b11ecd6fb33008685bc Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Feb 2024 09:55:16 +0100 Subject: [PATCH 04/20] don't globally include ngcore --- libsrc/general/ngpython.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/general/ngpython.hpp b/libsrc/general/ngpython.hpp index ef02d19f..d455f2df 100644 --- a/libsrc/general/ngpython.hpp +++ b/libsrc/general/ngpython.hpp @@ -8,7 +8,7 @@ #include #include -using namespace ngcore; +// using namespace ngcore; template py::array MoveToNumpy(std::vector& vec) From 7d45d47260a8697f7f470814322022a6018eeb92 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Feb 2024 09:57:37 +0100 Subject: [PATCH 05/20] no extra win include --- libsrc/occ/python_occ.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/libsrc/occ/python_occ.cpp b/libsrc/occ/python_occ.cpp index b2370a79..8f95f0e2 100644 --- a/libsrc/occ/python_occ.cpp +++ b/libsrc/occ/python_occ.cpp @@ -2,24 +2,6 @@ #ifdef OCCGEOMETRY -// for testing: copied from mystdlib.h -#ifdef _MSC_VER -# define WIN32_LEAN_AND_MEAN -# ifndef NO_PARALLEL_THREADS -# ifdef MSVC_EXPRESS -# else -# include -# include -# endif // MSVC_EXPRESS -# endif -# include -# undef WIN32_LEAN_AND_MEAN -# include -#else // Not using MC VC++ -#endif - - - #include #include From 61f34fc4ad5b579702624b4430622ad82c9fd18f Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Feb 2024 10:02:55 +0100 Subject: [PATCH 06/20] converting back: no win include in python-occ --- libsrc/occ/python_occ_basic.cpp | 17 ----------------- libsrc/occ/python_occ_shapes.cpp | 17 ----------------- 2 files changed, 34 deletions(-) diff --git a/libsrc/occ/python_occ_basic.cpp b/libsrc/occ/python_occ_basic.cpp index 48a9b723..d84e78d1 100644 --- a/libsrc/occ/python_occ_basic.cpp +++ b/libsrc/occ/python_occ_basic.cpp @@ -1,23 +1,6 @@ #ifdef NG_PYTHON #ifdef OCCGEOMETRY - -// for testing: copied from mystdlib.h -#ifdef _MSC_VER -# define WIN32_LEAN_AND_MEAN -# ifndef NO_PARALLEL_THREADS -# ifdef MSVC_EXPRESS -# else -# include -# include -# endif // MSVC_EXPRESS -# endif -# include -# undef WIN32_LEAN_AND_MEAN -# include -#else // Not using MC VC++ -#endif - #include #include #include diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index e1266119..9c50261c 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -1,23 +1,6 @@ #ifdef NG_PYTHON #ifdef OCCGEOMETRY -// for testing: copied from mystdlib.h -#ifdef _MSC_VER -# define WIN32_LEAN_AND_MEAN -# ifndef NO_PARALLEL_THREADS -# ifdef MSVC_EXPRESS -# else -# include -# include -# endif // MSVC_EXPRESS -# endif -# include -# undef WIN32_LEAN_AND_MEAN -# include -#else // Not using MC VC++ -#endif - - #include #include From 6622829e8fa8cb436cac67e01f1efa7ba9bf14d5 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Feb 2024 10:05:00 +0100 Subject: [PATCH 07/20] windows include in visual --- libsrc/visualization/visual.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libsrc/visualization/visual.hpp b/libsrc/visualization/visual.hpp index 94dcf87d..5bcaa840 100644 --- a/libsrc/visualization/visual.hpp +++ b/libsrc/visualization/visual.hpp @@ -17,6 +17,27 @@ Visualization // #define PARALLELGL // #endif +/*** Windows headers ***/ +#ifdef _MSC_VER +# define WIN32_LEAN_AND_MEAN +# ifndef NO_PARALLEL_THREADS +# ifdef MSVC_EXPRESS +# else +# include +# include +# endif // MSVC_EXPRESS +# endif +# include +# undef WIN32_LEAN_AND_MEAN +# include + +#else // Not using MC VC++ + + +#endif + + + #include "visual_api.hpp" #include "../include/incopengl.hpp" From e8a9131b3128fdcd1e12577f112ecdd2d1cd74b0 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Feb 2024 10:09:29 +0100 Subject: [PATCH 08/20] include win first --- libsrc/visualization/visual.hpp | 18 ------------------ libsrc/visualization/visualpkg.cpp | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/libsrc/visualization/visual.hpp b/libsrc/visualization/visual.hpp index 5bcaa840..032838ca 100644 --- a/libsrc/visualization/visual.hpp +++ b/libsrc/visualization/visual.hpp @@ -17,24 +17,6 @@ Visualization // #define PARALLELGL // #endif -/*** Windows headers ***/ -#ifdef _MSC_VER -# define WIN32_LEAN_AND_MEAN -# ifndef NO_PARALLEL_THREADS -# ifdef MSVC_EXPRESS -# else -# include -# include -# endif // MSVC_EXPRESS -# endif -# include -# undef WIN32_LEAN_AND_MEAN -# include - -#else // Not using MC VC++ - - -#endif diff --git a/libsrc/visualization/visualpkg.cpp b/libsrc/visualization/visualpkg.cpp index 11881159..623c1638 100644 --- a/libsrc/visualization/visualpkg.cpp +++ b/libsrc/visualization/visualpkg.cpp @@ -1,3 +1,23 @@ +/*** Windows headers ***/ +#ifdef _MSC_VER +# define WIN32_LEAN_AND_MEAN +# ifndef NO_PARALLEL_THREADS +# ifdef MSVC_EXPRESS +# else +# include +# include +# endif // MSVC_EXPRESS +# endif +# include +# undef WIN32_LEAN_AND_MEAN +# include + +#else // Not using MC VC++ + + +#endif + + #include // #include #include From 3a2e3fa901e1046a1069644b2c270d9b2d4f603d Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Feb 2024 10:15:11 +0100 Subject: [PATCH 09/20] includes in vsocc --- libsrc/occ/vsocc.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libsrc/occ/vsocc.cpp b/libsrc/occ/vsocc.cpp index d4631da7..d76395c1 100644 --- a/libsrc/occ/vsocc.cpp +++ b/libsrc/occ/vsocc.cpp @@ -2,6 +2,23 @@ #ifdef OCCGEOMETRY + +/*** Windows headers ***/ +#ifdef _MSC_VER +# define WIN32_LEAN_AND_MEAN +# ifndef NO_PARALLEL_THREADS +# ifdef MSVC_EXPRESS +# else +# include +# include +# endif // MSVC_EXPRESS +# endif +# include +# undef WIN32_LEAN_AND_MEAN +# include +#else // Not using MC VC++ +#endif + #include #include #include From e9ee45024c37975a1eb0f48b87757ada1edeb557 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Feb 2024 20:52:45 +0100 Subject: [PATCH 10/20] include windows.h back to mystdlib --- libsrc/include/mystdlib.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libsrc/include/mystdlib.h b/libsrc/include/mystdlib.h index 71843a72..a538b6da 100644 --- a/libsrc/include/mystdlib.h +++ b/libsrc/include/mystdlib.h @@ -49,7 +49,6 @@ namespace metis { extern "C" { #define M_PI 3.14159265358979323846 #endif -#ifdef TESTWITHOUTWIN /*** Windows headers ***/ #ifdef _MSC_VER # define WIN32_LEAN_AND_MEAN @@ -63,11 +62,7 @@ namespace metis { extern "C" { # include # undef WIN32_LEAN_AND_MEAN # include - #else // Not using MC VC++ - - -#endif #endif From 97de13cf303623fb919fd2e5cd60ce8819122dbc Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sat, 10 Feb 2024 20:55:45 +0100 Subject: [PATCH 11/20] remove include from cpp-files --- libsrc/occ/vsocc.cpp | 16 ---------------- libsrc/visualization/visualpkg.cpp | 20 -------------------- 2 files changed, 36 deletions(-) diff --git a/libsrc/occ/vsocc.cpp b/libsrc/occ/vsocc.cpp index d76395c1..d3b84092 100644 --- a/libsrc/occ/vsocc.cpp +++ b/libsrc/occ/vsocc.cpp @@ -3,22 +3,6 @@ #ifdef OCCGEOMETRY -/*** Windows headers ***/ -#ifdef _MSC_VER -# define WIN32_LEAN_AND_MEAN -# ifndef NO_PARALLEL_THREADS -# ifdef MSVC_EXPRESS -# else -# include -# include -# endif // MSVC_EXPRESS -# endif -# include -# undef WIN32_LEAN_AND_MEAN -# include -#else // Not using MC VC++ -#endif - #include #include #include diff --git a/libsrc/visualization/visualpkg.cpp b/libsrc/visualization/visualpkg.cpp index 623c1638..11881159 100644 --- a/libsrc/visualization/visualpkg.cpp +++ b/libsrc/visualization/visualpkg.cpp @@ -1,23 +1,3 @@ -/*** Windows headers ***/ -#ifdef _MSC_VER -# define WIN32_LEAN_AND_MEAN -# ifndef NO_PARALLEL_THREADS -# ifdef MSVC_EXPRESS -# else -# include -# include -# endif // MSVC_EXPRESS -# endif -# include -# undef WIN32_LEAN_AND_MEAN -# include - -#else // Not using MC VC++ - - -#endif - - #include // #include #include From b88535621f352158967293b8fae941f9ffccba47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sch=C3=B6berl=2C=20Joachim?= Date: Sun, 11 Feb 2024 11:02:18 +0100 Subject: [PATCH 12/20] Removewinheader --- libsrc/general/gzstream.cpp | 6 +++--- libsrc/general/gzstream.h | 14 +++++++------- libsrc/general/myadt.hpp | 1 - libsrc/general/parthreads.hpp | 8 ++++---- libsrc/general/template.hpp | 2 +- libsrc/include/incopengl.hpp | 1 + libsrc/include/mystdlib.h | 13 +++++++++---- libsrc/meshing/meshing.hpp | 8 ++++++++ libsrc/stlgeom/stlpkg.cpp | 5 +++++ libsrc/visualization/visual.hpp | 7 ------- libsrc/visualization/visualpkg.cpp | 3 +-- ng/gui.cpp | 7 ++++++- ng/ngappinit.cpp | 5 +++++ 13 files changed, 50 insertions(+), 30 deletions(-) diff --git a/libsrc/general/gzstream.cpp b/libsrc/general/gzstream.cpp index 49003377..968c07f9 100644 --- a/libsrc/general/gzstream.cpp +++ b/libsrc/general/gzstream.cpp @@ -44,7 +44,7 @@ namespace GZSTREAM_NAMESPACE { // class gzstreambuf: // -------------------------------------- -gzstreambuf* gzstreambuf::open( const filesystem::path & name, int open_mode) { + gzstreambuf* gzstreambuf::open( const std::filesystem::path & name, int open_mode) { if ( is_open()) return (gzstreambuf*)0; mode = open_mode; @@ -143,7 +143,7 @@ int gzstreambuf::sync() { // class gzstreambase: // -------------------------------------- -gzstreambase::gzstreambase( const filesystem::path & name, int mode) { + gzstreambase::gzstreambase( const std::filesystem::path & name, int mode) { init( &buf); open( name.c_str(), mode); } @@ -152,7 +152,7 @@ gzstreambase::~gzstreambase() { buf.close(); } -void gzstreambase::open( const filesystem::path & name, int open_mode) { + void gzstreambase::open( const std::filesystem::path & name, int open_mode) { if ( ! buf.open( name.c_str(), open_mode)) clear( rdstate() | std::ios::badbit); } diff --git a/libsrc/general/gzstream.h b/libsrc/general/gzstream.h index 7528b5f0..20a77795 100644 --- a/libsrc/general/gzstream.h +++ b/libsrc/general/gzstream.h @@ -62,7 +62,7 @@ public: // ASSERT: both input & output capabilities will not be used together } int is_open() { return opened; } - gzstreambuf* open( const filesystem::path & name, int open_mode); + gzstreambuf* open( const std::filesystem::path & name, int open_mode); gzstreambuf* close(); ~gzstreambuf() { close(); } @@ -76,9 +76,9 @@ protected: gzstreambuf buf; public: gzstreambase() { init(&buf); } - gzstreambase( const filesystem::path & name, int open_mode); + gzstreambase( const std::filesystem::path & name, int open_mode); ~gzstreambase(); - void open( const filesystem::path & name, int open_mode); + void open( const std::filesystem::path & name, int open_mode); void close(); gzstreambuf* rdbuf() { return &buf; } }; @@ -92,10 +92,10 @@ public: class DLL_HEADER igzstream : public gzstreambase, public std::istream { public: igzstream() : std::istream( &buf) {} - igzstream( const filesystem::path & name, int open_mode = std::ios::in) + igzstream( const std::filesystem::path & name, int open_mode = std::ios::in) : gzstreambase( name, open_mode), std::istream( &buf) {} gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); } - void open( const filesystem::path & name, int open_mode = std::ios::in) { + void open( const std::filesystem::path & name, int open_mode = std::ios::in) { gzstreambase::open( name, open_mode); } }; @@ -103,10 +103,10 @@ public: class DLL_HEADER ogzstream : public gzstreambase, public std::ostream { public: ogzstream() : std::ostream( &buf) {} - ogzstream( const filesystem::path & name, int mode = std::ios::out) + ogzstream( const std::filesystem::path & name, int mode = std::ios::out) : gzstreambase( name, mode), std::ostream( &buf) {} gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); } - void open( const filesystem::path & name, int open_mode = std::ios::out) { + void open( const std::filesystem::path & name, int open_mode = std::ios::out) { gzstreambase::open( name, open_mode); } }; diff --git a/libsrc/general/myadt.hpp b/libsrc/general/myadt.hpp index 56f65ab2..1c26d02b 100644 --- a/libsrc/general/myadt.hpp +++ b/libsrc/general/myadt.hpp @@ -45,5 +45,4 @@ namespace netgen // #include "mpi_interface.hpp" #include "netgenout.hpp" - #endif diff --git a/libsrc/general/parthreads.hpp b/libsrc/general/parthreads.hpp index d7f42a4a..52b3208d 100644 --- a/libsrc/general/parthreads.hpp +++ b/libsrc/general/parthreads.hpp @@ -77,8 +77,8 @@ public: template void ParallelFor( int first, int next, const TFunc & f ) { - int nthreads = thread::hardware_concurrency(); - thread * threads = new thread[nthreads]; + int nthreads = std::thread::hardware_concurrency(); + std::thread * threads = new std::thread[nthreads]; for (int i=0; i); - typedef void (*NgTracer)(string, bool); // false .. start, true .. stop + typedef void (*NgTracer)(std::string, bool); // false .. start, true .. stop inline void DummyTaskManager (std::function func) { @@ -105,7 +105,7 @@ void ParallelFor( int first, int next, const TFunc & f ) func(1,2); } - inline void DummyTracer (string, bool) { ; } + inline void DummyTracer (std::string, bool) { ; } template inline void ParallelFor (NgTaskManager tm, size_t n, FUNC func) diff --git a/libsrc/general/template.hpp b/libsrc/general/template.hpp index ccb35ab7..5f2b41d7 100644 --- a/libsrc/general/template.hpp +++ b/libsrc/general/template.hpp @@ -16,7 +16,7 @@ namespace netgen templates, global types, defines and variables */ -DLL_HEADER extern const string netgen_version; + DLL_HEADER extern const std::string netgen_version; /// The following value may be adapted to the hardware ! #ifndef CLOCKS_PER_SEC diff --git a/libsrc/include/incopengl.hpp b/libsrc/include/incopengl.hpp index 1f42f12f..7b07cf6f 100644 --- a/libsrc/include/incopengl.hpp +++ b/libsrc/include/incopengl.hpp @@ -5,6 +5,7 @@ #include #include + # ifdef __APPLE__ #define GL_SILENCE_DEPRECATION #define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED diff --git a/libsrc/include/mystdlib.h b/libsrc/include/mystdlib.h index a538b6da..5b495edd 100644 --- a/libsrc/include/mystdlib.h +++ b/libsrc/include/mystdlib.h @@ -55,18 +55,23 @@ namespace metis { extern "C" { # ifndef NO_PARALLEL_THREADS # ifdef MSVC_EXPRESS # else -# include -# include +// # include +// # include # endif // MSVC_EXPRESS # endif # include # undef WIN32_LEAN_AND_MEAN -# include +// # include #else // Not using MC VC++ #endif -using namespace std; +// using namespace std; +namespace netgen +{ + using namespace std; +} + #endif diff --git a/libsrc/meshing/meshing.hpp b/libsrc/meshing/meshing.hpp index 48dc76f2..12129cbb 100644 --- a/libsrc/meshing/meshing.hpp +++ b/libsrc/meshing/meshing.hpp @@ -9,6 +9,12 @@ #include "../include/opti.hpp" +/*** Windows headers ***/ +#ifdef _MSC_VER +# define WIN32_LEAN_AND_MEAN +# include +# undef WIN32_LEAN_AND_MEAN +#endif namespace netgen { @@ -62,4 +68,6 @@ namespace netgen #include "paralleltop.hpp" + + #endif diff --git a/libsrc/stlgeom/stlpkg.cpp b/libsrc/stlgeom/stlpkg.cpp index 6ca94118..7dc7b3ab 100644 --- a/libsrc/stlgeom/stlpkg.cpp +++ b/libsrc/stlgeom/stlpkg.cpp @@ -1,4 +1,5 @@ #include + #include #include #include @@ -6,7 +7,11 @@ #include + #include + + + #include #include diff --git a/libsrc/visualization/visual.hpp b/libsrc/visualization/visual.hpp index 032838ca..83425fa4 100644 --- a/libsrc/visualization/visual.hpp +++ b/libsrc/visualization/visual.hpp @@ -13,13 +13,6 @@ Visualization */ -// #ifdef PARALLEL -// #define PARALLELGL -// #endif - - - - #include "visual_api.hpp" #include "../include/incopengl.hpp" diff --git a/libsrc/visualization/visualpkg.cpp b/libsrc/visualization/visualpkg.cpp index 11881159..21d4668e 100644 --- a/libsrc/visualization/visualpkg.cpp +++ b/libsrc/visualization/visualpkg.cpp @@ -1,6 +1,5 @@ #include // #include -#include #include @@ -8,7 +7,7 @@ #include #include - +#include // #include #include diff --git a/ng/gui.cpp b/ng/gui.cpp index 88927aad..8b702376 100644 --- a/ng/gui.cpp +++ b/ng/gui.cpp @@ -1,8 +1,13 @@ #include -#include #include +#include #include +using std::string; +using std::endl; +using std::cout; +using std::cerr; + namespace netgen { NGCORE_API_EXPORT Flags parameters; diff --git a/ng/ngappinit.cpp b/ng/ngappinit.cpp index 5fa8c248..92b05a6f 100644 --- a/ng/ngappinit.cpp +++ b/ng/ngappinit.cpp @@ -33,6 +33,11 @@ using netgen::verbose; using netgen::NgArray; using netgen::RegisterUserFormats; +using std::string; +using std::endl; +using std::cout; +using std::cerr; +using std::ofstream; From c87aea14eb2b00fff331ec348205e50f2deed892 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Mon, 12 Feb 2024 07:36:15 +0100 Subject: [PATCH 13/20] rename INT to IVec (avoiding windows name conflict) --- libsrc/core/hashtable.hpp | 106 ++++++++++++++--------------- libsrc/geom2d/csg2d.cpp | 6 +- libsrc/meshing/delaunay.cpp | 6 +- libsrc/meshing/delaunay2d.cpp | 20 +++--- libsrc/meshing/delaunay2d.hpp | 5 +- libsrc/meshing/topology.cpp | 117 ++++++++++++++++---------------- libsrc/visualization/mvdraw.hpp | 2 +- libsrc/visualization/vsmesh.cpp | 4 +- 8 files changed, 131 insertions(+), 135 deletions(-) diff --git a/libsrc/core/hashtable.hpp b/libsrc/core/hashtable.hpp index 8ef05200..4ba73451 100644 --- a/libsrc/core/hashtable.hpp +++ b/libsrc/core/hashtable.hpp @@ -41,39 +41,39 @@ namespace ngcore /// N integers template - class INT + class IVec { /// data T i[(N>0)?N:1]; public: /// - NETGEN_INLINE INT () { } + NETGEN_INLINE IVec () { } /// init all - NETGEN_INLINE INT (T ai1) + NETGEN_INLINE IVec (T ai1) { for (int j = 0; j < N; j++) { i[j] = ai1; } } /// init i[0], i[1] - constexpr NETGEN_INLINE INT (T ai1, T ai2) + constexpr NETGEN_INLINE IVec (T ai1, T ai2) : i{ai1, ai2} { ; } /// init i[0], i[1], i[2] - constexpr NETGEN_INLINE INT (T ai1, T ai2, T ai3) + constexpr NETGEN_INLINE IVec (T ai1, T ai2, T ai3) : i{ai1, ai2, ai3} { ; } /// init i[0], i[1], i[2] - constexpr NETGEN_INLINE INT (T ai1, T ai2, T ai3, T ai4) + constexpr NETGEN_INLINE IVec (T ai1, T ai2, T ai3, T ai4) : i{ai1, ai2, ai3, ai4} { ; } /// init i[0], i[1], i[2] - constexpr NETGEN_INLINE INT (T ai1, T ai2, T ai3, T ai4, T ai5) + constexpr NETGEN_INLINE IVec (T ai1, T ai2, T ai3, T ai4, T ai5) : i{ai1, ai2, ai3, ai4, ai5} { ; } /// init i[0], i[1], i[2] - NETGEN_INLINE INT (T ai1, T ai2, T ai3, T ai4, T ai5, T ai6, T ai7, T ai8, T ai9) + NETGEN_INLINE IVec (T ai1, T ai2, T ai3, T ai4, T ai5, T ai6, T ai7, T ai8, T ai9) : i{ai1, ai2, ai3, ai4, ai5, ai6, ai7, ai8, ai9 } { ; } template @@ -83,7 +83,7 @@ namespace ngcore } template - NETGEN_INLINE INT (const INT & in2) + NETGEN_INLINE IVec (const IVec & in2) { if (N2 <= N) { @@ -100,7 +100,7 @@ namespace ngcore } template - NETGEN_INLINE INT (const BaseArrayObject & ao) + NETGEN_INLINE IVec (const BaseArrayObject & ao) { for (int j = 0; j < N; j++) i[j] = ao.Spec()[j]; @@ -108,7 +108,7 @@ namespace ngcore NETGEN_INLINE size_t Size() const { return N; } /// all ints equal ? - NETGEN_INLINE bool operator== (const INT & in2) const + NETGEN_INLINE bool operator== (const IVec & in2) const { for (int j = 0; j < N; j++) if (i[j] != in2.i[j]) return 0; @@ -116,7 +116,7 @@ namespace ngcore } /// any ints unequal ? - NETGEN_INLINE bool operator!= (const INT & in2) const + NETGEN_INLINE bool operator!= (const IVec & in2) const { for (int j = 0; j < N; j++) if (i[j] != in2.i[j]) return 1; @@ -124,7 +124,7 @@ namespace ngcore } /// sort integers - NETGEN_INLINE INT & Sort () & + NETGEN_INLINE IVec & Sort () & { for (int k = 0; k < N; k++) for (int l = k+1; l < N; l++) @@ -133,7 +133,7 @@ namespace ngcore return *this; } - NETGEN_INLINE INT Sort () && + NETGEN_INLINE IVec Sort () && { for (int k = 0; k < N; k++) for (int l = k+1; l < N; l++) @@ -155,7 +155,7 @@ namespace ngcore operator FlatArray () { return FlatArray (N, &i[0]); } - NETGEN_INLINE INT & operator= (T value) + NETGEN_INLINE IVec & operator= (T value) { for (int j = 0; j < N; j++) i[j] = value; @@ -163,7 +163,7 @@ namespace ngcore } template - NETGEN_INLINE INT & operator= (INT v2) + NETGEN_INLINE IVec & operator= (IVec v2) { for (int j = 0; j < N; j++) i[j] = v2[j]; @@ -186,14 +186,14 @@ namespace ngcore /// sort 2 integers template <> - NETGEN_INLINE INT<2> & INT<2>::Sort () & + NETGEN_INLINE IVec<2> & IVec<2>::Sort () & { if (i[0] > i[1]) Swap (i[0], i[1]); return *this; } template <> - NETGEN_INLINE INT<2> INT<2>::Sort () && + NETGEN_INLINE IVec<2> IVec<2>::Sort () && { if (i[0] > i[1]) Swap (i[0], i[1]); return *this; @@ -201,7 +201,7 @@ namespace ngcore /// sort 3 integers template <> - NETGEN_INLINE INT<3> INT<3>::Sort () && + NETGEN_INLINE IVec<3> IVec<3>::Sort () && { if (i[0] > i[1]) Swap (i[0], i[1]); if (i[1] > i[2]) Swap (i[1], i[2]); @@ -211,7 +211,7 @@ namespace ngcore /// Print integers template - inline ostream & operator<<(ostream & s, const INT & i2) + inline ostream & operator<<(ostream & s, const IVec & i2) { for (int j = 0; j < N; j++) s << (int) i2[j] << " "; @@ -219,15 +219,15 @@ namespace ngcore } template - auto begin(const INT & ind) + auto begin(const IVec & ind) { - return AOWrapperIterator> (ind, 0); + return AOWrapperIterator> (ind, 0); } template - auto end(const INT & ind) + auto end(const IVec & ind) { - return AOWrapperIterator> (ind, N); + return AOWrapperIterator> (ind, N); } @@ -236,9 +236,9 @@ namespace ngcore template - NETGEN_INLINE size_t HashValue (const INT & ind, size_t size) + NETGEN_INLINE size_t HashValue (const IVec & ind, size_t size) { - INT lind = ind; + IVec lind = ind; size_t sum = 0; for (int i = 0; i < N; i++) sum += lind[i]; @@ -247,24 +247,24 @@ namespace ngcore /// hash value of 1 int template - NETGEN_INLINE size_t HashValue (const INT<1,TI> & ind, size_t size) + NETGEN_INLINE size_t HashValue (const IVec<1,TI> & ind, size_t size) { return ind[0] % size; } /// hash value of 2 int template - NETGEN_INLINE size_t HashValue (const INT<2,TI> & ind, size_t size) + NETGEN_INLINE size_t HashValue (const IVec<2,TI> & ind, size_t size) { - INT<2,size_t> lind = ind; + IVec<2,size_t> lind = ind; return (113*lind[0]+lind[1]) % size; } /// hash value of 3 int template - NETGEN_INLINE size_t HashValue (const INT<3,TI> & ind, size_t size) + NETGEN_INLINE size_t HashValue (const IVec<3,TI> & ind, size_t size) { - INT<3,size_t> lind = ind; + IVec<3,size_t> lind = ind; return (113*lind[0]+59*lind[1]+lind[2]) % size; } @@ -284,9 +284,9 @@ namespace ngcore template - NETGEN_INLINE size_t HashValue2 (const INT & ind, size_t mask) + NETGEN_INLINE size_t HashValue2 (const IVec & ind, size_t mask) { - INT lind = ind; + IVec lind = ind; size_t sum = 0; for (int i = 0; i < N; i++) sum += lind[i]; @@ -295,24 +295,24 @@ namespace ngcore /// hash value of 1 int template - NETGEN_INLINE size_t HashValue2 (const INT<1,TI> & ind, size_t mask) + NETGEN_INLINE size_t HashValue2 (const IVec<1,TI> & ind, size_t mask) { return ind[0] & mask; } /// hash value of 2 int template - NETGEN_INLINE size_t HashValue2 (const INT<2,TI> & ind, size_t mask) + NETGEN_INLINE size_t HashValue2 (const IVec<2,TI> & ind, size_t mask) { - INT<2,size_t> lind = ind; + IVec<2,size_t> lind = ind; return (113*lind[0]+lind[1]) & mask; } /// hash value of 3 int template - NETGEN_INLINE size_t HashValue2 (const INT<3,TI> & ind, size_t mask) + NETGEN_INLINE size_t HashValue2 (const IVec<3,TI> & ind, size_t mask) { - INT<3,size_t> lind = ind; + IVec<3,size_t> lind = ind; return (113*lind[0]+59*lind[1]+lind[2]) & mask; } @@ -332,7 +332,7 @@ namespace ngcore // using ngstd::max; template - NETGEN_INLINE T Max (const INT & i) + NETGEN_INLINE T Max (const IVec & i) { if (D == 0) return 0; T m = i[0]; @@ -342,7 +342,7 @@ namespace ngcore } template - NETGEN_INLINE T Min (const INT & i) + NETGEN_INLINE T Min (const IVec & i) { if (D == 0) return 0; T m = i[0]; @@ -352,18 +352,18 @@ namespace ngcore } template - NETGEN_INLINE INT Max (INT i1, INT i2) + NETGEN_INLINE IVec Max (IVec i1, IVec i2) { - INT tmp; + IVec tmp; for (int i = 0; i < D; i++) tmp[i] = std::max(i1[i], i2[i]); return tmp; } template - NETGEN_INLINE INT operator+ (INT i1, INT i2) + NETGEN_INLINE IVec operator+ (IVec i1, IVec i2) { - INT tmp; + IVec tmp; for (int i = 0; i < D; i++) tmp[i] = i1[i]+i2[i]; return tmp; @@ -828,21 +828,21 @@ namespace ngcore } template - NETGEN_INLINE size_t HashValue (const INT<3,TI> ind) + NETGEN_INLINE size_t HashValue (const IVec<3,TI> ind) { - INT<3,size_t> lind = ind; + IVec<3,size_t> lind = ind; return 113*lind[0]+59*lind[1]+lind[2]; } template - NETGEN_INLINE size_t HashValue (const INT<2,TI> ind) + NETGEN_INLINE size_t HashValue (const IVec<2,TI> ind) { - INT<2,size_t> lind = ind; + IVec<2,size_t> lind = ind; return 113*lind[0]+lind[1]; } template - NETGEN_INLINE size_t HashValue (const INT<1,TI> ind) + NETGEN_INLINE size_t HashValue (const IVec<1,TI> ind) { return ind[0]; } @@ -1075,7 +1075,7 @@ namespace ngcore #ifdef PARALLEL namespace ngcore { template - class MPI_typetrait > + class MPI_typetrait > { public: /// gets the MPI datatype @@ -1099,7 +1099,7 @@ namespace ngcore template struct MPI_typetrait; template - struct MPI_typetrait > { + struct MPI_typetrait > { static auto MPIType () { return MPI_typetrait>::MPIType(); } @@ -1112,8 +1112,8 @@ namespace std { // structured binding support template - struct tuple_size> : std::integral_constant {}; - template struct tuple_element> { using type = T; }; + struct tuple_size> : std::integral_constant {}; + template struct tuple_element> { using type = T; }; } #endif diff --git a/libsrc/geom2d/csg2d.cpp b/libsrc/geom2d/csg2d.cpp index 20143d15..667c7514 100644 --- a/libsrc/geom2d/csg2d.cpp +++ b/libsrc/geom2d/csg2d.cpp @@ -12,8 +12,6 @@ namespace netgen { -using ngcore::INT; - constexpr static double EPSILON=0.000000001; void ComputeWeight( Spline & s, Point<2> p ) @@ -2037,13 +2035,13 @@ shared_ptr CSG2d :: GenerateSplineGeometry() } netgen::BoxTree <2> solid_tree(box); - Array> loop_list; + Array> loop_list; for(auto i : Range(solids)) for(auto li : Range(solids[i].polys)) { solid_tree.Insert(solids[i].polys[li].GetBoundingBox(), loop_list.Size()); - loop_list.Append(INT<2>(i, li)); + loop_list.Append(IVec<2>(i, li)); } for(auto i1 : Range(solids)) diff --git a/libsrc/meshing/delaunay.cpp b/libsrc/meshing/delaunay.cpp index 51b594b4..2ebc031e 100644 --- a/libsrc/meshing/delaunay.cpp +++ b/libsrc/meshing/delaunay.cpp @@ -840,12 +840,12 @@ namespace netgen tets_with_3_bnd_points.SetSize(cnt); static Timer t1("Build face table"); t1.Start(); - ngcore::ClosedHashTable< ngcore::INT<3>, int > face_table( 4*cnt + 3 ); + ngcore::ClosedHashTable< ngcore::IVec<3>, int > face_table( 4*cnt + 3 ); for(auto ei : tets_with_3_bnd_points) for(auto j : Range(4)) { auto i3_ = tempels[ei].GetFace (j); - ngcore::INT<3> i3 = {i3_[0], i3_[1], i3_[2]}; + ngcore::IVec<3> i3 = {i3_[0], i3_[1], i3_[2]}; if(bnd_points[i3[0]] && bnd_points[i3[1]] && bnd_points[i3[2]]) { i3.Sort(); @@ -860,7 +860,7 @@ namespace netgen for (int i = 1; i <= mesh.GetNOpenElements(); i++) { const Element2d & tri = mesh.OpenElement(i); - ngcore::INT<3> i3(tri[0], tri[1], tri[2]); + ngcore::IVec<3> i3(tri[0], tri[1], tri[2]); i3.Sort(); if(!face_table.Used(i3)) openels.Append(i); diff --git a/libsrc/meshing/delaunay2d.cpp b/libsrc/meshing/delaunay2d.cpp index 7a7b2b2d..c6674719 100644 --- a/libsrc/meshing/delaunay2d.cpp +++ b/libsrc/meshing/delaunay2d.cpp @@ -38,7 +38,7 @@ namespace netgen if(p1 hash = {p0,p1}; + IVec<2> hash = {p0,p1}; auto pos = edge_to_trig.Position(hash); if (pos == -1) return -1; @@ -53,7 +53,7 @@ namespace netgen if(p1 hash = {p0,p1}; + IVec<2> hash = {p0,p1}; auto pos = edge_to_trig.Position(hash); if (pos == -1) edge_to_trig[hash] = {eli, -1}; @@ -80,7 +80,7 @@ namespace netgen if(p1 hash = {p0,p1}; + IVec<2> hash = {p0,p1}; auto pos = edge_to_trig.Position(hash); auto i2 = edge_to_trig.GetData(pos); @@ -256,7 +256,7 @@ namespace netgen { int p1 = trig[k]; int p2 = trig[(k+1)%3]; - INT<2> edge{p1,p2}; + IVec<2> edge{p1,p2}; edge.Sort(); bool found = false; for (int l = 0; l < edges.Size(); l++) @@ -801,13 +801,13 @@ namespace netgen // Mark edges and trigs as inside or outside, starting with boundary edges enum POSITION { UNKNOWN, BOUNDARY, INSIDE, OUTSIDE }; Array trig_pos(tempmesh.SurfaceElements().Size()); - ngcore::ClosedHashTable, POSITION> edge_pos(3*tempmesh.SurfaceElements().Size()); + ngcore::ClosedHashTable, POSITION> edge_pos(3*tempmesh.SurfaceElements().Size()); trig_pos = UNKNOWN; for (auto & seg : tempmesh.LineSegments()) { ArrayMem els; - INT<2> edge{seg[0], seg[1]}; + IVec<2> edge{seg[0], seg[1]}; edge.Sort(); edge_pos[edge] = BOUNDARY; @@ -828,8 +828,8 @@ namespace netgen else pos = OUTSIDE; - INT<2> e1{seg[0], pi2}; - INT<2> e2{seg[1], pi2}; + IVec<2> e1{seg[0], pi2}; + IVec<2> e2{seg[1], pi2}; e1.Sort(); e2.Sort(); if(!edge_pos.Used(e1)) @@ -857,7 +857,7 @@ namespace netgen // any edge of unknown trig already marked? for(auto i : IntRange(3)) { - INT<2> edge{el[(i+1)%3], el[(i+2)%3]}; + IVec<2> edge{el[(i+1)%3], el[(i+2)%3]}; edge.Sort(); if(edge_pos.Used(edge) && edge_pos[edge]!=BOUNDARY) { @@ -871,7 +871,7 @@ namespace netgen if(trig_pos[sei] != UNKNOWN) for(auto i : IntRange(3)) { - INT<2> edge{el[(i+1)%3], el[(i+2)%3]}; + IVec<2> edge{el[(i+1)%3], el[(i+2)%3]}; edge.Sort(); if(!edge_pos.Used(edge) || edge_pos[edge]==BOUNDARY) edge_pos[edge] = trig_pos[sei]; diff --git a/libsrc/meshing/delaunay2d.hpp b/libsrc/meshing/delaunay2d.hpp index 40f3b000..52b3d952 100644 --- a/libsrc/meshing/delaunay2d.hpp +++ b/libsrc/meshing/delaunay2d.hpp @@ -2,7 +2,6 @@ namespace netgen { - using ngcore::INT; static inline Point<2> P2( Point<3> p ) { @@ -44,14 +43,14 @@ namespace netgen class DelaunayMesh { - ngcore::ClosedHashTable, INT<2>> edge_to_trig; + ngcore::ClosedHashTable, IVec<2>> edge_to_trig; Array trigs; unique_ptr> tree; Array, PointIndex> & points; Array closeels; Array intersecting; - Array> edges; + Array> edges; int GetNeighbour( int eli, int edge ); diff --git a/libsrc/meshing/topology.cpp b/libsrc/meshing/topology.cpp index e12fe2cc..e7a87032 100644 --- a/libsrc/meshing/topology.cpp +++ b/libsrc/meshing/topology.cpp @@ -5,7 +5,6 @@ namespace netgen { using ngcore::ParallelForRange; using ngcore::ParallelFor; - using ngcore::INT; using ngcore::TasksPerThread; /* @@ -699,20 +698,20 @@ namespace netgen // edge is splitting edge in middle of triangle: for (int j = 1; j <= 2; j++) { - INT<2> paedge1, paedge2, paedge3; + IVec<2> paedge1, paedge2, paedge3; int orient_inner = 0; if (j == 1) { - paedge1 = INT<2> (pa0[0], verts[1]); - paedge2 = INT<2> (pa0[1], verts[1]); - paedge3 = INT<2> (pa0[0], pa0[1]); + paedge1 = IVec<2> (pa0[0], verts[1]); + paedge2 = IVec<2> (pa0[1], verts[1]); + paedge3 = IVec<2> (pa0[0], pa0[1]); orient_inner = 0; } else { - paedge1 = INT<2> (pa1[0], verts[0]); - paedge2 = INT<2> (pa1[1], verts[0]); - paedge3 = INT<2> (pa1[0], pa1[1]); + paedge1 = IVec<2> (pa1[0], verts[0]); + paedge2 = IVec<2> (pa1[1], verts[0]); + paedge3 = IVec<2> (pa1[0], pa1[1]); orient_inner = 1; } if (paedge1[0] > paedge1[1]) @@ -752,21 +751,21 @@ namespace netgen if (!bisect_edge) // not a bisect edge (then a red edge) { - INT<2> paedge1, paedge2, paedge3; + IVec<2> paedge1, paedge2, paedge3; int orient1 = 0, orient2 = 0, orient3=0; // int orient_inner = 0; - paedge1 = INT<2> (pa0[0], pa0[1]); - paedge2 = INT<2> (pa1[0], pa1[1]); + paedge1 = IVec<2> (pa0[0], pa0[1]); + paedge2 = IVec<2> (pa1[0], pa1[1]); // find common vertex and the third pa edge if (pa0[0]==pa1[0]){// 00 //orient1 = 0; orient2 = 1; if (pa0[1] (pa0[1], pa1[1]); + paedge3 = IVec<2> (pa0[1], pa1[1]); }else{ //orient3 = 0; - paedge3 = INT<2> (pa1[1], pa0[1]); + paedge3 = IVec<2> (pa1[1], pa0[1]); } } else if (pa0[0]==pa1[1]){//01 @@ -774,10 +773,10 @@ namespace netgen //orient2 = 0; if (pa0[1] (pa0[1], pa1[0]); + paedge3 = IVec<2> (pa0[1], pa1[0]); }else{ //orient3 = 0; - paedge3 = INT<2> (pa1[0], pa0[1]); + paedge3 = IVec<2> (pa1[0], pa0[1]); } } else if (pa0[1]==pa1[0]){//10 @@ -785,10 +784,10 @@ namespace netgen orient2 = 1; if (pa0[0] (pa0[0], pa1[1]); + paedge3 = IVec<2> (pa0[0], pa1[1]); }else{ //orient3 = 0; - paedge3 = INT<2> (pa1[1], pa0[0]); + paedge3 = IVec<2> (pa1[1], pa0[0]); } } else if (pa0[1]==pa1[1]){//11 @@ -796,10 +795,10 @@ namespace netgen //orient2 = 0; if (pa0[0] (pa0[0], pa1[0]); + paedge3 = IVec<2> (pa0[0], pa1[0]); }else{ //orient3 = 0; - paedge3 = INT<2> (pa1[0], pa0[0]); + paedge3 = IVec<2> (pa1[0], pa0[0]); } } @@ -832,16 +831,16 @@ namespace netgen pa1[1] != pa2[1]) for (int j = 1; j <= 2; j++) { - INT<2> paedge1, paedge2; + IVec<2> paedge1, paedge2; if (j == 1) { - paedge1 = INT<2> (pa1[0], pa2[0]); - paedge2 = INT<2> (pa1[1], pa2[1]); + paedge1 = IVec<2> (pa1[0], pa2[0]); + paedge2 = IVec<2> (pa1[1], pa2[1]); } else { - paedge1 = INT<2> (pa1[0], pa2[1]); - paedge2 = INT<2> (pa1[1], pa2[0]); + paedge1 = IVec<2> (pa1[0], pa2[1]); + paedge2 = IVec<2> (pa1[1], pa2[0]); } int paedgenr1 = 0, paedgenr2 = 0; @@ -877,7 +876,7 @@ namespace netgen for (int j = 0; j < 2; j++) for (int k = 0; k < 2; k++) { - INT<2> paedge (pa1[1-j], pa2[1-k]); + IVec<2> paedge (pa1[1-j], pa2[1-k]); int orientpa = 1; if (paedge[0] > paedge[1]) { @@ -909,12 +908,12 @@ namespace netgen // edge hashtable:: needed for getting parent faces - ngcore::ClosedHashTable, int> v2e(nv); + ngcore::ClosedHashTable, int> v2e(nv); if (build_parent_faces) for (auto i : Range(edge2vert)) { auto edge = edge2vert[i]; - INT<2> e2(edge[0], edge[1]); + IVec<2> e2(edge[0], edge[1]); e2.Sort(); v2e[e2] = i; } @@ -947,7 +946,7 @@ namespace netgen vert2oldface.AddSave (face2vert[i][0], i); // find all potential intermediate faces - Array> intermediate_faces; + Array> intermediate_faces; if (build_parent_faces) { for (ElementIndex ei = 0; ei < ne; ei++) @@ -957,7 +956,7 @@ namespace netgen // cout << "element: " << (*mesh)[ei].PNums() << endl; (*mesh)[ei].GetFace(i+1, face); // cout << "face " << face.PNums() << endl; - INT<3,PointIndex> f3 = { face[0], face[1], face[2] }; + IVec<3,PointIndex> f3 = { face[0], face[1], face[2] }; for (int j = 0; j < 3; j++) { PointIndex v = f3[j]; @@ -973,10 +972,10 @@ namespace netgen PointIndex v2 = f3[0]+f3[1]+f3[2] - v - v0; // if there is an edge connecting v1 and v2, accept // the new face - INT<2> parentedge(v1, v2); + IVec<2> parentedge(v1, v2); parentedge.Sort(); if (v2e.Used(parentedge)){ - INT<3> cf3 = { v0, v1, v2 }; + IVec<3> cf3 = { v0, v1, v2 }; cf3.Sort(); // cout << "intermediate: " << cf3 << " of " << f3 << endl; intermediate_faces.Append (cf3); @@ -988,7 +987,7 @@ namespace netgen for (SurfaceElementIndex sei = 0; sei < nse; sei++) { const Element2d & sel = (*mesh)[sei]; - INT<3,PointIndex> f3 = { sel[0], sel[1], sel[2] }; + IVec<3,PointIndex> f3 = { sel[0], sel[1], sel[2] }; for (int j = 0; j < 3; j++) { PointIndex v = f3[j]; @@ -1004,10 +1003,10 @@ namespace netgen PointIndex v2 = f3[0]+f3[1]+f3[2] - v - v0; // if there is an edge connecting v1 and v2, accept // the new face - INT<2> parentedge(v1, v2); + IVec<2> parentedge(v1, v2); parentedge.Sort(); if (v2e.Used(parentedge)){ - INT<3> cf3 = { v0, v1, v2 }; + IVec<3> cf3 = { v0, v1, v2 }; cf3.Sort(); // cout << "intermediate: " << cf3 << " of " << f3 << endl; intermediate_faces.Append (cf3); @@ -1377,11 +1376,11 @@ namespace netgen // cout << "f2v = " << face2vert << endl; - ngcore::ClosedHashTable, int> v2f(nv); + ngcore::ClosedHashTable, int> v2f(nv); for (auto i : Range(face2vert)) { auto face = face2vert[i]; - INT<3> f3(face[0], face[1], face[2]); + IVec<3> f3(face[0], face[1], face[2]); f3.Sort(); v2f[f3] = i; } @@ -1393,7 +1392,7 @@ namespace netgen for (auto i : Range(nfa)) { - INT<3,PointIndex> f3(face2vert[i][0], face2vert[i][1], face2vert[i][2]); + IVec<3,PointIndex> f3(face2vert[i][0], face2vert[i][1], face2vert[i][2]); // face on coarses level ? @@ -1433,10 +1432,10 @@ namespace netgen // if there is an edge connecting v1 and v2, accept // the new face - INT<2> parentedge(v1, v2); + IVec<2> parentedge(v1, v2); parentedge.Sort(); if (v2e.Used(parentedge)){ - INT<3> parentverts(v0, v1, v2); + IVec<3> parentverts(v0, v1, v2); parentverts.Sort(); int classnr = 0; @@ -1476,13 +1475,13 @@ namespace netgen PointIndex v1 = parents[1]; PointIndex v2 = f3[(k+1)%3]; PointIndex v3 = f3[(k+2)%3]; - INT<3> parentedge1(v0, v2); + IVec<3> parentedge1(v0, v2); parentedge1.Sort(); - INT<3> parentedge2(v0, v3); + IVec<3> parentedge2(v0, v3); parentedge2.Sort(); - INT<3> parentedge3(v1, v2); + IVec<3> parentedge3(v1, v2); parentedge3.Sort(); - INT<3> parentedge4(v1, v3); + IVec<3> parentedge4(v1, v3); parentedge4.Sort(); // if edges [v0,v2], [v0, v3], [v1,v2], [v1,v3] exists // then vb is the bisecting edge @@ -1507,13 +1506,13 @@ namespace netgen // by default v0 < v1 < vb < v2 < v3 classnr=9; } - INT<3> parentverts1(v0, v2, v3); + IVec<3> parentverts1(v0, v2, v3); parentverts1.Sort(); - INT<3> parentverts2(v1, v2, v3); + IVec<3> parentverts2(v1, v2, v3); parentverts2.Sort(); - INT<3> parentverts3(v0, v1, v2); + IVec<3> parentverts3(v0, v1, v2); parentverts3.Sort(); - INT<3> parentverts4(v0, v1, v3); + IVec<3> parentverts4(v0, v1, v3); parentverts4.Sort(); int pafacenr1=-1, pafacenr2=-1, pafacenr3=-1, pafacenr4=-1; if (v2f.Used(parentverts1)) @@ -1561,13 +1560,13 @@ namespace netgen PointIndex v1 = parents[1]; PointIndex v2 = f3[(k+1)%3]; PointIndex v3 = f3[(k+2)%3]; - INT<2> parentedge1(v0, v2); + IVec<2> parentedge1(v0, v2); parentedge1.Sort(); - INT<2> parentedge2(v0, v3); + IVec<2> parentedge2(v0, v3); parentedge2.Sort(); - INT<2> parentedge3(v1, v2); + IVec<2> parentedge3(v1, v2); parentedge3.Sort(); - INT<2> parentedge4(v1, v3); + IVec<2> parentedge4(v1, v3); parentedge4.Sort(); // if edges [v0,v2], [v0, v3], [v1,v2], [v1,v3] exists @@ -1595,13 +1594,13 @@ namespace netgen } // cout << "classnr = " << classnr << endl; - INT<3> parentverts1(v1, v2, v3); + IVec<3> parentverts1(v1, v2, v3); parentverts1.Sort(); - INT<3> parentverts2(v0, v2, v3); + IVec<3> parentverts2(v0, v2, v3); parentverts2.Sort(); - INT<3> parentverts3(v0, v1, v3); + IVec<3> parentverts3(v0, v1, v3); parentverts3.Sort(); - INT<3> parentverts4(v0, v1, v2); + IVec<3> parentverts4(v0, v1, v2); parentverts4.Sort(); if (!v2f.Used(parentverts1) || !v2f.Used(parentverts2) || @@ -1634,17 +1633,17 @@ namespace netgen // v0 is a coarse vertex ==> f3 is a boundary face if (v0==pa1[0] || v0==pa1[1]){ if (pa1[0]==v0){// type 0: bottom left corner - INT<3> parentverts(v0, pa1[1], pa2[1]); + IVec<3> parentverts(v0, pa1[1], pa2[1]); int pafacenr = v2f[parentverts]; parent_faces[i] = { 16, { pafacenr, -1, -1, -1} }; //cout << "f "< parentverts(pa1[0], v0, pa2[1]); + IVec<3> parentverts(pa1[0], v0, pa2[1]); int pafacenr = v2f[parentverts]; parent_faces[i] = { 17, { pafacenr, -1, -1, -1} }; //cout << "f "< parentverts(pa1[0], pa2[0], v0); + IVec<3> parentverts(pa1[0], pa2[0], v0); int pafacenr = v2f[parentverts]; parent_faces[i] = { 18, { pafacenr, -1, -1, -1} }; //cout << "f "< parentverts(pa0[0], pa0[1], pa1[1]); + IVec<3> parentverts(pa0[0], pa0[1], pa1[1]); int pafacenr = v2f[parentverts]; parent_faces[i] = { 19, { pafacenr, -1, -1, -1} }; //cout << "f "< &p, bool select_on_clipping_plane); bool Unproject(int px, int py, Point<3> &p); - ngcore::INT<2> Project(Point<3> p); + ngcore::IVec<2> Project(Point<3> p); }; NGGUI_API extern VisualSceneMesh vsmesh; diff --git a/libsrc/visualization/vsmesh.cpp b/libsrc/visualization/vsmesh.cpp index 7e439d0f..b1f3971d 100644 --- a/libsrc/visualization/vsmesh.cpp +++ b/libsrc/visualization/vsmesh.cpp @@ -3405,13 +3405,13 @@ namespace netgen return pz<1 && pz>0; } - ngcore::INT<2> VisualSceneMesh :: Project(Point<3> p) + ngcore::IVec<2> VisualSceneMesh :: Project(Point<3> p) { Point<3> pwin; gluProject(p[0], p[1], p[2], transformationmat, select.projmat, select.viewport, &pwin[0], &pwin[1], &pwin[2]); - return ngcore::INT<2>(pwin[0]+0.5, select.viewport[3]-pwin[1]+0.5); + return ngcore::IVec<2>(pwin[0]+0.5, select.viewport[3]-pwin[1]+0.5); } From 18262a526df179f33ee2623aa30635bfd4d76ada Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Mon, 12 Feb 2024 07:44:26 +0100 Subject: [PATCH 14/20] replace INT by IVec (cgns) --- libsrc/interface/rw_cgns.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/interface/rw_cgns.cpp b/libsrc/interface/rw_cgns.cpp index 096fbfdc..458036e9 100644 --- a/libsrc/interface/rw_cgns.cpp +++ b/libsrc/interface/rw_cgns.cpp @@ -8,7 +8,7 @@ namespace netgen::cg { - typedef ngcore::ClosedHashTable, size_t> PointTable; + typedef ngcore::ClosedHashTable, size_t> PointTable; int getDim(ElementType_t type) { @@ -416,7 +416,7 @@ namespace netgen::cg for(auto i : Range(nv)) { - ngcore::INT<3,size_t> hash = {*reinterpret_cast(&x[i]), *reinterpret_cast(&y[i]), *reinterpret_cast(&z[i])}; + ngcore::IVec<3,size_t> hash = {*reinterpret_cast(&x[i]), *reinterpret_cast(&y[i]), *reinterpret_cast(&z[i])}; size_t pi_ng; size_t pos; // check if this point is new From dfaf2706701860e3f219325d684814d81c1be6e0 Mon Sep 17 00:00:00 2001 From: "Hochsteger, Matthias" Date: Mon, 12 Feb 2024 11:57:54 +0100 Subject: [PATCH 15/20] Remove windows.h include where possible. --- libsrc/include/incopengl.hpp | 4 ++++ libsrc/include/inctcl.hpp | 5 +++++ libsrc/include/mystdlib.h | 2 +- libsrc/meshing/meshing.hpp | 7 ------- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libsrc/include/incopengl.hpp b/libsrc/include/incopengl.hpp index 7b07cf6f..35b1c48b 100644 --- a/libsrc/include/incopengl.hpp +++ b/libsrc/include/incopengl.hpp @@ -5,6 +5,10 @@ #include #include +#ifdef WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif # ifdef __APPLE__ #define GL_SILENCE_DEPRECATION diff --git a/libsrc/include/inctcl.hpp b/libsrc/include/inctcl.hpp index 8191a44a..4a15a885 100644 --- a/libsrc/include/inctcl.hpp +++ b/libsrc/include/inctcl.hpp @@ -1,3 +1,8 @@ +#ifdef WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif + #include #include diff --git a/libsrc/include/mystdlib.h b/libsrc/include/mystdlib.h index 5b495edd..08f4af3e 100644 --- a/libsrc/include/mystdlib.h +++ b/libsrc/include/mystdlib.h @@ -59,7 +59,7 @@ namespace metis { extern "C" { // # include # endif // MSVC_EXPRESS # endif -# include +// # include # undef WIN32_LEAN_AND_MEAN // # include #else // Not using MC VC++ diff --git a/libsrc/meshing/meshing.hpp b/libsrc/meshing/meshing.hpp index 12129cbb..779453b8 100644 --- a/libsrc/meshing/meshing.hpp +++ b/libsrc/meshing/meshing.hpp @@ -9,13 +9,6 @@ #include "../include/opti.hpp" -/*** Windows headers ***/ -#ifdef _MSC_VER -# define WIN32_LEAN_AND_MEAN -# include -# undef WIN32_LEAN_AND_MEAN -#endif - namespace netgen { // extern int printmessage_importance; From cee5d55b7dc1e214b19058b94a7654fe3a6edaaa Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 12 Feb 2024 07:12:17 -0800 Subject: [PATCH 16/20] Fix dangling reference in ZRefinement --- libsrc/meshing/meshclass.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index e735bac9..382b669b 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -6357,6 +6357,8 @@ namespace netgen for(auto si : Range(segments)) { auto& seg = segments[si]; + // Copy segment, as reference above might get invalidated in AddSegment() + auto reference_seg = seg; auto p1 = seg[0]; auto p2 = seg[1]; @@ -6376,7 +6378,7 @@ namespace netgen seg[1] = ipts[1]; for(auto i : Range(size_t(1), ipts.Size()-1)) { - Segment snew = seg; + Segment snew = reference_seg; if(c2) { snew[0] = ipts[ipts.Size()-1-i]; From ddc50aa6512fd05f17054ab3eb83ce20eb54e9b8 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 13 Feb 2024 09:33:12 +0100 Subject: [PATCH 17/20] throw exception if surface triangulation cannot be built by occ --- libsrc/occ/occgenmesh.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp index 656b8e36..7eb2d77d 100644 --- a/libsrc/occ/occgenmesh.cpp +++ b/libsrc/occ/occgenmesh.cpp @@ -669,6 +669,8 @@ namespace netgen BRepMesh_IncrementalMesh (geom.shape, 0.01, true); triangulation = BRep_Tool::Triangulation (face, loc); } + if(triangulation.IsNull()) + throw Exception("OCC-Triangulation could not be built. Do you have a bounded shape?"); BRepAdaptor_Surface sf(face, Standard_True); // one prop for evaluating and one for derivatives From 803eb73d2d958aeaace749af89e38057eb0bada6 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 13 Feb 2024 09:35:44 +0100 Subject: [PATCH 18/20] allow internal edges on boundarylayer (for sphere, ellipsoid) --- libsrc/meshing/boundarylayer.cpp | 17 +++++++++++------ libsrc/meshing/boundarylayer.hpp | 1 + libsrc/meshing/python_mesh.cpp | 5 ++++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/libsrc/meshing/boundarylayer.cpp b/libsrc/meshing/boundarylayer.cpp index e54464d5..e5a927e9 100644 --- a/libsrc/meshing/boundarylayer.cpp +++ b/libsrc/meshing/boundarylayer.cpp @@ -679,7 +679,8 @@ namespace netgen // result in pushed through elements, since we do not (yet) // curvature through layers. // Therefore we disable curving for these surfaces. - mesh.GetFaceDescriptor(i).SetSurfNr(-1); + if(!params.keep_surfaceindex) + mesh.GetFaceDescriptor(i).SetSurfNr(-1); } } @@ -984,7 +985,7 @@ namespace netgen Array points; // find first vertex on edge double edge_len = 0.; - auto is_end_point = [&] (PointIndex pi) + auto is_end_point = [&] (PointIndex pi, const Segment& testseg) { // if(mesh[pi].Type() == FIXEDPOINT) // return true; @@ -992,13 +993,14 @@ namespace netgen auto segs = topo.GetVertexSegments(pi); auto first_edgenr = mesh[segs[0]].edgenr; for(auto segi : segs) - if(mesh[segi].edgenr != first_edgenr) - return true; + if(auto& seg = mesh[segi]; seg.edgenr != first_edgenr || (testseg[0] == seg[1] && testseg[1] == seg[0])) + return true; return false; }; bool any_grows = false; + const Segment* last_seg = nullptr; for(const auto& seg : segments) { if(seg.edgenr-1 == edgenr) @@ -1006,8 +1008,9 @@ namespace netgen if(growthvectors[seg[0]].Length2() != 0 || growthvectors[seg[1]].Length2() != 0) any_grows = true; - if(points.Size() == 0 && is_end_point(seg[0])) + if(points.Size() == 0 && is_end_point(seg[0], seg)) { + last_seg = &seg; points.Append(seg[0]); points.Append(seg[1]); edge_len += (mesh[seg[1]] - mesh[seg[0]]).Length(); @@ -1034,6 +1037,7 @@ namespace netgen edge_len += (mesh[points.Last()] - mesh[seg[1]]).Length(); points.Append(seg[1]); point_found = true; + last_seg = &seg; break; } else if(seg[1] == points.Last() && @@ -1042,10 +1046,11 @@ namespace netgen edge_len += (mesh[points.Last()] - mesh[seg[0]]).Length(); points.Append(seg[0]); point_found = true; + last_seg = &seg; break; } } - if(is_end_point(points.Last())) + if(last_seg && is_end_point(points.Last(), *last_seg)) break; if(!point_found) { diff --git a/libsrc/meshing/boundarylayer.hpp b/libsrc/meshing/boundarylayer.hpp index 87790a2d..c879e7bb 100644 --- a/libsrc/meshing/boundarylayer.hpp +++ b/libsrc/meshing/boundarylayer.hpp @@ -23,6 +23,7 @@ public: bool limit_growth_vectors = true; double limit_safety = 0.3; // alloow only 30% of the growth vector length bool sides_keep_surfaceindex = false; + bool keep_surfaceindex = false; Array project_boundaries; }; diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 886122e6..910a5e13 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -1463,7 +1463,8 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) variant domain, bool outside, optional project_boundaries, bool grow_edges, bool limit_growth_vectors, - bool sides_keep_surfaceindex) + bool sides_keep_surfaceindex, + bool keep_surfaceindex) { BoundaryLayerParameters blp; BitArray boundaries(self.GetNFD()+1); @@ -1549,12 +1550,14 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) blp.grow_edges = grow_edges; blp.limit_growth_vectors = limit_growth_vectors; blp.sides_keep_surfaceindex = sides_keep_surfaceindex; + blp.keep_surfaceindex = keep_surfaceindex; GenerateBoundaryLayer (self, blp); self.UpdateTopology(); }, py::arg("boundary"), py::arg("thickness"), py::arg("material"), py::arg("domains") = ".*", py::arg("outside") = false, py::arg("project_boundaries")=nullopt, py::arg("grow_edges")=true, py::arg("limit_growth_vectors") = true, py::arg("sides_keep_surfaceindex")=false, + py::arg("keep_surfaceindex")=false, R"delimiter( Add boundary layer to mesh. From 8e94de7a732fc6f055f01e8c9f0f9772a08ea5c9 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 13 Feb 2024 13:01:42 +0100 Subject: [PATCH 19/20] fix isendpoint check in boundarylayer code --- libsrc/meshing/boundarylayer.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libsrc/meshing/boundarylayer.cpp b/libsrc/meshing/boundarylayer.cpp index e5a927e9..9db4601a 100644 --- a/libsrc/meshing/boundarylayer.cpp +++ b/libsrc/meshing/boundarylayer.cpp @@ -985,22 +985,23 @@ namespace netgen Array points; // find first vertex on edge double edge_len = 0.; - auto is_end_point = [&] (PointIndex pi, const Segment& testseg) + auto is_end_point = [&] (PointIndex pi) { // if(mesh[pi].Type() == FIXEDPOINT) // return true; // return false; auto segs = topo.GetVertexSegments(pi); + if(segs.Size() == 1) + return true; auto first_edgenr = mesh[segs[0]].edgenr; for(auto segi : segs) - if(auto& seg = mesh[segi]; seg.edgenr != first_edgenr || (testseg[0] == seg[1] && testseg[1] == seg[0])) + if(mesh[segi].edgenr != first_edgenr) return true; return false; }; bool any_grows = false; - const Segment* last_seg = nullptr; for(const auto& seg : segments) { if(seg.edgenr-1 == edgenr) @@ -1008,9 +1009,8 @@ namespace netgen if(growthvectors[seg[0]].Length2() != 0 || growthvectors[seg[1]].Length2() != 0) any_grows = true; - if(points.Size() == 0 && is_end_point(seg[0], seg)) + if(points.Size() == 0 && is_end_point(seg[0])) { - last_seg = &seg; points.Append(seg[0]); points.Append(seg[1]); edge_len += (mesh[seg[1]] - mesh[seg[0]]).Length(); @@ -1037,7 +1037,6 @@ namespace netgen edge_len += (mesh[points.Last()] - mesh[seg[1]]).Length(); points.Append(seg[1]); point_found = true; - last_seg = &seg; break; } else if(seg[1] == points.Last() && @@ -1046,11 +1045,10 @@ namespace netgen edge_len += (mesh[points.Last()] - mesh[seg[0]]).Length(); points.Append(seg[0]); point_found = true; - last_seg = &seg; break; } } - if(last_seg && is_end_point(points.Last(), *last_seg)) + if(is_end_point(points.Last())) break; if(!point_found) { From 4e31878f89443dce169638f81af111da44123d35 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Wed, 31 Jan 2024 11:55:53 +0100 Subject: [PATCH 20/20] Utility function to split faces when they have more than two adjacent domains --- libsrc/meshing/meshclass.cpp | 47 ++++++++++++++++++++++++++++++++++ libsrc/meshing/meshclass.hpp | 2 ++ libsrc/meshing/python_mesh.cpp | 1 + 3 files changed, 50 insertions(+) diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 382b669b..c7b70efc 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -7152,6 +7152,53 @@ namespace netgen SetNextMajorTimeStamp(); } + void Mesh :: SplitFacesByAdjacentDomains () + { + UpdateTopology(); + std::map, int> face_doms_2_new_face; + int nfaces = FaceDescriptors().Size(); + Array first_visit(nfaces); + first_visit = true; + + for (auto sei : Range(SurfaceElements())) + { + int eli0, eli1; + GetTopology().GetSurface2VolumeElement(sei+1, eli0, eli1); + auto & sel = (*this)[sei]; + int face = sel.GetIndex(); + int domin = VolumeElement(eli0).GetIndex(); + int domout = eli1 ? VolumeElement(eli1).GetIndex() : 0; + if(domin < domout) + swap(domin, domout); + auto key = std::make_tuple(face, domin, domout); + if(face_doms_2_new_face.find(key) == face_doms_2_new_face.end()) + { + if(!first_visit[face-1]) { + nfaces++; + FaceDescriptor new_fd = FaceDescriptors()[face-1]; + new_fd.bcprop = nfaces; + new_fd.domin = domin; + new_fd.domout = domout; + AddFaceDescriptor(new_fd); + SetBCName(nfaces-1, new_fd.GetBCName()); + face_doms_2_new_face[key] = nfaces; + } + else { + face_doms_2_new_face[key] = face; + auto & fd = FaceDescriptors()[face-1]; + fd.domin = domin; + fd.domout = domout; + } + first_visit[face-1] = false; + } + sel.SetIndex(face_doms_2_new_face[key]); + } + SetNextMajorTimeStamp(); + RebuildSurfaceElementLists (); + CalcSurfacesOfNode(); + UpdateTopology(); + } + void Mesh :: SetMaterial (int domnr, const string & mat) { if (domnr > materials.Size()) diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index a1adf171..e946244f 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -699,6 +699,8 @@ namespace netgen auto & GetCommunicator() const { return this->comm; } void SetCommunicator(NgMPI_Comm acomm); + DLL_HEADER void SplitFacesByAdjacentDomains(); + /// DLL_HEADER void SetMaterial (int domnr, const string & mat); /// diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 910a5e13..71bb1245 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -1250,6 +1250,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) .def ("GetCD3Name", &Mesh::GetCD3Name) .def ("SetCD3Name", &Mesh::SetCD3Name) + .def ("SplitFacesByAdjacentDomains", &Mesh::SplitFacesByAdjacentDomains) .def("GetIdentifications", [](Mesh & self) -> py::list { py::list points;