[cig-commits] r5159 - in long/3D/Gale/trunk/src/Underworld: .
plugins/Output/AverageTemperature
walter at geodynamics.org
walter at geodynamics.org
Tue Oct 31 13:33:20 PST 2006
Author: walter
Date: 2006-10-31 13:33:19 -0800 (Tue, 31 Oct 2006)
New Revision: 5159
Modified:
long/3D/Gale/trunk/src/Underworld/
long/3D/Gale/trunk/src/Underworld/plugins/Output/AverageTemperature/AverageTemperature.c
Log:
r697 at earth: boo | 2006-10-31 13:32:08 -0800
r687 at earth (orig r364): JulianGiordani | 2006-10-25 00:30:45 -0700
Changing the definition of Average Temperature. What we really mean is the average temperature of the nodes above a certain critical temperature. Cath and I have set that default temperature to 1e-4 for now.
Property changes on: long/3D/Gale/trunk/src/Underworld
___________________________________________________________________
Name: svk:merge
- 9570c393-cf10-0410-b476-9a651db1e55a:/cig:696
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:363
+ 9570c393-cf10-0410-b476-9a651db1e55a:/cig:697
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:364
Modified: long/3D/Gale/trunk/src/Underworld/plugins/Output/AverageTemperature/AverageTemperature.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/Output/AverageTemperature/AverageTemperature.c 2006-10-31 21:33:16 UTC (rev 5158)
+++ long/3D/Gale/trunk/src/Underworld/plugins/Output/AverageTemperature/AverageTemperature.c 2006-10-31 21:33:19 UTC (rev 5159)
@@ -82,13 +82,20 @@
FeVariable* temperatureFe = context->temperatureField;
FiniteElement_Mesh* mesh = temperatureFe->feMesh;
Node_LocalIndex lNode_I;
+ double nodeTemperature;
double processorAvg = 0;
double simulationAvg = 0;
+ int nodeWithinCylinder = 0;
for( lNode_I = 0 ; lNode_I < mesh->nodeLocalCount ; lNode_I++ ) {
- processorAvg += FeVariable_GetScalarAtNode( temperatureFe, lNode_I );;
+ nodeTemperature = FeVariable_GetScalarAtNode( temperatureFe, lNode_I );
+ processorAvg += nodeTemperature;
+ if( nodeTemperature > 1e-4 ) {
+ nodeWithinCylinder++;
+ }
}
- processorAvg = processorAvg / (mesh->nodeLocalCount) ;
+ //printf("!!!!!!!!!!!!!!! Number Nodes in Cylinder = %d out of %d and fraction is %f \n", nodeWithinCylinder, mesh->nodeLocalCount, (double)nodeWithinCylinder/(double)mesh->nodeLocalCount );
+ processorAvg = processorAvg / nodeWithinCylinder; // * (double)mesh->nodeLocalCount / ( 2 * (double)nodeWithinCylinder );
MPI_Reduce( &processorAvg, &simulationAvg, 1, MPI_DOUBLE, MPI_SUM, 0, context->communicator );
simulationAvg = simulationAvg / context->nproc;
More information about the cig-commits
mailing list