[cig-commits] commit: Make advection happen before a solve, except on the first step
Mercurial
hg at geodynamics.org
Tue Oct 4 02:00:05 PDT 2011
changeset: 625:2995217ae203
tag: tip
user: Walter Landry <wlandry at caltech.edu>
date: Tue Oct 04 01:58:30 2011 -0700
files: Swarm/tests/Bouncer/Bouncer.cxx Swarm/tests/SingleAttractor/SingleAttractor.cxx Swarm/tests/SingleAttractorSuite.cxx Swarm/tests/VaryingCornerAttractors/VaryingCornerAttractors.cxx
description:
Make advection happen before a solve, except on the first step
diff -r 4550141f61d4 -r 2995217ae203 Swarm/tests/Bouncer/Bouncer.cxx
--- a/Swarm/tests/Bouncer/Bouncer.cxx Fri Sep 30 14:58:52 2011 -0700
+++ b/Swarm/tests/Bouncer/Bouncer.cxx Tue Oct 04 01:58:30 2011 -0700
@@ -38,7 +38,7 @@ void StGermain_Bouncer_UpdatePositions(
blockGeom = (BlockGeometry*) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"geometry" );
- if ( context->timeStep == 1 ) {
+ if ( context->timeStep == 0 ) {
/* for each particle, set a random velocity */
for ( lParticle_I=0; lParticle_I < swarm->particleLocalCount; lParticle_I++ ) {
currParticle = (Particle*)Swarm_ParticleAt( swarm, lParticle_I );
diff -r 4550141f61d4 -r 2995217ae203 Swarm/tests/SingleAttractor/SingleAttractor.cxx
--- a/Swarm/tests/SingleAttractor/SingleAttractor.cxx Fri Sep 30 14:58:52 2011 -0700
+++ b/Swarm/tests/SingleAttractor/SingleAttractor.cxx Tue Oct 04 01:58:30 2011 -0700
@@ -48,7 +48,7 @@ void StGermain_SingleAttractor_UpdatePos
Journal_Printf( stream, "Calculated attractor point is at (%f,%f,%f):\n", attractorPoint[0], attractorPoint[1], attractorPoint[2] );
/* Now decide if we are attracting or repelling */
- if ( ( ( (context->timeStep - 1) / explosionPeriod ) % 2 ) == 0 ) {
+ if ( ( ( context->timeStep / explosionPeriod ) % 2 ) == 0 ) {
Journal_Printf( stream, "Timestep %d - Implosive mode\n", context->timeStep );
movementSign = 1;
}
diff -r 4550141f61d4 -r 2995217ae203 Swarm/tests/SingleAttractorSuite.cxx
--- a/Swarm/tests/SingleAttractorSuite.cxx Fri Sep 30 14:58:52 2011 -0700
+++ b/Swarm/tests/SingleAttractorSuite.cxx Tue Oct 04 01:58:30 2011 -0700
@@ -188,7 +188,7 @@ void SingleAttractorSuite_SingleAttracto
Journal_Printf( stream, "Calculated attractor point is at (%f,%f,%f):\n", attractorPoint[0], attractorPoint[1], attractorPoint[2] );
/* Now decide if we are attracting or repelling */
- if ( ( ( (context->timeStep - 1) / explosionPeriod ) % 2 ) == 0 ) {
+ if ( ( ( context->timeStep / explosionPeriod ) % 2 ) == 0 ) {
Journal_Printf( stream, "Timestep %d - Implosive mode\n", context->timeStep );
movementSign = 1;
}
diff -r 4550141f61d4 -r 2995217ae203 Swarm/tests/VaryingCornerAttractors/VaryingCornerAttractors.cxx
--- a/Swarm/tests/VaryingCornerAttractors/VaryingCornerAttractors.cxx Fri Sep 30 14:58:52 2011 -0700
+++ b/Swarm/tests/VaryingCornerAttractors/VaryingCornerAttractors.cxx Tue Oct 04 01:58:30 2011 -0700
@@ -79,7 +79,7 @@ void StGermain_VaryingCornerAttractors_U
cornerCoords[7][K_AXIS] = blockGeometry->max[K_AXIS];
/* calculate which corner */
- modValue = (context->timeStep - 1) % (numCorners * cornerPeriod );
+ modValue = context->timeStep % (numCorners * cornerPeriod );
cornerIndex = modValue / cornerPeriod;
memcpy( attractorPoint, cornerCoords[cornerIndex], 3 * sizeof(double) );
Journal_Printf( stream, "Calculated attractor point is at (%f,%f,%f):\n", attractorPoint[0], attractorPoint[1], attractorPoint[2] );
@@ -87,7 +87,7 @@ void StGermain_VaryingCornerAttractors_U
/* Can't really explode in this test as particles go out of box */
#if 0
/* Now decide if we are attracting or repelling */
- if ( ( ( (context->timeStep - 1) / explosionPeriod ) % 2 ) == 0 ) {
+ if ( ( ( context->timeStep / explosionPeriod ) % 2 ) == 0 ) {
Journal_Printf( stream, "Timestep %d - Implosive mode\n", context->timeStep );
movementSign = 1;
}
More information about the CIG-COMMITS
mailing list