
# This code creates the ICEM CFD Manager.
#
# Copyright (c) 1993 - 1996 Pacific Marketing and Consulting, Inc,
#       and ICEM Systems, GmbH.  All rights reserved.
# Author:  Wayne A. Christopher, wayne@icemcfd.com

# Routines for Westinghouse Bettis.

proc app_tagging {what} {
    global place partfile ddn_path place leo_path tagout_path exec_problem
    global confname geoname env partname sheetname s2u_path partname
    global waiting_for_part partfile env ddnterm westinghouse_output_path
    global domain_history tag_meshname partname hex_path
    
    if {$place == ""} {
	errormsg "Can't run tagging -- the configuration or \
geometry is not set."
	return
    }
    
    if ![file exists $place/tagging] { exec /bin/mkdir $place/tagging }
    
    if {($what != "shell") && ($what != "list")} {
	foreach f "[glob -nocomplain $place/tagging/*.plist]\
		[glob -nocomplain $place/mesh/*.cart]" {
	    set ff([file rootname [file tail $f]]) 1
	}
	if [info exists ff] {
	    set poss [lsort [array names ff]]
	    infomsg "Available mesh names: $poss"
	} else {
	    infomsg "No mesh names are currently available."
	}
	if ![info exists tag_meshname] {
	    if [info exists poss] {
		set tag_meshname [lindex $poss 0]
	    } else {
		set tag_meshname mesh
	    }
	}
	if {$what == "delete"} { set word delete } else { set word use }
	while 1 {
	    set m [query_enter .query "Name of mesh to $word?" $tag_meshname]
	    if {$m == "*cancel*"} return
	    if {[string length $m] > 8} {
		warningmsg "Mesh names must be a maximum of 8 characters.\n"
		continue
	    }
	    set tag_meshname $m
	    break
	}
    }
    
    case $what in {
	global {
	    set dom $tag_meshname.unstruct
	    set cart $place/mesh/$tag_meshname.cart
	    set map $place/tagging/$tag_meshname.map
	    
	    if [file exists $cart] {
		if {[query_question .query "Resume editing the currently\
			existing mesh?"] == "*cancel*"} {
		    exec /bin/rm -f $cart
		}
	    }
	    if ![file exists $cart] {
		set om [query_enter .query "Copy mesh cart_file from\
			another mesh (enter name, cancel = no)?" ""]
		if {$om != "*cancel*"} {
		    if [file exists $place/mesh/$om.cart] {
			exec /bin/cp $place/mesh/$om.cart $cart
			set newp $place/mesh/$tag_meshname.plist
			set newi $place/mesh/$tag_meshname.iname
			if {[file exists $place/mesh/$om.plist] && \
				![file exists $newp]} {
		            infomsg "Copying plist file"
			    exec /bin/cp $place/mesh/$om.plist $newp
		        }
			if {[file exists $place/mesh/$om.iname] && \
				![file exists $newi]} {
		            infomsg "Copying iname file"
			    exec /bin/cp $place/mesh/$om.iname $newi
		        }
			
		    } else {
			warningmsg "No such mesh exists"
		    }
		}
	    }
	    
	    infomsg "Cartesian domain name is $place/domains/$dom"
	    infomsg "Cartesian grid information is $cart"
	    
	    # if ![set_part_for_meshname $tag_meshname
		   # $place/tagging/$tag_meshname.partmap] return
	    
	    if [run_cartesian $dom $cart 0] {
		set fp [open $place/tagging/$tag_meshname.pname w]
		puts $fp [string trim $partname \"]
		close $fp
		
		infomsg "Note: you don't need to convert the mesh -- it is\
			already in the correct format for the tagging editor\
			(domain \"[file tail $dom]\")."
		exec /bin/rm -f $map
	    }
	}
	hexa {
	    set dom $tag_meshname.unstruct
	    set map $place/tagging/$tag_meshname.map
	    
	    if {$ddnterm == "x11"} {set x " -x"} else {set x ""}
	    set command "$hex_path $x -tagging $dom $place"
	    
	    runxcom HEX $command "" 1 0
	    
	    set fp [open $place/tagging/$tag_meshname.pname w]
	    puts $fp [string trim $partname \"]
	    close $fp
	    
	    infomsg "Note: you don't need to convert the mesh -- it is\
		    already in the correct format for the tagging editor\
		    (domain \"[file tail $dom]\")."
	    exec /bin/rm -f $map
	}
	autrim {
	    run_ddn_linked Autrim d autrim ""
	}
	outer {
	    run_ddn_linked Outer d outer ""
	}
	crplist {
	    run_ddn_linked Create_Plist d crplist ""
	}
	mergep {
	    if [file exists $place/tagging/$tag_meshname.pname] {
		set fp [open $place/tagging/$tag_meshname.pname r]
		set npname [gets $fp]
		close $fp
		
		global global_parts
		if [locate_part $npname $global_parts .parts.g.list] {
		    infomsg "Selecting part \"$npname\""
		} else {
		    warningmsg "Couldn't find the part that corresponds to\
			    mesh \"$tag_meshname\""
		}
	    } else {
		if ![pick_part "Meshing parts"] return
		if [part_is_mulcad] {
		    warningmsg "Merged P-List parts must be in the\
			    DDN parts directory"
		    return
		}
	    }
	    set plist $place/tagging/$tag_meshname.plist
	    set iname $place/tagging/$tag_meshname.iname
	    if 0 {
		if ![file exists $plist] {
		    set om [query_enter .query "Copy plist information\
			    from previous mesh (cancel = no)?" ""]
		    if {($om != "") && ($om != "*cancel*")} {
			if [file exists $place/tagging/$om.plist] {
			    exec /bin/cp $place/tagging/$om.plist $plist
			    exec /bin/cp $place/tagging/$om.iname $iname
			} else {
			    warningmsg "No such plist file exists"
			}
		    }
		}
	    }
	    global partform
	    set old_partform $partform
	    set partform ASCII
	    if [run_ddn_linked Merge_Plist d mergep "$plist\n$iname"] {
		set fp [open $place/tagging/$tag_meshname.pname w]
		puts $fp [string trim $partname \"]
		close $fp
	    }
	    set partform $old_partform
	}
	geometry {
	    set fp [open _directive_tmp w]
	    puts $fp "*CONVERT,NAME"
	    close $fp
	    
	    set waiting_for_part 1
	    set q "Select the DDN part that contains the base geometry."
	    set infile [query_waitvar .query $q]
	    if {$infile == "*cancel*"} return
	    	    	    
	    set igesfile $place/tagging/tagging.iges
	    #set igesfile [query_enter .query "Name of iges file?" $igesfile]
	    #if {$igesfile == "*cancel*"} return
	    
	    infomsg "Converting base part to IGES: file is $igesfile ..."
	    set command "$env(ICEM_ACN)/iges/iges_pre i=$partfile\
		    o=$igesfile l=iges_list d=_directive_tmp"
	    runcom $command iges_list
	    if $exec_problem {
		warningmsg "Did you remember to file your DDN part in\
			ASCII format?"
	    } else {
		set igesmap $place/tagging/$tag_meshname.igesmap
		infomsg "Deleting IGES map file $igesmap"
		exec /bin/rm -f $igesmap
	    }
	    infomsg Done.
	}
	mesh {
	    set domains [glob -nocomplain $place/domains/domain.*]
	    if {$domains == ""} {
		errormsg "There are no structured domains available"
		return
	    }
#	    set topo $place/mesh/topo_mulcad_out
	    get_boco_topo
            set topo $topofile

	    if ![file exists $topo] {
		errormsg "There is no topo file available"
		return
	    }
	    set ufile $place/domains/$tag_meshname.unstruct
	    infomsg "Converting multi-block structured to unstructured:\
		mesh is [file tail $ufile]"
	    
	    set command "$s2u_path -t $topo -o $ufile $domains"
	    runcom $command
	    set mapfile $place/tagging/$tag_meshname.map
	    infomsg "Deleting tagging map file $mapfile"
	    exec /bin/rm -f $mapfile
	    infomsg Done.
	}
	leo {
	    infomsg "Starting leo ..."
	    catch {unset env(LEO_DEVELOPMENT)}
	    if {$ddnterm == "x11"} {set x "-x"} else {set x ""}
	    
	    set domain $place/domains/$tag_meshname.unstruct
	    
	    set iges_file $place/tagging/tagging.iges
	    if ![file exists $iges_file] { set iges_file "" }
	    #set iges_file [query_path .query "Select the IGES file to use." $iges_file]
	    #if {$iges_file == "*cancel*"} return
	    
	    set tag_map $place/tagging/$tag_meshname.map
	    set iges_map $place/tagging/$tag_meshname.igesmap
	    set plist_file $place/tagging/$tag_meshname.plist
	    set iname $place/tagging/$tag_meshname.iname
	    
	    set prev_dom ""
	    if {[query_question .query "Copy tagging information from\
		    a previous mesh?"] == "*okay*"} {
		set omesh [query_enter .query "Mesh to copy from?" ""]
		if {$omesh == "*cancel*"} return
		set pd $place/domains/$omesh.unstruct
		set old_tag_map $place/tagging/$omesh.map
		if {![file exists $pd] || ![file exists $old_tag_map]} {
		    warningmsg "No such mesh is available"
		} else {
		    set prev_dom "-tag_prev_dom $pd"
		    exec /bin/cp $old_tag_map $tag_map
		    if [file exists $place/tagging/$omesh.igesmap] {
			exec /bin/cp $place/tagging/$omesh.igesmap $iges_map
		    } else {
			warningmsg "No object definitions were available\
				for the old mesh"
		    }
		}
	    }
	    
	    if ![file exists $domain] {
		warningmsg "Domain $domain doesn't exist"
		return
	    }
	    set command "$leo_path $x -tag -tag_tagfile $tag_map \
		-tag_igesfile $iges_map $prev_dom -dom $domain \
		-tag_plistfile $plist_file \
		-iges_namefile $iname"
	    if {$iges_file != ""} {
		append command " -iges $iges_file"
	    }
	    runxcom Leo $command "" 1 1
	}
	output_pdq {
	    set domain $place/domains/$tag_meshname.unstruct
	    set outfile $place/tagging/PDQ
	    set sortfile $place/tagging/$tag_meshname.sort
	    set tag_map $place/tagging/$tag_meshname.map
	    
	    set command "$env(ICEM_ACN)/icemcfd/sort_unstruct $domain $sortfile"
	    runcom $command ""
	    
	    infomsg "The output file is $outfile"
	    set command "$westinghouse_output_path -dom $domain -tag $tag_map \
			-sort $sortfile -typ PDQ $outfile"
	    runcom $command ""
	}
	output_razor {
	    set domain $place/domains/$tag_meshname.unstruct
	    set outfile $place/tagging/RAZOR
	    set sortfile $place/tagging/$tag_meshname.sort
	    set tag_map $place/tagging/$tag_meshname.map
	    set plist $place/tagging/$tag_meshname.plist
	    
	    set un [query_two_choices .query "Units?" inches cm]
	    
	    set command "$env(ICEM_ACN)/icemcfd/sort_unstruct $domain $sortfile"
	    runcom $command ""
	    
	    set pl ""
	    if [file exists $plist] { set pl "-plist $plist" }
	    
	    infomsg "The output file is $outfile"
	    set command "$westinghouse_output_path -dom $domain -tag $tag_map \
			-sort $sortfile -units $un -typ RAZOR $outfile $pl"
	    runcom $command ""
	}
	output_rpc01 {
	    set domain $place/domains/$tag_meshname.unstruct
	    set sortfile $place/tagging/$tag_meshname.sort
	    set tag_map $place/tagging/$tag_meshname.map
	    set plist $place/tagging/$tag_meshname.plist
	    
	    for {set i 1} {[file exists $place/tagging/rpc01.$i]} {incr i} {}
	    set outfile $place/tagging/rpc01.$i
	    
	    set un [query_two_choices .query "Units?" inches cm]
	    
	    set command "$env(ICEM_ACN)/icemcfd/sort_unstruct $domain $sortfile"
	    runcom $command ""
	    
	    set pl ""
	    if [file exists $plist] { set pl "-plist $plist" }
	    
	    infomsg "The output file is $outfile"
	    set command "$westinghouse_output_path -dom $domain -tag $tag_map \
			-sort $sortfile -units $un -typ RPC01 $outfile $pl"
	    runcom $command ""
	}
	output_cabin {
	    set domain $place/domains/$tag_meshname.unstruct
	    set outfile $place/tagging/CABIN
	    set sortfile $place/tagging/$tag_meshname.sort
	    set tag_map $place/tagging/$tag_meshname.map
	    set plist $place/tagging/$tag_meshname.plist
	    set iname $place/tagging/$tag_meshname.iname
	    set igesmap $place/tagging/$tag_meshname.igesmap
	    
	    set command "$env(ICEM_ACN)/icemcfd/sort_unstruct $domain $sortfile"
	    runcom $command ""
	    
	    set pl ""
	    if [file exists $plist] { set pl "-plist $plist" }
	    
	    set un [query_two_choices .query "Units?" inches cm]
	    set name [query_enter .query "Name?" XXXXX]
	    if {$name == "*cancel*"} return
	    
	    infomsg "The output file is $outfile"
	    set command "$westinghouse_output_path -dom $domain -tag $tag_map \
		    -sort $sortfile -typ CABIN -units $un -name $name \
		    -iname $iname -obj $igesmap $outfile $pl"
	    runcom $command ""
	}
	output_magic {
	    set domain $place/domains/$tag_meshname.unstruct
	    set outfile $place/tagging/MAT
	    set tag_map $place/tagging/$tag_meshname.map
	    
	    infomsg "The output file is $outfile"
	    set command "$westinghouse_output_path -dom $domain -tag $tag_map \
			-typ MAT $outfile"
	    runxcom Magic $command "" 1 1
	}
	output_generic {
	    set domain $place/domains/$tag_meshname.unstruct
	    set outfile $place/tagging/ALL
	    set tag_map $place/tagging/$tag_meshname.map
	    set plist $place/tagging/$tag_meshname.plist
	    
	    infomsg "The output file is $outfile"
	    set command "$westinghouse_output_path -dom $domain -tag $tag_map \
			-plist $plist -typ GENERIC $outfile"
	    runcom $command ""
	}
	list {
	    set pnames [glob -nocomplain $place/tagging/*.pname]
	    set carts [glob -nocomplain $place/tagging/*.cart]
	    set plists [glob -nocomplain $place/tagging/*.plist]
	    set meshes [glob -nocomplain $place/domains/*.unstruct]
	    set maps [glob -nocomplain $place/tagging/*.map]
	    foreach i "$pnames $carts $plists $meshes $maps" {
		set found([file rootname [file tail $i]]) 1
	    }
	    if [info exists found] {
		infomsg "\nTagging data for configuration \"$confname\":"
		infomsg "Mesh\t\tPart\t\tPlist\tCart\tMesh\tTags"
		foreach mesh [lsort [array names found]] {
		    foreach i {pname cart plist unstruct map} { set $i "" }
		    if [file exists $place/tagging/$mesh.pname] {
			set pname [exec cat $place/tagging/$mesh.pname]
		    }
		    if [file exists $place/tagging/$mesh.cart] {
			set cart YES
		    }
		    if [file exists $place/tagging/$mesh.plist] {
			set plist YES
		    }
		    if [file exists $place/domains/$mesh.unstruct] {
			set unstruct YES
		    }
		    if [file exists $place/tagging/$mesh.map] {
			set map YES
		    }
		    infomsg "[format %-16s $mesh]\t[format %-16s $pname]\t$plist\t$cart\t$unstruct\t$map"
		}
	    } else {
		infomsg "There are no meshes available"
	    }
	}
	delete {
	    if {[query_question .query "Really delete all data for mesh\
		    \"$tag_meshname?\""] == "*okay*"} {
		eval exec /bin/rm -f \
			[glob -nocomplain $place/tagging/$tag_meshname.*]
	    }
	}
	shell {
	    util_shell tagging
	}
    }
}

proc app_tnh {what} {
    global place partfile ddn_path place leo_path tagout_path
    global confname geoname env partname sheetname partname exec_problem
    global waiting_for_part partfile env ddnterm iflow_output_path
    global tnh_meshname
    
    if {$place == ""} {
	errormsg "Can't run T & H operations -- the configuration or \
geometry is not set."
	return
    }
    
    if ![file exists $place/tnh] { exec /bin/mkdir $place/tnh }
        
    if {$what != "shell"} {
	foreach f [glob -nocomplain $place/tnh/*.cart] {
	    set ff([file rootname [file tail $f]]) 1
	}
	
	if [info exists ff] {
	    set poss [lsort [array names ff]]
	    infomsg "Available mesh names: $poss"
	} else {
	    infomsg "No mesh names are currently available."
	}
	if ![info exists tnh_meshname] {
	    if [info exists poss] {
		set tnh_meshname [lindex $poss 0]
	    } else {
		set tnh_meshname mesh
	    }
	}
	
	if {$what == "delete"} { set word delete } else { set word use }
	set m [query_enter .query "Name of mesh to $word?" $tnh_meshname]
	if {$m == "*cancel*"} return
	set tnh_meshname $m
    }
    
    case $what in {
	global {
	    set dom $tnh_meshname.struct
	    set cart $place/mesh/$tnh_meshname.cart
	    
	    if ![info exists $cart] {
		set om [query_enter .query "Copy mesh cart_file from\
			previous mesh (cancel = no)?" ""]
		if {$om != "*cancel*"} {
		    if [file exists $place/mesh/$om.cart] {
			exec /bin/cp $place/mesh/$om.cart $cart
		    } else {
			warningmsg "No such mesh exists"
		    }
		}
	    }
	    
	    infomsg "Cartesian domain name is $place/domains/$dom"
	    infomsg "Cartesian grid information is $cart"
	    
	    # if ![set_part_for_meshname $tnh_meshname
		   # $place/tnh/$tnh_meshname.partmap] return
	    
	    run_cartesian $dom $cart 1
	}
	outer {
	    run_ddn_linked Outer d outer ""
	}
	geometry {
	    set waiting_for_part 1
	    set infile [query_waitvar .query "Select the DDN part that contains\
			the base geometry."]
	    if {$infile == "*cancel*"} return
	    
	    if [part_is_mulcad] { errormsg "You must select a DDN part."; return }
	    
	    set igesfile $place/tnh/tnh.iges
	    #set igesfile [query_enter .query "IGES file?" $igesfile]
	    #if {$igesfile == "*cancel*"} return
	    
	    set igesmap $place/tnh/$tnh_meshname.igesmap
	    
	    infomsg "Converting base part to IGES: file is $igesfile ..."
	    set command "$env(ICEM_ACN)/iges/iges_pre i=$partfile\
		o=$igesfile l=iges_list"
	    runcom $command iges_list
	    if $exec_problem {
		warningmsg "Did you remember to file your DDN part in ASCII format?"
	    } else {
		infomsg "Deleting IGES map file $igesmap"
		exec /bin/rm -f $igesmap
	    }
	    infomsg Done.
	}
	scalar {
	    # I guess this should be a standalone program but ...
	    set wish $env(ICEM_ACN)/bin/blt_wish
	    set scalar [query_enter .query "Select the scalar file to edit" \
			$place/tnh/scalar_params]
	    if {$scalar == "*cancel*"} return
	    runcom "$wish -f $env(ICEM_ACN)/lib/iceman/tnh_scalar.tcl $scalar"
	}
	leo {
	    infomsg "Starting leo ..."
	    catch {unset env(LEO_DEVELOPMENT)}
	    if {$ddnterm == "x11"} {set x "-x"} else {set x ""}

	    set domain $place/domains/$tnh_meshname.struct
	    set cellfile $place/tnh/$tnh_meshname.cell
	    set varfile $place/tnh/$tnh_meshname.var
	    set iges_map $place/tnh/$tnh_meshname.igesmap
	    set iges_file $place/tnh/tnh.iges
	    #set iges_file [query_enter .query "IGES file?" $iges_file]
	    #if {$iges_file == "*cancel*"} return
	    
	    if ![file exists $domain] {
		warningmsg "Domain $domain doesn't exist"
		return
	    }
	    set command "$leo_path $x -tnh -tnh_igesfile $iges_map \
		-tnh_cellfile $cellfile -tnh_varfile $varfile \
		-dom $domain -iges $iges_file"
	    runxcom Leo $command "" 1 1
	}
	output {
	    set outfile $place/tnh/$tnh_meshname.iflow
	    set cellfile $place/tnh/$tnh_meshname.cell
	    set varfile $place/tnh/$tnh_meshname.var
	    
	    set scalfile $place/tnh/scalar_params
	    set scalfile [query_enter .query "Scalar file?" $scalfile]
	    if {$scalfile == "*cancel*"} return
	    
	    set command "$iflow_output_path -scal $scalfile -cell $cellfile \
		-var $varfile $outfile"
	    runcom $command ""
	    
	    infomsg "The IFLOW input file is $outfile"
	}
	delete {
	    if {[query_question .query "Really delete all data for mesh\
		    \"$tnh_meshname?\""] == "*okay*"} {
		eval exec /bin/rm -f \
			[glob -nocomplain $place/tnh/$tnh_meshname.*]
	    }
	}
	shell {
	    util_shell tnh
	}
    }
}

proc run_cartesian {domain_file cartfile struct} {
    global place xterm_prog partform
    
    if {$place == ""} {
	errormsg "Can't run Global -- the configuration or \
geometry is not set."
	return
    }
    
    set epilog_file $place/mesh/epilog
    set config_dir $place

infomsg "Should be using cart file $cartfile"
    
    set epi [open $epilog_file w]
    if $struct {
	puts $epi "write_structured $place/domains/$domain_file"
    } else {
	puts $epi "write_unstructured $place/domains/$domain_file"
    }
    puts $epi return
    close $epi
    
    set old_partform $partform
    set partform ASCII
    set ret [run_ddn_linked Global_Grid m global \
	    "$config_dir\n$xterm_prog\n$cartfile" ]
    set partform $old_partform
    return $ret
}

proc set_part_for_meshname {meshname mapfile} {
    global partfile place partname
    
    # This is a work-a-round.
    
    if {($partname == "") && ![pick_part "Meshing parts"]} return
    
    if [file exists $mapfile] {
	# The mapfile contains lines of the form "set meshpart(meshname) partfile"
	source $mapfile
    }
    if [info exists meshpart($meshname)] {
	if ![set_part_partfile $meshpart($meshname)] {
	    warningmsg "Part file $meshpart($meshname) no longer exists"
	    unset meshpart($meshname)
	} else {
	    return 1
	}
    }
    if ![info exists meshpart($meshname)] {
	infomsg "No part exists yet for $meshname..."
	set base $place/parts/[file tail $partfile]
	for {set n 0} {[file exists ${base}_$n]} {incr n} {}
	set npart ${base}_$n
	exec /bin/cp $partfile $npart
	update_partlist m 1
	infomsg "New part file is $npart"
	set_part_partfile $npart
	set meshpart($meshname) $npart
	set fp [open $mapfile w]
	foreach m [array names meshpart] {
	    puts $fp [list set meshpart($m) $meshpart($m)]
	}
	close $fp
    }
    return 1
}

# -----------------------------------------------------------

if $icem_tagging {

make_entry tag "Cartesian Mesh" {} {} {app_tagging global} \
    {Run global to create an unstructured Cartesian mesh.}

make_entry tag "Hexa Mesher" {} {} {app_tagging hexa} \
    {Run global to create an unstructured Cartesian mesh.}

make_entry tag "Create P-List" {} {} {app_tagging crplist} \
    {Create a single P-List as a DDN part.}

make_entry tag "Merge P-Lists" {} {} {app_tagging mergep} \
    {Merge P-Lists into a single P-list file.}

#make_entry tag "Extend lines" {} {} {app_tagging outer} {Extend lines in DDN.}

make_entry tag "Auto-trim" {} {} {app_tagging autrim} \
    {Automatically trim lines in DDN.}

make_line tag

make_entry tag "Convert $gui_name(Geo)" {} {} {app_tagging geometry} \
    {Convert the geometry from DDN to IGES for tagging.}

make_entry tag "Convert Mesh" {} {} {app_tagging mesh} \
    {Convert the mesh from PADAMM to an unstructured mesh for input\
	to the tagging editor.}

make_entry tag "Tagging Editor" {} {} {app_tagging leo} \
    {Run leo in tagging mode.}

make_line tag

make_entry tag "PDQ Output" {} {} {app_tagging output_pdq} \
    {Create an output file for PDQ.}

make_entry tag "Razor Output" {} {} {app_tagging output_razor} \
    {Create an output file for Razor.}

make_entry tag "Cabin Output" {} {} {app_tagging output_cabin} \
	{Create an output file for Cabin.}

make_entry tag "Magic Output" {} {} {app_tagging output_magic} \
	{Create an output file for Magic.}

make_entry tag "RCP01 Output" {} {} {app_tagging output_rcp01} \
    {Create an output file for RCP01.}

make_entry tag "Generic Output" {} {} {app_tagging output_generic} \
	{Create an output file for a generic solver.}

make_line tag

make_entry tag "List Tagging Data" {} {} {app_tagging list} \
	{List all the data associated with the available meshes.}

make_entry tag "Delete Tagging Data" {} {} {app_tagging delete} \
	{Delete all the data associated with a particular mesh.}

make_entry tag "Tagging Shell" {} {} {app_tagging shell} \
    {Create a UNIX shell in the tagging directory.}

}

if $icem_tnh {

make_entry tnh "Cartesian Mesh" {} {} {app_tnh global}  \
    {Run global to create a structured Cartesian mesh.}

#make_entry tnh "Extend lines" {} {} {app_tnh outer} {Extend lines in DDN.}

make_entry tnh "Convert $gui_name(Geo)" {} {} {app_tnh geometry} \
    {Convert the geometry from DDN to IGES for T & H.}

make_entry tnh "T & H Editor" {} {} {app_tnh leo} \
    {Run leo in T & H mode.}

make_entry tnh "T & H Scalar Values" {} {} {app_tnh scalar} \
    {Associate values with scalar variables for T & H.}

make_entry tnh "T & H Output" {} {} {app_tnh output} \
    {Create an output file for the IFLOW application.}

make_entry tnh "Delete T & H Data" {} {} {app_tnh delete} \
	{Delete all the data associated with a particular mesh.}

make_entry tnh "T & H Shell" {} {} {app_tnh shell} \
    {Create a UNIX shell in the T & H directory.}

}
