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

proc concert3d_write_input {} {
    global confname file_name env concert3d_output_path
    global file_name

    set super [domain_select $file_name(domains_dir) "Select a superdomain" super 1]
    if {$super == {}} return
    
    get_boco_topo
    set outfile $file_name(transfer_dir)/concert3d
    set formatted 0
    set iblank 0

    if {![dialog .concert3d "Concert3D" \
          "Please edit the following Concert3D options." {
               {bocofile -type path -title "Boundary condition file"} 
               {topofile -type path -title "Topology file"}
               {formatted -opt {{"Binary" 0} {"Formatted" 1}} \
                   -title "Format of grid file"}
		{iblank -opt {{No 0} {Yes 1}} -title "Include IBLANK array" \
		-help "Include the IBLANK array"}
               {outfile -type path -title "Output file" -help "Output file"}
           }]} return

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

    set command "\"$concert3d_output_path\" -dom \"$super\" -b \"$bocofile\" -t \"$topofile\" -f \"$ftopofile\""
    if $formatted {set command "$command -fmt"}
    if $iblank {set command "$command -i"}
    set command "$command \"$outfile\""

    runcom $command ""
}
