[cig-commits] commit: Fix compiler warnings
Mercurial
hg at geodynamics.org
Sun Oct 16 06:00:19 PDT 2011
changeset: 887:a3a5956268a8
user: Walter Landry <wlandry at caltech.edu>
date: Sun Oct 16 05:56:21 2011 -0700
files: Rheology/src/ConstitutiveMatrixCartesian.cxx Rheology/src/Director.cxx Rheology/src/DruckerPrager.cxx Rheology/src/FaultingMoresiMuhlhaus2006.cxx Rheology/src/MohrCoulomb.cxx Rheology/src/Orthotropic.cxx Rheology/src/OrthotropicAligned.cxx Rheology/src/Pouliquen_etal.cxx Rheology/src/RheologyMaterial.cxx Rheology/src/VonMises.cxx Rheology/tests/ByerleeYieldingSuite.cxx Rheology/tests/ConstitutiveMatrixSuite.cxx Rheology/tests/DirectorSuite.cxx Rheology/tests/VonMisesYieldingSuite.cxx Utils/src/BaseRecoveryFeVar.cxx Utils/src/DivergenceForce.cxx Utils/src/MixedStabiliserTerm.cxx Utils/src/REP_Algorithm.cxx Utils/src/RecoveredFeVariable.cxx Utils/src/SPR_StrainRate.cxx Utils/src/SmoothVelGradField.cxx Utils/src/StressField.cxx Utils/src/TracerOutput.cxx plugins/Output/BoundaryLayers/BoundaryLayers.cxx plugins/Output/BuoyancyIntegrals/BuoyancyIntegrals.cxx
description:
Fix compiler warnings
diff -r 90a83768712b -r a3a5956268a8 Rheology/src/ConstitutiveMatrixCartesian.cxx
--- a/Rheology/src/ConstitutiveMatrixCartesian.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/src/ConstitutiveMatrixCartesian.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -60,7 +60,6 @@
#include <assert.h>
#include <string.h>
#include <time.h>
-#include <limits>
/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
const Type ConstitutiveMatrixCartesian_Type = "ConstitutiveMatrixCartesian";
@@ -304,12 +303,12 @@ void _ConstitutiveMatrixCartesian_Assemb
OneToManyRef *ref;
double **matrixData;
- uint ii, jj, kk;
+ uint jj, kk;
matrixData = Memory_Alloc_2DArray( double, self->columnSize, self->rowSize, (Name)self->name );
memset(matrixData[0], 0, self->columnSize*self->rowSize*sizeof(double));
ref = OneToManyMapper_GetMaterialRef(((IntegrationPointsSwarm*)swarm)->mapper, particle);
- for(ii = 0; ii < ref->numParticles; ii++) {
+ for(int ii = 0; ii < ref->numParticles; ii++) {
/* Assemble this material point. */
ConstitutiveMatrix_AssembleMaterialPoint(
constitutiveMatrix, lElement_I,
@@ -326,30 +325,13 @@ void _ConstitutiveMatrixCartesian_Assemb
Memory_Free(matrixData);
}
else if(nearestNeighbor) {
- /* This does a search over all of the particles in the swarm in
- the element to find the one that is closest to the gauss
- point. There may be more efficient ways of doing this, but
- this works for now. */
IntegrationPointsSwarm* NNswarm=
((NearestNeighborMapper*)((IntegrationPointsSwarm*)self->integrationSwarm)->mapper)->swarm;
int NNcell_I = CellLayout_MapElementIdToCellId( NNswarm->cellLayout, lElement_I );
- int NNcellParticleCount = NNswarm->cellParticleCountTbl[ NNcell_I ];
-
- Journal_Firewall( NNcellParticleCount != 0, Journal_Register( Error_Type, (Name)ConstitutiveMatrix_Type ),
- "In func %s: NNcellParticleCount is 0.\n", __func__ );
-
- double min_dist(std::numeric_limits<double>::max());
- int nearest_particle(-1);
-
- for ( int NNcParticle_I = 0 ; NNcParticle_I < NNcellParticleCount ; NNcParticle_I++ ) {
- IntegrationPoint* NNparticle = (IntegrationPoint*)Swarm_ParticleInCellAt( NNswarm, NNcell_I, NNcParticle_I );
- double dist=StGermain_DistanceBetweenPoints(particle->xi,NNparticle->xi,dim);
- if(dist<min_dist)
- {
- nearest_particle=NNcParticle_I;
- min_dist=dist;
- }
- }
+ int nearest_particle=
+ NearestNeighbor_FindNeighbor(((IntegrationPointsSwarm*)self->integrationSwarm)->mapper,
+ lElement_I,NNcell_I,particle->xi,dim);
+
IntegrationPoint* NNparticle = (IntegrationPoint*)Swarm_ParticleInCellAt( NNswarm, NNcell_I, nearest_particle );
ConstitutiveMatrix_Assemble(constitutiveMatrix, lElement_I,
NNswarm->cellParticleTbl[NNcell_I][nearest_particle], NNparticle,
@@ -739,9 +721,7 @@ void ConstitutiveMatrixCartesian_SetupPa
IntegrationPointsSwarm* swarm = (IntegrationPointsSwarm*)self->integrationSwarm;
MaterialPointsSwarm **materialSwarms, *materialSwarm;
- MaterialPoint particle;
int materialSwarmCount;
- double *cMatrix = NULL;
if( beenHere ) return;
@@ -756,10 +736,10 @@ void ConstitutiveMatrixCartesian_SetupPa
/* add extension to material swarm */
self->storedConstHandle = ExtensionManager_Add( materialSwarm->particleExtensionMgr, (Name)self->type, self->rowSize * self->columnSize * sizeof(double) );
- cMatrix = (double*)ExtensionManager_Get( materialSwarm->particleExtensionMgr, &particle, self->storedConstHandle );
#if 0
/*This isn't needed so I've disabled it, 2Dec09, JG*/
+ double *cMatrix = (double*)ExtensionManager_Get( materialSwarm->particleExtensionMgr, &particle, self->storedConstHandle );
if( self->dim == 2 ) {
/* TODO: clean up this vector logic. The only reson there's an if is because
* * of the list of names the must be given as the final arguments to this function. */
diff -r 90a83768712b -r a3a5956268a8 Rheology/src/Director.cxx
--- a/Rheology/src/Director.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/src/Director.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -343,7 +343,6 @@ void _Director_Initialise( void* directo
and check first is material is defined as random.*/
Material_Index materialsCount = Materials_Register_GetCount( self->materialPointsSwarm->materials_Register);
XYZ* materialDirectionVectors;
- int material_I;
Material* material;
Bool* randomInitialDirections;
int* randomInitialDirectionSeeds;
@@ -356,7 +355,7 @@ void _Director_Initialise( void* directo
"randomInitialDirections");
/* Loop over materials and get material properties from dictionary */
- for ( material_I = 0 ; material_I < materialsCount ; material_I++ ) {
+ for (uint material_I = 0 ; material_I < materialsCount ; material_I++ ) {
material = Materials_Register_GetByIndex(
self->materialPointsSwarm->materials_Register,
material_I );
@@ -386,7 +385,7 @@ void _Director_Initialise( void* directo
/* If material is random, set the local srand,
locate all random particles, and set their director */
- for (material_I = 0; material_I < materialsCount; material_I++) {
+ for (uint material_I = 0; material_I < materialsCount; material_I++) {
if (randomInitialDirections[material_I] == True) {
Particle_Index gParticle_I;
unsigned approxGlobalParticleCount = particleLocalCount * self->materialPointsSwarm->nProc;
@@ -429,7 +428,7 @@ void _Director_Initialise( void* directo
/* For each non-random particle, set the initial direction */
for ( lParticle_I = 0 ; lParticle_I < particleLocalCount ; lParticle_I++ ) {
/* Initialise the norm of each director */
- material_I = MaterialPointsSwarm_GetMaterialIndexAt(
+ uint material_I = MaterialPointsSwarm_GetMaterialIndexAt(
self->materialPointsSwarm,
lParticle_I );
if (randomInitialDirections[material_I] == False) {
@@ -474,7 +473,6 @@ Bool _Director_TimeDerivative( void* dir
MaterialPointsSwarm* materialPointsSwarm = self->materialPointsSwarm;
TensorArray velGrad;
double* normal;
- Element_LocalIndex lElement_I;
MaterialPoint* materialPoint = (MaterialPoint*) Swarm_ParticleAt( materialPointsSwarm, lParticle_I );
Director_ParticleExt* particleExt;
InterpolationResult result;
@@ -491,8 +489,6 @@ Bool _Director_TimeDerivative( void* dir
normal = particleExt->director;
- lElement_I = materialPoint->owningCell;
-
result = FieldVariable_InterpolateValueAt( self->velGradField, materialPoint->coord, velGrad );
/* if in debug mode, perform some tests */
#ifdef DEBUG
diff -r 90a83768712b -r a3a5956268a8 Rheology/src/DruckerPrager.cxx
--- a/Rheology/src/DruckerPrager.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/src/DruckerPrager.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -352,18 +352,11 @@ double _DruckerPrager_GetYieldCriterion(
{
DruckerPrager* self = (DruckerPrager*) druckerPrager;
Dimension_Index dim = constitutiveMatrix->dim;
- double cohesion;
- double cohesionAfterSoftening;
- double frictionCoefficient;
- double frictionCoefficientAfterSoftening;
double minimumYieldStress;
- double minimumViscosity;
- double maxStrainRate;
double effectiveCohesion;
double effectiveFrictionCoefficient;
double frictionalStrength;
double pressure;
- DruckerPrager_Particle* particleExt;
Cell_Index cell_I;
Coord coord;
Element_GlobalIndex element_gI = 0;
@@ -373,16 +366,8 @@ double _DruckerPrager_GetYieldCriterion(
double factor;
/* Get Parameters From Rheology */
- cohesion = self->cohesion;
- cohesionAfterSoftening = self->cohesionAfterSoftening;
- frictionCoefficient = self->frictionCoefficient;
- frictionCoefficientAfterSoftening = self->frictionCoefficientAfterSoftening;
minimumYieldStress = self->minimumYieldStress;
- minimumViscosity = self->minimumViscosity;
- maxStrainRate = self->maxStrainRate;
- particleExt = (DruckerPrager_Particle*)ExtensionManager_Get( materialPointsSwarm->particleExtensionMgr, materialPoint, self->particleExtHandle );
-
if( self->pressureField )
FeVariable_InterpolateWithinElement( self->pressureField, lElement_I, xi, &pressure );
else {
@@ -582,7 +567,6 @@ void _DruckerPrager_UpdateDrawParameters
double oneOverGlobalMaxStrainIncrement;
double postFailureWeakeningIncrement;
- int ierr; /* mpi error code */
/* Note : this function defines some drawing parameters (brightness, opacity, diameter) as
* functions of the strain weakening - this needs to be improved since most of the parameters
@@ -620,9 +604,9 @@ void _DruckerPrager_UpdateDrawParameters
}
}
- ierr = MPI_Allreduce( &localMaxStrainIncrement, &globalMaxStrainIncrement, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );
- ierr = MPI_Allreduce( &localMeanStrainIncrement, &globalMeanStrainIncrement, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
- ierr = MPI_Allreduce( &localFailed, &globalFailed, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
+ MPI_Allreduce( &localMaxStrainIncrement, &globalMaxStrainIncrement, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );
+ MPI_Allreduce( &localMeanStrainIncrement, &globalMeanStrainIncrement, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
+ MPI_Allreduce( &localFailed, &globalFailed, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
if(globalFailed == 0)
return;
diff -r 90a83768712b -r a3a5956268a8 Rheology/src/FaultingMoresiMuhlhaus2006.cxx
--- a/Rheology/src/FaultingMoresiMuhlhaus2006.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/src/FaultingMoresiMuhlhaus2006.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -948,7 +948,6 @@ void _FaultingMoresiMuhlhaus2006_UpdateD
double averagedGlobalMaxStrainIncrement = 0.0;
double oneOverGlobalMaxSlipRate;
- double oneOverGlobalMaxStrainIncrement;
double postFailureWeakeningIncrement;
@@ -1036,7 +1035,6 @@ void _FaultingMoresiMuhlhaus2006_UpdateD
/* Let's simply assume that twice the mean is a good place to truncate these values */
oneOverGlobalMaxSlipRate = 1.0 / averagedGlobalMaxSlipRate;
- oneOverGlobalMaxStrainIncrement = 1.0 / averagedGlobalMaxStrainIncrement;
for ( lParticle_I = 0 ; lParticle_I < particleLocalCount ; lParticle_I++ ) {
materialPoint = (GlobalParticle*) Swarm_ParticleAt( strainWeakening->swarm, lParticle_I );
@@ -1138,7 +1136,7 @@ void _FaultingMoresiMuhlhaus2006_UpdateD
opacity = (slipRate/globalMaxSlipRate);
if (opacity > 0.90)
- opacity = 1.0;/* this condition is to make sure we have enough planes that will be clearly seen. */ /*
+ opacity = 1.0; // this condition is to make sure we have enough planes that will be clearly seen.
Variable_SetValueFloat( self->brightness->variable, lParticle_I, brightness );
Variable_SetValueFloat( self->opacity->variable, lParticle_I, opacity );
diff -r 90a83768712b -r a3a5956268a8 Rheology/src/MohrCoulomb.cxx
--- a/Rheology/src/MohrCoulomb.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/src/MohrCoulomb.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -383,7 +383,6 @@ void _MohrCoulomb_StoreCurrentParameters
Dimension_Index dim = constitutiveMatrix->dim;
Eigenvector evectors[3];
double trace;
- int i;
FeVariable_InterpolateWithinElement( self->pressureField, lElement_I, xi, &self->currentPressure );
if( !self->swarmStrainRate ) {
@@ -398,7 +397,7 @@ void _MohrCoulomb_StoreCurrentParameters
/* Subtract the trace (which should be zero anyway). We can
use TensorMapST3D even for 2D, because it is the same for
the xx and yy components */
- for(i=0;i<dim;++i)
+ for(uint i=0;i<dim;++i)
self->currentStrainRate[TensorMapST3D[i][i]]-=trace/dim;
ConstitutiveMatrix_CalculateStress( constitutiveMatrix, self->currentStrainRate, self->currentStress );
diff -r 90a83768712b -r a3a5956268a8 Rheology/src/Orthotropic.cxx
--- a/Rheology/src/Orthotropic.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/src/Orthotropic.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -169,7 +169,6 @@ void _Orthotropic_ModifyConstitutiveMatr
Orthotropic* self = (Orthotropic*) rheology;
Dimension_Index dim = swarm->dim;
- int i,j;
double** C = constitutiveMatrix->matrixData;
double n1,n2,n3;
double m1,m2,m3;
@@ -187,8 +186,8 @@ void _Orthotropic_ModifyConstitutiveMatr
n1 = self->n[0];
n2 = self->n[1];
- for(i=0;i<dim*(dim+1)/2;i++){
- for(j=0;j<dim*(dim+1)/2;j++){
+ for(uint i=0;i<dim*(dim+1)/2;i++){
+ for(uint j=0;j<dim*(dim+1)/2;j++){
C[i][j] = 0.0;
}
}
diff -r 90a83768712b -r a3a5956268a8 Rheology/src/OrthotropicAligned.cxx
--- a/Rheology/src/OrthotropicAligned.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/src/OrthotropicAligned.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -143,7 +143,6 @@ void _OrthotropicAligned_ModifyConstitut
/* double isotropicViscosity = ConstitutiveMatrix_GetIsotropicViscosity( constitutiveMatrix ); */
/* double deltaViscosity; */
/* XYZ normal; */
- int i,j;
double** D = constitutiveMatrix->matrixData;
/* static int flag = 0; */
/* deltaViscosity = isotropicViscosity * (1.0 - self->viscosityRatio); */
@@ -151,11 +150,11 @@ void _OrthotropicAligned_ModifyConstitut
/* ConstitutiveMatrix_SetSecondViscosity( constitutiveMatrix, deltaViscosity, normal ); */
- /* if(!flag){/* if not visited modify matrix else no need to update *\/ */
+ /* if(!flag){ // if not visited modify matrix else no need to update */
/* Snark dies if I only allow this to be called once.. */
/* ahh need to allow it to be called once for every particle */
- for(i=0;i<dim*(dim+1)/2;i++){
- for(j=0;j<dim*(dim+1)/2;j++){
+ for(uint i=0;i<dim*(dim+1)/2;i++){
+ for(uint j=0;j<dim*(dim+1)/2;j++){
D[i][j] = 0.0;
}
}
diff -r 90a83768712b -r a3a5956268a8 Rheology/src/Pouliquen_etal.cxx
--- a/Rheology/src/Pouliquen_etal.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/src/Pouliquen_etal.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -426,14 +426,14 @@ void _Pouliquen_etal_HasYielded(
double oneOnI;
Pouliquen_etal_Particle* particleExt;
double mu;
- double strainWeakeningRatio;
+ // double strainWeakeningRatio;
/*double mu_2_afterSoftening = self->mu_2_afterSoftening;
double mu_s_afterSoftening = self->mu_s_afterSoftening;*/
double effective_mu_s;
double effective_mu_2;
double pressure;
- strainWeakeningRatio = StrainWeakening_CalcRatio( self->strainWeakening, materialPoint );
+ // strainWeakeningRatio = StrainWeakening_CalcRatio( self->strainWeakening, materialPoint );
particleExt = (Pouliquen_etal_Particle*)ExtensionManager_Get( materialPointsSwarm->particleExtensionMgr, materialPoint, self->particleExtHandle );
diff -r 90a83768712b -r a3a5956268a8 Rheology/src/RheologyMaterial.cxx
--- a/Rheology/src/RheologyMaterial.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/src/RheologyMaterial.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -175,7 +175,7 @@ void _RheologyMaterial_Init(
Rheology_Register_Add( self->rheology_Register, rheologyList[ rheology_I ] );
}
- /* self->debug = Journal_Register( Debug_Type, (Name)self->type ); /* TODO make child of Underworld_Debug */
+ /* self->debug = Journal_Register( Debug_Type, (Name)self->type ); // TODO make child of Underworld_Debug */
}
diff -r 90a83768712b -r a3a5956268a8 Rheology/src/VonMises.cxx
--- a/Rheology/src/VonMises.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/src/VonMises.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -230,7 +230,6 @@ double _VonMises_GetYieldIndicator(
{
VonMises* self = (VonMises*) rheology;
SymmetricTensor strainRate;
- int i;
double stressTrace, strainRateTrace;
/* Get Strain Rate */
@@ -252,7 +251,7 @@ double _VonMises_GetYieldIndicator(
SymmetricTensor_GetTrace(strainRate, constitutiveMatrix->dim,
&strainRateTrace);
- for(i=0;i<constitutiveMatrix->dim;++i)
+ for(uint i=0;i<constitutiveMatrix->dim;++i)
{
strainRate[TensorMapST3D[i][i]]-=
strainRateTrace/constitutiveMatrix->dim;
diff -r 90a83768712b -r a3a5956268a8 Rheology/tests/ByerleeYieldingSuite.cxx
--- a/Rheology/tests/ByerleeYieldingSuite.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/tests/ByerleeYieldingSuite.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -134,7 +134,6 @@ void ByerleeYieldingSuite_Check_Sync( Fi
void ByerleeYieldingSuite_TestByerlee2D( ByerleeYieldingSuiteData* data ) {
UnderworldContext* context;
- Dictionary* dictionary;
YieldRheology* yieldRheology;
Stg_ComponentFactory* cf;
char expected_file[PCU_PATH_MAX];
@@ -147,8 +146,6 @@ void ByerleeYieldingSuite_TestByerlee2D(
Stream_Enable( context->info, False );
Stream_Enable( context->debug, False );
Stream_Enable( context->verbose, False );
- dictionary = context->dictionary;
-
stgMainBuildAndInitialise( cf );
/* get pointer to the mesh */
diff -r 90a83768712b -r a3a5956268a8 Rheology/tests/ConstitutiveMatrixSuite.cxx
--- a/Rheology/tests/ConstitutiveMatrixSuite.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/tests/ConstitutiveMatrixSuite.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -84,7 +84,6 @@ void testConstitutiveMatrix( FiniteEleme
void ConstitutiveMatrixSuite_CartesianMatrix2D( ConstitutiveMatrixSuiteData* data ) {
- Dictionary* dictionary;
UnderworldContext* context;
Stg_ComponentFactory* cf;
char expected_file[PCU_PATH_MAX], output_file[PCU_PATH_MAX];
@@ -99,7 +98,6 @@ void ConstitutiveMatrixSuite_CartesianMa
cf = stgMainInitFromXML( xml_input, MPI_COMM_WORLD, NULL );
context = (UnderworldContext*)LiveComponentRegister_Get( cf->LCRegister, (Name)"context" );
data->context = context;
- dictionary = context->dictionary;
/* replace the Execute EP with the function to test the ConstitutiveMatrix */
ContextEP_ReplaceAll( context, AbstractContext_EP_Execute, testConstitutiveMatrix );
diff -r 90a83768712b -r a3a5956268a8 Rheology/tests/DirectorSuite.cxx
--- a/Rheology/tests/DirectorSuite.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/tests/DirectorSuite.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -56,7 +56,6 @@ void test( UnderworldContext* context )
void test( UnderworldContext* context ) {
Director* director = (Director*)LiveComponentRegister_Get( context->CF->LCRegister, (Name)"director" );
Particle_Index lParticle_I;
- GlobalParticle* particle;
double time = context->currentTime + context->dt;
Swarm* swarm = (Swarm* )LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialSwarm" );
XYZ normal;
@@ -65,16 +64,14 @@ void test( UnderworldContext* context )
double angleDirector;
double gError;
int particleGlobalCount;
- int ierr;
for ( lParticle_I = 0 ; lParticle_I < swarm->particleLocalCount ; lParticle_I++ ) {
- particle = (GlobalParticle* )Swarm_ParticleAt( swarm, lParticle_I );
SwarmVariable_ValueAt( director->directorSwarmVariable, lParticle_I, normal );
angleDirector = atan(-normal[1]/normal[0]);
error += fabs( angleDirector - angle );
}
- ierr = MPI_Allreduce( &error, &gError, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
- ierr = MPI_Allreduce( &swarm->particleLocalCount, &particleGlobalCount, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
+ MPI_Allreduce( &error, &gError, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
+ MPI_Allreduce( &swarm->particleLocalCount, &particleGlobalCount, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
//error /= (double) swarm->particleLocalCount;
//pcu_check_true( error < TOLERANCE );
@@ -86,7 +83,6 @@ void testRandom( UnderworldContext* cont
AlignmentSwarmVariable* alignment = (AlignmentSwarmVariable*) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"alignment" );
Director* director;
Particle_Index lParticle_I;
- GlobalParticle* particle;
Swarm* swarm;
XYZ normal;
int ii;
@@ -102,13 +98,11 @@ void testRandom( UnderworldContext* cont
int circleAngleUpperBound;
double gCircleAngleAverage;
int gCircleAngleCounts[36] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- int ierr;
swarm = alignment->swarm;
director = alignment->director;
for ( lParticle_I = 0 ; lParticle_I < swarm->particleLocalCount ; lParticle_I++ ) {
- particle = (GlobalParticle*)Swarm_ParticleAt( swarm, lParticle_I );
SwarmVariable_ValueAt( director->directorSwarmVariable, lParticle_I, normal );
/* Calculate dot product between normal and (0,1), then get an angle */
@@ -123,10 +117,10 @@ void testRandom( UnderworldContext* cont
}
circleAngleCounts[ (int)(circleAngle+0.5) / 10 ] += 1;
}
- ierr = MPI_Allreduce( circleAngleCounts, gCircleAngleCounts, 36, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
+ MPI_Allreduce( circleAngleCounts, gCircleAngleCounts, 36, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
circleAngleAverage = (double)swarm->particleLocalCount / 36;
- ierr = MPI_Allreduce( &circleAngleAverage, &gCircleAngleAverage, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
+ MPI_Allreduce( &circleAngleAverage, &gCircleAngleAverage, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
/*NB. This definition is determined based on a set no. of particlesPerCell. Currently this value is = 20 */
#define TheoreticalStandardDeviation 13.64
@@ -161,12 +155,10 @@ void testRandom( UnderworldContext* cont
void testPerMaterial( UnderworldContext* context ) {
AlignmentSwarmVariable* alignment = (AlignmentSwarmVariable*) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"alignment" );
- Materials_Register* materials_Register = context->materials_Register;
Director* director;
Particle_Index lParticle_I;
Swarm* swarm;
XYZ testVector;
- Material_Index materialsCount;
int material_I;
XYZ* matDirectionVectors;
double angle;
@@ -174,7 +166,6 @@ void testPerMaterial( UnderworldContext*
swarm = alignment->swarm;
director = alignment->director;
- materialsCount = Materials_Register_GetCount( materials_Register );
/* construct test for testDirectorPerMaterial.xml */
/* assume a direction for each material and check that */
@@ -209,12 +200,10 @@ void testPerMaterial( UnderworldContext*
void testPerMaterial2( UnderworldContext* context ) {
AlignmentSwarmVariable* alignment = (AlignmentSwarmVariable*) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"alignment" );
- Materials_Register* materials_Register = context->materials_Register;
Director* director;
Particle_Index lParticle_I;
Swarm* swarm;
XYZ testVector;
- Material_Index materialsCount;
int material_I;
XYZ* matDirectionVectors;
double angle;
@@ -222,7 +211,6 @@ void testPerMaterial2( UnderworldContext
swarm = alignment->swarm;
director = alignment->director;
- materialsCount = Materials_Register_GetCount( materials_Register );
matDirectionVectors = Memory_Alloc_Array(XYZ, DIR_TEST_NUM_MAT, "materialDirectionVectors");
diff -r 90a83768712b -r a3a5956268a8 Rheology/tests/VonMisesYieldingSuite.cxx
--- a/Rheology/tests/VonMisesYieldingSuite.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Rheology/tests/VonMisesYieldingSuite.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -129,7 +129,6 @@ void Underworld_testVonMisesYielding_Che
void VonMisesYieldingSuite_VonMises2D( VonMisesYieldingSuiteData* data ) {
UnderworldContext* context;
- Dictionary* dictionary;
YieldRheology* yieldRheology;
Stg_ComponentFactory* cf;
char expected_file[PCU_PATH_MAX];
@@ -139,7 +138,6 @@ void VonMisesYieldingSuite_VonMises2D( V
pcu_filename_input( "testVonMisesYieldCriterion.xml", xml_input );
cf = stgMainInitFromXML( xml_input, MPI_COMM_WORLD, NULL );
context = (UnderworldContext*)LiveComponentRegister_Get( cf->LCRegister, (Name)"context" );
- dictionary = context->dictionary;
stgMainBuildAndInitialise( cf );
diff -r 90a83768712b -r a3a5956268a8 Utils/src/BaseRecoveryFeVar.cxx
--- a/Utils/src/BaseRecoveryFeVar.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Utils/src/BaseRecoveryFeVar.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -141,8 +141,8 @@ void _BaseRecoveryFeVar_Build( void* _se
void _BaseRecoveryFeVar_Build( void* _self, void* data ) {
BaseRecoveryFeVar* self = (BaseRecoveryFeVar*) _self;
Sync* sync;
- int componentsCount = 0;
- int variable_I, node_I;
+ uint componentsCount = 0;
+ uint variable_I;
int *nodeDomainCountPtr = NULL;
char **variableName, *tmpName;
Variable* dataVariable;
@@ -194,7 +194,7 @@ void _BaseRecoveryFeVar_Build( void* _se
variable->arrayPtrPtr = &dataVariable->arrayPtr;
/* Assign variable to each node */
- for( node_I = 0; node_I < *nodeDomainCountPtr; node_I++ ) {
+ for( int node_I = 0; node_I < *nodeDomainCountPtr; node_I++ ) {
DofLayout_AddDof_ByVarName( self->dofLayout, variableName[variable_I], node_I );
}
/* Free Name */
@@ -352,7 +352,6 @@ void _BaseRecoveryFeVar_GetValueInElemen
void _BaseRecoveryFeVar_GetValueInElementWithCoeffInterpolation( void* feVariable, Element_Index lEl_I, double* xi, double* value ) {
BaseRecoveryFeVar* self = (BaseRecoveryFeVar*) feVariable;
FeMesh* mesh = self->feMesh;
- IArray* inc = self->inc;
double globalCoord[3];
double coeff[50];
int order, dof_I, dofThatExist;
@@ -382,7 +381,7 @@ double _BaseRecoveryFeVar_ApplyCoeff( Ba
return value;
}
-void BaseUtils_Add2LmStruct( LmStruct* lmStruct, Index nodeID ) {
+void BaseUtils_Add2LmStruct( LmStruct* lmStruct, int nodeID ) {
int count_I;
for( count_I = 0 ; count_I < lmStruct->numberOfNodes ; count_I++ ) {
/* To prevent duplication in the list*/
@@ -409,22 +408,21 @@ void BaseUtils_PopulateBoundaryNodesInfo
* if so, set onBoundary = true
*
*/
- Node_Index dNodes_I, tmpNodeID, tmpNode_I;
- Element_Index nbrElementID, nbrElement_I;
- int nEls, *els;
- int nNodes, *nodes;
+ Node_Index tmpNodeID, tmpNode_I;
+ Element_Index nbrElementID;
+ int *els;
+ uint nNodes;
LmStruct list;
Sync* sync;
- int domainNodes;
- int nLocalNodes;
+ uint nLocalNodes;
int nVerts;
- const int *verts;
+ const int *verts;
IArray* inc[2];
sync = Mesh_GetSync( mesh, MT_VERTEX );
IGraph_GetBoundaryElements( mesh->topo, MT_VERTEX, &nVerts, &verts );
nLocalNodes = FeMesh_GetNodeLocalSize( mesh );
- domainNodes = FeMesh_GetNodeDomainSize( mesh );
+ int domainNodes = FeMesh_GetNodeDomainSize( mesh );
assert( nVerts <= domainNodes );
@@ -434,14 +432,14 @@ void BaseUtils_PopulateBoundaryNodesInfo
* numOfPatches2use = 0
* patchNodes list = [-1,-1,-1,....,-1]
* */
- for( dNodes_I = 0 ; dNodes_I < domainNodes ; dNodes_I++ ) {
+ for( int dNodes_I = 0 ; dNodes_I < domainNodes ; dNodes_I++ ) {
bninfo[dNodes_I].onMeshBoundary = False;
bninfo[dNodes_I].numOfPatches2use = 0;
memset( bninfo[dNodes_I].patchNodes, -1, sizeof(int)*REP_MAXNODESPERPATCH );
}
/* First flag boundary nodes */
- for( dNodes_I = 0 ; dNodes_I < nVerts ; dNodes_I++ )
+ for( int dNodes_I = 0 ; dNodes_I < nVerts ; dNodes_I++ )
bninfo[verts[dNodes_I]].onMeshBoundary = True;
/* Update all other procs. */
@@ -462,7 +460,7 @@ void BaseUtils_PopulateBoundaryNodesInfo
*/
inc[0] = IArray_New();
inc[1] = IArray_New();
- for( dNodes_I = 0 ; dNodes_I < FeMesh_GetNodeDomainSize( mesh ) ; dNodes_I++ ) {
+ for( uint dNodes_I = 0 ; dNodes_I < FeMesh_GetNodeDomainSize( mesh ) ; dNodes_I++ ) {
if( !bninfo[dNodes_I].onMeshBoundary )
continue;
@@ -470,15 +468,15 @@ void BaseUtils_PopulateBoundaryNodesInfo
/* Go through all neighbour elements */
FeMesh_GetNodeElements( mesh, dNodes_I, inc[0] );
- nEls = IArray_GetSize( inc[0] );
+ int nEls = IArray_GetSize( inc[0] );
els = IArray_GetPtr( inc[0] );
- for( nbrElement_I = 0 ; nbrElement_I < nEls ; nbrElement_I++) {
+ for(int nbrElement_I = 0; nbrElement_I < nEls; nbrElement_I++) {
nbrElementID = els[nbrElement_I];
/* Go through nodes on elements and see if they're valid patchs */
FeMesh_GetElementNodes( mesh, nbrElementID, inc[1] );
nNodes = IArray_GetSize( inc[1] );
- nodes = IArray_GetPtr( inc[1] );
+ int *nodes = IArray_GetPtr( inc[1] );
for( tmpNode_I = 0 ; tmpNode_I < nNodes ; tmpNode_I++ ) {
tmpNodeID = nodes[tmpNode_I];
diff -r 90a83768712b -r a3a5956268a8 Utils/src/DivergenceForce.cxx
--- a/Utils/src/DivergenceForce.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Utils/src/DivergenceForce.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -158,7 +158,6 @@ void* _DivergenceForce_DefaultNew( Name
void _DivergenceForce_AssignFromXML( void* forceTerm, Stg_ComponentFactory* cf, void* data ) {
DivergenceForce* self = (DivergenceForce*)forceTerm;
- Dictionary* dict;
Stg_Shape* domainShape=NULL;
FeMesh* geometryMesh=NULL;
StressBC_Entry force;
@@ -167,7 +166,6 @@ void _DivergenceForce_AssignFromXML( voi
/* Construct Parent */
_ForceTerm_AssignFromXML( self, cf, data );
- dict = Dictionary_Entry_Value_AsDictionary( Dictionary_Get( cf->componentDict, self->name ) );
domainShape = Stg_ComponentFactory_ConstructByKey( cf, self->name, "DomainShape", Stg_Shape, True, data ) ;
type = Stg_ComponentFactory_GetString( cf, self->name, "force_type", "");
@@ -290,6 +288,8 @@ void _DivergenceForce_AssembleElement( v
elementNodes[eNode_I],0,self->context,&force);
break;
}
+
+ // This needs to be properly integrated.
elForceVec[ eNode_I] += force*factor;
}
}
diff -r 90a83768712b -r a3a5956268a8 Utils/src/MixedStabiliserTerm.cxx
--- a/Utils/src/MixedStabiliserTerm.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Utils/src/MixedStabiliserTerm.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -149,7 +149,6 @@ void _MixedStabiliserTerm_AssembleElemen
ElementType* elementType;
IntegrationPointsSwarm* swarm;
IntegrationPoint* integrationPoint;
- double geometric_factor;
double** localElStiffMat;
int ii, jj, kk;
double sumVisc = 0.0, visc;
diff -r 90a83768712b -r a3a5956268a8 Utils/src/REP_Algorithm.cxx
--- a/Utils/src/REP_Algorithm.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Utils/src/REP_Algorithm.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -459,7 +459,7 @@ void _REP_Algorithm_AssembleElement( REP
ElementType* elementType;
IntegrationPoint* particle;
double globalCoord[3], detJac;
- int cell_I, cellParticleCount, nodesPerEl, cParticle_I;
+ int cell_I, cellParticleCount, cParticle_I;
/* Only need one */
int dim = self->repFieldList[0]->dim;
int field_I;
@@ -469,7 +469,6 @@ void _REP_Algorithm_AssembleElement( REP
/* Get the number of nodes per element */
FeMesh_GetElementNodes( mesh, lElement_I, self->incArray );
- nodesPerEl = IArray_GetSize( self->incArray );
/* Get number of particles per element */
cell_I = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
diff -r 90a83768712b -r a3a5956268a8 Utils/src/RecoveredFeVariable.cxx
--- a/Utils/src/RecoveredFeVariable.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Utils/src/RecoveredFeVariable.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -371,16 +371,15 @@ void _RecoveredFeVariable_AssembleAtPart
memcpy( pMatrix[dof_I], pVec, order*sizeof(double) );
if( self->recoverStrain ) {
- Index ii;
if( !constitutiveMatrix ) {
/* if no consitutive matrix make it up - assume viscosity = 1 */
- for( ii = 0 ; ii < dofThatExist; ii++ ) { memset( tmpC[ii], 0, dofThatExist*sizeof(double)); }
+ for(int ii = 0 ; ii < dofThatExist; ii++ ) { memset( tmpC[ii], 0, dofThatExist*sizeof(double)); }
if (dim == 2) { tmpC[0][0] = tmpC[1][1] = tmpC[2][2] = 1; }
else { tmpC[0][0] = tmpC[1][1] = tmpC[2][2] = tmpC[3][3] = tmpC[4][4] = tmpC[5][5] = 1; }
} else {
/* copy constitutive matrix */
- for(ii = 0 ; ii < dofThatExist ; ii++)
+ for(int ii = 0 ; ii < dofThatExist ; ii++)
memcpy( tmpC[ii], constitutiveMatrix->matrixData[ii], dofThatExist*sizeof(double) );
}
if( dim == 2 ){
@@ -521,7 +520,7 @@ void _RecoveredFeVariable_CalcFi3D( Reco
}
void _RecoveredFeVariable_PutElIntoProc( RecoveredFeVariable* self, int lElement_I, double*** elHi_Mat, double** elFi_Mat ) {
- int keyH, keyF, dof_I, row_I, order_I;
+ int keyF, dof_I, row_I, order_I;
int dim, dofThatExist, order, nodesPerEl, rowsInH;
double* ptrH = self->elementRep_H;
double* ptrF = self->elementRep_F;
@@ -533,7 +532,6 @@ void _RecoveredFeVariable_PutElIntoProc(
rowsInH = nodesPerEl * dim;
for( dof_I = 0 ; dof_I < dofThatExist ; dof_I++ ) {
- keyH = (lElement_I*dofThatExist*rowsInH*order) + (dof_I*rowsInH*order);
keyF = (lElement_I*dofThatExist*rowsInH) + (dof_I*rowsInH);
for( row_I = 0 ; row_I < rowsInH ; row_I++ ) {
ptrF[ keyF + row_I ] =+ elFi_Mat[dof_I][row_I];
@@ -576,9 +574,8 @@ void RecoveredFeVariable_CommunicateHF(
}
void RecoveredFeVariable_SetupWorkSpace( RecoveredFeVariable* self ) {
- int dofThatExist, order, nodesPerEl, nodesInPatch, rowsInH;
+ int dofThatExist, order, nodesInPatch, rowsInH;
- nodesPerEl = self->nodesPerEl;
dofThatExist = self->fieldComponentCount;
order = self->orderOfInterpolation;
nodesInPatch = self->nodesInPatch;
@@ -621,9 +618,8 @@ void RecoveredFeVariable_SolvePatch( Rec
double **el_H = self->tmpEl_H;
double *el_F = self->tmpEl_F;
double *ptrH, *ptrF;
- double coeff[50];
+ double coeff[50];
IArray *inc;
- double *coord;
int dim, dofThatExist, order, nodesPerEl, rowsInElH, rowsInPatchH, row, elID;
int dof_I, el_I, node_I, nodeID, indexOfEntry, order_I;
int *nodeList;
@@ -642,8 +638,6 @@ void RecoveredFeVariable_SolvePatch( Rec
/* use the inc on the FeVariable */
inc = self->inc;
-
- coord = Mesh_GetVertex( self->feMesh , pNodeID );
for( dof_I = 0 ; dof_I < dofThatExist ; dof_I++ ) {
ZeroMatrix( self->patch_H[dof_I], rowsInPatchH, order );
diff -r 90a83768712b -r a3a5956268a8 Utils/src/SPR_StrainRate.cxx
--- a/Utils/src/SPR_StrainRate.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Utils/src/SPR_StrainRate.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -227,7 +227,7 @@ void _SPR_StrainRate_AssemblePatch( SPR_
FeMesh* feMesh = (FeMesh*)rawField->feMesh;
Index dofThatExist = rawField->fieldComponentCount;
Index nbrEl_I, nbrElementID, nbrElCount;
- Index count_i, count_j, dof_I;
+ Index dof_I;
double center[3] = {0.0,0.0,0.0};
int orderOfInterpolation = self->orderOfInterpolation;
IArray* inc = self->inc;
@@ -263,13 +263,13 @@ void _SPR_StrainRate_AssemblePatch( SPR_
/* Construct A Matrix (Geometric based) and b Vectors (tensor based) */
for( nbrEl_I = 0 ; nbrEl_I < nbrElCount ; nbrEl_I++ ) {
- for( count_i = 0 ; count_i < orderOfInterpolation ; count_i++ ) {
- for( count_j = 0; count_j < orderOfInterpolation ; count_j++ ) {
+ for(int count_i = 0 ; count_i < orderOfInterpolation ; count_i++ ) {
+ for(int count_j = 0; count_j < orderOfInterpolation ; count_j++ ) {
AMatrix[count_i][count_j] += ( pVec[nbrEl_I][count_i] * pVec[nbrEl_I][count_j] );
}
}
for(dof_I = 0 ; dof_I < dofThatExist ; dof_I++ ) {
- for( count_i = 0 ; count_i < orderOfInterpolation ; count_i++ ) {
+ for(int count_i = 0 ; count_i < orderOfInterpolation ; count_i++ ) {
bVector[dof_I][ count_i ] += (scp_eps[nbrEl_I][dof_I] * pVec[nbrEl_I][count_i]);
}
}
diff -r 90a83768712b -r a3a5956268a8 Utils/src/SmoothVelGradField.cxx
--- a/Utils/src/SmoothVelGradField.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Utils/src/SmoothVelGradField.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -107,12 +107,10 @@ void* _SmoothVelGradField_Copy( const vo
}
void SmoothVelGradField_NonLinearUpdate( void* _sle, void* _ctx ) {
- SystemLinearEquations* sle;
DomainContext* ctx = (DomainContext*)_ctx;
FieldVariable_Register* fieldVar_Register;
SmoothVelGradField* preVar;
- sle = (SystemLinearEquations*)_sle;
fieldVar_Register = ctx->fieldVariable_Register;
preVar = (SmoothVelGradField*)FieldVariable_Register_GetByName( fieldVar_Register, "VelocityGradientsField" );
ParticleFeVariable_Update( preVar );
diff -r 90a83768712b -r a3a5956268a8 Utils/src/StressField.cxx
--- a/Utils/src/StressField.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Utils/src/StressField.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -127,12 +127,10 @@ void* _StressField_DefaultNew( Name name
}
void StressField_NonLinearUpdate( void* _sle, void* _ctx ) {
- SystemLinearEquations* sle;
DomainContext* ctx = (DomainContext*)_ctx;
FieldVariable_Register* fieldVar_Register;
StressField* stressVar;
- sle = (SystemLinearEquations*)_sle;
fieldVar_Register = ctx->fieldVariable_Register;
stressVar = (StressField*)FieldVariable_Register_GetByName( fieldVar_Register, "StressField" );
ParticleFeVariable_Update( stressVar );
diff -r 90a83768712b -r a3a5956268a8 Utils/src/TracerOutput.cxx
--- a/Utils/src/TracerOutput.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/Utils/src/TracerOutput.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -188,23 +188,21 @@ void _TracerOutput_AssignFromXML( void*
}
void _TracerOutput_Build( void* swarmOutput, void* data ) {
- int i;
TracerOutput* self = (TracerOutput*) swarmOutput;
if(self->pressureField)
Stg_Component_Build( self->pressureField, data, False );
- for(i=0;i<self->num_fields;++i)
+ for(uint i=0;i<self->num_fields;++i)
Stg_Component_Build( self->fields[i], data, False );
_SwarmOutput_Build( self, data );
}
void _TracerOutput_Initialise( void* swarmOutput, void* data ) {
- int i;
TracerOutput* self = (TracerOutput*) swarmOutput;
if(self->pressureField)
Stg_Component_Initialise( self->pressureField, data, False );
- for(i=0;i<self->num_fields;++i)
+ for(uint i=0;i<self->num_fields;++i)
Stg_Component_Initialise( self->fields[i], data, False );
_SwarmOutput_Initialise( self, data );
@@ -215,12 +213,11 @@ void _TracerOutput_Execute( void* swarmO
_SwarmOutput_Execute( self, data );
}
void _TracerOutput_Destroy( void* swarmOutput, void* data ) {
- int i;
TracerOutput* self = (TracerOutput*)swarmOutput;
if(self->pressureField)
Stg_Component_Destroy( self->pressureField, data, False );
- for(i=0;i<self->num_fields;++i)
+ for(uint i=0;i<self->num_fields;++i)
Stg_Component_Destroy( self->fields[i], data, False );
_SwarmOutput_Destroy( self, data );
@@ -228,7 +225,6 @@ void _TracerOutput_Destroy( void* swarmO
void _TracerOutput_PrintHeader( void* swarmOutput, Stream* stream,
Particle_Index lParticle_I, void* context ){
- int i;
char name[32];
TracerOutput* self = (TracerOutput*)swarmOutput;
@@ -236,7 +232,7 @@ void _TracerOutput_PrintHeader( void* sw
_SwarmOutput_PrintHeader( self, stream, lParticle_I, context );
SwarmOutput_PrintString( self, stream, "Pressure" );
- for(i=0;i<self->num_fields;++i)
+ for(uint i=0;i<self->num_fields;++i)
{
sprintf(name,"Field%d",i);
SwarmOutput_PrintString( self, stream, name );
@@ -253,7 +249,6 @@ void _TracerOutput_PrintData( void* swar
double* coord = particle->coord;
HydrostaticTerm *hydrostaticTerm;
double pressure, field;
- int i;
hydrostaticTerm =
(HydrostaticTerm*)LiveComponentRegister_Get(fe_context->CF->LCRegister,
@@ -273,7 +268,7 @@ void _TracerOutput_PrintData( void* swar
}
SwarmOutput_PrintValue( self, stream, pressure );
}
- for(i=0;i<self->num_fields;++i)
+ for(uint i=0;i<self->num_fields;++i)
{
FieldVariable_InterpolateValueAt(self->fields[i],coord,&field);
SwarmOutput_PrintValue( self, stream, field );
diff -r 90a83768712b -r a3a5956268a8 plugins/Output/BoundaryLayers/BoundaryLayers.cxx
--- a/plugins/Output/BoundaryLayers/BoundaryLayers.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/plugins/Output/BoundaryLayers/BoundaryLayers.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -183,7 +183,7 @@ double Underworld_BoundaryLayers_Interna
Element_LocalIndex lElement_I;
Node_LocalIndex nodeAtElementBottom;
Node_LocalIndex nodeAtElementTop;
- int elementNodeCount, *elementNodes;
+ int *elementNodes;
double elementBottomHeight;
double elementTopHeight;
double detJac;
@@ -211,7 +211,6 @@ double Underworld_BoundaryLayers_Interna
for ( lElement_I = 0 ; lElement_I < FeMesh_GetElementLocalSize( mesh ) ; lElement_I++ ) {
elementType = FeMesh_GetElementType( mesh, lElement_I );
FeMesh_GetElementNodes( mesh, lElement_I, incArray );
- elementNodeCount = IArray_GetSize( incArray );
elementNodes = IArray_GetPtr( incArray );
nodeAtElementBottom = elementNodes[ 0 ] ;
diff -r 90a83768712b -r a3a5956268a8 plugins/Output/BuoyancyIntegrals/BuoyancyIntegrals.cxx
--- a/plugins/Output/BuoyancyIntegrals/BuoyancyIntegrals.cxx Sat Oct 08 02:06:43 2011 -0700
+++ b/plugins/Output/BuoyancyIntegrals/BuoyancyIntegrals.cxx Sun Oct 16 05:56:21 2011 -0700
@@ -273,7 +273,6 @@ void perform_integrals( UnderworldContex
Cell_Index cell_I;
double velocity[3], global_coord[3];
FeMesh* mesh;
- Element_LocalIndex e;
double i_T, i_v, i_y, i_vT; /* interpolated quantity */
double sum_T, sum_vT, sum_yT; /* integral sum */
@@ -342,7 +341,7 @@ void perform_integrals( UnderworldContex
n_elements = FeMesh_GetElementLocalSize( mesh );
// printf("n_elements = %d \n", n_elements );
- for( e=0; e<n_elements; e++ ) {
+ for(int e=0; e<n_elements; e++ ) {
cell_I = CellLayout_MapElementIdToCellId( gaussSwarm->cellLayout, e );
elementType = FeMesh_GetElementType( mesh, e );
@@ -418,7 +417,6 @@ void eval_temperature( UnderworldContext
{
Underworld_BuoyancyIntegrals_CTX *ctx;
double global_coord[3];
- InterpolationResult result;
double T;
FeVariable* temperatureField;
@@ -439,7 +437,7 @@ void eval_temperature( UnderworldContext
global_coord[1] = y_b;
}
- result = FieldVariable_InterpolateValueAt( temperatureField, global_coord, &T );
+ FieldVariable_InterpolateValueAt( temperatureField, global_coord, &T );
MPI_Allreduce ( &T, temp_b, 1, MPI_DOUBLE, MPI_MAX, context->communicator );
}
More information about the CIG-COMMITS
mailing list