test_bem.tcl 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #! /bin/sh
  2. # restart using wish \
  3. exec /sppdg/software/tools/public_domain/${HOST_TYPE}/bin/wish "$0" "$@"
  4. set auto_path [linsert $auto_path 0 /sppdg/software/lib]
  5. package require Itcl
  6. package require -exact BWidget 1.2.1
  7. package require bem
  8. namespace import ::bem::*
  9. # From whence is this script run?
  10. # For there shall we find the rest.
  11. set ::scriptDir [file dirname [info script]]
  12. source [file join $::scriptDir mmtl_compare.tcl]
  13. proc runTests { testNode originalNode log {cSegs 10} {pSegs 10} } {
  14. puts "-----------------------------------------------"
  15. # bemDeleteAll
  16. # puts "\n\nProcessing the graphic file..."
  17. # puts $log "\n\nProcessing the graphic file..."
  18. # source $testNode.xsctn
  19. # bemWriteGraphicFile $testNode
  20. # bemRunSimulation $testNode $cSegs $pSegs
  21. # mmtl_compare $testNode.result $originalNode.result $log
  22. bemDeleteAll
  23. puts "\nProcessing the cross-section file..."
  24. puts $log "\nProcessing the cross-section file..."
  25. source $testNode.xsctn
  26. ## set newNode [format {%sB} $testNode]
  27. ## ::csdl::csdlWriteTCL $newNode.xsctn \
  28. ## "Duplicate of $newNode.xsctn" $cSegs $pSegs
  29. ## puts "\nComparing xsctn files $testNode.xsctn - $newNode.xsctn"
  30. ## mmtl_compare $testNode.xsctn $newNode.xsctn $log
  31. bemRunSimulationCS $testNode $cSegs $pSegs
  32. mmtl_compare $testNode.result $originalNode.result_save $log
  33. }
  34. ##################################################################
  35. # Create the main window.
  36. ##################################################################
  37. proc createMain { mmtlInitialize } {
  38. global mainframe
  39. global status
  40. # Menu description
  41. set descmenu {
  42. "&File" all file 0 {
  43. {command "&Quit" {} "Quit" {Ctrl q} -command _quit}
  44. }
  45. }
  46. set mainframe [MainFrame .mainframe \
  47. -menu $descmenu \
  48. -textvariable status]
  49. ::gui::guiCreateConsole
  50. ::gui::guiConsole 1
  51. pack $mainframe -fill both -expand yes
  52. wm protocol . WM_DELETE_WINDOW {_exit}
  53. }
  54. proc runTheTests { log testDir orgDir } {
  55. global env
  56. runTests $testDir/9-7-00 $orgDir/9-7-00 $log 20 40
  57. update
  58. runTests $testDir/abcs1 $orgDir/abcs1 $log 20 40
  59. update
  60. runTests $testDir/w10t2.5 $orgDir/w10t2.5 $log 40 80
  61. update
  62. runTests $testDir/coplanar $orgDir/coplanar $log 45 45
  63. update
  64. runTests $testDir/trap_test $orgDir/trap_test $log 45 45
  65. update
  66. runTests $testDir/test1 $orgDir/test1 $log 45 45
  67. update
  68. runTests $testDir/generic $orgDir/generic $log 90 90
  69. update
  70. }
  71. ##################################################################
  72. ##################################################################
  73. proc main { argv } {
  74. global env
  75. set mmtlInitialize 1
  76. option add *font {courier 10 bold}
  77. wm withdraw .
  78. # Create main window
  79. createMain $mmtlInitialize
  80. BWidget::place . 0 0 center
  81. set testDir $::scriptDir
  82. set orgDir $::scriptDir
  83. set log [open $testDir/test_bem.log w]
  84. runTheTests $log $testDir $orgDir
  85. close $log
  86. }
  87. main $argv