From 0ae4f04f654ceacffcde0e28292b7dc2437f4901 Mon Sep 17 00:00:00 2001 From: nsr Date: Tue, 29 Sep 2020 19:26:54 +0530 Subject: [PATCH 1/5] Exposed parameters for parallel meshing, point tolerance, and setting granularity --- nglib/nglib.cpp | 33 +++++++++++++++++++++++++++++++++ nglib/nglib.h | 16 ++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/nglib/nglib.cpp b/nglib/nglib.cpp index bcff69d0c..75b6b3ea3 100644 --- a/nglib/nglib.cpp +++ b/nglib/nglib.cpp @@ -1013,6 +1013,17 @@ namespace nglib check_overlap = 1; check_overlapping_boundary = 1; + + parthreadenable = 0; + nthreads = 4; + + surfcurvfact = 2; + chartdistfact = 1.2; + edgeanglefact = 1; + surfmeshcurvfact = 1; + linelengthfact = 0.5; + + stlgeom_tol_fact = 1E-6; } @@ -1054,6 +1065,17 @@ namespace nglib check_overlap = 1; check_overlapping_boundary = 1; + + parthreadenable = 0; + nthreads = 4; + + surfcurvfact = 2; + chartdistfact = 1.2; + edgeanglefact = 1; + surfmeshcurvfact = 1; + linelengthfact = 0.5; + + stlgeom_tol_fact = 1E-6; } @@ -1086,6 +1108,17 @@ namespace nglib mparam.checkoverlap = check_overlap; mparam.checkoverlappingboundary = check_overlapping_boundary; + + mparam.parthread = parthreadenable; + mparam.nthreads = nthreads; + + stlparam.resthsurfcurvfac = surfcurvfact; + stlparam.resthchartdistfac = chartdistfact; + stlparam.resthedgeanglefac = edgeanglefact; + stlparam.resthsurfmeshcurvfac = surfmeshcurvfact; + stlparam.resthlinelengthfac = linelengthfact; + + stldoctor.geom_tol_fact = stlgeom_tol_fact; } // ------------------ End - Meshing Parameters related functions -------------------- diff --git a/nglib/nglib.h b/nglib/nglib.h index 286db0cb7..a4b6aef3a 100644 --- a/nglib/nglib.h +++ b/nglib/nglib.h @@ -130,6 +130,20 @@ class Ng_Meshing_Parameters int check_overlap; //!< Check for overlapping surfaces during Surface meshing int check_overlapping_boundary; //!< Check for overlapping surface elements before volume meshing + // Nikhil - 29/09/2020 + // Added a couple more parameters into the meshing parameters list + // from Netgen into Nglib + int parthreadenable; //!< Enable / Disable parallel threads + int nthreads; //!< Set number of threads to use + + double surfcurvfact; //!< Set STL - surface curvature + double chartdistfact; //!< Set STL - chart distance + double edgeanglefact; //!< Set STL - edge angle + double surfmeshcurvfact; //!< Set STL - surface mesh curv + double linelengthfact; //!< Set STL - line length + + double stlgeom_tol_fact; //!< Set the point tolerance in STL files + /*! Default constructor for the Mesh Parameters class @@ -155,6 +169,8 @@ class Ng_Meshing_Parameters - #invert_trigs:0 - #check_overlap: 1 - #check_overlapping_boundary: 1 + - #parthreadenable: 0 + - #nthreads: 4 */ DLL_HEADER Ng_Meshing_Parameters(); From 5b0f650a282e8d66e79c0766888d428482a8538a Mon Sep 17 00:00:00 2001 From: nsr Date: Tue, 29 Sep 2020 19:40:00 +0530 Subject: [PATCH 2/5] adding comments to nglib.h for new parameters --- nglib/nglib.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nglib/nglib.h b/nglib/nglib.h index a4b6aef3a..2746000da 100644 --- a/nglib/nglib.h +++ b/nglib/nglib.h @@ -171,6 +171,12 @@ class Ng_Meshing_Parameters - #check_overlapping_boundary: 1 - #parthreadenable: 0 - #nthreads: 4 + - #surfcurvfact: 2 + - #chartdistfact: 1.2 + - #edgeanglefact: 1 + - #surfmeshcurvfact: 1 + - #linelengthfact: 0.5 + - #stlgeom_tol_fact: 1E-6 */ DLL_HEADER Ng_Meshing_Parameters(); From b3bbc670a28aa4a353176ab0ca8dc5dc3568936a Mon Sep 17 00:00:00 2001 From: nsr Date: Thu, 29 Oct 2020 21:44:09 +0530 Subject: [PATCH 3/5] new parameters exposed - opterrpow, delaunay, blockfill, filldist, maxoutersteps, only3D_domain_nr, try_hexes. replace parthread with parallel_meshing --- nglib/nglib.cpp | 31 ++++++++++++++++++++++++++++--- nglib/nglib.h | 12 ++++++++++-- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/nglib/nglib.cpp b/nglib/nglib.cpp index 75b6b3ea3..c030e333a 100644 --- a/nglib/nglib.cpp +++ b/nglib/nglib.cpp @@ -1014,8 +1014,16 @@ namespace nglib check_overlap = 1; check_overlapping_boundary = 1; - parthreadenable = 0; + parallel_meshing = 1; nthreads = 4; + + opterrpow = 2; + delaunayenable = 1; + blockfillenable = 1; + blockfilldist = 0.1; + maxoutersteps = 10; + only3D_domain_nr = 0; + try_hexes = 0; surfcurvfact = 2; chartdistfact = 1.2; @@ -1066,8 +1074,16 @@ namespace nglib check_overlap = 1; check_overlapping_boundary = 1; - parthreadenable = 0; + parallel_meshing = 1; nthreads = 4; + + opterrpow = 2; + delaunayenable = 1; + blockfillenable = 1; + blockfilldist = 0.1; + maxoutersteps = 10; + only3D_domain_nr = 0; + try_hexes = 0; surfcurvfact = 2; chartdistfact = 1.2; @@ -1100,6 +1116,7 @@ namespace nglib mparam.meshsizefilename = meshsize_filename; else mparam.meshsizefilename = ""; + mparam.optsteps2d = optsteps_2d; mparam.optsteps3d = optsteps_3d; @@ -1109,8 +1126,16 @@ namespace nglib mparam.checkoverlap = check_overlap; mparam.checkoverlappingboundary = check_overlapping_boundary; - mparam.parthread = parthreadenable; + mparam.parallel_meshing = parallel_meshing; mparam.nthreads = nthreads; + + mparam.opterrpow = opterrpow; + mparam.delaunay = delaunayenable; + mparam.blockfill = blockfillenable; + mparam.filldist = blockfilldist; + mparam.maxoutersteps = maxoutersteps; + mparam.only3D_domain_nr = only3D_domain_nr; + mparam.try_hexes = try_hexes; stlparam.resthsurfcurvfac = surfcurvfact; stlparam.resthchartdistfac = chartdistfact; diff --git a/nglib/nglib.h b/nglib/nglib.h index 2746000da..c631b0a86 100644 --- a/nglib/nglib.h +++ b/nglib/nglib.h @@ -133,8 +133,16 @@ class Ng_Meshing_Parameters // Nikhil - 29/09/2020 // Added a couple more parameters into the meshing parameters list // from Netgen into Nglib - int parthreadenable; //!< Enable / Disable parallel threads + int parallel_meshing; //!< Enable / Disable parallel meshing int nthreads; //!< Set number of threads to use + + double opterrpow; + int delaunayenable; //!< Enable / Disable delaunay + int blockfillenable; //!< Enable / Disable block fill + double blockfilldist; //!< Enable / Disable block fill distance + int maxoutersteps; //!< Set max number of outer steps + int only3D_domain_nr; + int try_hexes; //!< Enable / Disable hex-meshing double surfcurvfact; //!< Set STL - surface curvature double chartdistfact; //!< Set STL - chart distance @@ -169,7 +177,7 @@ class Ng_Meshing_Parameters - #invert_trigs:0 - #check_overlap: 1 - #check_overlapping_boundary: 1 - - #parthreadenable: 0 + - #parallel_meshing: 1 - #nthreads: 4 - #surfcurvfact: 2 - #chartdistfact: 1.2 From 30c48a8df0cdf0d1e0fbe5932e32357f20a57189 Mon Sep 17 00:00:00 2001 From: nsr Date: Fri, 30 Oct 2020 18:33:44 +0530 Subject: [PATCH 4/5] connected closeedgeenable and closeedgefact to mparam.closeedgefac, and added comments --- nglib/nglib.cpp | 5 ++++- nglib/nglib.h | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/nglib/nglib.cpp b/nglib/nglib.cpp index c030e333a..a68b4e484 100644 --- a/nglib/nglib.cpp +++ b/nglib/nglib.cpp @@ -1116,7 +1116,7 @@ namespace nglib mparam.meshsizefilename = meshsize_filename; else mparam.meshsizefilename = ""; - + mparam.optsteps2d = optsteps_2d; mparam.optsteps3d = optsteps_3d; @@ -1144,6 +1144,9 @@ namespace nglib stlparam.resthlinelengthfac = linelengthfact; stldoctor.geom_tol_fact = stlgeom_tol_fact; + + if(closeedgeenable) + mparam.closeedgefac = closeedgefact; } // ------------------ End - Meshing Parameters related functions -------------------- diff --git a/nglib/nglib.h b/nglib/nglib.h index c631b0a86..a702c8e26 100644 --- a/nglib/nglib.h +++ b/nglib/nglib.h @@ -136,12 +136,12 @@ class Ng_Meshing_Parameters int parallel_meshing; //!< Enable / Disable parallel meshing int nthreads; //!< Set number of threads to use - double opterrpow; + double opterrpow; //!< Set power of error (to approximate max err optimization) int delaunayenable; //!< Enable / Disable delaunay int blockfillenable; //!< Enable / Disable block fill double blockfilldist; //!< Enable / Disable block fill distance int maxoutersteps; //!< Set max number of outer steps - int only3D_domain_nr; + int only3D_domain_nr; //!< Select domain to perform volume meshing ignoring others. (0 => ignore none) int try_hexes; //!< Enable / Disable hex-meshing double surfcurvfact; //!< Set STL - surface curvature @@ -179,6 +179,13 @@ class Ng_Meshing_Parameters - #check_overlapping_boundary: 1 - #parallel_meshing: 1 - #nthreads: 4 + - #opterrpow: 2 + - #delaunayenable: 1 + - #blockfillenable = 1 + - #blockfilldist = 0.1 + - maxoutersteps = 10 + - only3D_domain_nr = 0 + - try_hexes = 1 - #surfcurvfact: 2 - #chartdistfact: 1.2 - #edgeanglefact: 1 From 9db68e28f21e1ca5120ffe63bfa373530dfd4f83 Mon Sep 17 00:00:00 2001 From: nsr Date: Fri, 30 Oct 2020 18:41:46 +0530 Subject: [PATCH 5/5] fixed typo in comment --- nglib/nglib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nglib/nglib.h b/nglib/nglib.h index a702c8e26..e3a578000 100644 --- a/nglib/nglib.h +++ b/nglib/nglib.h @@ -185,7 +185,7 @@ class Ng_Meshing_Parameters - #blockfilldist = 0.1 - maxoutersteps = 10 - only3D_domain_nr = 0 - - try_hexes = 1 + - try_hexes = 0 - #surfcurvfact: 2 - #chartdistfact: 1.2 - #edgeanglefact: 1