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

proc em_write_input {} {
    global confname file_name em_output_path 
    global file_name

    set outfile $file_name(transfer_dir)/em
    set scale 0
    set x 1.0
    set y 1.0
    set z 1.0

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

    if {![dialog .em "EM" \
      "Please edit the following EM options." {
        {outfile -type path -title "Name of EM output file"}
        {scale -opt {{"Yes" 1} {"No" 0}} -title "Scaling of x, y, z" }
        {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

    set command "\"$em_output_path\" -dom \"$domain\" \"$outfile\""
    if $scale {set command "$command -scale $x,$y,$z"}
    runxcom ICEM-CFD/EM-Interface $command "" 1 0
}
