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

proc exodus_write_input {} {
    global confname file_name exodus_output_path icem_powermesh
    global file_name

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

    set outfile $file_name(transfer_dir)/exodus
    set double_precision 1

    if {![dialog .exodus "EXODUS" \
          "Please edit the following EXODUS options." {
		{double_precision -opt {{Single 0} {Double 1}} -title Precision -help "Precision"}
               {bocofile -type path -title "Boco file" \
                   -help "Boundary condition file"}
	       {outfile -type path -title "Output file" -help "Output file"}
           }]} return

   
    if {![file exists $domain]} {
        errormsg "Domain file $domain doesn't exist"
        return
    }

    if {![file exists $bocofile]} {
        errormsg "File $bocofile doesn't exist"
        return
    }

#   set command "\"$exodus_output_path\" -dom \"$domain\" -b \"$bocofile\" -config \"$confname\""
    set command "\"$exodus_output_path\" -dom \"$domain\" -b \"$bocofile\""
    if {$double_precision} {set command "$command -db"}
    set command "$command \"$outfile\""

    runcom $command ""
}
