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

proc fieldview_write_input {} {
    global confname file_name fieldview_output_path icem_powermesh
    global file_name
    
    set domain $file_name(domain)

    set outfile $file_name(transfer_dir)/fv_uns
    set ascii 0

    if {![dialog .fieldview "FIELDVIEW-Unstructured (FV-UNS)" \
	  "Please edit the following FV-UNS options." {
               {ascii -opt {{"Binary" 0} {"ASCII" 1}} -title "Format"\
                       -help "Binary or ASCII format"}
	       {outfile -type path -title "Prefix of output file" -help "Output file"}
	   }]} return
    

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

    set command "\"$fieldview_output_path\" -dom \"$domain\""
    if $ascii {set command "$command -ascii"}
    set command "$command \"$outfile\""
    
    runcom $command ""
}
