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

proc trio_u_write_input {} {
    global confname file_name trio_u_output_path 

    get_boco_topo

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

    if {![dialog .trio_u "TRIO_U" \
      "Please edit the following ICEM-CFD/TRIO_U Interface options:" {
        {bocofile -type path -title "Boco file" \
                -help "Boundary condition file"}
	{prefixe -type path -title "Prefix of TRIO_U files" \
		-help "Prefix of TRIO_U files"}
        {fmt -opt {{"Binary C" 0} {"ASCII" 1}} -title "Format" \
                -help "Option for binary or ASCII output"}
    }]} return

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

    set command "\"$trio_u_output_path\" -b \"$bocofile\" -dom \"$domain\" -pre \"$prefixe\""
    if $fmt {set command "$command -fmt"}
    runxcom ICEM-CFD/TRIO_U-Interface $command "" 1 0
}
