* Converted the minimum edge length used for subdividing geometry edges during the meshing phase into a user defined parameter accessible from the GUI

This commit is contained in:
Philippose Rajan 2014-01-25 21:17:16 +00:00
parent d5ae11a9b1
commit c7ba1a6dc8
9 changed files with 8915 additions and 8870 deletions

View File

@ -1003,9 +1003,16 @@ namespace netgen
int nedges = geom.emap.Extent(); int nedges = geom.emap.Extent();
double mincurvelength = IGNORECURVELENGTH;
double maxedgelen = 0; double maxedgelen = 0;
double minedgelen = 1e99; double minedgelen = 1e99;
if(occparam.resthminedgelenenable)
{
mincurvelength = occparam.resthminedgelen;
if(mincurvelength < IGNORECURVELENGTH) mincurvelength = IGNORECURVELENGTH;
}
multithread.task = "Setting local mesh size (elements per edge)"; multithread.task = "Setting local mesh size (elements per edge)";
// setting elements per edge // setting elements per edge
@ -1020,7 +1027,7 @@ namespace netgen
BRepGProp::LinearProperties(e, system); BRepGProp::LinearProperties(e, system);
double len = system.Mass(); double len = system.Mass();
if (len < IGNORECURVELENGTH) if (len < mincurvelength)
{ {
(*testout) << "ignored" << endl; (*testout) << "ignored" << endl;
continue; continue;

View File

@ -1585,6 +1585,8 @@ namespace netgen
{ {
resthcloseedgefac = 1; resthcloseedgefac = 1;
resthcloseedgeenable = 1; resthcloseedgeenable = 1;
resthminedgelen = 0.001;
resthminedgelenenable = 1;
} }
@ -1594,7 +1596,9 @@ namespace netgen
{ {
ost << "OCC Parameters:" << endl ost << "OCC Parameters:" << endl
<< "close edges: " << resthcloseedgeenable << "close edges: " << resthcloseedgeenable
<< ", fac = " << resthcloseedgefac << endl; << ", fac = " << resthcloseedgefac << endl
<< "minimum edge length: " << resthminedgelenenable
<< ", min len = " << resthminedgelen << endl;
} }

View File

@ -407,6 +407,12 @@ namespace netgen
int resthcloseedgeenable; int resthcloseedgeenable;
/// Minimum edge length to be used for dividing edges to mesh points
double resthminedgelen;
/// Enable / Disable use of the minimum edge length (by default use 1e-4)
int resthminedgelenenable;
/*! /*!
Default Constructor for the OpenCascade Default Constructor for the OpenCascade

View File

@ -43,6 +43,10 @@ namespace netgen
atof (Tcl_GetVar (interp, "::stloptions.resthcloseedgefac", 0)); atof (Tcl_GetVar (interp, "::stloptions.resthcloseedgefac", 0));
occparam.resthcloseedgeenable = occparam.resthcloseedgeenable =
atoi (Tcl_GetVar (interp, "::stloptions.resthcloseedgeenable", 0)); atoi (Tcl_GetVar (interp, "::stloptions.resthcloseedgeenable", 0));
occparam.resthminedgelen =
atof (Tcl_GetVar (interp, "::stloptions.resthminedgelen", 0));
occparam.resthminedgelenenable =
atoi (Tcl_GetVar (interp, "::stloptions.resthminedgelenenable", 0));
} }
}; };

View File

@ -271,9 +271,16 @@ proc meshingoptionsdialog { } {
-resolution 0.1 -variable stloptions.resthcloseedgefac -resolution 0.1 -variable stloptions.resthcloseedgefac
checkbutton $f.stl.r3.bu -text "STL/IGES/STEP - close edges" \ checkbutton $f.stl.r3.bu -text "STL/IGES/STEP - close edges" \
-variable stloptions.resthcloseedgeenable -variable stloptions.resthcloseedgeenable
pack $f.stl.r3.sc $f.stl.r3.bu -side left pack $f.stl.r3.sc $f.stl.r3.bu -side left
frame $f.stl.r1b
pack $f.stl.r1b -anchor w
scale $f.stl.r1b.sc -orient horizontal -length 200 -from 0.002 -to 10 \
-resolution 0.002 -variable stloptions.resthminedgelen
checkbutton $f.stl.r1b.bu -text "IGES/STEP - min edge length" \
-variable stloptions.resthminedgelenenable
pack $f.stl.r1b.sc $f.stl.r1b.bu -side left
frame $f.stl.r1 frame $f.stl.r1
pack $f.stl.r1 -anchor w pack $f.stl.r1 -anchor w
scale $f.stl.r1.sc -orient horizontal -length 200 -from 0.2 -to 5 \ scale $f.stl.r1.sc -orient horizontal -length 200 -from 0.2 -to 5 \

View File

@ -29,6 +29,10 @@ proc setgranularity { gran } {
set closeedgefaclist { 0.5 1 2 3.5 5 } set closeedgefaclist { 0.5 1 2 3.5 5 }
set stloptions.resthcloseedgefac [lindex $closeedgefaclist $gran] set stloptions.resthcloseedgefac [lindex $closeedgefaclist $gran]
global stloptions.resthminedgelen
set minedgelenlist { 0.002 0.02 0.2 1.0 2.0 5.0 10.0 }
set stloptions.resthminedgelen [lindex $minedgelenlist $gran]
global stloptions.resthedgeanglefac global stloptions.resthedgeanglefac
set edgeanglefaclist { 0.25 0.5 1 1.5 3 } set edgeanglefaclist { 0.25 0.5 1 1.5 3 }
set stloptions.resthedgeanglefac [lindex $edgeanglefaclist $gran] set stloptions.resthedgeanglefac [lindex $edgeanglefaclist $gran]

View File

@ -166,6 +166,8 @@ set stloptions.resthlinelengthfac 0.5
set stloptions.resthlinelengthenable 1 set stloptions.resthlinelengthenable 1
set stloptions.resthcloseedgefac 1 set stloptions.resthcloseedgefac 1
set stloptions.resthcloseedgeenable 1 set stloptions.resthcloseedgeenable 1
set stloptions.resthminedgelen 0.01
set stloptions.resthminedgelenenable 1
set stloptions.resthedgeanglefac 1 set stloptions.resthedgeanglefac 1
set stloptions.resthedgeangleenable 0 set stloptions.resthedgeangleenable 0
set stloptions.resthsurfmeshcurvfac 1 set stloptions.resthsurfmeshcurvfac 1
@ -488,6 +490,8 @@ proc saveoptions { } {
puts $datei "stloptions.resthchartdistenable ${stloptions.resthchartdistenable}" puts $datei "stloptions.resthchartdistenable ${stloptions.resthchartdistenable}"
puts $datei "stloptions.resthlinelengthfac ${stloptions.resthlinelengthfac}" puts $datei "stloptions.resthlinelengthfac ${stloptions.resthlinelengthfac}"
puts $datei "stloptions.resthlinelengthenable ${stloptions.resthlinelengthenable}" puts $datei "stloptions.resthlinelengthenable ${stloptions.resthlinelengthenable}"
puts $datei "stloptions.resthminedgelen ${stloptions.resthminedgelen}"
puts $datei "stloptions.resthminedgelenenable ${stloptions.resthminedgelenenable}"
puts $datei "stloptions.resthcloseedgefac ${stloptions.resthcloseedgefac}" puts $datei "stloptions.resthcloseedgefac ${stloptions.resthcloseedgefac}"
puts $datei "stloptions.resthcloseedgeenable ${stloptions.resthcloseedgeenable}" puts $datei "stloptions.resthcloseedgeenable ${stloptions.resthcloseedgeenable}"
puts $datei "stloptions.resthedgeanglefac ${stloptions.resthedgeanglefac}" puts $datei "stloptions.resthedgeanglefac ${stloptions.resthedgeanglefac}"

View File

@ -976,6 +976,9 @@ namespace nglib
closeedgeenable = 0; closeedgeenable = 0;
closeedgefact = 2.0; closeedgefact = 2.0;
minedgelenenable = 0;
minedgelen = 1e-4;
second_order = 0; second_order = 0;
quad_dominated = 0; quad_dominated = 0;
@ -1014,6 +1017,9 @@ namespace nglib
closeedgeenable = 0; closeedgeenable = 0;
closeedgefact = 2.0; closeedgefact = 2.0;
minedgelenenable = 0;
minedgelen = 1e-4;
second_order = 0; second_order = 0;
quad_dominated = 0; quad_dominated = 0;

View File

@ -106,6 +106,9 @@ public:
int closeedgeenable; //!< Enable / Disable mesh refinement at close edges int closeedgeenable; //!< Enable / Disable mesh refinement at close edges
double closeedgefact; //!< Factor to use for refinement at close edges (larger => finer) double closeedgefact; //!< Factor to use for refinement at close edges (larger => finer)
int minedgelenenable; //!< Enable / Disable user defined minimum edge length for edge subdivision
double minedgelen; //!< Minimum edge length to use while subdividing the edges (default = 1e-4)
int second_order; //!< Generate second-order surface and volume elements int second_order; //!< Generate second-order surface and volume elements
int quad_dominated; //!< Creates a Quad-dominated mesh int quad_dominated; //!< Creates a Quad-dominated mesh