[cig-commits] r5289 - in long/3D/Gale/trunk/src/Underworld: .
plugins/Output/AverageTemperature
walter at geodynamics.org
walter at geodynamics.org
Wed Nov 15 13:07:58 PST 2006
Author: walter
Date: 2006-11-15 13:07:58 -0800 (Wed, 15 Nov 2006)
New Revision: 5289
Modified:
long/3D/Gale/trunk/src/Underworld/
long/3D/Gale/trunk/src/Underworld/plugins/Output/AverageTemperature/AverageTemperature.c
Log:
r722 at earth: boo | 2006-11-15 13:06:46 -0800
r713 at earth (orig r370): JulianGiordani | 2006-11-02 18:08:26 -0800
By Cath and Jules. Further sharping of this plugin. Now it calculates total volume of the buoyancy material. The definition of Buoyancy material is now something that is hotter than 1e-6. This definition could be generalised for the future, i.e. what if the max temperature was not 1 but 42.
Property changes on: long/3D/Gale/trunk/src/Underworld
___________________________________________________________________
Name: svk:merge
- 9570c393-cf10-0410-b476-9a651db1e55a:/cig:721
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:369
+ 9570c393-cf10-0410-b476-9a651db1e55a:/cig:722
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:370
Modified: long/3D/Gale/trunk/src/Underworld/plugins/Output/AverageTemperature/AverageTemperature.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/Output/AverageTemperature/AverageTemperature.c 2006-11-15 21:07:50 UTC (rev 5288)
+++ long/3D/Gale/trunk/src/Underworld/plugins/Output/AverageTemperature/AverageTemperature.c 2006-11-15 21:07:58 UTC (rev 5289)
@@ -90,7 +90,8 @@
double particleTemperature;
double lTempIntegral = 0;
double lAvg = 0;
- double lVolumeIntegral = 0;
+ double simulationBuoyancyVolumeIntegral = 0;
+ double lBuoyancyVolumeIntegral = 0;
double simulationAvg = 0;
double detJac;
@@ -105,23 +106,24 @@
particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
FeVariable_InterpolateWithinElement( temperatureFe, lElement_I, particle->xi, &particleTemperature );
- if( particleTemperature > 0.0 ) {
+ if( particleTemperature > 1e-6 ) {
/* Calculate Determinant of Jacobian */
detJac = ElementType_JacobianDeterminant( elementType, mesh, lElement_I, particle->xi, dim );
-
/* Sum Integral */
- lVolumeIntegral += detJac * particle->weight;
+ lBuoyancyVolumeIntegral += detJac * particle->weight;
lTempIntegral += detJac * particle->weight * particleTemperature;
}
}
}
- lAvg = lTempIntegral / lVolumeIntegral;
+ lAvg = lTempIntegral / lBuoyancyVolumeIntegral;
MPI_Reduce( &lAvg, &simulationAvg, 1, MPI_DOUBLE, MPI_SUM, 0, context->communicator );
+ MPI_Reduce( &lBuoyancyVolumeIntegral, &simulationBuoyancyVolumeIntegral, 1, MPI_DOUBLE, MPI_SUM, 0, context->communicator );
simulationAvg = simulationAvg / context->nproc;
+ simulationBuoyancyVolumeIntegral = simulationBuoyancyVolumeIntegral / context->nproc;
StgFEM_FrequentOutput_PrintValue( context, simulationAvg );
- StgFEM_FrequentOutput_PrintValue( context, lVolumeIntegral );
+ StgFEM_FrequentOutput_PrintValue( context, simulationBuoyancyVolumeIntegral );
}
void Underworld_AverageTemperature_PrintHeaderToFile( void* context ) {
More information about the cig-commits
mailing list