[cig-commits] r8010 - in long/3D/Gale/trunk: . input/examples src/StGermain/Discretisation/Mesh/src

walter at geodynamics.org walter at geodynamics.org
Mon Sep 24 10:45:36 PDT 2007


Author: walter
Date: 2007-09-24 10:45:36 -0700 (Mon, 24 Sep 2007)
New Revision: 8010

Added:
   long/3D/Gale/trunk/input/examples/tibet.xml
Modified:
   long/3D/Gale/trunk/
   long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.c
   long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.h
Log:
 r1925 at earth:  boo | 2007-09-24 10:18:27 -0700
 Add a plateau surface type and an input file to test it



Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
   - 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1924
   + 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1925

Added: long/3D/Gale/trunk/input/examples/tibet.xml
===================================================================
--- long/3D/Gale/trunk/input/examples/tibet.xml	2007-09-24 17:45:32 UTC (rev 8009)
+++ long/3D/Gale/trunk/input/examples/tibet.xml	2007-09-24 17:45:36 UTC (rev 8010)
@@ -0,0 +1,510 @@
+<?xml version="1.0"?>
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+  <struct name="components">
+    <struct name="conditionFunctions">
+      <param name="Type">StgFEM_StandardConditionFunctions</param>
+    </struct>
+    <struct name="mesh-constant">
+      <param name="Type">FeMesh</param>
+      <param name="elementType">constant</param>
+    </struct>
+    <struct name="constantMesh-generator">
+      <param name="Type">C0Generator</param>
+      <param name="mesh">mesh-constant</param>
+      <param name="elementMesh">mesh-linear</param>
+    </struct>
+    <struct name="mesh-linear">
+      <param name="Type">FeMesh</param>
+      <param name="elementType">linear</param>
+    </struct>
+    <struct name="linearMesh-generator">
+      <param name="Type">CartesianGenerator</param>
+      <param name="mesh">mesh-linear</param>
+      <param name="dim">dim</param>
+      <param name="shadowDepth">shadowDepth</param>
+      <list name="size">
+        <param>elementResI</param>
+        <param>elementResJ</param>
+        <param>elementResK</param>
+      </list>
+      <list name="minCoord">
+        <param>minX</param>
+        <param>minY</param>
+        <param>minZ</param>
+      </list>
+      <list name="maxCoord">
+        <param>maxX</param>
+        <param>maxY</param>
+        <param>maxZ</param>
+      </list>
+    </struct>
+    <struct name="velocity">
+      <param name="Type">MeshVariable</param>
+      <param name="mesh">mesh-linear</param>
+      <param name="Rank">Vector</param>
+      <param name="DataType">Double</param>
+      <param name="VectorComponentCount">dim</param>
+      <list name="names">
+        <param>vx</param>
+        <param>vy</param>
+        <param>vz</param>
+      </list>
+    </struct>
+    <struct name="velocityBCs">
+      <param name="Type">CompositeVC</param>
+      <param name="Data">mesh-linear</param>
+    </struct>
+    <struct name="velocityICs">
+      <param name="Type">CompositeVC</param>
+      <param name="Data">mesh-linear</param>
+    </struct>
+    <struct name="velocityDofLayout">
+      <param name="Type">DofLayout</param>
+      <param name="mesh">mesh-linear</param>
+      <param name="BaseVariableCount">dim</param>
+      <list name="BaseVariables">
+        <param>vx</param>
+        <param>vy</param>
+        <param>vz</param>
+      </list>
+    </struct>
+    <struct name="VelocityField">
+      <param name="Type">FeVariable</param>
+      <param name="FEMesh">mesh-linear</param>
+      <param name="DofLayout">velocityDofLayout</param>
+      <param name="BC">velocityBCs</param>
+      <param name="IC">velocityICs</param>
+      <param name="LinkedDofInfo">velocityLinkedDofs</param>
+    </struct>
+    <struct name="VelocityMagnitudeField">
+      <param name="Type">OperatorFeVariable</param>
+      <param name="Operator">Magnitude</param>
+      <param name="FeVariable">VelocityField</param>
+    </struct>
+    <struct name="VelocityGradientsField">
+      <param name="Type">OperatorFeVariable</param>
+      <param name="Operator">Gradient</param>
+      <param name="FeVariable">VelocityField</param>
+    </struct>
+    <struct name="VelocityGradientsInvariantField">
+      <param name="Type">OperatorFeVariable</param>
+      <param name="Operator">TensorInvariant</param>
+      <param name="FeVariable">VelocityGradientsField</param>
+    </struct>
+    <struct name="StrainRateField">
+      <param name="Type">OperatorFeVariable</param>
+      <param name="Operator">TensorSymmetricPart</param>
+      <param name="FeVariable">VelocityGradientsField</param>
+    </struct>
+    <struct name="VorticityField">
+      <param name="Type">OperatorFeVariable</param>
+      <param name="Operator">TensorAntisymmetricPart</param>
+      <param name="FeVariable">VelocityGradientsField</param>
+    </struct>
+    <struct name="StrainRateInvariantField">
+      <param name="Type">OperatorFeVariable</param>
+      <param name="Operator">SymmetricTensor_Invariant</param>
+      <param name="FeVariable">StrainRateField</param>
+    </struct>
+    <struct name="pressure">
+      <param name="Type">MeshVariable</param>
+      <param name="mesh">mesh-constant</param>
+      <param name="Rank">Scalar</param>
+      <param name="DataType">Double</param>
+    </struct>
+    <struct name="pressureDofLayout">
+      <param name="Type">DofLayout</param>
+      <param name="mesh">mesh-constant</param>
+      <list name="BaseVariables">
+        <param>pressure</param>
+      </list>
+    </struct>
+    <struct name="PressureField">
+      <param name="Type">FeVariable</param>
+      <param name="FEMesh">mesh-constant</param>
+      <param name="DofLayout">pressureDofLayout</param>
+      <param name="LinkedDofInfo">pressureLinkedDofs</param>
+    </struct>
+    <struct name="cellLayout">
+      <param name="Type">SingleCellLayout</param>
+    </struct>
+    <struct name="particleLayout">
+      <param name="Type">GaussParticleLayout</param>
+    </struct>
+    <struct name="gaussSwarm">
+      <param name="Type">IntegrationPointsSwarm</param>
+      <param name="CellLayout">cellLayout</param>
+      <param name="ParticleLayout">particleLayout</param>
+      <param name="FeMesh">mesh-linear</param>
+      <param name="TimeIntegrator">timeIntegrator</param>
+      <param name="IntegrationPointMapper">gaussMapper</param>
+    </struct>
+    <struct name="gaussMapper">
+      <param name="Type">GaussMapper</param>
+      <param name="IntegrationPointsSwarm">gaussSwarm</param>
+      <param name="MaterialPointsSwarm">gaussMaterialSwarm</param>
+    </struct>
+    <struct name="backgroundLayout">
+      <param name="Type">BackgroundParticleLayout</param>
+    </struct>
+    <struct name="gaussMaterialSwarm">
+      <param name="Type">MaterialPointsSwarm</param>
+      <param name="CellLayout">cellLayout</param>
+      <param name="ParticleLayout">backgroundLayout</param>
+      <param name="FeMesh">mesh-linear</param>
+    </struct>
+    <struct name="timeIntegrator">
+      <param name="Type">TimeIntegrator</param>
+      <param name="order">1</param>
+      <param name="simultaneous">t</param>
+      <param name="Context">context</param>
+    </struct>
+    <struct name="elementCellLayout">
+      <param name="Type">ElementCellLayout</param>
+      <param name="Mesh">mesh-linear</param>
+    </struct>
+    <struct name="weights">
+      <param name="Type">PCDVC</param>
+      <param name="resolutionX">10</param>
+      <param name="resolutionY">10</param>
+      <param name="resolutionZ">10</param>
+      <param name="lowerT">0.6</param>
+      <param name="upperT">25</param>
+      <param name="maxDeletions">3</param>
+      <param name="maxSplits">3</param>
+      <param name="MaterialPointsSwarm">materialSwarm</param>
+    </struct>
+    <struct name="localLayout">
+      <param name="Type">MappedParticleLayout</param>
+    </struct>
+    <struct name="picIntegrationPoints">
+      <param name="Type">IntegrationPointsSwarm</param>
+      <param name="CellLayout">elementCellLayout</param>
+      <param name="ParticleLayout">localLayout</param>
+      <param name="FeMesh">mesh-linear</param>
+      <param name="WeightsCalculator">weights</param>
+      <param name="TimeIntegrator">timeIntegrator</param>
+      <param name="IntegrationPointMapper">mapper</param>
+    </struct>
+    <struct name="mapper">
+      <param name="Type">CoincidentMapper</param>
+      <param name="IntegrationPointsSwarm">picIntegrationPoints</param>
+      <param name="MaterialPointsSwarm">materialSwarm</param>
+    </struct>
+    <struct name="materialSwarmParticleLayout">
+      <param name="Type">MeshParticleLayout</param>
+      <param name="mesh">mesh-linear</param>
+      <param name="cellParticleCount">particlesPerCell</param>
+    </struct>
+    <struct name="materialSwarm">
+      <param name="Type">MaterialPointsSwarm</param>
+      <param name="CellLayout">elementCellLayout</param>
+      <param name="ParticleLayout">materialSwarmParticleLayout</param>
+      <param name="FeMesh">mesh-linear</param>
+      <param name="SplittingRoutine">splittingRoutine</param>
+      <param name="RemovalRoutine">removalRoutine</param>
+      <param name="EscapedRoutine">escapedRoutine</param>
+    </struct>
+    <struct name="materialSwarmAdvector">
+      <param name="Type">SwarmAdvector</param>
+      <param name="Swarm">materialSwarm</param>
+      <param name="TimeIntegrator">timeIntegrator</param>
+      <param name="VelocityField">VelocityField</param>
+      <param name="PeriodicBCsManager">periodicBCsManager</param>
+      <param name="allowFallbackToFirstOrder">True</param>
+    </struct>
+    <struct name="splittingRoutine">
+      <param name="Type">ReseedSplitting</param>
+      <param name="idealParticleCount">particlesPerCell</param>
+      <param name="originalParticleShape">bottomBoundaryShape</param>
+    </struct>
+    <struct name="solutionVelocity">
+      <param name="Type">SolutionVector</param>
+      <param name="FeVariable">VelocityField</param>
+    </struct>
+    <struct name="solutionPressure">
+      <param name="Type">SolutionVector</param>
+      <param name="FeVariable">PressureField</param>
+    </struct>
+    <struct name="mom_force">
+      <param name="Type">ForceVector</param>
+      <param name="FeVariable">VelocityField</param>
+      <param name="ExtraInfo">context</param>
+    </struct>
+    <struct name="cont_force">
+      <param name="Type">ForceVector</param>
+      <param name="FeVariable">PressureField</param>
+      <param name="ExtraInfo">context</param>
+    </struct>
+    <struct name="k_matrix">
+      <param name="Type">StiffnessMatrix</param>
+      <param name="RowVariable">VelocityField</param>
+      <param name="ColumnVariable">VelocityField</param>
+      <param name="RHS">mom_force</param>
+      <param name="allowZeroElementContributions">False</param>
+    </struct>
+    <struct name="constitutiveMatrix">
+      <param name="Type">ConstitutiveMatrixCartesian</param>
+      <param name="Swarm">picIntegrationPoints</param>
+      <param name="StiffnessMatrix">k_matrix</param>
+    </struct>
+    <struct name="g_matrix">
+      <param name="Type">StiffnessMatrix</param>
+      <param name="RowVariable">VelocityField</param>
+      <param name="ColumnVariable">PressureField</param>
+      <param name="RHS">cont_force</param>
+      <param name="allowZeroElementContributions">False</param>
+    </struct>
+    <struct name="gradientStiffnessMatrixTerm">
+      <param name="Type">GradientStiffnessMatrixTerm</param>
+      <param name="Swarm">gaussSwarm</param>
+      <param name="StiffnessMatrix">g_matrix</param>
+    </struct>
+    <struct name="preconditioner">
+      <param name="Type">StiffnessMatrix</param>
+      <param name="RowVariable">PressureField</param>
+      <param name="ColumnVariable">PressureField</param>
+      <param name="RHS">cont_force</param>
+      <param name="allowZeroElementContributions">True</param>
+    </struct>
+    <struct name="preconditionerTerm">
+      <param name="Type">UzawaPreconditionerTerm</param>
+      <param name="Swarm">picIntegrationPoints</param>
+      <param name="StiffnessMatrix">preconditioner</param>
+    </struct>
+    <struct name="uzawa">
+      <param name="Type">Stokes_SLE_UzawaSolver</param>
+      <param name="Preconditioner">preconditioner</param>
+      <param name="tolerance">1.0e-5</param>
+      <param name="maxIterations">5000</param>
+    </struct>
+    <struct name="stokesEqn">
+      <param name="Type">Stokes_SLE</param>
+      <param name="SLE_Solver">uzawa</param>
+      <param name="Context">context</param>
+      <param name="StressTensorMatrix">k_matrix</param>
+      <param name="GradientMatrix">g_matrix</param>
+      <param name="DivergenceMatrix"></param>
+      <param name="CompressibilityMatrix">c_matrix</param>
+      <param name="VelocityVector">solutionVelocity</param>
+      <param name="PressureVector">solutionPressure</param>
+      <param name="ForceVector">mom_force</param>
+      <param name="ContinuityForceVector">cont_force</param>
+      <param name="killNonConvergent">false</param>
+      <param name="nonLinearMaxIterations">nonLinearMaxIterations</param>
+      <param name="nonLinearTolerance">nonLinearTolerance</param>
+      <param name="makeConvergenceFile">false</param>
+    </struct>
+    <struct name="buoyancyForceTerm">
+      <param name="Type">BuoyancyForceTerm</param>
+      <param name="ForceVector">mom_force</param>
+      <param name="Swarm">picIntegrationPoints</param>
+      <param name="gravity">1.0</param>
+    </struct>
+    <struct name="background">
+      <param name="Type">Everywhere</param>
+    </struct>
+    <struct name="escapedRoutine">
+      <param name="Type">EscapedRoutine</param>
+      <param name="idealParticleCount">0</param>
+    </struct>
+    <struct name="velocityRemesher">
+      <param name="Type">StripRemesher</param>
+      <param name="mesh">mesh-linear</param>
+      <param name="meshType">regular</param>
+      <list name="dim">
+        <param>true</param>
+        <param>true</param>
+        <param>true</param>
+      </list>
+    </struct>
+    <struct name="pressureRemesher">
+      <param name="Type">CellRemesher</param>
+      <param name="mesh">mesh-constant</param>
+      <param name="meshType">regular</param>
+      <param name="dim">3</param>
+      <param name="cellMesh">mesh-linear</param>
+    </struct>
+
+    <struct name="bottomBoundaryShape">
+      <param name="Type">Box</param>
+      <param name="startX">minX</param>
+      <param name="endX">maxX</param>
+      <param name="startY">minY</param>
+      <param name="endY">0.05</param>
+      <param name="startZ">minZ</param>
+      <param name="endZ">maxZ</param>
+    </struct>
+
+    <struct name="boxShape">
+      <param name="Type">Box</param>
+      <param name="startX">minX</param>
+      <param name="endX">maxX</param>
+      <param name="startY">minY</param>
+      <param name="endY">maxY</param>
+      <param name="startZ">minZ</param>
+      <param name="endZ">maxZ</param>
+    </struct>
+    <struct name="backgroundViscosity">
+      <param name="Type">MaterialViscosity</param>
+      <param name="eta0">1.0</param>
+    </struct>
+    <struct name="storeViscosity">
+      <param name="Type">StoreVisc</param>
+      <param name="MaterialPointsSwarm">materialSwarm</param>
+    </struct>
+    <struct name="storeStress">
+      <param name="Type">StoreStress</param>
+      <param name="MaterialPointsSwarm">materialSwarm</param>
+    </struct>
+    <struct name="viscous">
+      <param name="Type">RheologyMaterial</param>
+      <param name="Shape">boxShape</param>
+      <param name="density">1.0</param>
+      <list name="Rheology">
+        <param>backgroundViscosity</param>
+        <param>storeViscosity</param>
+        <param>storeStress</param>
+      </list>
+    </struct>
+
+    <struct name="stressBC">
+      <param name="Type">StressBC</param>
+      <param name="ForceVector">mom_force</param>
+      <param name="Swarm">picIntegrationPoints</param>
+      <param name="wall">bottom</param>
+      <param name="y_type">double</param>
+      <param name="y_value">0.35</param>
+    </struct>
+
+    <struct name="surfaceAdaptor">
+      <param name="Type">SurfaceAdaptor</param>
+      <param name="mesh">mesh-linear</param>
+      <param name="sourceGenerator">linearMesh-generator</param>
+      <param name="surfaceType">plateau</param>
+      <param name="x1">0.5</param>
+      <param name="x2">0.7</param>
+      <param name="x3">1.3</param>
+      <param name="x4">1.5</param>
+      <param name="height">0.1</param>
+    </struct>
+
+  </struct>
+  <list name="plugins">
+    <param>Underworld_EulerDeform</param>
+    <param>Underworld_DumpSwarm</param>
+    <param>Underworld_VTKOutput</param>
+  </list>
+  <param name="maxTimeSteps">10</param>
+  <param name="outputEvery">1</param>
+  <param name="dumpEvery">1</param>
+  <param name="outputPath">./tibet</param>
+  <param name="dim">2</param>
+  <param name="shadowDepth">1</param>
+  <param name="minX">0.0f</param>
+  <param name="minY">0.0f</param>
+  <param name="minZ">0.0f</param>
+  <param name="maxX">2.0f</param>
+  <param name="maxY">0.35f</param>
+  <param name="maxZ">0.3f</param>
+  <param name="elementResI">32</param>
+  <param name="elementResJ">16</param>
+  <param name="elementResK">4</param>
+  <param name="allowUnbalancing">True</param>
+  <param name="buildNodeNeighbourTbl">True</param>
+  <param name="buildElementNeighbourTbl">True</param>
+  <param name="particlesPerCell">30</param>
+  <param name="seed">13</param>
+  <param name="gaussParticlesX">2</param>
+  <param name="gaussParticlesY">2</param>
+  <param name="gaussParticlesZ">2</param>
+  <param name="particlesPerCell">30</param>
+  <struct name="EulerDeform">
+    <list name="systems">
+      <struct>
+        <param name="mesh">mesh-constant</param>
+        <param name="remesher">pressureRemesher</param>
+        <param name="velocityField">VelocityField</param>
+        <list name="fields">
+          <struct>
+            <param name="field">PressureField</param>
+            <param name="variable">pressure</param>
+          </struct>
+        </list>
+      </struct>
+      <struct>
+        <param name="mesh">mesh-linear</param>
+        <param name="remesher">velocityRemesher</param>
+        <param name="velocityField">VelocityField</param>
+        <param name="wrapTop">True</param>
+        <param name="staticBottom">True</param>
+        <list name="fields">
+          <struct>
+            <param name="field">VelocityField</param>
+            <param name="variable">velocity</param>
+          </struct>
+        </list>
+      </struct>
+    </list>
+  </struct>
+  <struct name="velocityBCs">
+    <param name="type">CompositeVC</param>
+    <list name="vcList">
+      <struct>
+        <param name="type">WallVC</param>
+        <param name="wall">front</param>
+        <list name="variables">
+          <struct>
+            <param name="name">vz</param>
+            <param name="type">double</param>
+            <param name="value">0</param>
+          </struct>
+        </list>
+      </struct>
+      <struct>
+        <param name="type">WallVC</param>
+        <param name="wall">back</param>
+        <list name="variables">
+          <struct>
+            <param name="name">vz</param>
+            <param name="type">double</param>
+            <param name="value">0</param>
+          </struct>
+        </list>
+      </struct>
+      <struct>
+        <param name="type">WallVC</param>
+        <param name="wall">left</param>
+        <list name="variables">
+          <struct>
+            <param name="name">vx</param>
+            <param name="type">double</param>
+            <param name="value">0.0</param>
+          </struct>
+          <struct>
+            <param name="name">vy</param>
+            <param name="type">double</param>
+            <param name="value">0.0</param>
+          </struct>
+        </list>
+      </struct>
+      <struct>
+        <param name="type">WallVC</param>
+        <param name="wall">right</param>
+        <list name="variables">
+          <struct>
+            <param name="name">vx</param>
+            <param name="type">double</param>
+            <param name="value">1.0</param>
+          </struct>
+          <struct>
+            <param name="name">vy</param>
+            <param name="type">double</param>
+            <param name="value">0.0</param>
+          </struct>
+        </list>
+      </struct>
+    </list>
+  </struct>
+  <param name="checkpointEvery">1</param>
+</StGermainData>

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.c	2007-09-24 17:45:32 UTC (rev 8009)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.c	2007-09-24 17:45:36 UTC (rev 8010)
@@ -147,6 +147,18 @@
 		self->info.wedge.offs = Stg_ComponentFactory_GetDouble( cf, self->name, "offset", 0.0 );
 		self->info.wedge.grad = Stg_ComponentFactory_GetDouble( cf, self->name, "gradient", 0.5 );
 	}
+	else if( !strcmp( surfaceType, "plateau" ) ) {
+		self->surfaceType = SurfaceAdaptor_SurfaceType_Plateau;
+		self->info.plateau.x1 = Stg_ComponentFactory_GetDouble( cf, self->name, "x1", 0.0 );
+		self->info.plateau.x2 = Stg_ComponentFactory_GetDouble( cf, self->name, "x2", 0.0 );
+		self->info.plateau.x3 = Stg_ComponentFactory_GetDouble( cf, self->name, "x3", 0.0 );
+		self->info.plateau.x4 = Stg_ComponentFactory_GetDouble( cf, self->name, "x4", 0.0 );
+		self->info.plateau.z1 = Stg_ComponentFactory_GetDouble( cf, self->name, "z1", 0.0 );
+		self->info.plateau.z2 = Stg_ComponentFactory_GetDouble( cf, self->name, "z2", 0.0 );
+		self->info.plateau.z3 = Stg_ComponentFactory_GetDouble( cf, self->name, "z3", 0.0 );
+		self->info.plateau.z4 = Stg_ComponentFactory_GetDouble( cf, self->name, "z4", 0.0 );
+		self->info.plateau.height = Stg_ComponentFactory_GetDouble( cf, self->name, "height", 0.0 );
+	}
 	else if( !strcmp( surfaceType, "sine" ) || !strcmp( surfaceType, "cosine" ) ) {
 		Dictionary_Entry_Value*	originList;
 
@@ -216,6 +228,9 @@
 	case SurfaceAdaptor_SurfaceType_Wedge:
 		deformFunc = SurfaceAdaptor_Wedge;
 		break;
+	case SurfaceAdaptor_SurfaceType_Plateau:
+		deformFunc = SurfaceAdaptor_Plateau;
+		break;
 	case SurfaceAdaptor_SurfaceType_Sine:
 		deformFunc = SurfaceAdaptor_Sine;
 		break;
@@ -264,6 +279,62 @@
 		return 0.0;
 }
 
+double SurfaceAdaptor_Plateau( SurfaceAdaptor* self, Mesh* mesh, 
+                               unsigned* globalSize, unsigned vertex,
+                               unsigned* vertexInds )
+{
+  double x_factor, z_factor;
+  if( mesh->verts[vertex][0] < self->info.plateau.x1
+      || mesh->verts[vertex][0] > self->info.plateau.x4)
+    {
+      x_factor=0;
+    }
+  else if( mesh->verts[vertex][0] <= self->info.plateau.x2)
+    {
+      x_factor=(mesh->verts[vertex][0] - self->info.plateau.x1)
+        *self->info.plateau.height
+        /(self->info.plateau.x2 - self->info.plateau.x1);
+    }
+  else if( mesh->verts[vertex][0] <= self->info.plateau.x3)
+    {
+      x_factor=self->info.plateau.height;
+    }
+  else if( mesh->verts[vertex][0] <= self->info.plateau.x4)
+    {
+      x_factor=(self->info.plateau.x4 - mesh->verts[vertex][0])
+        *self->info.plateau.height
+        /(self->info.plateau.x4 - self->info.plateau.x3);
+    }
+
+  z_factor=1;
+  if(mesh->topo->nDims==3)
+    {
+      if( mesh->verts[vertex][2] < self->info.plateau.z1
+          || mesh->verts[vertex][2] > self->info.plateau.z4)
+        {
+          z_factor=0;
+        }
+      else if( mesh->verts[vertex][2] <= self->info.plateau.z2)
+        {
+          z_factor=(mesh->verts[vertex][2] - self->info.plateau.z1)
+            *self->info.plateau.height
+            /(self->info.plateau.z2 - self->info.plateau.z1);
+        }
+      else if( mesh->verts[vertex][2] <= self->info.plateau.z3)
+        {
+          z_factor=self->info.plateau.height;
+        }
+      else if( mesh->verts[vertex][2] <= self->info.plateau.z4)
+        {
+          z_factor=(self->info.plateau.z4 - mesh->verts[vertex][2])
+            *self->info.plateau.height
+            /(self->info.plateau.z4 - self->info.plateau.z3);
+        }
+    }
+
+  return x_factor*z_factor;
+}
+
 double SurfaceAdaptor_Sine( SurfaceAdaptor* self, Mesh* mesh, 
 			    unsigned* globalSize, unsigned vertex, unsigned* vertexInds )
 {

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.h	2007-09-24 17:45:32 UTC (rev 8009)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/SurfaceAdaptor.h	2007-09-24 17:45:36 UTC (rev 8010)
@@ -49,6 +49,7 @@
 	/** SurfaceAdaptor class contents */
 	typedef enum {
 		SurfaceAdaptor_SurfaceType_Wedge, 
+		SurfaceAdaptor_SurfaceType_Plateau, 
 		SurfaceAdaptor_SurfaceType_Sine, 
 		SurfaceAdaptor_SurfaceType_Cosine, 
 		SurfaceAdaptor_SurfaceType_Invalid
@@ -60,6 +61,10 @@
 	} SurfaceAdaptor_WedgeInfo;
 
 	typedef struct {
+          double	x1, x2, x3, x4, z1, z2, z3, z4, height;
+	} SurfaceAdaptor_PlateauInfo;
+
+	typedef struct {
 		double	origin[2];
 		double	amp;
 		double	freq;
@@ -67,6 +72,7 @@
 
 	typedef union {
 		SurfaceAdaptor_WedgeInfo	wedge;
+		SurfaceAdaptor_PlateauInfo	plateau;
 		SurfaceAdaptor_TrigInfo		trig;
 	} SurfaceAdaptor_SurfaceInfo;
 
@@ -120,6 +126,8 @@
 
 	double SurfaceAdaptor_Wedge( SurfaceAdaptor* self, Mesh* mesh, 
 				     unsigned* globalSize, unsigned vertex, unsigned* vertexInds );
+	double SurfaceAdaptor_Plateau( SurfaceAdaptor* self, Mesh* mesh, 
+				     unsigned* globalSize, unsigned vertex, unsigned* vertexInds );
 	double SurfaceAdaptor_Sine( SurfaceAdaptor* self, Mesh* mesh, 
 				    unsigned* globalSize, unsigned vertex, unsigned* vertexInds );
 	double SurfaceAdaptor_Cosine( SurfaceAdaptor* self, Mesh* mesh, 



More information about the cig-commits mailing list