<!-- for Underworld version 1.2 -->
<!-- some aspects of this model file have been modified from the release copy for use in the Underworld Grid Workshop 2009 -->

<!--
This is test xml for Multiple Material Thermal Diffusivity parameter.
It uses the plugin Underworld_MaterialThermalDiffusivity to enable this feature
The simulation is a 1x1 free slip box, with 3 strips of constant isoviscous material algined in the y-axis.
Each material has a different diffusivity; going from 1, 10, 100 from x = 0 to x = 1.

For the ascii art connoisseurs.
    _______________________
  1|       |       |       |
   |       |       |       |
Y  |  k=1  |  k=10 | k=100 |
|  |       |       |       |
A  |       |       |       |
x  |       |       |       |
i  |  *****|*******|*****  |
s  |    The|rmalPac|ket    |
   |  *****|*******|*****  |
   |       |       |       |
   |_______|_______|_______|
   0	X - Axis           1 
                
The fluid is driven by a thermal packet which spreads over each material.

The below is the definitions of the material layout and the thermal packet distribution. 

Note: The settings in this xml produce some unrealistic temperature max and min. So be aware of the
appropriate parameters and their values if you use this xml from production runs.
-->

<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">

        <list name="import">
                <param> Underworld </param>
        </list>

	<include> Underworld/BaseApps/ThermalConvectionPIC.xml </include>
	
	<list name="plugins" mergeType="merge">
		<!-- Output Plugins -->
		<param>StgFEM_FrequentOutput</param>	
		<param>Underworld_Nusselt</param>	
		<param>Underworld_Vrms</param>	
		<param>StgFEM_CPUTime</param>	
		<param>Underworld_MaterialThermalDiffusivity</param>	
		<param>Underworld_ShapeTemperatureIC</param>	
	</list>

	<struct name="components" mergeType="merge">
		<struct name="buoyancyForceTerm" mergeType="replace">
			<param name="Type">BuoyancyForceTerm</param>
			<param name="ForceVector">mom_force</param>
			<param name="TemperatureField">TemperatureField</param>
			<param name="Swarm">picIntegrationPoints</param>
			<param name="gravity">1e5</param>
		</struct>
		<struct name="isotropicViscosity">
			<param name="Type">MaterialViscosity</param>
			<param name="eta0">1.0</param>
		</struct> 
		<struct name="shapeA">
			<param name="Type">PolygonShape</param>
			<list name="verticies">
				<asciidata>
					<columnDefinition name = "x" type="double"/>
					<columnDefinition name = "y" type="double"/>
					<columnDefinition name = "z" type="double"/>
					0.0  0.0 0.0
					0.3333  0.0 0.0
					0.3333  1.0 0.0
					0.0  1.0 0.0
				</asciidata>
			</list>
		</struct>
		<struct name="materialA">
			<param name="Type">RheologyMaterial</param>
			<param name="Shape">shapeA</param>
			<param name="thermalDiffusivity">1</param>
			<param name="density">1</param>
			<param name="alpha">1</param>
			<list name="Rheology">
				<param>isotropicViscosity</param>
			</list>
		</struct>	
		<struct name="shapeB">
			<param name="Type">PolygonShape</param>

			<list name="verticies">
				<asciidata>
					<columnDefinition name = "x" type="double"/>
					<columnDefinition name = "y" type="double"/>
					<columnDefinition name = "z" type="double"/>
					0.3333  0.0 0.0
					0.6666  0.0 0.0
					0.6666  1.0 0.0
					0.3333 1.0 0.0
				</asciidata>
			</list>
		</struct>
		<struct name="materialB">
			<param name="Type">RheologyMaterial</param>
			<param name="Shape">shapeB</param>
			<param name="thermalDiffusivity">10</param>
			<param name="density">1</param>
			<param name="alpha">1</param>
			<list name="Rheology">
				<param>isotropicViscosity</param>
			</list>
		</struct>
		<struct name="shapeC">
			<param name="Type">PolygonShape</param>

			<list name="verticies">
				<asciidata>
					<columnDefinition name = "x" type="double"/>
					<columnDefinition name = "y" type="double"/>
					<columnDefinition name = "z" type="double"/>
					0.6666  0.0 0.0
					1.0  0.0 0.0
					1.0  1.0 0.0
					0.6666 1.0 0.0
				</asciidata>
			</list>
		</struct>
		<struct name="materialC">
			<param name="Type">RheologyMaterial</param>
			<param name="Shape">shapeC</param>
			<param name="thermalDiffusivity">100</param>
			<param name="density">1</param>
			<param name="alpha">1</param>
			<list name="Rheology">
				<param>isotropicViscosity</param>
			</list>
		</struct>

		<struct name="HeatShape">
			<param name="Type">PolygonShape</param>
			<list name="verticies">
				<asciidata>
					<columnDefinition name = "x" type="double"/>
					<columnDefinition name = "y" type="double"/>
					<columnDefinition name = "z" type="double"/>
					0.1  0.25 0.0
					0.9  0.25 0.0
					0.9  0.5 0.0
					0.1 0.5 0.0
				</asciidata>
			</list>
		</struct>

					
	</struct>

	<!-- Simulation control -->
	<param name="maxTimeSteps"> 250 </param>
	<param name="dumpEvery"> 10 </param>
	<param name="outputPath"> ./output/ </param>

	<param name="courantFactor"> 0.25 </param>	
	
	<!-- Journal Control -->
	<param name="journal.info.Context-verbose">True</param>
	<param name="journal-level.info.Stg_ComponentFactory">2</param>
	<param name="journal-level.info.lucInfo">2</param>
	<param name="journal-level.debug.lucDebug">1</param>
	<param name="journal-enable-branch.debug.lucDebug">f</param>
	<param name="journal-enable-branch.debug.StgFEM">t</param>
	<param name="journal-level-branch.debug.StgFEM"> 2 </param>	
	<param name="journal.debug">t</param>
	
	<!-- Geometry & Mesh setup -->
	<param name="dim"> 2 </param>
	<param name="elementResI"> 64 </param>
	<param name="elementResJ"> 64 </param>
	<param name="elementResK"> 1 </param>
	<param name="shadowDepth"> 1 </param>
	<param name="minX"> 0.0 </param>
	<param name="minY"> 0.0 </param>
	<param name="minZ"> 0.0 </param>
	<param name="maxX"> 1.0 </param>
	<param name="maxY"> 1.0 </param>
	<param name="maxZ"> 1.0 </param>
	<param name="allowUnbalancing"> True </param>

	<!-- Set up BCs and ICs -->
	<param name="temperatureICShape"> HeatShape </param>
	<struct name="temperatureICs">
		<param name="type">CompositeVC</param>
		<list name="vcList">
			<struct>
				<param name="type"> AllNodesVC </param>
				<list name="variables">
					<struct>
						<param name="name">temperature</param>
						<param name="type">func</param>
						<param name="value"> ShapeTemperatureIC </param>
					</struct>
				</list>
			</struct>
		</list>
	</struct>

	<include> Underworld/VariableConditions/velocityBCs.freeslip.xml </include>

	<!-- Integration Scheme configuration -->
	<param name="particlesPerCell"> 20 </param>

	<!-- Viewport stuff -->
	<include>Underworld/Viewports/TemperatureAndVelocityArrowsVP.xml</include>
	<include>Underworld/Viewports/VelocityMagnitudeVP.xml</include>
	<include>glucifer/window.xml</include>
	<include>glucifer/BuildMovies.xml</include>

	<struct name="components" mergeType="merge">
		<struct name="camera" mergeType="replace">
			<param name="Type">lucCamera</param>
			<param name="CentreFieldVariable">VelocityField</param>
			<param name="coordZ">1.4762</param>
		</struct>
		<struct name="densityColourMap">
			<param name="Type">lucColourMap</param>
			<param name="colours">Red Green Blue</param>
			<param name="dynamicRange">True</param>
		</struct>
		<!-- Drawing Objects -->
		<struct name="particleDots">
			<param name="Type">lucSwarmViewer</param>
			<param name="Swarm">materialSwarm</param>
			<param name="ColourVariable">materialSwarm-MaterialIndex</param>
			<param name="ColourMap">densityColourMap</param>
			<param name="pointSize">2.0</param>
		</struct>		
		<struct name="border" mergeType="replace">
			<param name="Type">lucFieldVariableBorder</param>
			<param name="FieldVariable">VelocityField</param>
		</struct>
		<struct name="particleTypeTitle" mergeType="replace">
			<param name="Type">lucTitle</param>
			<param name="string">Particle Types</param>
		</struct>
		<!-- Viewport -->
		<struct name="ParticleVP">
			<param name="Type">lucViewport</param>
			<param name="Camera">camera</param>
			<list name="DrawingObject">
				<param>particleDots</param>
				<param>particleTypeTitle</param>
				<param>border</param>
			</list>
		</struct>
		<!-- Drawing Objects -->
		<struct name="window" mergeType="merge">
			<param name="Viewport">TemperatureAndVelocityArrowsVP ParticleVP </param>
		</struct>
	</struct>
 
</StGermainData>
