
# ICEM CFD solver interface routine for the manager.
#
# Copyright (c) 1993-1995 ICEM Systems.

proc gsmacDF_write_input {} {
    global confname file_name gsmacDF_output_path icem_powermesh
    global file_name

    set domain [domain_select $file_name(domains_dir) "Select an unstructured domain." unstruct 0]
    if {$domain == {}} return

    set outfile $file_name(transfer_dir)/gsmacDF

    get_boco_topo

    set scale 0
    set x 1.0
    set y 1.0
    set z 1.0


    if {![dialog .gsmacDF "GSMACDF" \
          "Please edit the following gsmacDF options." {
               {bocofile -type path -title "bocofile" \
                        -help "Boundary Conditions File"}
               {outfile -type path -title "Prefix for output file"}
	       {scale -opt {{"Yes" 1} {"No" 0}} -title "Scaling"}
               {x -type string -active {$scale} -title "x scaling factor" }
               {y -type string -active {$scale} -title "y scaling factor" }
               {z -type string -active {$scale} -title "z scaling factor" }
           }]} return
  
    if {![file exists $domain]} {
        errormsg "Domain file $domain doesn't exist"
        return
    }

    set command "\"$gsmacDF_output_path\" -dom \"$domain\" -b \"$bocofile\""
    if $scale   {set command "$command -scale $x,$y,$z"}
    set command "$command \"$outfile\""

    runxcom ICEM-CFD/gsmacDF-Interface $command "" 1 0
}
