[cig-commits] r5640 - in long/3D/Gale/trunk/src/Gale: .
plugins/SurfaceProcess
walter at geodynamics.org
walter at geodynamics.org
Fri Jan 5 11:15:58 PST 2007
Author: walter
Date: 2007-01-05 11:15:57 -0800 (Fri, 05 Jan 2007)
New Revision: 5640
Modified:
long/3D/Gale/trunk/src/Gale/
long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c
Log:
r91 at earth: boo | 2007-01-05 11:15:04 -0800
r83 at earth (orig r68): LukeHodkinson | 2007-01-04 16:48:11 -0800
Updating the surface process interface in Gale;
there were a number of problems as a result of the
new meshing code.
Property changes on: long/3D/Gale/trunk/src/Gale
___________________________________________________________________
Name: svk:merge
- 4e4aea6e-fd02-0410-981f-80ab108a5659:/trunk:67
8f887497-cf10-0410-afc2-df8ae19c7fb0:/cig:90
+ 4e4aea6e-fd02-0410-981f-80ab108a5659:/trunk:68
8f887497-cf10-0410-afc2-df8ae19c7fb0:/cig:91
Modified: long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c 2007-01-05 19:15:54 UTC (rev 5639)
+++ long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c 2007-01-05 19:15:57 UTC (rev 5640)
@@ -160,13 +160,11 @@
void _Gale_SurfaceProcess_Build( void* codelet, void* data ) {
GaleContext* galeCtx = (GaleContext*)data;
Gale_SurfaceProcess_Context* spCtx;
- unsigned nDims;
- unsigned* gSize;
- double* min;
- double* max;
+ unsigned nMeshDims, nSurfDims;
+ Grid* elGrid;
+ double *min, *max;
unsigned* surfaceSize;
- double* surfaceMin;
- double* surfaceMax;
+ double *surfaceMin, *surfaceMax;
unsigned curDim;
CartesianGenerator* gen;
Grid* surfaceGrid;
@@ -190,26 +188,29 @@
*/
/* Get the dimensions of the surface. */
- nDims = Mesh_GetDimSize( spCtx->mesh ) - 1;
- gSize = (unsigned*)ExtensionManager_Get( spCtx->mesh->info, spCtx->mesh,
- ExtensionManager_GetHandle( spCtx->mesh->info, "vertexGrid" ) );
+ nMeshDims = Mesh_GetDimSize( spCtx->mesh );
+ nSurfDims = nMeshDims - 1;
+ elGrid = *(Grid**)ExtensionManager_Get( spCtx->mesh->info, spCtx->mesh,
+ ExtensionManager_GetHandle( spCtx->mesh->info, "elementGrid" ) );
+ min = AllocArray( double, nMeshDims );
+ max = AllocArray( double, nMeshDims );
Mesh_GetGlobalCoordRange( spCtx->mesh, min, max );
- surfaceSize = AllocArray( unsigned, nDims );
- surfaceMin = AllocArray( double, nDims );
- surfaceMax = AllocArray( double, nDims );
+ surfaceSize = AllocArray( unsigned, nSurfDims );
+ surfaceMin = AllocArray( double, nSurfDims );
+ surfaceMax = AllocArray( double, nSurfDims );
curDim = 0;
- for( d_i = 0; d_i < Mesh_GetDimSize( spCtx->mesh ); d_i++ ) {
+ for( d_i = 0; d_i < nMeshDims + 1; d_i++ ) {
if( d_i == 1 )
continue;
- surfaceSize[curDim] = gSize[d_i];
+ surfaceSize[curDim] = elGrid->sizes[d_i];
surfaceMin[curDim] = min[d_i];
surfaceMax[curDim++] = max[d_i];
}
/* Create the surface mesh. */
gen = CartesianGenerator_New( "" );
- CartesianGenerator_SetDimSize( gen, nDims );
+ CartesianGenerator_SetDimSize( gen, nSurfDims );
CartesianGenerator_SetTopologyParams( gen, surfaceSize, 0, NULL, NULL );
CartesianGenerator_SetGeometryParams( gen, surfaceMin, surfaceMax );
CartesianGenerator_SetShadowDepth( gen, spCtx->mesh->topo->shadowDepth );
@@ -217,9 +218,8 @@
Mesh_SetGenerator( spCtx->surface, gen );
Build( spCtx->surface, NULL, False );
- surfaceGrid = Grid_New();
- Grid_SetNDims( surfaceGrid, nDims );
- Grid_SetSizes( surfaceGrid, surfaceSize );
+ surfaceGrid = *(Grid**)ExtensionManager_Get( spCtx->surface->info, spCtx->mesh,
+ ExtensionManager_GetHandle( spCtx->mesh->info, "vertexGrid" ) );
FreeArray( surfaceSize );
FreeArray( surfaceMin );
@@ -263,10 +263,10 @@
unsigned vGlobal;
IJK ijk;
- vGlobal = MeshTopology_DomainToGlobal( spCtx->surface, MT_VERTEX, v_i );
+ vGlobal = Mesh_DomainToGlobal( spCtx->surface, MT_VERTEX, v_i );
RegularMeshUtils_Node_1DTo3D( spCtx->surface, vGlobal, ijk );
ijk[2] = ijk[1];
- ijk[1] = gSize[1];
+ ijk[1] = elGrid->sizes[1];
vGlobal = RegularMeshUtils_Node_3DTo1D( spCtx->mesh, ijk );
UIntMap_Insert( map, v_i, vGlobal );
}
@@ -287,21 +287,21 @@
/* Coordinates. */
DecompTransfer_AddArray( spCtx->sendOp,
&spCtx->mesh->verts[0][0], &spCtx->surface->verts[0][0],
- (nDims + 1) * sizeof(double), nDims * sizeof(double),
+ nMeshDims * sizeof(double), nSurfDims * sizeof(double),
sizeof(double) );
DecompTransfer_AddArray( spCtx->recvOp,
&spCtx->surface->verts[0][0], &spCtx->mesh->verts[0][0],
- nDims * sizeof(double), (nDims + 1) * sizeof(double),
+ nSurfDims * sizeof(double), nMeshDims * sizeof(double),
sizeof(double) );
- if( nDims == 3 ) {
+ if( nMeshDims == 3 ) {
DecompTransfer_AddArray( spCtx->sendOp,
&spCtx->mesh->verts[0][2], &spCtx->surface->verts[0][2],
- (nDims + 1) * sizeof(double), nDims * sizeof(double),
+ nMeshDims * sizeof(double), nSurfDims * sizeof(double),
sizeof(double) );
DecompTransfer_AddArray( spCtx->recvOp,
&spCtx->surface->verts[0][2], &spCtx->mesh->verts[0][2],
- nDims * sizeof(double), (nDims + 1) * sizeof(double),
+ nSurfDims * sizeof(double), nMeshDims * sizeof(double),
sizeof(double) );
}
@@ -309,11 +309,11 @@
spCtx->heights = AllocArray( double, Mesh_GetDomainSize( spCtx->surface, MT_VERTEX ) );
DecompTransfer_AddArray( spCtx->sendOp,
&spCtx->mesh->verts[0][1], spCtx->heights,
- (nDims + 1) * sizeof(double), sizeof(double),
+ nMeshDims * sizeof(double), sizeof(double),
sizeof(double) );
DecompTransfer_AddArray( spCtx->recvOp,
spCtx->heights, &spCtx->mesh->verts[0][1],
- sizeof(double), (nDims + 1) * sizeof(double),
+ sizeof(double), nMeshDims * sizeof(double),
sizeof(double) );
/*
More information about the cig-commits
mailing list