[cig-commits] r4144 - in long/3D/Gale/trunk/src/StGermain: . Discretisation/Mesh/src

walter at geodynamics.org walter at geodynamics.org
Tue Aug 1 01:53:35 PDT 2006


Author: walter
Date: 2006-08-01 01:53:35 -0700 (Tue, 01 Aug 2006)
New Revision: 4144

Modified:
   long/3D/Gale/trunk/src/StGermain/
   long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshGeometry.c
   long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshGeometry.h
Log:
 r2610 at earth:  boo | 2006-08-01 01:50:39 -0700
  r2589 at earth (orig r3712):  LukeHodkinson | 2006-07-26 20:33:29 -0700
  In parallel, when retrieving coorinates of a deformed
  mesh from the layout, we need to map global indices to
  domain indices. At the moment, if a global index is not
  in a processor's domain the code will assert.
  
 



Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
   - 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2609
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3711
   + 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2610
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3712

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshGeometry.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshGeometry.c	2006-08-01 08:53:32 UTC (rev 4143)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshGeometry.c	2006-08-01 08:53:35 UTC (rev 4144)
@@ -35,6 +35,7 @@
 
 #include "types.h"
 #include "shortcuts.h"
+#include "MeshDecomp.h"
 #include "MeshClass.h"
 #include "MeshGeometry.h"
 
@@ -191,7 +192,8 @@
 	
 	/* MeshGeometry info */
         self->useMesh = False;
-        self->meshCrds = NULL;
+        self->mesh = NULL;
+	self->decomp = NULL;
 }
 
 
@@ -228,24 +230,25 @@
 void _MeshGeometry_Construct( void* meshGeometry, Stg_ComponentFactory *cf ){
 	MeshGeometry*	self = (MeshGeometry*)meshGeometry;
         Dictionary*	dict;
-        char*		name;
-        Mesh*		mesh;
 
         _BlockGeometry_Construct( self, cf );
 
 	/* Get Size from Dictionary */
+	self->cf = cf;
         dict = Dictionary_Entry_Value_AsDictionary( Dictionary_Get( cf->componentDict, self->name ) );
-        name = Dictionary_GetString( dict, "mesh" );
-        mesh = Stg_ComponentFactory_ConstructByName( cf, (char*)name, Mesh, False );
-        self->meshCrds = &mesh->nodeCoord;
+        self->meshName = StG_Strdup( Dictionary_GetString( dict, "mesh" ) );
+	self->decompName = StG_Strdup( Dictionary_GetString( dict, "decomp" ) );
+
 }
-	
+
 void _MeshGeometry_Build( void* meshGeometry, void *data ){
-        
+	MeshGeometry*	self = (MeshGeometry*)meshGeometry;
+
+	self->mesh = Stg_ComponentFactory_ConstructByName( self->cf, self->meshName, Mesh, True );
+	self->decomp = Stg_ComponentFactory_ConstructByName( self->cf, self->decompName, MeshDecomp, True );
 }
 	
 void _MeshGeometry_Initialise( void* meshGeometry, void *data ){
-
 }
 	
 void _MeshGeometry_Execute( void* meshGeometry, void *data ){
@@ -264,25 +267,24 @@
 
 
 void _MeshGeometry_PointAt( void* meshGeometry, Index index, Coord point ) {
-	MeshGeometry* self = (MeshGeometry*)meshGeometry;
+	MeshGeometry*	self = (MeshGeometry*)meshGeometry;
+	unsigned	mapped;
 
         if( !self->useMesh ) {
                 _BlockGeometry_PointAt( self, index, point );
                 return;
         }
 
-        assert( self->meshCrds );
-	
-	if( index < self->pointCount ) {
-                point[0] = (*self->meshCrds)[index][0];
-                point[1] = (*self->meshCrds)[index][1];
-                point[2] = (*self->meshCrds)[index][2];
-	}
-	else {
-		point[0] = HUGE_VAL;
-		point[1] = HUGE_VAL;
-		point[2] = HUGE_VAL;
-	}
+	assert( self->mesh );
+
+	if( self->mesh->nodeG2D )
+		mapped = Mesh_NodeMapGlobalToDomain( self->mesh, index );
+	else
+		mapped = self->decomp->nodeMapGlobalToDomain( self->decomp, index );
+	assert( mapped < self->decomp->nodeDomainCount );
+	point[0] = self->mesh->nodeCoord[mapped][0];
+	point[1] = self->mesh->nodeCoord[mapped][1];
+	point[2] = self->mesh->nodeCoord[mapped][2];
 }
 
 

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshGeometry.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshGeometry.h	2006-08-01 08:53:32 UTC (rev 4143)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Mesh/src/MeshGeometry.h	2006-08-01 08:53:35 UTC (rev 4144)
@@ -52,8 +52,12 @@
 		/* Virtual info */ \
 		\
 		/* MeshGeometry info ... */ \
+		Stg_ComponentFactory*		cf; \
+		char*				meshName; \
+		char*				decompName; \
 		Bool				useMesh; \
-		Coord**				meshCrds;
+		Mesh*				mesh; \
+		MeshDecomp*			decomp;
 
 	struct MeshGeometry { __MeshGeometry };
 	



More information about the cig-commits mailing list