[cig-commits] commit: Cleaned-up 'unused variables' which causes compile warnings.

Mercurial hg at geodynamics.org
Mon Feb 1 15:31:40 PST 2010


changeset:   368:b40c29c94c09
branch:      pcu_rejig
user:        JericoRevote
date:        Fri Dec 18 16:51:48 2009 +1100
files:       MaterialPoints/src/BackgroundParticleLayout.c MaterialPoints/src/GaussCoincidentMapper.c MaterialPoints/src/GaussMapper.c MaterialPoints/src/IntegrationPointMapper.c MaterialPoints/src/MappedParticleLayout.c MaterialPoints/src/MaterialPointsSwarm.c MaterialPoints/src/SwarmVariableField.c MaterialPoints/tests/AdvectionSuite.c MaterialPoints/tests/MaterialFeVariableSuite.c Utils/src/BuoyancyForceTerm.c Utils/src/DiffusionSMT.c Utils/src/PCDVC.c Utils/tests/PCDVCSuite.c Weights/src/ConstantWeights.c
description:
Cleaned-up 'unused variables' which causes compile warnings.


diff -r 4447d0177429 -r b40c29c94c09 MaterialPoints/src/BackgroundParticleLayout.c
--- a/MaterialPoints/src/BackgroundParticleLayout.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/MaterialPoints/src/BackgroundParticleLayout.c	Fri Dec 18 16:51:48 2009 +1100
@@ -59,9 +59,9 @@ BackgroundParticleLayout* BackgroundPart
    self->isConstructed = True;
    return self;
 }
-BackgroundParticleLayout* _BackgroundParticleLayout_New(  BACKGROUNDPARTICLELAYOUT_DEFARGS  )
-{
-    BackgroundParticleLayout*		self;
+
+BackgroundParticleLayout* _BackgroundParticleLayout_New(  BACKGROUNDPARTICLELAYOUT_DEFARGS  ) {
+    BackgroundParticleLayout* self;
 	
     /* Allocate memory */
     assert( _sizeOfSelf >= sizeof(BackgroundParticleLayout) );
@@ -71,10 +71,10 @@ BackgroundParticleLayout* _BackgroundPar
 }
 
 
-void _BackgroundParticleLayout_Init(
-    void*                  particleLayout )
-{
-    BackgroundParticleLayout* self = (BackgroundParticleLayout*)particleLayout;
+void _BackgroundParticleLayout_Init( void* particleLayout ) {
+	BackgroundParticleLayout* self;
+
+	self = (BackgroundParticleLayout*)particleLayout;
 }
 
 void _BackgroundParticleLayout_Delete( void* particleLayout ) {
@@ -92,7 +92,6 @@ void _BackgroundParticleLayout_Print( vo
     _ParticleLayout_Print( self, stream );
 	
 }
-
 
 void* _BackgroundParticleLayout_Copy( void* particleLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
     BackgroundParticleLayout*		self = (BackgroundParticleLayout*)particleLayout;
diff -r 4447d0177429 -r b40c29c94c09 MaterialPoints/src/GaussCoincidentMapper.c
--- a/MaterialPoints/src/GaussCoincidentMapper.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/MaterialPoints/src/GaussCoincidentMapper.c	Fri Dec 18 16:51:48 2009 +1100
@@ -166,9 +166,11 @@ void _GaussCoincidentMapper_Map( void* m
 	IntegrationPoint*			integrationPoint;
 	MaterialPoint*				materialPoint;
 	MaterialPointRef*			ref;
+	Particle_Index				particle_lI;
+#if 0
 	FeMesh*						mesh = materialSwarm->mesh;
-	Particle_Index				particle_lI;
 	Cell_Index					cell_dI;
+#endif
 
 #ifdef CAUTIOUS
     Index						dim_I;
diff -r 4447d0177429 -r b40c29c94c09 MaterialPoints/src/GaussMapper.c
--- a/MaterialPoints/src/GaussMapper.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/MaterialPoints/src/GaussMapper.c	Fri Dec 18 16:51:48 2009 +1100
@@ -77,7 +77,9 @@ void* _GaussMapper_DefaultNew( Name name
 }
 
 void _GaussMapper_Init( void* mapper ) {
-	GaussMapper* self = (GaussMapper*)mapper;
+	GaussMapper* self;
+
+	self = (GaussMapper*)mapper;
 }
 
 void _GaussMapper_Delete( void* mapper ) {
diff -r 4447d0177429 -r b40c29c94c09 MaterialPoints/src/IntegrationPointMapper.c
--- a/MaterialPoints/src/IntegrationPointMapper.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/MaterialPoints/src/IntegrationPointMapper.c	Fri Dec 18 16:51:48 2009 +1100
@@ -129,21 +129,24 @@ void _IntegrationPointMapper_AssignFromX
 }
 
 void _IntegrationPointMapper_Build( void* mapper, void* data ) {
-	IntegrationPointMapper*	self = (IntegrationPointMapper*)mapper;
-	//Stg_Component_Build( self->integrationSwarm, data, False );
+	IntegrationPointMapper*	self;
+
+	self = (IntegrationPointMapper*)mapper;
 }
 
 void _IntegrationPointMapper_Initialise( void* mapper, void* data ) {
-	IntegrationPointMapper*	self = (IntegrationPointMapper*)mapper;
-	//Stg_Component_Initialise( self->integrationSwarm, data, False );
+	IntegrationPointMapper*	self;
+
+	self = (IntegrationPointMapper*)mapper;
 }
 
 void _IntegrationPointMapper_Execute( void* mapper, void* data ) {
 }
 
 void _IntegrationPointMapper_Destroy( void* mapper, void* data ) {
-	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
-	//Stg_Component_Destroy( self->integrationSwarm, data, False );
+	IntegrationPointMapper* self;
+	
+	self = (IntegrationPointMapper*)mapper;
 }
 
 void IntegrationPointMapper_Map( void* mapper ) {
diff -r 4447d0177429 -r b40c29c94c09 MaterialPoints/src/MappedParticleLayout.c
--- a/MaterialPoints/src/MappedParticleLayout.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/MaterialPoints/src/MappedParticleLayout.c	Fri Dec 18 16:51:48 2009 +1100
@@ -71,10 +71,10 @@ MappedParticleLayout* _MappedParticleLay
 }
 
 
-void _MappedParticleLayout_Init(
-    void*                  particleLayout )
-{
-    MappedParticleLayout* self = (MappedParticleLayout*)particleLayout;
+void _MappedParticleLayout_Init( void* particleLayout ) {
+	MappedParticleLayout* self;
+
+	self = (MappedParticleLayout*)particleLayout;
 }
 
 void _MappedParticleLayout_Delete( void* particleLayout ) {
diff -r 4447d0177429 -r b40c29c94c09 MaterialPoints/src/MaterialPointsSwarm.c
--- a/MaterialPoints/src/MaterialPointsSwarm.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/MaterialPoints/src/MaterialPointsSwarm.c	Fri Dec 18 16:51:48 2009 +1100
@@ -105,8 +105,8 @@ MaterialPointsSwarm* MaterialPointsSwarm
          particleLayout,
          dim,
          particleSize,
-         DEFAULT_CELL_PARTICLE_TBL_DELTA,
-         DEFAULT_EXTRA_PARTICLES_FACTOR,
+         cellParticleTblDelta,
+         extraParticlesFactor,
          extensionMgr_Register,
          swarmVariable_Register,
          comm, 
diff -r 4447d0177429 -r b40c29c94c09 MaterialPoints/src/SwarmVariableField.c
--- a/MaterialPoints/src/SwarmVariableField.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/MaterialPoints/src/SwarmVariableField.c	Fri Dec 18 16:51:48 2009 +1100
@@ -216,25 +216,22 @@ void _SwarmVariableField_Destroy( void* 
 	_ParticleFeVariable_Destroy( swarmVariableField, data );
 }
 
-void _SwarmVariableField_ValueAtParticle( void* swarmVariableField, 
-					  IntegrationPointsSwarm* swarm, 
-					  Element_LocalIndex lElement_I, 
-					  IntegrationPoint* particle,
-					  double* value ) 
+void _SwarmVariableField_ValueAtParticle(
+	void*							swarmVariableField, 
+	IntegrationPointsSwarm*	swarm, 
+	Element_LocalIndex		lElement_I, 
+	IntegrationPoint*			particle,
+	double*						value ) 
 {
-	SwarmVariableField*	self            = (SwarmVariableField*)swarmVariableField;
-	GlobalParticle*		matParticle;
-	double			distance;
-	Cell_Index		cell_I;
+	SwarmVariableField*	self = (SwarmVariableField*)swarmVariableField;
+	double					distance;
+	Cell_Index				cell_I;
 	Particle_InCellIndex	cParticle_I;
-	Particle_Index		lParticle_I;
+	Particle_Index			lParticle_I;
 
 	cell_I = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
-	cParticle_I = Swarm_FindClosestParticleInCell( swarm,
-		       				       cell_I,
-						       Mesh_GetDimSize( self->dofLayout->mesh ),
-						       particle->xi,
-						       &distance );
+	cParticle_I = Swarm_FindClosestParticleInCell( swarm, cell_I, Mesh_GetDimSize( self->dofLayout->mesh ), particle->xi, &distance );
+
 	// this function doesn't seem to be doing its joob properly!
 	//lParticle_I = IntegrationPointMapper_GetMaterialIndexAt( swarm->mapper, swarm->cellParticleTbl[cell_I][cParticle_I] );
 	
diff -r 4447d0177429 -r b40c29c94c09 MaterialPoints/tests/AdvectionSuite.c
--- a/MaterialPoints/tests/AdvectionSuite.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/MaterialPoints/tests/AdvectionSuite.c	Fri Dec 18 16:51:48 2009 +1100
@@ -77,7 +77,6 @@ void check( PICelleratorContext* context
 	Coord             analyticCoord;
 	double            time                 = context->currentTime + context->dt;
 	Dictionary*       dictionary           = context->dictionary;
-	Stream*           stream               = Journal_Register( Info_Type, CURR_MODULE_NAME );
 	double		  depthErrorTolerance  = Dictionary_GetDouble( dictionary, "depthErrorTolerance" );
 	double		  radiusErrorTolerance = Dictionary_GetDouble( dictionary, "radiusErrorTolerance" );
 	double		  thetaErrorTolerance  = Dictionary_GetDouble( dictionary, "thetaErrorTolerance" );
diff -r 4447d0177429 -r b40c29c94c09 MaterialPoints/tests/MaterialFeVariableSuite.c
--- a/MaterialPoints/tests/MaterialFeVariableSuite.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/MaterialPoints/tests/MaterialFeVariableSuite.c	Fri Dec 18 16:51:48 2009 +1100
@@ -46,8 +46,7 @@ typedef struct {
 } MaterialFeVariableSuiteData;
 
 void MaterialFeVariableSuite_Setup( MaterialFeVariableSuiteData* data ) {
-   char              	 	xmlInputFilename[PCU_PATH_MAX];
-	PICelleratorContext*		context;
+   char xmlInputFilename[PCU_PATH_MAX];
 
    pcu_filename_input( "testMaterialFeVariable.xml", xmlInputFilename );
    data->cf = stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD, NULL );
@@ -72,8 +71,6 @@ void MaterialFeVariableSuite_TestVolume(
    double              volumePIC;
    double              volumeFEM;
    Coord               centroid;
-
-   char   testStr[] = "This test compares the volume of a swarm as calculated based on the material points swarm and as calculate from a MaterialFeVariable\n";
 
    materialFeVariable = (MaterialFeVariable*) LiveComponentRegister_Get( data->context->CF->LCRegister, "materialFeVariable" );
    gaussSwarm = (Swarm*) LiveComponentRegister_Get( data->context->CF->LCRegister, "gaussSwarm" );
diff -r 4447d0177429 -r b40c29c94c09 Utils/src/BuoyancyForceTerm.c
--- a/Utils/src/BuoyancyForceTerm.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/Utils/src/BuoyancyForceTerm.c	Fri Dec 18 16:51:48 2009 +1100
@@ -219,7 +219,6 @@ void _BuoyancyForceTerm_Build( void* for
 	MaterialPointsSwarm**            materialSwarms;
 	Index                            materialSwarm_I;
 	Name                             name;
-	AbstractContext*                 context;
 	Stg_ComponentFactory*            cf;
 
 	cf = self->context->CF;
@@ -317,7 +316,6 @@ void _BuoyancyForceTerm_AssembleElement(
 void _BuoyancyForceTerm_AssembleElement( void* forceTerm, ForceVector* forceVector, Element_LocalIndex lElement_I, double* elForceVec ) {
 	BuoyancyForceTerm*               self               = (BuoyancyForceTerm*) forceTerm;
 	IntegrationPoint*                particle;
-	BuoyancyForceTerm_MaterialExt*   materialExt;
 	Particle_InCellIndex             cParticle_I;
 	Particle_InCellIndex             cellParticleCount;
 	Element_NodeIndex                elementNodeCount;
@@ -334,7 +332,10 @@ void _BuoyancyForceTerm_AssembleElement(
 	double                           Ni[27];
 	double                           force;
 	double*                          xi;
+#if 0
+	BuoyancyForceTerm_MaterialExt*   materialExt;
 	Material*                        material;
+#endif
 	FeVariable*                      temperatureField   = self->temperatureField;
 	double                           temperature        = 0.0;
 	double*				 gHat;
diff -r 4447d0177429 -r b40c29c94c09 Utils/src/DiffusionSMT.c
--- a/Utils/src/DiffusionSMT.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/Utils/src/DiffusionSMT.c	Fri Dec 18 16:51:48 2009 +1100
@@ -87,7 +87,9 @@ DiffusionSMT* _DiffusionSMT_New(  DIFFUS
 }
 
 void _DiffusionSMT_Init( void* matrixTerm ) {
-    DiffusionSMT* self = (DiffusionSMT*)matrixTerm;
+	DiffusionSMT* self;
+
+	self = (DiffusionSMT*)matrixTerm;
 }
 
 void _DiffusionSMT_Delete( void* matrixTerm ) {
diff -r 4447d0177429 -r b40c29c94c09 Utils/src/PCDVC.c
--- a/Utils/src/PCDVC.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/Utils/src/PCDVC.c	Fri Dec 18 16:51:48 2009 +1100
@@ -121,20 +121,28 @@ const Type PCDVC_Type = "PCDVC";
 ** Constructors
 */
 
-PCDVC* PCDVC_New( Name name, Dimension_Index dim, int* res,
-                  MaterialPointsSwarm* mps, double upT, double lowT,
-                  int maxDeletions, int maxSplits, Bool splitInInterfaceCells,
-                  Bool deleteInInterfaceCells, Bool Inflow, double CentPosRatio,
-                  int ParticlesPerCell, double Threshold )
+PCDVC* PCDVC_New(
+	Name						name,
+	Dimension_Index		dim,
+	int*						res,
+ 	MaterialPointsSwarm*	mps,
+	double					upT,
+	double					lowT,
+	int						maxDeletions,
+	int						maxSplits,
+	Bool						splitInInterfaceCells,
+ 	Bool						deleteInInterfaceCells,
+	Bool						Inflow,
+	double					CentPosRatio,
+	int						ParticlesPerCell,
+	double					Threshold )
 {
     PCDVC *self = _PCDVC_DefaultNew( name );
 
     self->isConstructed = True;
     _WeightsCalculator_Init( self, dim );
     _DVCWeights_Init( self, res );
-    _PCDVC_Init( self, mps, upT, lowT, maxDeletions, maxSplits,
-                 splitInInterfaceCells, deleteInInterfaceCells,
-                 Inflow, CentPosRatio, ParticlesPerCell, Threshold );
+    _PCDVC_Init( self, mps, upT, lowT, maxDeletions, maxSplits, splitInInterfaceCells, deleteInInterfaceCells, Inflow, CentPosRatio, ParticlesPerCell, Threshold );
 }
 
 PCDVC* _PCDVC_New(  PCDVC_DEFARGS  ) {
@@ -855,9 +863,12 @@ void _PCDVC_Calculate3D( void* pcdvc, vo
     }
     if(Inflow && (  ((1.0*nump_orig)/ParticlesPerCell < Thresh) || flag  ) ){
         int oneOda = (int)(1.0/da + 0.5);
+        int *VCsize=(int *)malloc(sizeof(int)*nump);
+#if 0
         double dist;
-        int numberofnewpoints, *VCsize=(int *)malloc(sizeof(int)*nump);
+        int numberofnewpoints;
         int newpindex;
+#endif
         int j;
         int delNum;
         VCsize=(int *)malloc(sizeof(int)*nump_orig);
@@ -969,8 +980,6 @@ void _PCDVC_Calculate3D( void* pcdvc, vo
     }// if Inflow && ...
     if(Inflow){
         int oneOda = (int)(1.0/da + 0.5);
-        int sumc = 0;
-        int j;
         //recreate the lists.
         particleVoronoiCellList = (int **)malloc(nump * sizeof(int *));// [i][j] is jth cell owned by particle i
         //VCsize = (int*)realloc(VCsize,nump_orig);
@@ -1198,7 +1207,7 @@ void _PCDVC_Calculate2D( void* pcdvc, vo
     double Thresh = self->Threshold;
     int ParticlesPerCell = self->ParticlesPerCell;
     double CentPosRatio = self->CentPosRatio;
-    time_t tm;
+    //time_t tm;
 	
 
 //	SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
@@ -1286,12 +1295,13 @@ void _PCDVC_Calculate2D( void* pcdvc, vo
     }
     if(Inflow && (  ((1.0*nump_orig)/ParticlesPerCell < Thresh) || flag  ) ){
         int oneOda = (int)(1.0/da + 0.5);
-        double dist;
-        int numberofnewpoints;
-        int newpindex;
-        int j,countSum;
-        double wSum;
-        int *temparray;
+        /*double dist; */
+        /*int numberofnewpoints;*/
+        /*int newpindex;*/
+        int j;
+		  /*int countSum;*/
+        /*double wSum;*/
+        /*int *temparray;*/
         int delNum;
         VCsize=(int *)malloc(sizeof(int)*nump_orig);
         count=(int *)malloc(sizeof(int)*nump_orig);
@@ -1375,8 +1385,8 @@ void _PCDVC_Calculate2D( void* pcdvc, vo
     }// if Inflow && ...
     if(Inflow){
         int oneOda = (int)(1.0/da + 0.5);
-        int sumc = 0;
-        int j;
+        //int sumc = 0;
+        //int j;
         //recreate the lists.
         particleVoronoiCellList = (int **)malloc(nump * sizeof(int *));// [i][j] is jth cell owned by particle i
         //VCsize = (int*)realloc(VCsize,nump_orig);
@@ -1571,9 +1581,9 @@ void _PCDVC_Calculate( void* pcdvc, void
 void _PCDVC_Calculate( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I ){
     Swarm* swarm = (Swarm*) _swarm;
     Dimension_Index dim = swarm->dim;
-    Stream*  stream = Journal_Register( Info_Type, swarm->type );
+    /* Stream*  stream = Journal_Register( Info_Type, swarm->type ); */
     PCDVC*             self            = (PCDVC*)  pcdvc;
-    MaterialPointsSwarm* matSwarm =	(MaterialPointsSwarm*) self->materialPointsSwarm;
+    /* MaterialPointsSwarm* matSwarm =	(MaterialPointsSwarm*) self->materialPointsSwarm; */
     /* it might be nice to report the total deletions and splits as well as the final population here */
     /* One could set the parameters to be too aggressive and cause "swarm thrashing" where many particles
        are being created and destroyed while maintaining some population that it has converged on */
diff -r 4447d0177429 -r b40c29c94c09 Utils/tests/PCDVCSuite.c
--- a/Utils/tests/PCDVCSuite.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/Utils/tests/PCDVCSuite.c	Fri Dec 18 16:51:48 2009 +1100
@@ -105,10 +105,8 @@ void compareAgainstReferenceSolution(PIC
 void compareAgainstReferenceSolution(PICelleratorContext* context, Stream* stream, double mean, double standardDeviation, char* expFile) {
 	double 	meanTolerance, stdDevTolerance;
 	double 	expectedMean, expectedStdDev;
-	double 	differenceMean, differenceStdDev;
-	char	expectedFile[PCU_PATH_MAX];
-	int	rank;
-	FILE*	expectedfp;
+	char		expectedFile[PCU_PATH_MAX];
+	FILE*		expectedfp;
 
 	pcu_filename_expected( expFile, expectedFile );
 	expectedfp = fopen( expectedFile, "r" );
diff -r 4447d0177429 -r b40c29c94c09 Weights/src/ConstantWeights.c
--- a/Weights/src/ConstantWeights.c	Fri Dec 18 11:54:43 2009 +1100
+++ b/Weights/src/ConstantWeights.c	Fri Dec 18 16:51:48 2009 +1100
@@ -88,7 +88,9 @@ ConstantWeights* _ConstantWeights_New(  
 }
 
 void _ConstantWeights_Init( void* constantWeights  ) {
-    ConstantWeights* self = (ConstantWeights*)constantWeights;
+	ConstantWeights* self;
+		
+	self = (ConstantWeights*)constantWeights;
 }
 
 



More information about the CIG-COMMITS mailing list