[cig-commits] r7185 - in long/3D/Gale/trunk: . src/Underworld/plugins/Output/VTKOutput

walter at geodynamics.org walter at geodynamics.org
Wed Jun 13 01:45:13 PDT 2007


Author: walter
Date: 2007-06-13 01:45:13 -0700 (Wed, 13 Jun 2007)
New Revision: 7185

Modified:
   long/3D/Gale/trunk/
   long/3D/Gale/trunk/src/Underworld/plugins/Output/VTKOutput/VTKOutput.c
Log:
 r1814 at earth:  boo | 2007-06-07 13:35:55 -0700
 Make VTKOutput output density and thermal expansivity



Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
   - 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1812
   + 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1814

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-13 00:45:24 UTC (rev 7184)
+++ long/3D/Gale/trunk/src/Underworld/plugins/Output/VTKOutput/VTKOutput.c	2007-06-13 08:45:13 UTC (rev 7185)
@@ -55,7 +55,7 @@
 	UnderworldContext* context;
 
 	context = (UnderworldContext*)Stg_ComponentFactory_ConstructByName( cf, "context", UnderworldContext, True, data );
-	
+
 	ContextEP_Append( context, AbstractContext_EP_Dump,
                           VTKOutput );
 }
@@ -78,7 +78,8 @@
 	return PluginsManager_Submit( pluginsManager, Underworld_VTKOutput_Type, "0", _Underworld_VTKOutput_DefaultNew );
 }
 
-void VTKOutput_particles(IntegrationPointsSwarm*  picswarm, int stepping,
+void VTKOutput_particles(IntegrationPointsSwarm*  picswarm, 
+                         int stepping,
                          char *outputPath, int timeStep, int dim, int myRank);
 void VTKOutput_fields(void *context, int myRank);
 
@@ -109,8 +110,9 @@
         VTKOutput_fields(context,myRank);
 }
 
-void VTKOutput_particles(IntegrationPointsSwarm*  picswarm, int stepping,
-                         char *outputPath, int timeStep, int dim, int myRank) {
+void VTKOutput_particles(IntegrationPointsSwarm*  picswarm,
+                         int stepping, char *outputPath,
+                         int timeStep, int dim, int myRank) {
         double *coord;
         int iteration;
 	Particle_Index          num_particles = picswarm->particleLocalCount;
@@ -139,19 +141,25 @@
 
         /* We need three iterations, because the values are written
            separately from the coordinates. */
-        for(iteration=0; iteration<4; ++iteration)
+        for(iteration=0; iteration<6; ++iteration)
           {
             /* Loop over all of the particles */
             for ( lParticle_I = 0 ; lParticle_I < num_particles ;
                   ++lParticle_I ){
-              double yielding, viscosity;
+              double yielding, viscosity, density, alpha;
               SymmetricTensor stress;
-              
+              BuoyancyForceTerm_MaterialExt*   materialExt;
+              Material *extension_info;
+
               IntegrationPoint* integrationparticle = (IntegrationPoint*)Swarm_ParticleAt( picswarm, lParticle_I );
               
               material = (RheologyMaterial*) IntegrationPointsSwarm_GetMaterialOn( picswarm, integrationparticle );
               materialparticle = OneToOneMapper_GetMaterialPoint( picswarm->mapper, integrationparticle, &materialSwarm );
-              
+
+              density=Dictionary_GetDouble_WithDefault( material->dictionary,
+                                                        "density", 0.0 );
+              alpha=Dictionary_GetDouble_WithDefault( material->dictionary,
+                                                      "alpha", 0.0 );
               rheology_register=(Rheology_Register*)material->rheology_Register;
               
               rheologyCount = Rheology_Register_GetCount( rheology_register ); 
@@ -212,24 +220,36 @@
                           }
                       }
                   }
-                  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)
+                    {
+                    case 1:
+                      fprintf(fp,"%lf ",viscosity);
+                      break;
+                    case 2:
+                      fprintf(fp,"%lf ",yielding);
+                      break;
+                    case 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]);
+                        }
+                      break;
+                    case 4:
+                      fprintf(fp,"%lf ",density);
+                      break;
+                    case 5:
+                      fprintf(fp,"%lf ",alpha);
+                      break;
+                    }
                 }
             }
             switch(iteration)
@@ -245,6 +265,12 @@
                 fprintf(fp,"\nTENSORS Stress float\n");
                 break;
               case 3:
+                fprintf(fp,"\nSCALARS Density float 1\nLOOKUP_TABLE default\n");
+                break;
+              case 4:
+                fprintf(fp,"\nSCALARS Alpha float 1\nLOOKUP_TABLE default\n");
+                break;
+              case 5:
                 fprintf(fp,"\n");
               }
           }



More information about the cig-commits mailing list