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

proc tno_write_input {} {
    global confname file_name tno_output_path 
    global file_name

    get_boco_topo

    set outfile $file_name(transfer_dir)/glasin.dat

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

    if {![dialog .tno "TNO" \
      "Please edit the following TNO options." {
        {bocofile -type path -title "Boco file" \
                -help "Boundary condition file"}
        {outfile -type path -title "Output file" -help "Output file"}
    }]} return

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

     if {[file exists $outfile] && \
         [query_question .query "Overwrite $outfile?"] != "*okay*"} return

    set command "\"$tno_output_path\" -b \"$bocofile\" -dom \"$domain\" \"$outfile\""
    runxcom ICEM-CFD/TNO-Interface $command "" 1 0
}
