[cig-commits] commit: fixing up problem with the lucFeVariableSurface drawing object.
Mercurial
hg at geodynamics.org
Mon Nov 24 11:29:02 PST 2008
changeset: 31:f82ce051800e
user: RobertTurnbull
date: Tue Oct 23 05:30:32 2007 +0000
files: DrawingObjects/src/FeVariableSurface.c DrawingObjects/tests/testFeVariableSurface.xml
description:
fixing up problem with the lucFeVariableSurface drawing object.
The order of the nodes in elements must have changed since this code was tested last.
I've added in an input file to test this code but I can't get it to work with all the toolbox stuff yet so I haven't committed the test script for it
I might need a nice person from VPAC to help me figure out the toolbox stuff to get this working...
diff -r 727a44fd8e08 -r f82ce051800e DrawingObjects/src/FeVariableSurface.c
--- a/DrawingObjects/src/FeVariableSurface.c Fri Oct 12 06:54:18 2007 +0000
+++ b/DrawingObjects/src/FeVariableSurface.c Tue Oct 23 05:30:32 2007 +0000
@@ -39,7 +39,7 @@
*+ Patrick Sunter
*+ Greg Watson
*+
-** $Id: FeVariableSurface.c 740 2007-10-11 08:05:31Z SteveQuenette $
+** $Id: FeVariableSurface.c 742 2007-10-23 05:30:32Z RobertTurnbull $
**
**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@@ -229,10 +229,11 @@ void _lucFeVariableSurface_BuildDisplayL
Element_LocalIndex elementLocalCount = FeMesh_GetElementLocalSize( mesh );
Element_NodeIndex eNode_I;
Element_NodeIndex elementNodeCount, *elementNodes;
+ Element_NodeIndex nodeMapper[] = { 0, 1, 3, 2 };
Node_LocalIndex lNode_I;
double nodeValue;
double height;
- IArray* inc;
+ IArray* inc;
FeVariable_SyncShadowValues( feVariable );
@@ -253,13 +254,16 @@ void _lucFeVariableSurface_BuildDisplayL
inc = IArray_New();
for ( lElement_I = 0 ; lElement_I < elementLocalCount ; lElement_I++ ) {
- FeMesh_GetElementNodes( mesh, lElement_I, inc );
+ FeMesh_GetElementNodes( mesh, lElement_I, inc );
elementNodeCount = IArray_GetSize( inc );
elementNodes = IArray_GetPtr( inc );
glBegin( GL_POLYGON );
for ( eNode_I = 0 ; eNode_I < elementNodeCount ; eNode_I++ ) {
- lNode_I = elementNodes[ eNode_I ];
+ /* Get the index of the node - we use the 'nodeMapper' array so that
+ * we are going around the nodes in an anti-clockwise direction */
+ lNode_I = elementNodes[ nodeMapper[ eNode_I ] ];
+
/* Get Value at node */
nodeValue = FeVariable_GetScalarAtNode( feVariable, lNode_I );
diff -r 727a44fd8e08 -r f82ce051800e DrawingObjects/tests/testFeVariableSurface.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DrawingObjects/tests/testFeVariableSurface.xml Tue Oct 23 05:30:32 2007 +0000
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+ <include>testDrawingObject.xml</include>
+
+ <!-- Add in FeVariable -->
+ <list name="import">
+ <param>StgFEM</param>
+ </list>
+ <include>StgFEM/LinearMesh.xml</include>
+ <include>StgFEM/TemperatureField.xml</include>
+ <list name="plugins">
+ <param>lucPlugin</param>
+ <param>StgFEM_StandardConditionFunctions</param>
+ </list>
+ <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"> LinearWithSinusoidalPerturbation </param>
+ </struct>
+ </list>
+ </struct>
+ </list>
+ </struct>
+
+ <!-- Geometry & Mesh setup -->
+ <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"> 1.0f </param>
+ <param name="maxY"> 1.0f </param>
+ <param name="maxZ"> 1.0f </param>
+ <param name="elementResI"> 10 </param>
+ <param name="elementResJ"> 10 </param>
+ <param name="elementResK"> 10 </param>
+<!--
+-->
+
+
+ <struct name="components" mergeType="merge">
+ <struct name="camera" mergeType="replace">
+ <param name="Type">lucCamera</param>
+ <param name="CentreFieldVariable">DummyFieldVariable</param>
+ <param name="coordZ">2.5</param>
+ </struct>
+ <struct name="colourMap">
+ <param name="Type">lucColourMap</param>
+ <param name="colours">#0B0133 White #B7210B</param>
+ <param name="dynamicRange">true</param>
+ </struct>
+ <!-- Drawing Objects -->
+ <struct name="temperatureSurface">
+ <param name="Type">lucFeVariableSurface</param>
+ <param name="FeVariable">TemperatureField</param>
+ <param name="ColourMap">colourMap</param>
+ <param name="scaleHeight">0.5</param>
+ </struct>
+ <struct name="temperatureSurfaceMesh">
+ <param name="Type">lucFeVariableSurface</param>
+ <param name="FeVariable">TemperatureField</param>
+ <param name="colour">Black</param>
+ <param name="wireframe">true</param>
+ <param name="scaleHeight">0.5</param>
+ </struct>
+ <!-- Put these althogether in a viewport -->
+ <struct name="viewport">
+ <param name="Type">lucViewport</param>
+ <param name="Camera">camera</param>
+ <list name="DrawingObject">
+ <param>temperatureSurface</param>
+ <param>temperatureSurfaceMesh</param>
+ </list>
+ </struct>
+ </struct>
+
+</StGermainData>
More information about the CIG-COMMITS
mailing list