[cig-commits] r7078 - in long/3D/Gale/trunk: .
src/Underworld/plugins/Output/VTKOutput
walter at geodynamics.org
walter at geodynamics.org
Wed Jun 6 09:56:22 PDT 2007
Author: walter
Date: 2007-06-06 09:56:22 -0700 (Wed, 06 Jun 2007)
New Revision: 7078
Modified:
long/3D/Gale/trunk/
long/3D/Gale/trunk/src/Underworld/plugins/Output/VTKOutput/VTKOutput.c
Log:
r1812 at earth: boo | 2007-06-06 09:53:20 -0700
Make VTKOutput output the stress
Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
- 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1810
+ 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1812
Modified: long/3D/Gale/trunk/src/Underworld/plugins/Output/VTKOutput/VTKOutput.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/Output/VTKOutput/VTKOutput.c 2007-06-06 00:47:40 UTC (rev 7077)
+++ long/3D/Gale/trunk/src/Underworld/plugins/Output/VTKOutput/VTKOutput.c 2007-06-06 16:56:22 UTC (rev 7078)
@@ -139,12 +139,13 @@
/* We need three iterations, because the values are written
separately from the coordinates. */
- for(iteration=0; iteration<3; ++iteration)
+ for(iteration=0; iteration<4; ++iteration)
{
/* Loop over all of the particles */
for ( lParticle_I = 0 ; lParticle_I < num_particles ;
++lParticle_I ){
double yielding, viscosity;
+ SymmetricTensor stress;
IntegrationPoint* integrationparticle = (IntegrationPoint*)Swarm_ParticleAt( picswarm, lParticle_I );
@@ -158,6 +159,7 @@
coord = materialparticle->coord;
yielding=0;
viscosity=0;
+ SymmetricTensor_Zero(stress);
/* First print out only the coordinates. */
if(iteration==0)
@@ -192,11 +194,42 @@
ExtensionManager_Get( materialSwarm->particleExtensionMgr, materialparticle, self->particleExtHandle );
viscosity=particleExt->effVisc;
}
+ /* Get stress */
+ else if(!strcmp(rheology->name,"storeStress"))
+ {
+ StoreStress* self = (StoreStress*) rheology;
+ StoreStress_ParticleExt* particleExt;
+ particleExt=
+ ExtensionManager_Get( materialSwarm->particleExtensionMgr, materialparticle, self->particleExtHandle );
+ stress[0]=particleExt->stress[0];
+ stress[1]=particleExt->stress[1];
+ stress[2]=particleExt->stress[2];
+ stress[3]=particleExt->stress[3];
+ if(dim==3)
+ {
+ stress[4]=particleExt->stress[4];
+ stress[5]=particleExt->stress[5];
+ }
+ }
}
if(iteration==1)
fprintf(fp,"%lf ",viscosity);
if(iteration==2)
fprintf(fp,"%lf ",yielding);
+ if(iteration==3)
+ if(dim==2)
+ {
+ fprintf(fp,"%lf %lf 0.0 %lf %lf 0.0 0.0 0.0 0.0 ",
+ stress[0],stress[1],
+ stress[1],stress[2]);
+ }
+ else
+ {
+ fprintf(fp,"%lf %lf %lf %lf %lf %lf %lf %lf %lf ",
+ stress[0],stress[1],stress[2],
+ stress[1],stress[3],stress[4],
+ stress[2],stress[4],stress[5]);
+ }
}
}
switch(iteration)
@@ -209,6 +242,9 @@
fprintf(fp,"\nSCALARS Yielding_fraction float 1\nLOOKUP_TABLE default\n");
break;
case 2:
+ fprintf(fp,"\nTENSORS Stress float\n");
+ break;
+ case 3:
fprintf(fp,"\n");
}
}
More information about the cig-commits
mailing list