#
# ~cvs/scrib/app_sm/data_column.tcl
#
# author: jason aftosmis (jason@icemcfd.com)
# date:   april 2002
#
# This file generates the data column in a scrib application
# *indentation matters not to the interp
#
scrib_app_data_notebook_begin

scrib_app_data_notebook_regression_page

scrib_app_data_notebook_page_begin "File info"

    scrib_app_data_notebook_begin

   scrib_app_data_notebook_page_begin "Import information"

	scrib_app_data_choicelist -var cadsys -desc "Type of CAD file(s)" \
		-choices {{tetin "ICEM CFD tetin file"} {catia "CATIA"} {iges "IGES"} } \
		-def tetin

	scrib_app_data_entry -var layers -desc "Layers of meshable surfaces" \
    		-type string -def "" -active {{cadsys catia}}

        scrib_app_data_choicelist -var cad_selmethod -desc "CAD File selection method" \
		-choices {{dir "By directory"} {files "By file list"} {skipto "Skipto number"}} -def dir

	scrib_app_data_entry -var cad_dir -desc "Directory of CAD file(s)" \
		-type dir -def . -select 1 -allow_new 0 -active {{cad_selmethod dir}}
	
        scrib_app_data_entry -var cad_files -desc "Specific CAD files" \
                -type file -def . -select 1 -allow_new 1 -active {{cad_selmethod files}}

        scrib_app_data_entry -var skipto_num -desc "Skip to file number" \
                -type int -def 0 -active {{cad_selmethod skipto}}

	scrib_app_data_entry -var wdir -desc "Working directory" \
    		-type dir -def ./wdir -select 1 -allow_new 1

   scrib_app_data_notebook_page_end

   scrib_app_data_notebook_page_begin "Export information"

# Currently, only Nastran is hooked up.  The rest can be reach through regular ICEM Output.

         scrib_app_data_choicelist -var solverout -desc "Solver output format" \
		-choices {{ANSYS "ANSYS"} {dyna "LS/DYNA-3D"} {nastran "Nastran"} {patran "PATRAN"} {radioss "RADIOSS"}  } \
		-def nastran
	
	scrib_app_data_entry -var export_dir -desc "Directory for output files" \
		-type dir -def ./out -select 1 -allow_new 1

  	   
          scrib_app_data_radio -var nasform -desc "File format" \
	    -choices {{0 "Long"} {1 "Short"} } \
	    -def 1 -active {{solverout nastran}}
  	
	    scrib_app_data_entry -var export_file -desc "Name of final assembly file" \
    			-type file -def assembly.nas -select 1 -allow_new 1

	scrib_app_data_entry -var results_report -desc "Results report" \
    		-type file -def "bsm_results.html" -select 1 -allow_new 1

    scrib_app_data_notebook_page_end	

    scrib_app_data_notebook_page_begin "PID naming information"
    	    scrib_app_data_frame_begin ""
            		scrib_app_data_entry -var naspid_keystrings -type string -def PART \
			-desc "List of possible keystrings in CAD filename"

	    	scrib_app_data_entry -var naspid_nchar -type int -def 5 \
			-desc "Length of PID string (number of characters)"	
	
	    	scrib_app_data_entry -var naspid_offset -type string -def "+2" \
			-desc "Offset of pid boundary from keystring boundary (+/- integer)"
        	    scrib_app_data_frame_end
    	scrib_app_data_frame_begin "Note"
    	    
              		scrib_app_data_comment "To get the PID of 99999 from the partfile named PART_09999900, these values would be { PART , 5 , +3 } or { PART_ , 5 , +2 }.\nTo get the PID 999 from the partfile named 1234999_AB0000, the values could be { {AA AB BB} , 3 , -2 }."
   	 scrib_app_data_frame_end   
       	scrib_app_data_notebook_page_end
scrib_app_data_notebook_end


scrib_app_data_notebook_page_end

#-------------------------------
scrib_app_data_notebook_page_begin "Geometry Midplane"
   scrib_app_data_notebook_begin
    scrib_app_data_notebook_page_begin "Offset Info"
	scrib_app_data_frame_begin ""
	    scrib_app_data_choicelist -var offset -def 0 -desc "Type of offset" \
		-choices {{0 "No offset"} {1 "Offset from file"} {2 "Offset from layers"}}
    
	    scrib_app_data_entry -var offset_file -desc "Offset file" \
    		-type file -def "" -allow_new 1 -select 1 \
		-active {{offset 1}}
	
	    scrib_app_data_entry -var offset_layers -desc "Layers of offset curves" \
    		-type string -def "" -active {{offset 2}}
	scrib_app_data_frame_end

	scrib_app_data_frame_begin "Note: Offset file should be space delimited and of format;"
             scrib_app_data_comment "Part#    <other columns such as part name>   Material    Thickness    Thickness_Direction \n12345         Example row      Another field         Steel            2                                  Y+            "
	scrib_app_data_frame_end
    scrib_app_data_notebook_page_end  
    scrib_app_data_notebook_page_begin "Solids?"   

	scrib_app_data_choicelist -var Midsurface_Method -desc "Thickness" -def "0"\
             -choices {{0 "Auto Compute"} {1 "Defined"}}

	scrib_app_data_entry -var mid_surf_max_dist -desc "Max. distance" \
		-type float -def 10 -active {{Midsurface_Method 1}}

	scrib_app_data_toggle -var mid_surf_variable_thickness -desc "Run variable thickness midsurfacing"

	scrib_app_data_choicelist -var Solid_Method -desc "Treatment of Thick Solids?" -def "0"\
             -choices {{0 "Place in Solid Parts bin"} {1 "Shell Mesh Solids"} {2 "Solid mesh" }}

#
#     	scrib_app_data_toggle -var mid_surf_keep_orig -desc "Keep original surface(s)" \
#		-def 0 -active {{Solid_Method 2}}

    	#scrib_app_data_notebook_page_begin "OCTREE TETRA OPTIONS"
	#scrib_app_data_notebook_page_begin "Advancing Front TETRA"
         #scrib_app_data_notebook_page_end
 #scrib_app_data_notebook_end  	    
   	       
    scrib_app_data_notebook_page_end
    scrib_app_data_notebook_end
scrib_app_data_notebook_page_end


#-------------------------------
scrib_app_data_notebook_page_begin "Feature info"

    scrib_app_data_entry -var build_topo_tol -type float -def 0.2 \
    			-desc "Gap tolerance"
    scrib_app_data_entry -var number_rings -type float -def 2 \
    			-desc "Number of quad rings around bolt holes"
    scrib_app_data_entry -var ratio -type float -def 0.6 \
    			-desc "Ratio of quad ring offset"
	

    scrib_app_data_notebook_begin

    	scrib_app_data_notebook_page_begin "Bolt holes info"
	  
   	    scrib_app_data_frame_begin "Feature information"

		scrib_app_data_toggle -var Bolts -desc "Run bolt hole detection"	
	
	    	scrib_app_data_entry -var min_hole -type float -def 3 \
    			-desc "Remove holes w/Diameter <"  \
			 -active {{Bolts 1}}  		
	         
                  	scrib_app_data_entry -var med_hole -type float -def "__compute__" \
    			-desc "4+ noded bolt hole (diameter upper limit <)"	\
			    -compute_cmd "app_compute_bolt_hole_dia 4" \
			 -active {{Bolts 1}}
	    
	    	scrib_app_data_entry -var max1_hole -type float -def "__compute__" \
    			-desc "6+ noded bolt hole (diameter upper limit <)" \
				-compute_cmd "app_compute_bolt_hole_dia 6" \
			 -active {{Bolts 1}}
	    
	    	scrib_app_data_entry -var max2_hole -type float -def "__compute__" \
    			-desc "8+ noded bolt hole (diameter upper limit <)" \
				-compute_cmd "app_compute_bolt_hole_dia 8" \
			 -active {{Bolts 1}}
	
	    	scrib_app_data_entry -var max3_hole -type float -def "__compute__" \
			-desc "10+ noded bolt hole (diameter upper limit <)" \
				-compute_cmd "app_compute_bolt_hole_dia 10" \
			 -active {{Bolts 1}}
	
	    	scrib_app_data_entry -var max4_hole -type float -def "__compute__" \
    			-desc "12+ noded bolt hole (diameter upper limit <)" \
				-compute_cmd "app_compute_bolt_hole_dia 12" \
			 -active {{Bolts 1}}

		scrib_app_data_entry -var max_hole -type float -def 55 \
			-desc "Max sized hole for quad rings (diameter upper limit <)" \
			 -active {{Bolts 1}}
	
  	    scrib_app_data_frame_end

        	scrib_app_data_notebook_page_end

    	scrib_app_data_notebook_page_begin "Flanges info"
	  
   	    scrib_app_data_frame_begin "Feature information"

		scrib_app_data_toggle -var Flanges -desc "Run flange detection"	

		scrib_app_data_entry -var flange_width -type float -def 30 \
    			-desc "Max width of flange" -active {{Flanges 1}}

		scrib_app_data_entry -var flange_width_min -type float -def 5 \
    			-desc "Min width of flange" -active {{Flanges 1}}

		scrib_app_data_entry -var flange_curvature -type float -def 80 \
    			-desc "Max curvature of flange" -active {{Flanges 1}}

		scrib_app_data_entry -var notch_length -type float -def 8 \
    			-desc "Max notch cutout" 

  	    scrib_app_data_frame_end

        	scrib_app_data_notebook_page_end


       	scrib_app_data_notebook_page_begin "Fillet info"
	
   	    scrib_app_data_frame_begin "Feature information"
	
		scrib_app_data_toggle -var Fillets -desc "Run fillet detection"	

	    	scrib_app_data_entry -var Fillet_ang_min -type float -def 10 \
    			-desc "Minimum fillet angle" -active {{Fillets 1}}
	
	    	scrib_app_data_entry -var Fillet_ang_max -type float -def 170 \
    			-desc "Maximum fillet angle"  -active {{Fillets 1}}   		

	    	scrib_app_data_entry -var Fillet_length_min -type float -def 2  \
    			-desc "Minimum fillet length" -active {{Fillets 1}}    		

	    	
		scrib_app_data_entry -var Fillet_length_2 -type float -def "__compute__" \
    			-desc "2 noded fillets (length <)" -active {{Fillets 1}} 	\
			    -compute_cmd "app_compute_fillet_length 2"
	    
	    			
		scrib_app_data_entry -var Fillet_length_3 -type float -def "__compute__" \
    			-desc "3 noded fillets (length <)" -active {{Fillets 1}} 	\
			    -compute_cmd "app_compute_fillet_length 3"	    


		scrib_app_data_entry -var Fillet_length_4 -type float -def "__compute__" \
    			-desc "4 noded fillets (length <)"	 -active {{Fillets 1}} \
			    -compute_cmd "app_compute_fillet_length 4"

	    
	    	scrib_app_data_entry -var Fillet_length_5 -type float -def "__compute__" \
    			-desc "5 noded fillets (length <)" -active {{Fillets 1}}	\
			    -compute_cmd "app_compute_fillet_length 5"
	
	
	    scrib_app_data_frame_end

        	scrib_app_data_notebook_page_end

  	#scrib_app_data_notebook_page_begin "Flange info"
	
   	 #   scrib_app_data_frame_end
   	 #   scrib_app_data_frame_begin "Feature information"
	
	    	
	 #   	scrib_app_data_comment "Coming soon to a batch mesher near you!"


  	  #  scrib_app_data_frame_end

        #scrib_app_data_notebook_page_end

	scrib_app_data_notebook_page_begin "Button info"

   	    scrib_app_data_frame_begin "Feature information"
	
        		scrib_app_data_entry -var bead_mesh_size -desc "Button mesh size" \
		    -type float -def 7.5

		scrib_app_data_toggle -var Buttons -desc "Run button detection"

  		scrib_app_data_toggle -var Buttons_free -desc "Run free button detection"

		scrib_app_data_toggle -var Buttons_fillet -desc "Run fillet button detection"

		scrib_app_data_toggle -var Buttons_split -desc "Run split button detection"
	
  	    scrib_app_data_frame_end

        scrib_app_data_notebook_page_end

	scrib_app_data_notebook_page_begin "Smart Loop info"

   	    scrib_app_data_frame_begin "Feature information"

		scrib_app_data_toggle -var smart_loops -desc "Run smart loop detection"

  		scrib_app_data_entry -var smart_loop_min_edge -desc "Smart loop min edge" \
		    -type float -def 5 -active {{smart_loops 1}}

    		scrib_app_data_entry -var smart_loop_min_surf_area -desc "Smart loop min surface area" \
		    -type float -def 300 -active {{smart_loops 1}}

  		scrib_app_data_entry -var smart_loop_max_curvature -desc "Smart loop max curvature (deg)" \
		    -type float -def 70 

  		scrib_app_data_entry -var smart_loop_angle -desc "Smart loop angle" \
		    -type float -def 20 

		scrib_app_data_toggle -var thin_surfs -desc "Run thin surf detection"

		scrib_app_data_entry -var thin_surf_aspect_ratio -desc "Thin surf aspect ratio" \
		    -type float -def 30 -active {{thin_surfs 1}}

		scrib_app_data_toggle -var ring_conflict -desc "Run boundary loop detection"

	   	scrib_app_data_entry -var ring_conflict_distance -desc "Surface boundary conflict distance" \
		    -type float -def 10 -active {{ring_conflict 1}}

   	    scrib_app_data_frame_end

        scrib_app_data_notebook_page_end
    
    scrib_app_data_notebook_end

scrib_app_data_notebook_page_end


#-----------------------------------------------------------------------
scrib_app_data_notebook_page_begin "Meshing info"

   scrib_app_data_notebook_begin

   scrib_app_data_notebook_page_begin "Meshing information"

	scrib_app_data_choicelist -var mesh_method -desc "Meshing method" \
		-choices {{quad "Feature Based"} {hexa "Orthogonal"} } -def quad

	scrib_app_data_entry -var mesh_size -desc "Mesh size" \
		-type float -def 10

	scrib_app_data_entry -var ignore_tol -desc "Ignore feature size" \
   		 -type float -def 2

	scrib_app_data_entry -var ignore_angle -desc  "Ignore feature angle" \
   		-type float -def 10

	scrib_app_data_entry -var mapped_mesh -desc "Mapped mesh surface factor" \
		-type float -def 0.2

scrib_app_data_frame_begin ""
       scrib_app_data_toggle -var file_check -desc "Special meshing params from file" 
       scrib_app_data_entry -var spcl_file -desc "File (Comma delimited - .csv)" \
		-type file -def . -select 1 -allow_new 1 -active {{file_check 1}}
	
scrib_app_data_frame_end

scrib_app_data_frame_begin ""	
	scrib_app_data_entry -var num -type int -def 100 \
    		-desc "Remesh components with number of elements <"
	
	scrib_app_data_entry -var size2 -desc "Remesh size" \
		-type float -def 5

scrib_app_data_frame_end
#scrib_app_data_frame_begin ""	
#	scrib_app_data_entry -var mapped_mesh -desc "Mapped Mesh Surface Factor" \
#		-type float -def 0.2
	
#    scrib_app_data_frame_end
#    scrib_app_data_notebook_page_end

#    scrib_app_data_notebook_page_begin "Special Meshing Parameters"

    # Put the good stuff here.

#    scrib_app_data_notebook_page_end
    #Here, I just wanted it to close the internal note book, and revert to the original one.
    scrib_app_data_notebook_end
scrib_app_data_notebook_page_end

#--------------------------------------------------------------
scrib_app_data_notebook_page_begin "Quality"
#   scrib_app_data_frame_begin ""
#	scrib_app_data_toggle -var FixPatterns -desc "Fix patterns" -def 1
#	scrib_app_data_toggle -var IgnoreDim -desc "Ignore projection" 
#       	scrib_app_data_entry -var IgnoreDimUpto -desc "Upto quality" \
#		-type float -def 0.7	-active {{IgnoreDim 1}}
#   scrib_app_data_frame_end
   
#   scrib_app_data_frame_begin "Define Custom Quality"
#      scrib_app_data_entry -var mergetolerance -desc "Merge val" \
#		-type float -def 0
       scrib_app_data_entry -var SmoothingUptos -desc "Smoothing pattern" \
		-type float -def [list .2 .4 .5 .6 .7 .8 .9 1.0 1.5 2.0 2.5 3.0]
       scrib_app_data_entry -var ViolateGeomVal -desc "Violate Geometry Tolerance" \
		-type float -def 0.001
       scrib_app_data_notebook_begin
           scrib_app_data_notebook_page_begin "Quad elements base"

		scrib_app_data_entry -var Q_A_Q4_min -type float -def 45 \
    			-desc "Angle Min"
	
		scrib_app_data_entry -var Q_A_Q4_max -type float -def 135  \
    			-desc "Angle Max" 

		scrib_app_data_entry -var Q_D_Q4_min -type float -def .7 \
    			-desc "Jacobian (Distortion) Min"
	
		scrib_app_data_entry -var Q_AR_Q4_min -type float -def .3 \
    			-desc "Aspect Ratio Min"    		

		scrib_app_data_entry -var Q_W_Q4_max -type float -def 8  \
    			-desc "Warpage Max"

		scrib_app_data_entry -var Q_S_Q4_max -type float -def 45  \
    			-desc "Skewness Max"

		scrib_app_data_entry -var Q_ME_Q4_min -type float -def 5  \
    			-desc "Min Edge"

		scrib_app_data_entry -var Q_ME_Q4_max -type float -def 25  \
    			-desc "Max Edge"

	    scrib_app_data_notebook_page_end
	    scrib_app_data_notebook_page_begin "Quad elements weighting"

		scrib_app_data_entry -var Q_A_Q4_amin -type float -def 30 \
    			-desc "Low Angle Min"

		scrib_app_data_entry -var Q_A_Q4_amax -type float -def 150  \
    			-desc "High Angle Max" 

		scrib_app_data_entry -var Q_D_Q4_amin -type float -def .5 \
    			-desc "Low Jacobian (Distortion) Min"

		scrib_app_data_entry -var Q_AR_Q4_amin -type float -def .2 \
    			-desc "Low Aspect Ratio Min"   

		scrib_app_data_entry -var Q_W_Q4_amax -type float -def 15  \
    			-desc "High Warpage Max"

		scrib_app_data_entry -var Q_S_Q4_amax -type float -def 60  \
    			-desc "High Skewness Max"

		scrib_app_data_entry -var Q_ME_Q4_amin -type float -def 3  \
    			-desc "Low Min Edge"

		scrib_app_data_entry -var Q_ME_Q4_amax -type float -def 30  \
    			-desc "High Max Edge"

	    scrib_app_data_notebook_page_end
	    scrib_app_data_notebook_page_begin "Tri elements"
	
		scrib_app_data_entry -var Q_A_T3_amin -type float -def 10 \
    			-desc "Low Angle Min"

		scrib_app_data_entry -var Q_A_T3_min -type float -def 20 \
    			-desc "Angle Min"
	
	 	scrib_app_data_entry -var Q_A_T3_max -type float -def 120  \
    			-desc "Angle Max" 
	
	 	scrib_app_data_entry -var Q_A_T3_amax -type float -def 130  \
    			-desc "High Angle Max" 

		scrib_app_data_entry -var Q_AR_T3_amin -type float -def .1 \
    			-desc "Low Aspect Ratio Min" 

		scrib_app_data_entry -var Q_AR_T3_min -type float -def .2 \
    			-desc "Aspect Ratio Min" 

		scrib_app_data_entry -var Q_S_T3_max -type float -def 45  \
    			-desc "Skew Max"

		scrib_app_data_entry -var Q_S_T3_amax -type float -def 60  \
    			-desc "High Skew Max"

	    scrib_app_data_notebook_page_end
         scrib_app_data_notebook_end
#    scrib_app_data_frame_end
scrib_app_data_notebook_page_end

#---------------------------------------------------------------------------
scrib_app_data_notebook_page_begin "Weld/Assembly info"
    scrib_app_data_frame_begin "Weld information"

         scrib_app_data_choicelist -var welding_mode -desc "Type of WELD file" -def "" \
		-choices {{"" "None"} {vif "WSPOT # X Y Z PID1 PID2 PID3 Dia"} {biwasm "BIWASM"} }
	    
	scrib_app_data_entry -var welding_file -desc "Weld file" \
    		-type file -def "" -allow_new 0 -select 1 \
		-active {{welding_mode vif} {welding_mode biwasm}}
	
	scrib_app_data_entry -var welding_report -desc "Weld report file" \
    		-type file -def "welding_report.txt" -allow_new 1 -select 1 \
		-active {{welding_mode vif} {welding_mode biwasm}}

	scrib_app_data_entry -var welding_maxproject -desc "Maximum projection" \
    		-type string -def "" -active {{welding_mode vif} {welding_mode biwasm}}

	scrib_app_data_entry -var welding_max_width_limit -desc "Maximum proximity to edge" \
    		-type string -def "" -active {{welding_mode vif} {welding_mode biwasm}}

	scrib_app_data_toggle -var original_geom -desc "Meshable Geometry"

	scrib_app_data_choicelist -var welding_splitting -desc "Element splitting" \
                -choices {{terminate "Terminate"} {propagate "Propagate"} \
			       {remesh_tri_quad "Remesh area (Tri/Quad)"} } \
		-def remesh_tri_quad -active {{welding_mode vif} {welding_mode biwasm}}

   scrib_app_data_frame_end
        
scrib_app_data_notebook_page_end

#-----------------------------------------------------------------------
scrib_app_data_notebook_page_begin "Execution options"

       scrib_app_data_choicelist -var execution_mode -desc "Executon mode" \
                -choices {{LOCAL Local} {REMOTE Remote} {BATCH_QUEUE "Batch queueing"} } \
		-def LOCAL

       scrib_app_data_notebook_begin
           scrib_app_data_notebook_page_begin "Local"
              scrib_app_data_toggle -var interactive -desc "Run with GUI" \
                    -active {{execution_mode LOCAL}} -def 0
              scrib_app_data_toggle -var failure_mode -desc "Run with prompts" \
                    -active {{execution_mode LOCAL}} -def 0
              #scrib_app_data_choicelist -var timing -def "" -desc "Run with time profiling" \
              #      -choices {{"" "None"} {"rel" "Relative time"} {"abs" "Absolute time"}} \
              #      -active {{execution_mode LOCAL}}
	    scrib_app_data_notebook_page_end
	    scrib_app_data_notebook_page_begin "Batch queueing"
               scrib_app_data_choicelist -var batch_system -desc "Batch queueing system" -def "" \
                     -choices {{"" None} {icbqs IcBQS}  {pbs PBS} {gridengine "Grid Engine"}} \
                     -active {{execution_mode BATCH_QUEUE}}
               scrib_app_data_entry -var icbqs_remote_hosts -desc "IcBQS remote hosts" \
    		     -type string -def "localhost" -active {{batch_system icbqs}}
	    scrib_app_data_notebook_page_end
            scrib_app_data_notebook_page_begin "Remote"
               scrib_app_data_entry -var remote_host -desc "Remote host" \
                     -type string -def "localhost" -active {{execution_mode REMOTE}}
               scrib_app_data_entry -var remote_icemacn -desc "Remote ICEM_ACN" \
                     -type string -def "" -active {{execution_mode REMOTE}}
               scrib_app_data_entry -var remote_port -desc "Remote port" \
                     -type string -def 2054 -active {{execution_mode REMOTE}}
               #scrib_app_data_entry -var remote_user -desc "Remote user" \
               #      -type string -def "" -active {{remote_exec 1}}
               #scrib_app_data_entry -var remote_path -desc "Remote path" \
               #      -type string -def "" -active {{remote_exec 1}}
               #scrib_app_data_entry -var remote_sh -desc "Remote shell" \
               #      -type string -def "" -active {{remote_exec 1}}
	    scrib_app_data_notebook_page_end
         scrib_app_data_notebook_end
    scrib_app_data_frame_end

scrib_app_data_notebook_page_end

scrib_app_data_notebook_end

# I have put this in the "Execution info" page
#scrib_app_data_frame_begin "Options"
#scrib_app_data_toggle -var failure_mode -desc "Run with prompts"
#scrib_app_data_choicelist -var timing -def "" -desc "Run with time profiling" \
#    -choices {{"" "None"} {"rel" "Relative time"} {"abs" "Absolute time"}}
#scrib_app_data_frame_end










