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

walter at geodynamics.org walter at geodynamics.org
Wed Aug 9 02:48:20 PDT 2006


Author: walter
Date: 2006-08-09 02:48:19 -0700 (Wed, 09 Aug 2006)
New Revision: 4250

Added:
   long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/
   long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/DumpSwarm.c
   long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/DumpSwarm.h
   long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/SConscript
Modified:
   long/3D/Gale/trunk/
   long/3D/Gale/trunk/simple-extension.xml
   long/3D/Gale/trunk/src/Underworld/plugins/Output/SConscript
   long/3D/Gale/trunk/src/Underworld/src/main.c
Log:
 r579 at earth:  boo | 2006-08-09 02:46:38 -0700
 Added a DumpSwarm plugin to print out where material has yielded



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

Modified: long/3D/Gale/trunk/simple-extension.xml
===================================================================
--- long/3D/Gale/trunk/simple-extension.xml	2006-08-09 07:19:43 UTC (rev 4249)
+++ long/3D/Gale/trunk/simple-extension.xml	2006-08-09 09:48:19 UTC (rev 4250)
@@ -483,6 +483,7 @@
   <list name="plugins">
     <param>StG_FEM_StandardConditionFunctions</param>
     <param>Underworld_EulerDeform</param>
+    <param>Underworld_DumpSwarm</param>
   </list>
   <param name="journal-level.info.Stg_ComponentFactory">1</param>
   <param name="journal.debug">True</param>
@@ -492,7 +493,7 @@
   <param name="outputEvery">1</param>
   <param name="dumpEvery">1</param>
   <param name="outputPath">./output.sandbox</param>
-  <param name="dim">3</param>
+  <param name="dim">2</param>
   <param name="shadowDepth">1</param>
   <param name="minX">0.0f</param>
   <param name="minY">0.0f</param>
@@ -500,8 +501,8 @@
   <param name="maxX">2.0f</param>
   <param name="maxY">0.35f</param>
   <param name="maxZ">1.0f</param>
-  <param name="elementResI">16</param>
-  <param name="elementResJ">9</param>
+  <param name="elementResI">32</param>
+  <param name="elementResJ">16</param>
   <param name="elementResK">4</param>
   <param name="allowUnbalancing">True</param>
   <param name="buildNodeNeighbourTbl">True</param>

Added: long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/DumpSwarm.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/DumpSwarm.c	2006-08-09 07:19:43 UTC (rev 4249)
+++ long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/DumpSwarm.c	2006-08-09 09:48:19 UTC (rev 4250)
@@ -0,0 +1,163 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
+**
+** Contributors:
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: /cig/src/StgFEM/plugins/Output/PrintFeVariableDiscreteValues/Plugin.c 21 2006-04-07T21:29:57.251207Z walter  $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StG_FEM/StG_FEM.h>
+#include <PICellerator/PICellerator.h>
+#include <Underworld/Underworld.h>
+#include "DumpSwarm.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+const Type Underworld_DumpSwarm_Type = "Underworld_DumpSwarm";
+
+void _Underworld_DumpSwarm_Construct( void* component, Stg_ComponentFactory* cf ) {
+	FiniteElementContext* context;
+
+	context = (FiniteElementContext*)Stg_ComponentFactory_ConstructByName( cf, "context", FiniteElementContext, True );
+	
+	ContextEP_Append( context, AbstractContext_EP_Dump,
+                          DumpSwarm );
+}
+
+void* _Underworld_DumpSwarm_DefaultNew( Name name ) {
+	return Codelet_New(
+			Underworld_DumpSwarm_Type,
+			_Underworld_DumpSwarm_DefaultNew,
+			_Underworld_DumpSwarm_Construct,
+			_Codelet_Build,
+			_Codelet_Initialise,
+			_Codelet_Execute,
+			_Codelet_Destroy,
+			name );
+}
+
+Index Underworld_DumpSwarm_Register( PluginsManager* pluginsManager ) {
+	Journal_DPrintf( StG_FEM_Debug, "In: %s( void* )\n", __func__ );
+	
+	return PluginsManager_Submit( pluginsManager, Underworld_DumpSwarm_Type, "0", _Underworld_DumpSwarm_DefaultNew );
+}
+
+
+void DumpSwarm( void* _context ) {
+	UnderworldContext*	context = (UnderworldContext*)_context;
+	FeVariable*		currFeVar;
+	Name			currFeVarName;
+	Dictionary_Entry_Value*	feVarList=NULL;
+	Dictionary_Entry_Value*	currFvParam=NULL;
+	Index			feVar_I=0;
+	Index			numFeVarsToPrint=0;
+
+        Swarm*                  swarm=context->gaussSwarm;
+        IntegrationPointsSwarm*  picswarm=context->picIntegrationPoints;
+
+	Particle_Index          particleLocalCount = picswarm->particleLocalCount;
+	Particle_Index          lParticle_I;
+
+	RheologyMaterial*       material;
+	MaterialPointsSwarm*    materialSwarm;
+	MaterialPoint*          materialparticle;
+
+        Rheology_Register*      rheology_register;
+
+        /* Only dump if at the right time step. */
+        if(context->timeStep % context->dumpEvery != 0)
+          return;
+	
+        Name filename;
+        Stream*           stream              = Journal_Register( MPIStream_Type, Swarm_Type );
+        Stg_asprintf( &filename, "%s/%s.%05d.txt", context->outputPath,
+                      picswarm->name, context->timeStep );
+        Stream_RedirectFile( stream, filename );
+        
+        /* Loop over all of the particles */
+      	for ( lParticle_I = 0 ; lParticle_I < particleLocalCount ;
+              ++lParticle_I ){
+
+          IntegrationPoint* integrationparticle = (IntegrationPoint*)Swarm_ParticleAt( picswarm, lParticle_I );
+
+          material = (RheologyMaterial*) IntegrationPointsSwarm_GetMaterialOn( picswarm, integrationparticle );
+          materialparticle = OneToOneMapper_GetMaterialPoint( picswarm->mapper, integrationparticle, &materialSwarm );
+
+          rheology_register=(Rheology_Register*)material->rheology_Register;
+
+          Rheology_Index      rheology_I; 
+          Rheology_Index      rheologyCount = Rheology_Register_GetCount( rheology_register ); 
+          MohrCoulomb*           rheology; 
+	
+          /* Loop over all of the rheologies for a particle. */
+
+          for( rheology_I = 0; rheology_I < rheologyCount ; rheology_I++ ) { 
+            rheology = (MohrCoulomb*)Rheology_Register_GetByIndex( rheology_register, rheology_I ); 
+
+            /* We are only interested in whether a particle has
+               yielded, so we only look at yielding rheologies */
+            if(!strcmp(rheology->name,"yielding"))
+              {
+                Journal_Printf(stream,"%d ",rheology_I);
+            
+                double *coord = materialparticle->coord;
+                
+                if (context->dim == 2) {
+                  Journal_Printf(stream,"%lf %lf ",(double)coord[0],(double)coord[1]);
+                } else {
+                  Journal_Printf(stream,"%lf %lf %lf ",(double)coord[0],(double)coord[1],
+                                 (double)coord[2]);
+                }
+                if ( (rheology)->hasYieldedParticleExtHandle == (ExtensionInfo_Index) -1 )
+                  {
+                    Journal_Printf(stream,"No particle yield extension\n");
+                  }
+                else
+                  {
+                    Journal_Printf(stream,"%d\n",(*(Particle_Bool*)ExtensionManager_Get( (materialSwarm)->particleExtensionMgr,
+                                                                                           (materialparticle),
+                                                                                           (rheology)->hasYieldedParticleExtHandle )));
+                  }
+              }
+          }
+        }
+
+        Stream_CloseFile( stream );
+        Memory_Free( filename );
+}

Added: long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/DumpSwarm.h
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/DumpSwarm.h	2006-08-09 07:19:43 UTC (rev 4249)
+++ long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/DumpSwarm.h	2006-08-09 09:48:19 UTC (rev 4250)
@@ -0,0 +1,63 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
+**
+** Contributors:
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+** Role:
+**	This plugin simply prints out the discrete values of a list of feVariables that the user requests.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Underworld_DumpSwarm_h__
+#define __Underworld_DumpSwarm_h__
+
+	extern const Type Underworld_DumpSwarm_Type;
+
+	typedef struct {
+		__Codelet
+	} Underworld_DumpSwarm;
+
+	Index _Underworld_DumpSwarm_Register( PluginsManager* pluginsManager );
+	void DumpSwarm( void* _context );
+
+#endif	

Added: long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/SConscript
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/SConscript	2006-08-09 07:19:43 UTC (rev 4249)
+++ long/3D/Gale/trunk/src/Underworld/plugins/Output/DumpSwarm/SConscript	2006-08-09 09:48:19 UTC (rev 4250)
@@ -0,0 +1,30 @@
+# Copyright 2006 California Institute of Technology
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+
+Import('env','shared_lib_objects','Underworld_static_objects','header_groups')
+
+local_env=env.Copy()
+local_env.Append(CPPFLAGS=["-DCURR_MODULE_NAME=\\\"Underworld_DumpSwarm\\\""])
+
+header_groups['Underworld/plugins/Output/DumpSwarm']=Split("""DumpSwarm.h""")
+
+c_files=Split("""DumpSwarm.c""")
+
+shared_lib_objects+=[local_env.SharedLibrary('Underworld_DumpSwarmmodule',
+                                             c_files,SHLIBPREFIX='')]
+Underworld_static_objects+=[local_env.StaticObject(c_files)]    
+

Modified: long/3D/Gale/trunk/src/Underworld/plugins/Output/SConscript
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/Output/SConscript	2006-08-09 07:19:43 UTC (rev 4249)
+++ long/3D/Gale/trunk/src/Underworld/plugins/Output/SConscript	2006-08-09 09:48:19 UTC (rev 4250)
@@ -18,4 +18,5 @@
 SConscript('BoundaryLayers/SConscript')
 SConscript('Nusselt/SConscript')
 SConscript('Vrms/SConscript')
+SConscript('DumpSwarm/SConscript')
 

Modified: long/3D/Gale/trunk/src/Underworld/src/main.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/src/main.c	2006-08-09 07:19:43 UTC (rev 4249)
+++ long/3D/Gale/trunk/src/Underworld/src/main.c	2006-08-09 09:48:19 UTC (rev 4250)
@@ -69,22 +69,25 @@
 Index Underworld_Vrms_Register( PluginsManager* pluginsManager );
 Index _Underworld_EulerDeform_Register( PluginsManager* pluginsManager );
 Index StG_FEM_PrintFeVariableDiscreteValues_Register( PluginsManager* pluginsManager );
+Index Underworld_DumpSwarm_Register( PluginsManager* pluginsManager );
 
-int			nPlugins = 6;
+int			nPlugins = 8;
 char*			pluginNames[] = {"StG_FEM_FrequentOutput", 
 					 "StG_FEM_StandardConditionFunctions", 
 					 "StG_FEM_CPUTime",
                                          "Underworld_MovingMesh",
                                          "Underworld_Vrms",
 					 "Underworld_EulerDeform",
-                                         "StG_FEM_PrintFeVariableDiscreteValues"};
+                                         "StG_FEM_PrintFeVariableDiscreteValues",
+                                         "Underworld_DumpSwarm"};
 StaticPluginEntry	pluginLst[] = {{StG_FEM_FrequentOutput_Register, NULL, NULL, NULL}, 
 				       {StG_FEM_StandardConditionFunctions_Register, NULL, NULL, NULL}, 
 				       {StG_FEM_CPUTime_Register, NULL, NULL, NULL}, 
                                        {Underworld_MovingMesh_Register, NULL, NULL, NULL},
                                        {Underworld_Vrms_Register, NULL, NULL, NULL},
 				       {_Underworld_EulerDeform_Register},
-                                       {StG_FEM_PrintFeVariableDiscreteValues_Register}};
+                                       {StG_FEM_PrintFeVariableDiscreteValues_Register},
+                                       {Underworld_DumpSwarm_Register}};
 /* END STATIC PLUGINS */
 
 



More information about the cig-commits mailing list