adding tcl - files

This commit is contained in:
Joachim Schoeberl 2009-01-17 20:52:26 +00:00
parent d462a1e95a
commit e3fe37b68f
12 changed files with 8520 additions and 0 deletions

3532
ng/dialog.tcl Normal file

File diff suppressed because it is too large Load Diff

106
ng/drawing.tcl Normal file
View File

@ -0,0 +1,106 @@
#
# Creates a drawing frame, and binds mouse events
#
set oldmousex 0
set oldmousey 0
#
# if { 1 } {
if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect false }] } {
puts "no OpenGL"
} {
#
pack .ndraw -expand true -fill both -padx 10 -pady 10
#
bind .ndraw <Button-1> {
set oldmousex %x; set oldmousey %y;
}
bind .ndraw <Button-2> {
set oldmousex %x; set oldmousey %y;
}
bind .ndraw <Button-3> {
set oldmousex %x; set oldmousey %y;
}
bind .ndraw <B1-Motion> {
Ng_MouseMove $oldmousex $oldmousey %x %y $drawmode
.ndraw render
set oldmousex %x; set oldmousey %y;
}
bind .ndraw <Double-1> {
Ng_MouseDblClick %x %y
.ndraw render
if { [winfo exists .bcprop_dlg] } { bcpropdialog }
if { [winfo exists .fieldlines_dlg] } { fieldlinesdialog }
}
bind .ndraw <B2-Motion> {
Ng_MouseMove $oldmousex $oldmousey %x %y move
.ndraw render
set oldmousex %x; set oldmousey %y;
}
bind .ndraw <B3-Motion> {
Ng_MouseMove $oldmousex $oldmousey %x %y zoom
.ndraw render
set oldmousex %x; set oldmousey %y;
}
}
proc popupcheckredraw { vari { x 0 } } {
upvar $vari varname
if { $varname == 1 } {
set varname 0
} {
# puts "popup-redraw $vari"
Ng_Vis_Set parameters
redraw
}
}
proc popupcheckredraw2 { vari boolvar { x 0 } } {
upvar $vari varname
if { $varname == 1 } {
set varname 0
} {
Ng_SetVisParameters
if { $boolvar == 1 } { redraw }
Ng_SetVisParameters
}
}
proc popupcheckredraw3 { vari { x 0 } } {
upvar $vari varname
if { $varname == 1 } {
set varname 0
} {
Ng_Vis_Set parameters
}
}
proc redraw { {x 0} } {
if {[winfo exists .ndraw]} { .ndraw render }
}
bind . <Left> { Ng_MouseMove 0 0 -10 0 rotate; redraw }
bind . <Right> { Ng_MouseMove 0 0 10 0 rotate; redraw }
bind . <Up> { Ng_MouseMove 0 0 0 -10 rotate; redraw }
bind . <Down> { Ng_MouseMove 0 0 0 10 rotate; redraw }
bind . <Shift-Left> { Ng_MouseMove 0 0 -10 0 move; redraw }
bind . <Shift-Right> { Ng_MouseMove 0 0 10 0 move; redraw }
bind . <Shift-Up> { Ng_MouseMove 0 0 0 -10 move; redraw }
bind . <Shift-Down> { Ng_MouseMove 0 0 0 10 move; redraw }
bind . <Control-Up> { Ng_MouseMove 0 0 0 -10 zoom; redraw }
bind . <Control-Down> { Ng_MouseMove 0 0 0 10 zoom; redraw }
bind all <Button-4> \
{event generate [focus -displayof %W] <MouseWheel> -delta 120}
bind all <Button-5> \
{event generate [focus -displayof %W] <MouseWheel> -delta -120}
bind all <MouseWheel> { Ng_MouseMove 0 0 0 [expr {%D/-5}] zoom; redraw }

1137
ng/menustat.tcl Normal file

File diff suppressed because it is too large Load Diff

302
ng/ng.tcl Normal file
View File

@ -0,0 +1,302 @@
puts "found ng.tcl"
if {[catch {package require Tix }]} {
puts "cannot find package Tix"
}
# if {[catch {package require Togl 1.7}]} {
# puts "cannot find package Togl 1.7"
# }
# userlevel 1..standard user 2..power-user 3..developer
set userlevel 3
if { [Ng_GetCommandLineParameter expert]=="defined" } {
set userlevel 3
}
set progname "NETGEN"
set ngdir ""
if { [lsearch [array names env] NETGENDIR] != -1 } {
set ngdir $env(NETGENDIR)
}
if { [string length $ngdir] == 0 } {
set ngdir "."
}
set batchmode [Ng_GetCommandLineParameter batchmode]
set solvemode 0
if { [Ng_GetCommandLineParameter solve] != "undefined" || [Ng_GetCommandLineParameter recent] == "defined" } {
set solvemode defined
}
set shellmode [Ng_GetCommandLineParameter shellmode]
if { $shellmode == "defined" } {
set batchmode "defined"
}
if { $batchmode != "defined" } {
catch {
wm withdraw .
wm title . $progname
wm geometry . =800x600
wm minsize . 400 300
}
}
source ${ngdir}/variables.tcl
source ${ngdir}/parameters.tcl
if { $batchmode != "defined" } {
catch {
source ${ngdir}/menustat.tcl
}
}
catch {
source ${ngdir}/dialog.tcl
}
catch {
source ${ngdir}/drawing.tcl
}
catch {
source ${ngdir}/nghelp.tcl
}
catch {
source ${ngdir}/ngvisual.tcl
}
catch {
source ${ngdir}/sockets.tcl
}
catch {
source ${ngdir}/acis.tcl
}
catch { source ${ngdir}/ngsolve/ngsolve.tcl }
# catch { [source ${ngdir}/ngsolve/preproc.tcl] }
# catch { [source ${ngdir}/ngsolve/pdecreator.tcl] }
# some applications:
# source ${ngdir}/demoapp/demoapp.tcl
# source ${ngdir}/metis/ngmetis.tcl
# trafo/zugstange : menu
##################################################
set zugstange 0
catch { source ${ngdir}/trafo/menu.tcl }
setgranularity ${meshoptions.fineness}
Ng_SetMeshingParameters
Ng_SetVisParameters
Ng_SetDebugParameters
Ng_STLDoctor
Ng_GeometryOptions set
Ng_SetOCCVisParameters
if { $batchmode != "defined" } {
catch {
wm protocol . WM_DELETE_WINDOW { .ngmenu.file invoke "Quit" }
wm deiconify .
}
}
set trafoapp 0
catch { source ${ngdir}/trafoapp/trafoapp.tcl }
set geofilename [Ng_GetCommandLineParameter geofile]
if { $geofilename != "undefined" &&
[info exists trafo] == 0 && $zugstange == 0} {
if { [ catch { Ng_LoadGeometry $geofilename } errstring] == 0 } {
if { $batchmode != "defined" } {
AddRecentFile $geofilename
}
Ng_ParseGeometry
if { $batchmode != "defined" } {
set selectvisual geometry
Ng_SetVisParameters
redraw
wm title . [concat "$progname - " $geofilename]
}
set dirname [file dirname $geofilename]
set basefilename [file tail [file rootname $geofilename]]
} {
puts "Problem with input file:"
puts "$errstring"
}
}
set cnt 0
foreach { gran } { verycoarse coarse moderate fine veryfine } {
set cnt [expr $cnt + 1]
if { [Ng_GetCommandLineParameter $gran] == "defined" } {
set meshoptions.fineness $cnt
setgranularity ${meshoptions.fineness}
}
}
set meshfilename [Ng_GetCommandLineParameter meshfile]
if { $meshfilename == "undefined" } {
set meshfilename out.mesh
}
set meshfiletype [Ng_GetCommandLineParameter meshfiletype]
if { $meshfiletype == "undefined" } {
set meshfiletype netgen
}
set inputmeshfilename [Ng_GetCommandLineParameter inputmeshfile]
set mergemeshfilename [Ng_GetCommandLineParameter mergefile]
set meshsizefilename [Ng_GetCommandLineParameter meshsizefile]
if { $meshsizefilename != "undefined" } {
set options.meshsizefilename $meshsizefilename
}
set refinementfilename [Ng_GetCommandLineParameter refinementfile]
if { $batchmode == "defined" && $solvemode != "defined"} {
set options.parthread 0
if { $shellmode == "undefined" } {
# old batchmode: only processes commandline arguments
set selectvisual mesh
Ng_SetVisParameters
set meshsize [Ng_GetCommandLineParameter meshsize]
if {$meshsize != "undefined"} { set options.meshsize $meshsize }
if { $inputmeshfilename == "undefined" } {
Ng_GenerateMesh ${meshoptions.firststep} ${meshoptions.laststep}
} else {
Ng_LoadMesh $inputmeshfilename
if { $mergemeshfilename != "undefined" } {
Ng_MergeMesh $mergemeshfilename
}
}
if { $refinementfilename != "undefined" } {
Ng_Bisect $refinementfilename
}
if { $meshfiletype == "netgen" } {
Ng_SaveMesh $meshfilename
} else {
if { [catch { Ng_ExportMesh $meshfilename $meshfiletype } ] == 1 } {
puts "Unknown file format $meshfiletype"
}
}
Ng_Exit;
exit
} else {
set code [catch { source ${ngdir}/ngshell.tcl } errcode]
if {$code} {
puts "error: $errcode"
}
set code [ catch {Ng_RunShell} errcode]
if {$code} {
puts "error: $errcode"
}
Ng_Exit;
exit
}
}
set stereo [Ng_GetCommandLineParameter stereo]
if { $stereo == "defined" } {
set viewoptions.stereo 1
puts "use stereo mode"
Ng_SetVisParameters;
redraw
}
set scriptfilename [Ng_GetCommandLineParameter script]
if { $scriptfilename != "undefined" } {
if { [catch { source $scriptfilename } errstring] == 1 } {
puts "Error in input: $errstring"
}
}
if { [Ng_GetCommandLineParameter help]=="defined" } {
if { $zugstange == 1 } {
print_zug_commandline_help
exit;
} {
if { $trafoapp == 1 } {
print_trafo_commandline_help;
} {
print_commandline_help;
Ng_Exit;
exit
}
}
}
if { [file exists startup.tcl] } {
source startup.tcl }
##################################################
catch { source ${ngdir}/trafo/trafo.tcl }
catch { source ${ngdir}/trafoapp/smallmodels.tcl }
catch {
source ${ngdir}/ngshell.tcl
source ${ngdir}/ngtesting.tcl
}
# source ngusers/ebg/elasticity/ebgelast.tcl
if { [catch { load libngsolve.so ngsolve }] } {
puts "cannot load ngsolve"
} {
source ${ngdir}/ngsolve.tcl
}
catch { source ${ngdir}/demoapp.tcl }
if { [catch { load libdemoapp.so demoapp }] } {
puts "cannot load demoapp"
} {
}

338
ng/nghelp.tcl Normal file
View File

@ -0,0 +1,338 @@
proc print_commandline_help { } {
puts "Usage: ng { options }"
puts "-geofile=filename Input geometry file (alternative: ng filename)"
puts "-meshfile=filename Output mesh file"
puts "-verycoarse, -coarse, -moderate, -fine, -veryfine"
puts " Automatic mesh-size selection"
puts "-meshsizefile=filename Load mesh-size file with local mesh sizes"
puts "-meshfiletype={\"Neutral Format\", ...}"
puts " Filetype of output file, default is netgen file"
puts "-batchmode Run Netgen in batchmode"
puts "-inputmeshfile=filename"
puts " Input mesh file (batchmode only)"
puts "-mergefile=filename Merge with mesh file (batchmode only)"
puts "-refinementfile=filename"
puts " Use refinementinfo from file (batchmode only)"
puts "-serversocket=\#num Start a Netgen server with port \#num"
puts "-V Print additional information"
puts "-testout=filename file for test output"
if { [catch { NGS_GetData } ] == 0 } {
puts "\nNGSolve parameters:"
puts "-pdefile=filename Load pde input file"
puts "-solve Solve pde once"
puts "-solve=n Solve pde by n adaptive refinement steps"
puts "-recent Load and solve most recently loaded pde"
}
}
proc set_menu_help { entry helpmsg } {
global menuhelps
set menuhelps($entry) $helpmsg
}
proc show_menu_help { entry } {
global menuhelps
if {[catch {set helptext $menuhelps($entry)}]} {
set helptext "no help available "
}
.helpline configure -text $helptext
if {[winfo exists .senshelp_dlg]==1} {
.senshelp_dlg.text delete 1.0 end
.senshelp_dlg.text insert end "Menu item: $entry\n\n"
.senshelp_dlg.text insert end $helptext
}
}
tixBalloon .balloon -statusbar .helpline
proc set_control_help { control helpmsg } {
bind $control <Enter> "show_control_help {$helpmsg}"
bind $control <Leave> "show_control_help {None}"
.balloon bind $control -balloonmsg $helpmsg -statusmsg $helpmsg
# puts "Add Help to $control"
}
proc show_control_help { helpmsg } {
.helpline configure -text $helpmsg
if {[winfo exists .senshelp_dlg]==1} {
.senshelp_dlg.text delete 1.0 end
.senshelp_dlg.text insert end $helpmsg
}
}
proc sensitivehelpdialog { show } {
set w .senshelp_dlg
if {[winfo exists .senshelp_dlg] == 1} {
if { $show == 1 } {
wm withdraw .senshelp_dlg
wm deiconify $w
focus $w
} {
wm withdraw $w
}
} {
toplevel $w
# wm minsize $w 200 150
global senshelptext
text $w.text -yscrollcommand "$w.scroll set" -setgrid true \
-width 40 -height 10 -wrap word
scrollbar $w.scroll -command "$w.text yview"
pack $w.scroll -side right -fill y
pack $w.text -expand yes -fill both
frame $w.bu
pack $w.bu
# -fill x
button $w.close -text "Close" \
-command {
wm withdraw .senshelp_dlg
set showsensitivehelp 0
}
pack $w.close
if { $show == 1 } {
wm withdraw $w
wm geom $w +100+100
wm deiconify $w
wm title $w "Help"
focus $w
}
}
}
set_menu_help "File" "In File menu you can load and store geometries, meshes etc."
set_menu_help "New Geometry" "Deletes current geometry"
set_menu_help "Load Geometry" "Loads Geometry file in one of the formats STL (ASCII or binary), Constructive Solid Geometry (.geo) or 2D geometry. Please have a look into Netgen User's manuel for more details."
set_menu_help "Save Geometry" "Saves STL Geometry in in either ASCII or binary STL format."
set_menu_help "Load Mesh" "Loads surface and volume mesh in Netgen internal format."
set_menu_help "Save Mesh" "Saves surface and volume mesh in Netgen internal format."
set_menu_help "Write EPS File" "Dumps OpenGL rendering to EPS File."
set_menu_help "Save Options" "Saves current options in file \"ng.opt\". These options will be loaded again when starting ng in the same directory."
set_menu_help "Export Mesh" "Exports mesh in format defined by Export Filetype."
set_menu_help "Export Filetype" "Selects file format for exporting mesh. Please have a look into the Netgen User's manual for more information."
set_menu_help "Import Mesh" "Imports surface or volume mesh in exchange format."
set_menu_help "Quit" "Quits Netgen"
set_menu_help "Geometry" "Preparing geometries, visualiztion of geometries."
set_menu_help "Scan CSG Geometry" "Generates surface triangulation for rendering"
set_menu_help "CSG Options" "Sets Options for CSG visualization (bounding box, detail size, number of facets)."
set_menu_help "CSG Properties" "Defines appearence of current CSG geometry (color, visibility, transparency)"
set_menu_help "STL Doctor" "Calls STL Doctor for preprocessing STL geometry files."
set_menu_help "STL Info" "Retrieves information about current STL geometry."
set_menu_help "Mesh" "Menu for mesh generation"
set_menu_help "Generate Mesh" "Generates mesh from geometry, same as Button \"Generate Mesh\""
set_menu_help "Stop Meshing" "Terminates meshgeneration. It may take a while until meshing terminates, please be patient."
set_menu_help "Meshing Options" "Set options for mesh generation."
set_menu_help "Delete Mesh" "Deletes mesh. Not necessary before generation of new mesh."
set_menu_help "Delete Vol Mesh" "Deletes only volume mesh."
set_menu_help "Mesh Quality" "Computs element shape measures. Triangle angles are inner angles of all triangles (faces of tetrahedra). Tet angles are angles between faces of tetrahedra."
set_menu_help "Check Surface Mesh" "Checks consistency and overlap of surface mesh. Marks overlapping elements as bad elements, please enable visualization of bad elements in View->Mesh."
set_menu_help "Check Volume Mesh" "Checks conformity of volume mesh."
set_menu_help "Edit Boundary Conditions" "Open dialog for setting boundary condition numbers for individual faces."
set_menu_help "Analyze Geometry" "Perform only first step in mesh generation. Action depends on geometry type, e.g. generates charts for STL mesh, find vertices in CSG geometries."
set_menu_help "Mesh Edges" "Meshes edges"
set_menu_help "Mesh Surface" "Generates surface mesh. Includes already surface optimization for some geomtry types."
set_menu_help "Optimize Surface" "Optimizes surface mesh."
set_menu_help "Surface Optim. Step" "Performs a specific surface optimiztion step. Mesh smoothing moves nodes. edge swapping swaps the diagonal of a quadrilateral built by two triangles, criterion either by number of nodes, or anlges. Combine points eliminates triangles by combining points (in the center of gravity)."
set_menu_help "Mesh Volume" "Performs volume meshing. Algorithm is a combination of Delaunay and Rule-based Advancing Front"
set_menu_help "Optimize Volume" "Performs additional volume optimization steps"
set_menu_help "Smooth Opt Volume" "Performs optimization steps by smoothing iterations"
set_menu_help "Smooth Opt Volume Jacobian" "Volume optimization by smoothing iterations. Criterion is optimization of Jacobi determinants. This optimization step is also available for 10-node tetrahedra."
set_menu_help "View" "Sets viewing options"
set_menu_help "Zoom all" "Zooms scene to show whole object"
set_menu_help "Center" "Defines center of rotation"
set_menu_help "Viewing Options" "Sets viewing options for geometry, mesh, lighting"
set_menu_help "Clipping Plane" "Introduces clipping plane. The clipping plane is defined by the normal vector, and a scaled offset. Clipping of performed by OpenGl rendering"
set_menu_help "Quality Plot" "Shows the element quality distribution histogram. Measure is volume scaled by edge-length to the third. Optimal elements have measure 1."
set_menu_help "Sensitve Help" "Shows this help window"
set_menu_help "Mesh-size" "Manipulations of existing mesh"
set_menu_help "Refine uniform" "Refines mesh by splitting elements into eight childs (algorithm of J. Bey)"
set_menu_help "Second Order" "Converts 4 node elements to 10 node elements. Edge-midpoitns are projected to the geometry."
set_menu_help "Refinement Dialog" "Controls local mesh refinement"
set_menu_help "Load Meshsize" "Loads mesh-size file for local mesh refinement."
set_menu_help "MS from Surf Mesh" "Defines mesh-size by the surface mesh."
set f .options_dlg.nb.nbframe.general
# set_control_help $f "General meshing page"
set_control_help $f.fine "Controls relative mesh size.\nThis control affects other mesh-size controls in common"
set_control_help $f.first "First step in mesh generation. Usually, meshing starts from \"analyze geometry\". If the surface mesh is already available \"First step\" should be set to \"mesh volume\""
set_control_help $f.last "Last step in mesh generation. If only the surface mesh is required, please set \"Last Step\" to \"Optimize Surface\""
set_control_help .bubar.surfm "Start mesh generation"
set_control_help .bubar.stopm "Start mesh generation"
proc help_item { helptext } {p
puts $helptext
}
proc show_help { } {
set w .help
if {[winfo exists .help] == 1} {
wm withdraw $w
wm deiconif $w
focus $w
} {
toplevel $w
frame $w.buttons
pack $w.buttons -side bottom -fill x -pady 2m
button $w.buttons.done -text Done -command "destroy $w"
pack $w.buttons.done -side left -expand 1
text $w.text -yscrollcommand "$w.scroll set" -setgrid true \
-width 60 -height 24 -wrap word
scrollbar $w.scroll -command "$w.text yview"
pack $w.scroll -side right -fill y
pack $w.text -expand yes -fill both
}
$w.text configure -state normal
$w.text delete 1.0 end
}
set bold "-background #43ce80 -relief raised -borderwidth 1"
set normal "-background {} -relief flat"
proc help_main { } {
show_help;
set w .help
global bold
global normal
$w.text insert 0.0 \
{NETGEN Help}
$w.text insert end \n\n
$w.text insert end \
{1. General} d1
$w.text insert end \n\n
$w.text insert end \
{2. Menu items } d2
$w.text insert end \n\n
foreach tag {d1 d2} {
$w.text tag bind $tag <Any-Enter> "$w.text tag configure $tag $bold"
$w.text tag bind $tag <Any-Leave> "$w.text tag configure $tag $normal"
}
$w.text tag bind d1 <1> { puts "general"; help_general }
$w.text tag bind d2 <1> { help_menus }
$w.text configure -state disabled
}
proc help_general { } {
show_help;
set w .help
global bold
global normal
puts "general called"
$w.text insert 0.0 \
{NETGEN is an automatic three dimensional tetrahedral mesh generation system. It accepts input from constructive solid geometry (CSG) or boundary representation (BRep) from STEP or STL file format. NETGEN contains modules for mesh optimization and hierarchical mesh refinement.}
$w.text configure -state disabled
}
proc help_menus { } {
show_help;
set w .help
global bold
global normal
$w.text insert 0.0 \
{The NETGEN Menu items are}
$w.text insert end \n\n
$w.text insert end \
{1. File} d1
$w.text insert end \n\n
$w.text insert end \
{2. Geometry } d2
$w.text insert end \n\n
$w.text insert end \
{3. Mesh } d3
$w.text insert end \n\n
$w.text insert end \
{4. View } d4
$w.text insert end \n\n
$w.text insert end \
{5. Mesh-size } d5
$w.text insert end \n\n
$w.text insert end \
{6. STL } d6
foreach tag {d1 d2 d3 d4 d5 d6} {
$w.text tag bind $tag <Any-Enter> "$w.text tag configure $tag $bold"
$w.text tag bind $tag <Any-Leave> "$w.text tag configure $tag $normal"
}
$w.text tag bind d1 <1> {puts "File menu"}
$w.text tag bind d2 <1> {puts "Geometry menu"}
$w.text tag bind d3 <1> {puts "Mesh menu"}
$w.text tag bind d4 <1> {puts "View menu"}
$w.text tag bind d5 <1> {puts "Mesh-size menu"}
$w.text tag bind d6 <1> {puts "STL menu"}
$w.text configure -state disabled
}

75
ng/ngicon.tcl Normal file
View File

@ -0,0 +1,75 @@
set icon_data {
/* XPM */
static char *icon2[] = {
/* width height num_colors chars_per_pixel */
" 60 60 6 1",
/* colors */
". c #000000",
"# c #008000",
"a c #00b700",
"b c #00c700",
"c c #00ff00",
"d s c None c None",
/* pixels */
"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
"dddddddddddddddd..........dddddddddddddddddddddddddddddddddd",
"ddddddddddddddd.c..cc#####................dddddddddddddddddd",
"ddddddddddddd..cccc..ccccccccccccccccc...#...............ddd",
"dddddddddddd.cccccccc..cccccccccccc...ccc..cccccccccc###..dd",
"ddddddddddd.ccccccccccc..ccccccccc.cccccccc.ccccccccccc...dd",
"dddddddddd.cccccccccccccc.cccccc..cccccccccc.ccccccccc.b..dd",
"ddddddddd.cccccccccccccccc..ccc.ccccccccccccc..cccccc.bb..dd",
"ddddddd........................cccccccccccccccc.cccc.bbb..dd",
"dddddd.ccc.ccccccccccccccccc..#..............ccc.c..bbbb..dd",
"dddd..ccccc..cccccccccccccc.#..##############.....bbbbb.b.dd",
"ddd.ccccccccc..ccccccccccc.##.#.#################.bbbbb.b.dd",
"dd.cccccccccccc..cccccccc.###.##.################.bbbbb.b.dd",
"d..cccccccccccccc..ccccc.####.###.###############.bbbbb.b.dd",
"d.a..............cc..cc.#####.####.##############.bbbb.bb.dd",
"d..aaaaaaaaaaaaaa......######.#####.#############.bbbb.bb.dd",
"d.a.aaaaaaaaaaaaaaaaa...#####.######..###########.bbbb.bb.dd",
"d.aa.aaaaaaaaaaaaaaaa...#####.########.##########.bbbb.bb.dd",
"d.aaa.aaaaaaaaaaaaaaa..#.####.#########.##########..b.bbb.dd",
"d.aaaa.aaaaaaaaaaaaaa..#.####.##########.#########..b.bbb.dd",
"d.aaaaa..aaaaaaaaaaaa..##.###.###########.########..b.bbb.dd",
"d.aaaaaaa.aaaaaaaaaaa..###.###.###########.#######..b.bbb.dd",
"d.aaaaaaaa.aaaaaaaaaa..###.###.############.######..b.bbb#.d",
"d.aaaaaaaaa.aaaaaaaaa..####.##.#############.#####...bbbb#.d",
"d.aaaaaaaaaa.aaaaaaaa..#####.#.##############.####...bbbb#.d",
"d.aaaaaaaaaaa.aaaaaaa..#####.#.###############.###...bbbb#.d",
"d.aaaaaaaaaaaa.aaaaaa..######..################.##...bbbb#.d",
"d.aaaaaaaaaaaaa.aaaaaaa.#####..#################.#..bbbbb#.d",
"d.aaaaaaaaaaaaaa.aaaaaa.#####.............#######...bbbbb#.d",
"d.aaaaaaaaaaaaaaa.aaaaa.####.###.#########..........bbbbbb.d",
"dd.aaaaaaaaaaaaaaa.aaaa.###.#####..##############...bbbbbb.d",
"dd.aaaaaaaaaaaaaaaa.aaa.##.########.############.b...bbbbb.d",
"dd.aaaaaaaaaaaaaaaaa.aa.#.##########...########.b.bbb.bbbb.d",
"dd.aaaaaaaaaaaaaaaaaa....##############.######.bb.bbb.bbbb.d",
"dd.aaaaaaaaaaaaaaaaaaaa...##############..###.bbb.bbbb.bbb.d",
"dd.aaaaaaaaaaaaaaaaaa..a.a..............##.#.bbbb.bbbb.bbb.d",
"dd.aaaaaaaaaaaaaaaaa.aaaa.aaaaaaaaaaaaaa....bbbb.bbbbbb.bb.d",
"dd.aaaaaaaaaaaaaaaa.aaaaa.aaaaaaaaaaaaaaaaa.bbbb.bbbbbbb.b.d",
"dd.aaaaaaaaaaaaaaa.aaaaaaa.aaaaaaaaaaaaaaaa.bbbb.bbbbbbb.b.d",
"dd.aaaaaaaaaaaaaa.aaaaaaaaa.aaaaaaaaaaaaaaa.bbbb.bbbbbbbb..d",
"dd.aaaaaaaaaaaaa.aaaaaaaaaaa.aaaaaaaaaaaaaa.bbb.bbbbbbbbb..d",
"dd.aaaaaaaaaaaa.aaaaaaaaaaaaa.aaaaaaaaaaaaa.bbb.bbbbbbbbbb.d",
"dd.aaaaaaaaaaa.aaaaaaaaaaaaaaa.aaaaaaaaaaaa.bbb.bbbbbbbbbb.d",
"dd.aaaaaaaaaa.aaaaaaaaaaaaaaaaa.aaaaaaaaaaaa.bb.bbbbbbbbb.dd",
"dd.aaaaaaaaa.aaaaaaaaaaaaaaaaaaa.aaaaaaaaaaa.bb.bbbbbbbb.ddd",
"dd.aaaaaaaa.aaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaa.b.bbbbbbbb.dddd",
"dd.aaaaaaa.aaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaa.b.bbbbbbb.ddddd",
"dd.aaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaa.b.bbbbbb.dddddd",
"dd.aaaa..aaaaaaaaaaaaaaaaaaaaaaaaaaa..aaaaaa.b.bbbbb.ddddddd",
"ddd.aa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaa..bbbb..dddddddd",
"ddd.a.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaa..bbb.dddddddddd",
"ddd..aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaa..bb.ddddddddddd",
"ddd........aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aa..b.dddddddddddd",
"ddddddddddd.............aaaaaaaaaaaaaaaaaa.a...ddddddddddddd",
"dddddddddddddddddddddddd............aaaaaaa...dddddddddddddd",
"dddddddddddddddddddddddddddddddddddd.........ddddddddddddddd",
"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
};
}

253
ng/ngshell.tcl Normal file
View File

@ -0,0 +1,253 @@
## the shell loop
proc dotest {} {
source ngtest.tcl
}
proc Ng_RunShell {} {
puts "Wellcome to NG Shell mode"
set line 1
while { 1 } {
puts -nonewline "$line: "
flush stdout
set cmdline [gets stdin]
if { [catch $cmdline errcode] } {
# puts "error in command: '$cmdline'"
puts "$errcode"
}
incr line 1
}
}
## global list for help index
set cmdindex {}
set hlpindex {}
set secindex {}
# print comd list
proc Ng_PrintCmdIndex { } {
global cmdindex
foreach { lst } $cmdindex {
puts $lst
}
}
# print formatted help index
proc Ng_PrintHlpIndex { } {
global hlpindex
global secindex
foreach {sec} $secindex {
puts "\n * $sec:"
foreach {lst} $hlpindex {
if {$sec == [lindex $lst 1]} {
puts " * [lindex $lst 2]: [lindex $lst 3]"
}
}
}
}
# register a cmd to the help index
proc Ng_RegisterCmd { cmd section syntax {help ""} } {
global hlpindex
global cmdindex
global secindex
if { [lsearch $cmdindex cmd] != -1 } {
puts "command '$cmd' already defined"
} else {
lappend cmdindex $cmd
lappend hlpindex [list $cmd $section $syntax $help]
if {[lsearch $secindex $section]==-1} {
lappend secindex $section
}
# puts "registered command $cmd"
}
}
# general purpose commands
Ng_RegisterCmd "exit" "general" "exit" "exit Netgen shell mode"
#Ng_RegisterCmd "Ng_LoadGeometry" "netgen" "Ng_LoadGeometry <file>" "load geometry file"
#Ng_RegisterCmd "Ng_ParseGeometry" "netgen" "Ng_ParseGeometry" "parse geometry"
#Ng_RegisterCmd "Ng_GenerateMesh" "netgen" "Ng_GenerateMesh" "generate mesh"
#Ng_RegisterCmd "Ng_SaveMesh" "netgen" "Ng_SaveMesh <file>" "save mesh to file"
## public domain shell functions
# print hel information
proc nghelp { {sec ""} } {
global secindex
global hlpindex
global cmdindex
if { $sec == "" } {
Ng_PrintHlpIndex
puts "\n type help 'section'\n"
return
}
if { [lsearch $secindex $sec] != -1} {
foreach {lst} $hlpindex {
if {[lindex $lst 1] == $sec } {
puts " * [lindex $lst 2]: [lindex $lst 3]"
}
}
return
}
set ind [lsearch $cmdindex $sec]
if {$ind != -1} {
set lst [lindex $hlpindex $ind]
puts " * [lindex $lst 2]: [lindex $lst 3]"
return
}
puts " unknown section or command $sec"
}
set ngtimer 0
proc nggettimer {} {
return [clock clicks -milliseconds]
}
proc ngtic {} {
set ::ngtimer [nggettimer]
}
proc ngtoc { {logfile stdout} } {
set end [nggettimer]
set tim [expr ($end - $::ngtimer)/1000.0]
puts $logfile "$tim s"
}
# load geometry file
proc ngloadgeometry { fname } {
if { ![file exists $fname] } {
puts "error: file $fname does not exist"
} else {
set err [catch {Ng_LoadGeometry $fname}]
if {$err != 0} {
puts "error: loading geometry failed"
}
}
}
Ng_RegisterCmd "ngloadgeometry" "netgen" "ngloadgeometry <file>" "load geometry file"
# parse geometry
proc ngparsegeometry {} {
set err [catch {Ng_ParseGeometry}]
if {$err} {
puts "error: parsing geometry failed"
}
}
Ng_RegisterCmd "ngparsegeometry" "netgen" "ngparsegeometry" "parse geometry"
# generate mesh
proc nggeneratemesh {} {
set err [catch {Ng_GenerateMesh}]
if {$err} {
puts "error: mesh generation failed"
}
}
Ng_RegisterCmd "nggeneratemesh" "netgen" "nggeneratemesh" "generate mesh"
# save mesh
proc ngsavemesh { fname } {
if { [file exists $fname]} {
puts "warning: existing file $fname overwritten"
} else {
set err [catch {Ng_SaveMesh $fname}]
if {$err != 0} {
puts "error: saving mesh failed"
}
}
}
Ng_RegisterCmd "ngsavemesh" "netgen" "ngsavemesh <file>" "save mesh to file"
#set option
proc ngset { opt {val 0} } {
if {$opt == "meshsize"} {
set ::options.meshsize $val
Ng_SetMeshingParameters
} elseif {$opt == "printmsg"} {
set ::options.printmsg $val
Ng_SetMeshingParameters
} else {
puts "error: unknown option $opt";
}
}
Ng_RegisterCmd "ngset" "netgen" "ngset <option> <val>" "set option to val"
proc nganalyzegeometry {} {
Ng_GenerateMesh ag ag
Ng_ReadStatus
}
proc ngmeshedges {} {
Ng_GenerateMesh me me
Ng_ReadStatus
}
proc ngmeshsurface { } {
Ng_GenerateMesh ms ms
Ng_ReadStatus
}
proc ngoptimizesurface { {step all} } {
if {$step == "all"} {
Ng_GenerateMesh os os cmsmSm
} elseif {$step == "meshsmoothing"} {
Ng_GenerateMesh os os m
} elseif {$step == "topologicedgeswapping" } {
Ng_GenerateMesh os os s
} elseif {$step == "metricedgeswapping"} {
Ng_GenerateMesh os os S
} elseif {$step == "combinepoints"} {
Ng_GenerateMesh os os c
} else {
puts "error: unkown option in ngoptimizesurface"
return
}
Ng_ReadStatus
}
proc ngmeshvolume { } {
Ng_GenerateMesh mv mv
Ng_ReadStatus
}
proc ngoptimizevolume {{step ""} } {
if {$step == ""} {
Ng_GenerateMesh ov ov
} elseif {$step == "smooth"} {
Ng_GenerateMesh ov ov m
} elseif {$step == "smoothjacobian"} {
Ng_GenerateMesh ov ov j
} else {
puts "error: unknown step $step in ngoptimizevolume"
return
}
Ng_ReadStatus
}
proc ngsloadpde {fname} {
if { ![file exists $fname] } {
puts "warning: pdefile $fname does not exist"
} else {
puts "load pde $fname"
NGS_LoadPDE $fname
}
}
proc ngssolvepde {} {
NGS_SolvePDE
}
catch {source "${::ngdir}/ngtcltk/ngtesting.tcl"} errcode
# puts "errcode = $errcode"

153
ng/ngtesting.tcl Normal file
View File

@ -0,0 +1,153 @@
# tests.tcl
proc Ng_TestMeshing { infile outfile logfile} {
if { ![file exists $infile]} {
puts $logfile "error: file $infile does not exist"
} else {
puts -nonewline $logfile " loading geometry: ";
ngtic; Ng_LoadGeometry "$infile"; ngtoc $logfile
puts -nonewline $logfile " parsing geometry: ";
ngtic; Ng_ParseGeometry; ngtoc $logfile
puts -nonewline $logfile " generating mesh: ";
ngtic; Ng_GenerateMesh; ngtoc $logfile
puts -nonewline $logfile " saving mesh: ";
ngtic; Ng_SaveMesh "$outfile"; ngtoc $logfile
flush $logfile
}
}
# tests.tcl
proc Ngs_TestPDE { infile {nsolves 1} logfile } {
if { ![file exists $infile]} {
puts $logfile "error: file $infile does not exist"
} else {
puts -nonewline $logfile " loading PDE file: ";
ngtic; ngsloadpde "$infile"; ngtoc $logfile
for {set i 1} {$i<=$nsolves} {incr i 1} {
puts -nonewline $logfile " solve PDE level $i: ";
ngtic; ngssolvepde; ngtoc $logfile
}
flush $logfile
}
}
proc ngtest { {t all} {f ""}} {
ngset printmsg 0
if {$f == "" } {
set logfile stdout
} else {
set logfile [open $f "w"]
}
global options.parthread
set options.parthread 0
Ng_SetMeshingParameters
if {$t == "all"} {
ngtest in2d $f
ngtest geo $f
ngtest stl $f
ngtest pde $f
return
} elseif {$t == "in2d"} {
puts "\n*** performing in2d file tests ***"
puts " ** writing results to $f"
puts "\n ** testing in2d files in examples/ **"
set testdir "$::ngdir/examples"
set in2dfiles { beam2d hyperbolic piezo2dround rectangle
squareincl squareinsquare }
foreach {tfile} $in2dfiles {
if {$f != ""} { puts " * meshing file examples/$tfile.in2d..." }
puts $logfile "\n * meshing file examples/$tfile.in2d..."; flush $logfile
Ng_TestMeshing "$testdir/$tfile.in2d" "$testdir/$tfile.vol" $logfile
}
puts "\n ** testing in2d files in tutorials/ **"
set testdir "$::ngdir/tutorials"
set in2dfiles { demo2d newin2d square v2in2d }
foreach {tfile} $in2dfiles {
if {$f != ""} { puts " * meshing file tutorials/$tfile.in2d..." }
puts $logfile "\n * meshing file tutorials/$tfile.in2d..."; flush $logfile
Ng_TestMeshing "$testdir/$tfile.in2d" "$testdir/$tfile.vol" $logfile
}
puts "*** in2d tests complete"
} elseif {$t == "geo"} {
puts "\n*** performing geo file tests ***"
puts " ** writing results to $f"
puts "\n ** testing geo files in examples/ **"
set testdir "$::ngdir/examples"
set geofiles { beam cylsphere rboxcyl thinc
boxcyl fichera period saw_3d thinplate
coilshield gamm3d plate shaft tripelpendel
cube halfsphere poly shell twocubes
cylinder kaese quarter3d skew_prisms }
foreach {tfile} $geofiles {
if {$f != ""} { puts " * meshing file examples/$tfile.geo..."; flush $logfile }
puts $logfile "\n * meshing file examples/$tfile.geo..."; flush $logfile
Ng_TestMeshing "$testdir/$tfile.geo" "$testdir/$tfile.vol" $logfile
}
puts "\n ** testing geo files in tutorials/ **"
set testdir "$::ngdir/tutorials"
set geofiles { boxcyl cubemcyl extrusion revolution trafo
circle_on_cube cubemsphere fichera sculpture twobricks
cone cylinder lshape3d shaft twocubes
cubeandring cylsphere manyholes sphere twocyl
cubeandspheres ellipsoid matrix sphereincube
cube ellipticcyl period torus }
foreach {tfile} $geofiles {
if {$f != ""} { puts " * meshing file $tfile.geo..." }
puts $logfile "\n * meshing file $tfile.geo..."; flush $logfile
Ng_TestMeshing "$testdir/$tfile.geo" "$testdir/$tfile.vol" $logfile
}
} elseif {$t == "stl"} {
puts "\n*** performing stl file tests ***"
# set logfile [open stltest.log "w"]
puts " ** writing results to $f"
puts "\n ** testing stl files in examples/ **"
set testdir "$::ngdir/examples"
set stlfiles { crankshaft hinge1 }
foreach {tfile} $stlfiles {
if {$f != ""} { puts " * meshing file examples/$tfile.stl..." }
puts $logfile "\n * meshing file examples/$tfile.stl..."; flush $logfile
Ng_TestMeshing "$testdir/$tfile.stl" "$testdir/$tfile.vol" $logfile
}
puts "\n ** testing stl files in tutorials/ **"
set testdir "$::ngdir/tutorials"
set stlfiles { hinge part1 }
foreach {tfile} $stlfiles {
if {$f != ""} { puts " * meshing file tutorials/$tfile.stl..." }
puts $logfile "\n * meshing file tutorials/$tfile.stl..."; flush $logfile
Ng_TestMeshing "$testdir/$tfile.stl" "$testdir/$tfile.vol" $logfile
}
puts "*** stl tests complete"
} elseif {$t == "pde"} {
puts "\n*** preforming pde tests ***"
# set logfile [open pdetest.log "w"]
puts " ** writing results to $f"
puts "\n ** testing pde files in ngsolve/pde_tutorial/ **"
set testdir "$::ngdir/ngsolve/pde_tutorial"
set pdefiles { d1_square.pde d2_chip.pde d3_helmholtz.pde d4_cube.pde
d5_beam.pde d6_shaft.pde d7_coil.pde d8_coilshield.pde }
foreach {tfile} $pdefiles {
if {$f != ""} { puts " * testing ngsolve/pde_tutorial/$tfile..." }
puts $logfile "\n * testing ngsolve/pde_tutorial/$tfile..."; flush $logfile
Ngs_TestPDE "$testdir/$tfile" 1 $logfile
}
puts "*** pde tests complete"
} else {
puts $logfile "error: unkown test program '$t'"; flush $logfile
}
puts ""
}
Ng_RegisterCmd "ngtest" "netgen" "ngtest" "perform ng standard tests: all in2d geo stl"

1591
ng/ngvisual.tcl Normal file

File diff suppressed because it is too large Load Diff

46
ng/parameters.tcl Normal file
View File

@ -0,0 +1,46 @@
proc setgranularity { gran } {
#
# puts "set granularity $gran"
#
if {$gran == 6} { return }
set gran [expr $gran - 1]
#
global options.curvaturesafety
set surfcurvlist { 1 1.5 2 3 5 }
set options.curvaturesafety [lindex $surfcurvlist $gran]
global options.segmentsperedge
set spelist { 0.3 0.5 1 2 3 }
set options.segmentsperedge [lindex $spelist $gran]
global stloptions.resthsurfcurvfac
set surfcurvfaclist { 0.25 0.5 1 1.5 3 }
set stloptions.resthsurfcurvfac [lindex $surfcurvfaclist $gran]
global stloptions.resthchartdistfac
set chartdistfaclist { 0.8 1 1.5 2 5 }
set stloptions.resthchartdistfac [lindex $chartdistfaclist $gran]
global stloptions.resthlinelengthfac
set linelengthfaclist { 0.2 0.35 0.5 1.5 3 }
set stloptions.resthlinelengthfac [lindex $linelengthfaclist $gran]
global stloptions.resthcloseedgefac
set closeedgefaclist { 0.5 1 2 3.5 5 }
set stloptions.resthcloseedgefac [lindex $closeedgefaclist $gran]
global stloptions.resthedgeanglefac
set edgeanglefaclist { 0.25 0.5 1 1.5 3 }
set stloptions.resthedgeanglefac [lindex $edgeanglefaclist $gran]
global stloptions.resthsurfmeshcurvfac
set surfmeshcurvlist { 1 1.5 2 3 5 }
set stloptions.resthsurfmeshcurvfac [lindex $surfmeshcurvlist $gran]
global options.grading
set gradinglist { 0.7 0.5 0.3 0.2 0.1 }
set options.grading [lindex $gradinglist $gran]
}

303
ng/sockets.tcl Normal file
View File

@ -0,0 +1,303 @@
set sockets.serverport 0
set sockets.serverhost "localhost"
set sockets.serverlistbox 0
set sockets.queuelistbox 0
set sockets.currentjoblistbox 0
set sockets.answerlistbox 0
set sockets.myidlabel -1
proc updateserverlist { } {
global sockets.serverlistbox
set retval [Ng_Socket getserverlist]
${sockets.serverlistbox} delete 0 end
for {set i 0} {$i < [llength $retval]} {incr i 3} {
${sockets.serverlistbox} insert end \
[format "%-16s %6i %6i" [lindex $retval $i] [lindex $retval [expr $i+1]] [lindex $retval [expr $i+2]]]
}
}
proc clientsocketdialog { } {
set w .clientsock_dlg
if {[winfo exists .clientsock_dlg] == 1} {
wm withdraw $w
wm deiconify $w
focus $w
} {
toplevel $w
global sockets.serverhost
global sockets.serverport
frame $w.general
frame $w.host
label $w.host.lab -text "Serverhost: "
entry $w.host.name -width 30 -relief sunken -textvariable sockets.serverhost
pack $w.host.lab $w.host.name -side left
pack $w.host
frame $w.ports
label $w.ports.lab1 -text "Serverport: "
entry $w.ports.statport -width 6 -relief sunken -textvariable sockets.serverport
pack $w.ports.lab1 $w.ports.statport -side left
pack $w.ports
frame $w.listboxes
frame $w.listboxes.choosesocketframe
tixScrolledListBox $w.listboxes.choosesocketframe.choosesocket -scrollbar auto
global sockets.serverlistbox
set sockets.serverlistbox [$w.listboxes.choosesocketframe.choosesocket subwidget listbox]
${sockets.serverlistbox} configure -width 35
${sockets.serverlistbox} configure -selectmode browse
${sockets.serverlistbox} configure -exportselection false
button $w.addserver -text "Add ServerSocket" -command {
Ng_Socket addserver ${sockets.serverport} ${sockets.serverhost}
updateserverlist
}
pack $w.addserver
label $w.linefeed -text "\n"
pack $w.linefeed
frame $w.clientidframe
label $w.clientidframe.lab -text "Client ID: ";
global sockets.myidlabel
entry $w.clientidframe.val -width 5 -relief sunken -textvariable sockets.myidlabel
button $w.clientidframe.but -text "Set" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0]
Ng_Socket setid $opserver ${sockets.myidlabel}
updateserverlist
}
}
pack $w.clientidframe.lab $w.clientidframe.val $w.clientidframe.but -side left
pack $w.clientidframe
# label $w.clientidlabel -text "\nClient ID: -1"
# global sockets.myidlabel
# set sockets.myidlabel $w.clientidlabel
# pack $w.clientidlabel
label $w.listboxes.choosesocketframe.chooselab -text [format "\n\n%-16s %6s %6s " Host Socket MyID ]
pack $w.listboxes.choosesocketframe.chooselab
pack $w.listboxes.choosesocketframe.choosesocket
frame $w.listboxes.choosesocketframe.serverbuttons
button $w.listboxes.choosesocketframe.serverbuttons.save -text "Save" -command {
Ng_Socket saveserverlist
}
global sockets.serverlist
Ng_Socket loadserverlist
updateserverlist
button $w.listboxes.choosesocketframe.serverbuttons.delete -text "Delete" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
Ng_Socket deletesocket [lindex $opsel 0]
updateserverlist
}
}
pack $w.listboxes.choosesocketframe.serverbuttons.save $w.listboxes.choosesocketframe.serverbuttons.delete -side left
pack $w.listboxes.choosesocketframe.serverbuttons
frame $w.listboxes.statusframe
label $w.listboxes.statusframe.statuslabel1 -text "\n\njobqueue"
tixScrolledListBox $w.listboxes.statusframe.queuestatus -scrollbar auto
label $w.listboxes.statusframe.statuslabel2 -text "\ncurrent job"
tixScrolledListBox $w.listboxes.statusframe.currentjobstatus -scrollbar auto
label $w.listboxes.statusframe.statuslabel3 -text "\nanswers"
tixScrolledListBox $w.listboxes.statusframe.answers -scrollbar auto
global sockets.queuelistbox
global sockets.currentjoblistbox
global sockets.answerlistbox
set sockets.queuelistbox [$w.listboxes.statusframe.queuestatus subwidget listbox]
set sockets.currentjoblistbox [$w.listboxes.statusframe.currentjobstatus subwidget listbox]
set sockets.answerlistbox [$w.listboxes.statusframe.answers subwidget listbox]
${sockets.queuelistbox} configure -width 50
${sockets.queuelistbox} configure -height 5
${sockets.queuelistbox} configure -selectmode browse
${sockets.queuelistbox} configure -exportselection false
${sockets.currentjoblistbox} configure -width 50
${sockets.currentjoblistbox} configure -height 1
${sockets.currentjoblistbox} configure -selectmode browse
${sockets.currentjoblistbox} configure -exportselection false
${sockets.answerlistbox} configure -width 50
${sockets.answerlistbox} configure -height 5
${sockets.answerlistbox} configure -selectmode browse
${sockets.answerlistbox} configure -exportselection false
button $w.listboxes.statusframe.updatebutton -text "Update" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0]
set retval [Ng_Socket sendqueuestatus $opserver]
${sockets.queuelistbox} delete 0 end
if {[lindex $retval 0] > 0} {
${sockets.queuelistbox} insert end [format "Blocked for user %i" [lindex $retval 0]]
} {
${sockets.queuelistbox} insert end "Not blocked"
}
for {set i 2} {$i < [expr 2*[lindex $retval 1]+2]} {incr i 2} {
${sockets.queuelistbox} insert end [format "client %i, command %s" [lindex $retval $i] [lindex $retval [expr $i+1]]]
}
${sockets.answerlistbox} delete 0 end
for {set i [expr 2*[lindex $retval 1]+3]} {$i < [llength $retval]} {incr i 2} {
${sockets.answerlistbox} insert end [format "client %i, command %s" [lindex $retval $i] [lindex $retval [expr $i+1]]]
}
${sockets.currentjoblistbox} delete 0 end
set retval [Ng_Socket sendjobstatus $opserver]
if {[lindex $retval 0] != 0} {
${sockets.currentjoblistbox} insert end [format "client %i, command %s: %s" [lindex $retval 0] [lindex $retval 1] [lrange $retval 2 end]]
}
}
}
pack $w.listboxes.statusframe.statuslabel1 $w.listboxes.statusframe.queuestatus \
$w.listboxes.statusframe.statuslabel2 $w.listboxes.statusframe.currentjobstatus \
$w.listboxes.statusframe.statuslabel3 $w.listboxes.statusframe.answers \
$w.listboxes.statusframe.updatebutton
pack $w.listboxes.choosesocketframe $w.listboxes.statusframe -side left
pack $w.listboxes
label $w.lab1 -text "\n"
pack $w.lab1
frame $w.buttons1
frame $w.buttons2
button $w.buttons1.getid -text "Get ID" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0]
set retval [Ng_Socket getid $opserver]
updateserverlist
set sockets.myidlabel $retval
}
}
button $w.buttons1.killjob -text "Kill Cur. Job" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0]
Ng_Socket killcurrentjob $opserver
}
}
button $w.buttons2.sendmesh -text "Send Mesh" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0]
set retval [Ng_Socket sendmesh $opserver]
set sockets.meshsent 1
}
}
button $w.buttons2.sendpde -text "Send PDE" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0]
set retval [NGS_Socket sendpdefile $opserver]
}
}
button $w.buttons2.solvepde -text "Solve PDE" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0]
set retval [NGS_Socket solvepde $opserver]
}
}
button $w.buttons2.writesol -text "Write Solution" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0]
set retval [NGS_Socket writesolution $opserver]
}
}
button $w.buttons2.sendsol -text "Receive Solution" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0]
set retval [NGS_Socket sendsolution $opserver]
}
}
button $w.buttons1.blockserver -text "Block Server" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0]
set retval [Ng_Socket blockserver $opserver]
}
}
button $w.buttons1.unblockserver -text "UnBlock Server" -command {
set opsel [${sockets.serverlistbox} curselection]
if {[llength $opsel] > 0} {
set opserver [lindex $opsel 0]
set retval [Ng_Socket unblockserver $opserver]
}
}
pack $w.buttons1.getid $w.buttons1.blockserver $w.buttons1.unblockserver $w.buttons1.killjob -side left
pack $w.buttons2.sendmesh $w.buttons2.sendpde $w.buttons2.solvepde $w.buttons2.writesol $w.buttons2.sendsol -side left
pack $w.buttons1 $w.buttons2
wm withdraw $w
wm geom $w +200+200
wm deiconify $w
wm title $w "Client Socket"
focus .options_dlg
}
}
.ngmenu.special add command -label "Client Socket" \
-command { clientsocketdialog }

684
ng/variables.tcl Normal file
View File

@ -0,0 +1,684 @@
# netgen global tcl-variables
set drawmode rotate
set selectvisual geometry
set dirname .
set basefilename filename
set meshoptions.fineness 3
set meshoptions.firststep ag
set meshoptions.laststep ov
set options.memory 0
set options.localh 1
set options.delaunay 1
set options.checkoverlap 1
set options.checkoverlappingboundary 0
set options.checkchartboundary 1
set options.startinsurface 0
set options.blockfill 1
set options.debugmode 0
set options.dooptimize 1
set options.parthread 1
set options.elsizeweight 0.2
set options.secondorder 0
set options.elementorder 1
set options.quad 0
set options.inverttets 0
set options.inverttrigs 0
set options.autozrefine 0
set options.meshsize 1000
set options.minmeshsize 0
set options.curvaturesafety 2
set options.segmentsperedge 2
set options.meshsizefilename ""
set options.badellimit 175
set options.optsteps2d 3
set options.optsteps3d 5
set options.opterrpow 2
set options.grading 0.5
set options.printmsg 2
set debug.slowchecks 0
set debug.debugoutput 0
set debug.haltexistingline 0
set debug.haltoverlap 0
set debug.haltsuccess 0
set debug.haltnosuccess 0
set debug.haltlargequalclass 0
set debug.haltsegment 0
set debug.haltnode 0
set debug.haltface 0
set debug.haltfacenr 0
set debug.haltsegmentp1 0
set debug.haltsegmentp2 0
set geooptions.drawcsg 1
set geooptions.detail 0.001
set geooptions.accuracy 1e-6
set geooptions.facets 20
set geooptions.minx -1000
set geooptions.miny -1000
set geooptions.minz -1000
set geooptions.maxx 1000
set geooptions.maxy 1000
set geooptions.maxz 1000
set viewqualityplot 0
set memuseplot 0
set viewrotatebutton 0
set showsensitivehelp 0
set showhelpline 0
set viewoptions.specpointvlen 0.3
set viewoptions.light.amb 0.3
set viewoptions.light.diff 0.7
set viewoptions.light.spec 1
set viewoptions.light.locviewer 0
set viewoptions.mat.shininess 50
set viewoptions.mat.transp 0.3
set viewoptions.colormeshsize 0
set viewoptions.whitebackground 1
set viewoptions.drawcoordinatecross 1
set viewoptions.drawcolorbar 1
set viewoptions.drawnetgenlogo 1
set viewoptions.stereo 0
set viewoptions.shrink 1
set viewoptions.drawfilledtrigs 1
set viewoptions.drawedges 0
set viewoptions.drawbadels 0
set viewoptions.centerpoint 0
set viewoptions.drawelement 0
set viewoptions.drawoutline 1
set viewoptions.drawtets 0
set viewoptions.drawtetsdomain 0
set viewoptions.drawprisms 0
set viewoptions.drawpyramids 0
set viewoptions.drawhexes 0
set viewoptions.drawidentified 0
set viewoptions.drawpointnumbers 0
set viewoptions.drawedgenumbers 0
set viewoptions.drawfacenumbers 0
set viewoptions.drawelementnumbers 0
set viewoptions.drawdomainsurf 0
set viewoptions.drawededges 1
set viewoptions.drawedpoints 1
set viewoptions.drawedpointnrs 0
set viewoptions.drawedtangents 0
set viewoptions.drawededgenrs 0
set viewoptions.drawmetispartition 0
set viewoptions.drawcurveproj 0
set viewoptions.drawcurveprojedge 1
set viewoptions.clipping.nx 0
set viewoptions.clipping.ny 1
set viewoptions.clipping.nz 0
set viewoptions.clipping.dist 0
set viewoptions.clipping.enable 0
set viewoptions.clipping.onlydomain 0
set viewoptions.clipping.notdomain 0
set viewoptions.usecentercoords 0
set viewoptions.centerx 0
set viewoptions.centery 0
set viewoptions.centerz 0
set viewoptions.drawspecpoint 0
set viewoptions.specpointx 0
set viewoptions.specpointy 0
set viewoptions.specpointz 0
set stloptions.showtrias 0
set stloptions.showfilledtrias 1
set stloptions.showedges 1
set stloptions.showmarktrias 0
set stloptions.showactivechart 0
set stloptions.yangle 30
set stloptions.contyangle 20
set stloptions.edgecornerangle 60
set stloptions.chartangle 15
set stloptions.outerchartangle 70
set stloptions.usesearchtree 0
set stloptions.chartnumber 1
set stloptions.charttrignumber 1
set stloptions.chartnumberoffset 0
set stloptions.atlasminh 0.1
set stloptions.resthsurfcurvfac 2
set stloptions.resthsurfcurvenable 0
set stloptions.resthatlasfac 2
set stloptions.resthatlasenable 1
set stloptions.resthchartdistfac 1.2
set stloptions.resthchartdistenable 1
set stloptions.resthlinelengthfac 0.5
set stloptions.resthlinelengthenable 1
set stloptions.resthcloseedgefac 1
set stloptions.resthcloseedgeenable 1
set stloptions.resthedgeanglefac 1
set stloptions.resthedgeangleenable 0
set stloptions.resthsurfmeshcurvfac 1
set stloptions.resthsurfmeshcurvenable 0
set stloptions.recalchopt 1
set stldoctor.drawmeshededges 1
set stldoctor.geom_tol_fact 0.000001
set stldoctor.useexternaledges 0
set stldoctor.showfaces 0
set stldoctor.conecheck 1
set stldoctor.spiralcheck 1
set stldoctor.selecttrig 0
set stldoctor.selectmode 1
set stldoctor.longlinefact 0
set stldoctor.showexcluded 1
set stldoctor.edgeselectmode 0
set stldoctor.nodeofseltrig 1
set stldoctor.showtouchedtrigchart 0
set stldoctor.showedgecornerpoints 0
set stldoctor.showmarkedtrigs 1
set stldoctor.dirtytrigfact 0.01
set stldoctor.smoothangle 90
set stldoctor.selectwithmouse 1
set stldoctor.showvicinity 0
set stldoctor.vicinity 50
set stldoctor.smoothnormalsweight 0.2
set occoptions.showvolumenr 0
set occoptions.showsurfaces 1
set occoptions.showedges 1
set occoptions.showsolidnr 0
set occoptions.showsolidnr2 0
set occoptions.visproblemfaces 0
set occoptions.zoomtohighlightedentity 0
set occoptions.deflection 1
set occoptions.tolerance 1e-3
set occoptions.fixsmalledges 1
set occoptions.fixspotstripfaces 1
set occoptions.sewfaces 1
set occoptions.makesolids 1
set occoptions.splitpartitions 0
set meshdoctor.active 0
set meshdoctor.markedgedist 1
# variablenname mit punkt problematisch!
set status_np 0
set status_ne 0
set status_nse 0
set status_working " "
set status_task " "
set status_percent 0
set status_filename 0
set status_tetqualclasses "10 20 30 40 10 20 30 40 10 20 30 40 10 20 30 40 10 20 30 40"
set exportfiletype PERMAS
set preproc.facenr 0
set preproc.selectmode query
set preproc.numtrig 0
set mem_moveable 0
set multithread_pause 0
set multithread_testmode 0
set multithread_redraw 0
set multithread_drawing 0
set multithread_terminate 0
set multithread_running 0
set level 0
set tablesforoutput {}
set optlist {
options.localh
options.delaunay
options.checkoverlap
options.startinsurface
options.blockfill
options.dooptimize
options.elsizeweight
options.meshsize
options.minmeshsize
options.curvaturesafety
options.optsteps2d
options.optsteps3d
options.secondorder
}
set visoptions.usetexture 0
set visoptions.invcolor 0
set visoptions.imaginary 0
set visoptions.lineartexture 1
set visoptions.numtexturecols 16
set visoptions.showclipsolution 1
set visoptions.showsurfacesolution 0
set visoptions.drawfieldlines 0
set visoptions.drawpointcurves 1
set visoptions.numfieldlines 100
set visoptions.fieldlinesrandomstart 0
set visoptions.fieldlinesstartarea box
set visoptions.fieldlinesstartareap1x 1
set visoptions.fieldlinesstartareap1y 1
set visoptions.fieldlinesstartareap1z 1
set visoptions.fieldlinesstartareap2x 0
set visoptions.fieldlinesstartareap2y 0
set visoptions.fieldlinesstartareap2z 0
set visoptions.fieldlinesstartface -1
set visoptions.fieldlinesfilename none
set visoptions.fieldlinestolerance 0.0005
set visoptions.fieldlinesrktype crungekutta
set visoptions.fieldlineslength 0.5
set visoptions.fieldlinesmaxpoints 500
set visoptions.fieldlinesthickness 0.0015
set visoptions.fieldlinesvecfunction none
set visoptions.fieldlinesphase 0
set visoptions.fieldlinesonlyonephase 1
set visoptions.lineplotfile empty
set visoptions.lineplotsource file
set visoptions.lineplotusingx 0
set visoptions.lineplotusingy 1
set visoptions.lineplotautoscale 1
set visoptions.lineplotxmin 0
set visoptions.lineplotxmax 1
set visoptions.lineplotymin 0
set visoptions.lineplotymax 1
set visoptions.lineplotcurrentnum -1
set visoptions.lineplotinfos ""
set visoptions.lineplotselected none
set visoptions.lineplotselector ""
set visoptions.lineplotcolor red
set visoptions.lineplotsizex 500
set visoptions.lineplotsizey 400
set visoptions.lineplotselectedeval 0
set visoptions.lineplotdatadescr "column1 column2 column3"
set visoptions.lineplotxcoordselector ""
set visoptions.lineplotycoordselector ""
set visoptions.evaluatefilenames none
set visoptions.evaluatefiledescriptions none
set visoptions.clipsolution none
set visoptions.scalfunction none
set visoptions.vecfunction none
set visoptions.evaluate abs
set visoptions.gridsize 20
set visoptions.xoffset 0
set visoptions.yoffset 0
set visoptions.autoscale 1
set visoptions.lineartexture 1
set visoptions.redrawperiodic 0
set visoptions.logscale 0
set visoptions.mminval 0
set visoptions.mmaxval 1
set visoptions.isolines 0
set visoptions.isosurf 0
set visoptions.subdivisions 1
set visoptions.numiso 10
set visoptions.autoredraw 0
set visoptions.autoredrawtime 2
set visoptions.simulationtime 0
set visoptions.multidimcomponent 0
# deform by vector function
set visoptions.deformation 0
set visoptions.scaledeform1 1
set visoptions.scaledeform2 1
set parallel_netgen 0
set optfilename ng.opt
global env
if { [llength [array names env NG_OPT]] == 1 } {
if { [string length $env(NG_OPT)] > 0 } {
set optfilename $env(NG_OPT)
}
}
if { [file exists $optfilename] == 1 } {
set datei [open $optfilename r]
while { [gets $datei line] >= 0 } {
set [lindex $line 0] [lindex $line 1]
}
close $datei
} {
puts "optfile $optfilename does not exist - using default values"
}
proc saveoptions { } {
uplevel 1 {
set file ng.opt
if {$file != ""} {
set datei [open $file w]
puts $datei "meshoptions.fineness ${meshoptions.fineness}"
puts $datei "meshoptions.firststep ${meshoptions.firststep}"
puts $datei "meshoptions.laststep ${meshoptions.laststep}"
puts $datei "options.localh ${options.localh}"
puts $datei "options.delaunay ${options.delaunay}"
puts $datei "options.checkoverlap ${options.checkoverlap}"
puts $datei "options.checkchartboundary ${options.checkchartboundary}"
puts $datei "options.startinsurface ${options.startinsurface}"
puts $datei "options.blockfill ${options.blockfill}"
puts $datei "options.debugmode ${options.debugmode}"
puts $datei "options.dooptimize ${options.dooptimize}"
puts $datei "options.parthread ${options.parthread}"
puts $datei "options.elsizeweight ${options.elsizeweight}"
puts $datei "options.secondorder ${options.secondorder}"
puts $datei "options.elementorder ${options.elementorder}"
puts $datei "options.memory ${options.memory}"
puts $datei "options.quad ${options.quad}"
puts $datei "options.inverttets ${options.inverttets}"
puts $datei "options.inverttrigs ${options.inverttrigs}"
puts $datei "options.autozrefine ${options.autozrefine}"
puts $datei "options.meshsize ${options.meshsize}"
puts $datei "options.minmeshsize ${options.minmeshsize}"
puts $datei "options.curvaturesafety ${options.curvaturesafety}"
puts $datei "options.segmentsperedge ${options.segmentsperedge}"
puts $datei "options.meshsizefilename ${options.meshsizefilename}"
puts $datei "options.badellimit ${options.badellimit}"
puts $datei "options.optsteps2d ${options.optsteps2d}"
puts $datei "options.optsteps3d ${options.optsteps3d}"
puts $datei "options.opterrpow ${options.opterrpow}"
puts $datei "options.grading ${options.grading}"
puts $datei "options.printmsg ${options.printmsg}"
puts $datei "geooptions.drawcsg ${geooptions.drawcsg}"
puts $datei "geooptions.detail ${geooptions.detail}"
puts $datei "geooptions.accuracy ${geooptions.accuracy}"
puts $datei "geooptions.facets ${geooptions.facets}"
puts $datei "geooptions.minx ${geooptions.minx}"
puts $datei "geooptions.miny ${geooptions.miny}"
puts $datei "geooptions.minz ${geooptions.minz}"
puts $datei "geooptions.maxx ${geooptions.maxx}"
puts $datei "geooptions.maxy ${geooptions.maxy}"
puts $datei "geooptions.maxz ${geooptions.maxz}"
puts $datei "viewoptions.specpointvlen ${viewoptions.specpointvlen}"
puts $datei "viewoptions.light.amb ${viewoptions.light.amb}"
puts $datei "viewoptions.light.diff ${viewoptions.light.diff}"
puts $datei "viewoptions.light.spec ${viewoptions.light.spec}"
puts $datei "viewoptions.light.locviewer ${viewoptions.light.locviewer}"
puts $datei "viewoptions.mat.shininess ${viewoptions.mat.shininess}"
puts $datei "viewoptions.mat.transp ${viewoptions.mat.transp}"
puts $datei "viewoptions.colormeshsize ${viewoptions.colormeshsize}"
puts $datei "viewoptions.whitebackground ${viewoptions.whitebackground}"
puts $datei "viewoptions.drawcolorbar ${viewoptions.drawcolorbar}"
puts $datei "viewoptions.drawcoordinatecross ${viewoptions.drawcoordinatecross}"
puts $datei "viewoptions.drawnetgenlogo ${viewoptions.drawnetgenlogo}"
puts $datei "viewoptions.stereo ${viewoptions.stereo}"
puts $datei "viewoptions.drawfilledtrigs ${viewoptions.drawfilledtrigs}"
puts $datei "viewoptions.drawedges ${viewoptions.drawedges}"
puts $datei "viewoptions.drawbadels ${viewoptions.drawbadels}"
puts $datei "viewoptions.centerpoint ${viewoptions.centerpoint}"
puts $datei "viewoptions.drawelement ${viewoptions.drawelement}"
puts $datei "viewoptions.drawoutline ${viewoptions.drawoutline}"
puts $datei "viewoptions.drawtets ${viewoptions.drawtets}"
puts $datei "viewoptions.drawprisms ${viewoptions.drawprisms}"
puts $datei "viewoptions.drawpyramids ${viewoptions.drawpyramids}"
puts $datei "viewoptions.drawhexes ${viewoptions.drawhexes}"
puts $datei "viewoptions.drawidentified ${viewoptions.drawidentified}"
puts $datei "viewoptions.drawpointnumbers ${viewoptions.drawpointnumbers}"
puts $datei "viewoptions.drawededges ${viewoptions.drawededges}"
puts $datei "viewoptions.drawedpoints ${viewoptions.drawedpoints}"
puts $datei "viewoptions.drawedpointnrs ${viewoptions.drawedpointnrs}"
puts $datei "viewoptions.drawedtangents ${viewoptions.drawedtangents}"
puts $datei "viewoptions.shrink ${viewoptions.shrink}"
puts $datei "stloptions.showtrias ${stloptions.showtrias}"
puts $datei "stloptions.showfilledtrias ${stloptions.showfilledtrias}"
puts $datei "stloptions.showedges ${stloptions.showedges}"
puts $datei "stloptions.showmarktrias ${stloptions.showmarktrias}"
puts $datei "stloptions.showactivechart ${stloptions.showactivechart}"
puts $datei "stloptions.yangle ${stloptions.yangle}"
puts $datei "stloptions.contyangle ${stloptions.contyangle}"
puts $datei "stloptions.edgecornerangle ${stloptions.edgecornerangle}"
puts $datei "stloptions.chartangle ${stloptions.chartangle}"
puts $datei "stloptions.outerchartangle ${stloptions.outerchartangle}"
puts $datei "stloptions.usesearchtree ${stloptions.usesearchtree}"
puts $datei "stloptions.chartnumber ${stloptions.chartnumber}"
puts $datei "stloptions.charttrignumber ${stloptions.charttrignumber}"
puts $datei "stloptions.chartnumberoffset ${stloptions.chartnumberoffset}"
puts $datei "stloptions.atlasminh ${stloptions.atlasminh}"
puts $datei "stloptions.resthsurfcurvfac ${stloptions.resthsurfcurvfac}"
puts $datei "stloptions.resthsurfcurvenable ${stloptions.resthsurfcurvenable}"
puts $datei "stloptions.resthatlasfac ${stloptions.resthatlasfac}"
puts $datei "stloptions.resthatlasenable ${stloptions.resthatlasenable}"
puts $datei "stloptions.resthchartdistfac ${stloptions.resthchartdistfac}"
puts $datei "stloptions.resthchartdistenable ${stloptions.resthchartdistenable}"
puts $datei "stloptions.resthlinelengthfac ${stloptions.resthlinelengthfac}"
puts $datei "stloptions.resthlinelengthenable ${stloptions.resthlinelengthenable}"
puts $datei "stloptions.resthcloseedgefac ${stloptions.resthcloseedgefac}"
puts $datei "stloptions.resthcloseedgeenable ${stloptions.resthcloseedgeenable}"
puts $datei "stloptions.resthedgeanglefac ${stloptions.resthedgeanglefac}"
puts $datei "stloptions.resthedgeangleenable ${stloptions.resthedgeangleenable}"
puts $datei "stloptions.resthsurfmeshcurvfac ${stloptions.resthsurfmeshcurvfac}"
puts $datei "stloptions.resthsurfmeshcurvenable ${stloptions.resthsurfmeshcurvenable}"
puts $datei "stloptions.recalchopt ${stloptions.recalchopt}"
puts $datei "visoptions.subdivisions ${visoptions.subdivisions}"
# trafo options
# if exist trafooptions then ...
if { [info exists trafooptions.solver] == 1 } {
puts $datei "trafooptions.solver ${trafooptions.solver}"
puts $datei "trafooptions.levels ${trafooptions.levels}"
puts $datei "trafooptions.linits ${trafooptions.linits}"
puts $datei "trafooptions.nonlinits ${trafooptions.nonlinits}"
puts $datei "trafooptions.stabcurrent ${trafooptions.stabcurrent}"
puts $datei "trafooptions.checkcond ${trafooptions.checkcond}"
puts $datei "trafooptions.maxdirect ${trafooptions.maxdirect}"
puts $datei "trafooptions.secondorder ${trafooptions.secondorder}"
puts $datei "trafooptions.homogenizedcore ${trafooptions.homogenizedcore}"
puts $datei "trafooptions.ordercore ${trafooptions.ordercore}"
puts $datei "trafooptions.simplecurrents ${trafooptions.simplecurrents}"
puts $datei "trafooptions.assemblecomplexmatrix ${trafooptions.assemblecomplexmatrix}"
puts $datei "trafooptions.meshcasing ${trafooptions.meshcasing}"
puts $datei "trafooptions.meshcore ${trafooptions.meshcore}"
puts $datei "trafooptions.meshclumps ${trafooptions.meshclumps}"
puts $datei "trafooptions.meshshields ${trafooptions.meshshields}"
puts $datei "trafooptions.meshcoils ${trafooptions.meshcoils}"
puts $datei "trafooptions.bcmdirectory ${trafooptions.bcmdirectory}"
puts $datei "trafooptions.lossdensityfile ${trafooptions.lossdensityfile}"
}
if { [info exists smalltrafomodell.tankheight] == 1 } {
puts $datei "smalltrafomodell.tankheight ${smalltrafomodell.tankheight}"
puts $datei "smalltrafomodell.tankwidth ${smalltrafomodell.tankwidth}"
puts $datei "smalltrafomodell.tanklength ${smalltrafomodell.tanklength}"
puts $datei "smalltrafomodell.corewidth ${smalltrafomodell.corewidth}"
puts $datei "smalltrafomodell.windowheight ${smalltrafomodell.windowheight}"
puts $datei "smalltrafomodell.limbdistance ${smalltrafomodell.limbdistance}"
puts $datei "smalltrafomodell.xposcore ${smalltrafomodell.xposcore}"
puts $datei "smalltrafomodell.yposcore ${smalltrafomodell.yposcore}"
puts $datei "smalltrafomodell.zposcore ${smalltrafomodell.zposcore}"
puts $datei "smalltrafomodell.leakagefluxguidethickness ${smalltrafomodell.leakagefluxguidethickness}"
puts $datei "smalltrafomodell.leakagefluxguidewidth ${smalltrafomodell.leakagefluxguidewidth}"
puts $datei "smalltrafomodell.leakagefluxguidezposition ${smalltrafomodell.leakagefluxguidezposition}"
puts $datei "smalltrafomodell.limbcoil.1 ${smalltrafomodell.limbcoil.1}"
puts $datei "smalltrafomodell.ricoil.1 ${smalltrafomodell.ricoil.1}"
puts $datei "smalltrafomodell.rocoil.1 ${smalltrafomodell.rocoil.1}"
puts $datei "smalltrafomodell.zposcoil.1 ${smalltrafomodell.zposcoil.1}"
puts $datei "smalltrafomodell.heightcoil.1 ${smalltrafomodell.heightcoil.1}"
puts $datei "smalltrafomodell.currentcoil.1 ${smalltrafomodell.currentcoil.1}"
puts $datei "smalltrafomodell.nturnscoil.1 ${smalltrafomodell.nturnscoil.1}"
puts $datei "smalltrafomodell.limbcoil.2 ${smalltrafomodell.limbcoil.2}"
puts $datei "smalltrafomodell.ricoil.2 ${smalltrafomodell.ricoil.2}"
puts $datei "smalltrafomodell.rocoil.2 ${smalltrafomodell.rocoil.2}"
puts $datei "smalltrafomodell.zposcoil.2 ${smalltrafomodell.zposcoil.2}"
puts $datei "smalltrafomodell.heightcoil.2 ${smalltrafomodell.heightcoil.2}"
puts $datei "smalltrafomodell.currentcoil.2 ${smalltrafomodell.currentcoil.2}"
puts $datei "smalltrafomodell.nturnscoil.2 ${smalltrafomodell.nturnscoil.2}"
puts $datei "smalltrafomodell.limbcoil.3 ${smalltrafomodell.limbcoil.3}"
puts $datei "smalltrafomodell.ricoil.3 ${smalltrafomodell.ricoil.3}"
puts $datei "smalltrafomodell.rocoil.3 ${smalltrafomodell.rocoil.3}"
puts $datei "smalltrafomodell.zposcoil.3 ${smalltrafomodell.zposcoil.3}"
puts $datei "smalltrafomodell.heightcoil.3 ${smalltrafomodell.heightcoil.3}"
puts $datei "smalltrafomodell.currentcoil.3 ${smalltrafomodell.currentcoil.3}"
puts $datei "smalltrafomodell.nturnscoil.3 ${smalltrafomodell.nturnscoil.3}"
puts $datei "smalltrafomodell.limbcoil.4 ${smalltrafomodell.limbcoil.4}"
puts $datei "smalltrafomodell.ricoil.4 ${smalltrafomodell.ricoil.4}"
puts $datei "smalltrafomodell.rocoil.4 ${smalltrafomodell.rocoil.4}"
puts $datei "smalltrafomodell.zposcoil.4 ${smalltrafomodell.zposcoil.4}"
puts $datei "smalltrafomodell.heightcoil.4 ${smalltrafomodell.heightcoil.4}"
puts $datei "smalltrafomodell.currentcoil.4 ${smalltrafomodell.currentcoil.4}"
puts $datei "smalltrafomodell.nturnscoil.4 ${smalltrafomodell.nturnscoil.4}"
puts $datei "smalltrafomodell.limbcoil.5 ${smalltrafomodell.limbcoil.5}"
puts $datei "smalltrafomodell.ricoil.5 ${smalltrafomodell.ricoil.5}"
puts $datei "smalltrafomodell.rocoil.5 ${smalltrafomodell.rocoil.5}"
puts $datei "smalltrafomodell.zposcoil.5 ${smalltrafomodell.zposcoil.5}"
puts $datei "smalltrafomodell.heightcoil.5 ${smalltrafomodell.heightcoil.5}"
puts $datei "smalltrafomodell.currentcoil.5 ${smalltrafomodell.currentcoil.5}"
puts $datei "smalltrafomodell.nturnscoil.5 ${smalltrafomodell.nturnscoil.5}"
puts $datei "smalltrafomodell.limbcoil.6 ${smalltrafomodell.limbcoil.6}"
puts $datei "smalltrafomodell.ricoil.6 ${smalltrafomodell.ricoil.6}"
puts $datei "smalltrafomodell.rocoil.6 ${smalltrafomodell.rocoil.6}"
puts $datei "smalltrafomodell.zposcoil.6 ${smalltrafomodell.zposcoil.6}"
puts $datei "smalltrafomodell.heightcoil.6 ${smalltrafomodell.heightcoil.6}"
puts $datei "smalltrafomodell.currentcoil.6 ${smalltrafomodell.currentcoil.6}"
puts $datei "smalltrafomodell.nturnscoil.6 ${smalltrafomodell.nturnscoil.6}"
puts $datei "smalltrafomodell.limbtest.1 ${smalltrafomodell.limbtest.1}"
puts $datei "smalltrafomodell.heighttest.1 ${smalltrafomodell.heighttest.1}"
puts $datei "smalltrafomodell.widthtest.1 ${smalltrafomodell.widthtest.1}"
puts $datei "smalltrafomodell.rtest.1 ${smalltrafomodell.rtest.1}"
puts $datei "smalltrafomodell.zpostest.1 ${smalltrafomodell.zpostest.1}"
puts $datei "smalltrafomodell.edgeradiustest.1 ${smalltrafomodell.edgeradiustest.1}"
puts $datei "smalltrafomodell.finetest.1 ${smalltrafomodell.finetest.1}"
puts $datei "smalltrafomodell.conductivetest.1 ${smalltrafomodell.conductivetest.1}"
puts $datei "smalltrafomodell.limbtest.2 ${smalltrafomodell.limbtest.2}"
puts $datei "smalltrafomodell.heighttest.2 ${smalltrafomodell.heighttest.2}"
puts $datei "smalltrafomodell.widthtest.2 ${smalltrafomodell.widthtest.2}"
puts $datei "smalltrafomodell.rtest.2 ${smalltrafomodell.rtest.2}"
puts $datei "smalltrafomodell.zpostest.2 ${smalltrafomodell.zpostest.2}"
puts $datei "smalltrafomodell.edgeradiustest.2 ${smalltrafomodell.edgeradiustest.2}"
puts $datei "smalltrafomodell.finetest.2 ${smalltrafomodell.finetest.2}"
puts $datei "smalltrafomodell.conductivetest.2 ${smalltrafomodell.conductivetest.2}"
puts $datei "smalltrafomodell.limbtest.3 ${smalltrafomodell.limbtest.3}"
puts $datei "smalltrafomodell.heighttest.3 ${smalltrafomodell.heighttest.3}"
puts $datei "smalltrafomodell.widthtest.3 ${smalltrafomodell.widthtest.3}"
puts $datei "smalltrafomodell.rtest.3 ${smalltrafomodell.rtest.3}"
puts $datei "smalltrafomodell.zpostest.3 ${smalltrafomodell.zpostest.3}"
puts $datei "smalltrafomodell.edgeradiustest.3 ${smalltrafomodell.edgeradiustest.3}"
puts $datei "smalltrafomodell.finetest.3 ${smalltrafomodell.finetest.3}"
puts $datei "smalltrafomodell.conductivetest.3 ${smalltrafomodell.conductivetest.3}"
puts $datei "smalltrafomodell.limbtest.4 ${smalltrafomodell.limbtest.4}"
puts $datei "smalltrafomodell.heighttest.4 ${smalltrafomodell.heighttest.4}"
puts $datei "smalltrafomodell.widthtest.4 ${smalltrafomodell.widthtest.4}"
puts $datei "smalltrafomodell.rtest.4 ${smalltrafomodell.rtest.4}"
puts $datei "smalltrafomodell.zpostest.4 ${smalltrafomodell.zpostest.4}"
puts $datei "smalltrafomodell.edgeradiustest.4 ${smalltrafomodell.edgeradiustest.4}"
puts $datei "smalltrafomodell.finetest.4 ${smalltrafomodell.finetest.4}"
puts $datei "smalltrafomodell.conductivetest.4 ${smalltrafomodell.conductivetest.4}"
puts $datei "smalltrafomodell.nperitest ${smalltrafomodell.nperitest}"
puts $datei "smalltrafomodell.filename ${smalltrafomodell.filename}"
puts $datei "smalltrafomodell.murlfguide ${smalltrafomodell.murlfguide}"
puts $datei "smalltrafomodell.murtestwire ${smalltrafomodell.murtestwire}"
puts $datei "smalltrafomodell.murcore ${smalltrafomodell.murcore}"
puts $datei "smalltrafomodell.kappalfguide ${smalltrafomodell.kappalfguide}"
puts $datei "smalltrafomodell.kappatestwire ${smalltrafomodell.kappatestwire}"
puts $datei "smalltrafomodell.kappacore ${smalltrafomodell.kappacore}"
}
close $datei
}
}
}
# the ini file is save on demand :
proc saveinifile { } {
uplevel 1 {
set datei [open ng.ini w]
for { set i [.ngmenu.file.recent index last] } { $i >= 1 } { incr i -1 } {
puts $datei "recentfile \"[.ngmenu.file.recent entrycget $i -label]\""
}
close $datei
}
}
proc savemeshinifile { } {
uplevel 1 {
set datei [open ngmesh.ini w]
for { set i [.ngmenu.file.recentmesh index last] } { $i >= 1 } { incr i -1 } {
puts $datei "recentfile \"[.ngmenu.file.recentmesh entrycget $i -label]\""
}
close $datei
}
}
proc loadinifile { } {
if { [file exists ng.ini] == 1 } {
set datei [open ng.ini r]
while { [gets $datei line] >= 0 } {
if {[lindex $line 0] == "recentfile"} {
set filename [lindex $line 1]
AddRecentFile $filename
}
}
close $datei
}
}
proc loadmeshinifile { } {
if { [file exists ngmesh.ini] == 1 } {
set datei [open ngmesh.ini r]
while { [gets $datei line] >= 0 } {
if {[lindex $line 0] == "recentfile"} {
set filename [lindex $line 1]
AddRecentMeshFile $filename
}
}
close $datei
}
}