[cig-commits] r5497 - in long/3D/Gale/trunk/src/Gale: .
Apps/Extension plugins/SurfaceProcess
walter at geodynamics.org
walter at geodynamics.org
Thu Dec 7 14:11:45 PST 2006
Author: walter
Date: 2006-12-07 14:11:45 -0800 (Thu, 07 Dec 2006)
New Revision: 5497
Modified:
long/3D/Gale/trunk/src/Gale/
long/3D/Gale/trunk/src/Gale/Apps/Extension/pic.xml
long/3D/Gale/trunk/src/Gale/Apps/Extension/sandbox.xml
long/3D/Gale/trunk/src/Gale/Apps/Extension/simple.xml
long/3D/Gale/trunk/src/Gale/Apps/Extension/surface-process.xml
long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/Context.h
long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c
Log:
r72 at earth: boo | 2006-12-07 14:11:07 -0800
r70 at earth (orig r63): LukeHodkinson | 2006-12-05 14:18:40 -0800
Changes primarily to XML files as a result
of interface changes lower down in the code tier.
Property changes on: long/3D/Gale/trunk/src/Gale
___________________________________________________________________
Name: svk:merge
- 4e4aea6e-fd02-0410-981f-80ab108a5659:/trunk:62
8f887497-cf10-0410-afc2-df8ae19c7fb0:/cig:65
+ 4e4aea6e-fd02-0410-981f-80ab108a5659:/trunk:63
8f887497-cf10-0410-afc2-df8ae19c7fb0:/cig:72
Modified: long/3D/Gale/trunk/src/Gale/Apps/Extension/pic.xml
===================================================================
--- long/3D/Gale/trunk/src/Gale/Apps/Extension/pic.xml 2006-12-07 22:11:25 UTC (rev 5496)
+++ long/3D/Gale/trunk/src/Gale/Apps/Extension/pic.xml 2006-12-07 22:11:45 UTC (rev 5497)
@@ -3,7 +3,6 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<!-- Include a bunch of stuff -->
- <include> Gale_Components/ElementLayout.xml </include>
<include> StgFEM_Components/ConstantMesh.xml </include>
<include> StgFEM_Components/LinearMesh.xml </include>
<include> StgFEM_Components/VelocityField.xml </include>
@@ -41,24 +40,13 @@
<param name="maxX"> 2.0f </param>
<param name="maxY"> 0.35f </param>
<param name="maxZ"> 0.3f </param>
- <param name="elementResI"> 10 </param>
- <param name="elementResJ"> 5 </param>
+ <param name="elementResI"> 4 </param>
+ <param name="elementResJ"> 3 </param>
<param name="elementResK"> 3 </param>
<param name="allowUnbalancing"> True </param>
<param name="buildNodeNeighbourTbl">True</param>
<param name="buildElementNeighbourTbl">True</param>
- <!-- New mesh setup -->
- <struct name="components" mergeType="merge">
- <struct name="cartesianGenerator">
- <param name="Type"> CartesianGenerator </param>
- <list name="meshes">
- <param> mesh-linear </param>
- </list>
- <param name="decomp"> decomp-linear </param>
- </struct>
- </struct>
-
<!-- Swarm parameters -->
<param name="particlesPerCell"> 30 </param>
<param name="seed"> 13 </param>
Modified: long/3D/Gale/trunk/src/Gale/Apps/Extension/sandbox.xml
===================================================================
--- long/3D/Gale/trunk/src/Gale/Apps/Extension/sandbox.xml 2006-12-07 22:11:25 UTC (rev 5496)
+++ long/3D/Gale/trunk/src/Gale/Apps/Extension/sandbox.xml 2006-12-07 22:11:45 UTC (rev 5497)
@@ -3,7 +3,6 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<!-- Include a bunch of stuff -->
- <include> Gale_Components/ElementLayout.xml </include>
<include> StgFEM_Components/ConstantMesh.xml </include>
<include> StgFEM_Components/LinearMesh.xml </include>
<include> StgFEM_Components/VelocityField.xml </include>
@@ -140,7 +139,6 @@
<!-- Geometry & Mesh setup -->
<param name="dim"> 2 </param>
- <param name="numPartitionedDims"> 1 </param>
<param name="shadowDepth"> 1 </param>
<param name="minX"> 0.0f </param>
<param name="minY"> 0.0f </param>
@@ -149,23 +147,12 @@
<param name="maxY"> 0.35f </param>
<param name="maxZ"> 0.3f </param>
<param name="elementResI"> 32 </param>
- <param name="elementResJ"> 16 </param>
+ <param name="elementResJ"> 12 </param>
<param name="elementResK"> 3 </param>
<param name="allowUnbalancing"> True </param>
<param name="buildNodeNeighbourTbl">True</param>
<param name="buildElementNeighbourTbl">True</param>
- <!-- New mesh setup -->
- <struct name="components" mergeType="merge">
- <struct name="cartesianGenerator">
- <param name="Type"> CartesianGenerator </param>
- <list name="meshes">
- <param> mesh-linear </param>
- </list>
- <param name="decomp"> decomp-linear </param>
- </struct>
- </struct>
-
<!-- Swarm parameters -->
<param name="particlesPerCell"> 30 </param>
<param name="seed"> 13 </param>
@@ -196,7 +183,6 @@
<param name="Type"> CellRemesher </param>
<param name="mesh"> mesh-constant </param>
<param name="meshType"> regular </param>
- <param name="dims"> 2 </param>
<param name="cellMesh"> mesh-linear </param>
</struct>
</struct>
@@ -232,6 +218,7 @@
<include>./VariableConditions/velocityBCs.sandbox.xml</include>
<!-- Rendering -->
+<!--
<include> ./window.xml </include>
<include> ./Viewports/MeshVP.xml </include>
<struct name="components" mergeType="merge">
@@ -241,5 +228,6 @@
</list>
</struct>
</struct>
+-->
</StGermainData>
Modified: long/3D/Gale/trunk/src/Gale/Apps/Extension/simple.xml
===================================================================
--- long/3D/Gale/trunk/src/Gale/Apps/Extension/simple.xml 2006-12-07 22:11:25 UTC (rev 5496)
+++ long/3D/Gale/trunk/src/Gale/Apps/Extension/simple.xml 2006-12-07 22:11:45 UTC (rev 5497)
@@ -3,7 +3,6 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<!-- Include a bunch of stuff -->
- <include> StgFEM_Components/ElementLayout.xml </include>
<include> StgFEM_Components/ConstantMesh.xml </include>
<include> StgFEM_Components/LinearMesh.xml </include>
<include> StgFEM_Components/VelocityField.xml </include>
Modified: long/3D/Gale/trunk/src/Gale/Apps/Extension/surface-process.xml
===================================================================
--- long/3D/Gale/trunk/src/Gale/Apps/Extension/surface-process.xml 2006-12-07 22:11:25 UTC (rev 5496)
+++ long/3D/Gale/trunk/src/Gale/Apps/Extension/surface-process.xml 2006-12-07 22:11:45 UTC (rev 5497)
@@ -3,7 +3,6 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<!-- Include a bunch of stuff -->
- <include> Gale_Components/ElementLayout.xml </include>
<include> StgFEM_Components/ConstantMesh.xml </include>
<include> StgFEM_Components/LinearMesh.xml </include>
<include> StgFEM_Components/VelocityField.xml </include>
@@ -160,11 +159,6 @@
<!-- New mesh setup -->
<struct name="components" mergeType="merge">
- <struct name="cartesianGenerator">
- <param name="Type"> CartesianGenerator </param>
- <param name="decomp"> decomp-linear </param>
- </struct>
-
<struct name="surfaceAdaptor">
<param name="Type"> SurfaceAdaptor </param>
<param name="mesh"> mesh-linear </param>
Modified: long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/Context.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/Context.h 2006-12-07 22:11:25 UTC (rev 5496)
+++ long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/Context.h 2006-12-07 22:11:45 UTC (rev 5497)
@@ -27,11 +27,12 @@
#define __Gale_plugins_SurfaceProcess_Context_h__
struct Gale_SurfaceProcess_Context {
- Mesh* mesh;
- Mesh* surface;
- DecompTransfer* sendOp;
- DecompTransfer* recvOp;
- double* heights;
+ Mesh* mesh;
+ Mesh* surface;
+ DecompTransfer* sendOp;
+ DecompTransfer* recvOp;
+ double* heights;
+ Decomp_Sync_Array* heightSyncArray;
};
#endif
Modified: long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c 2006-12-07 22:11:25 UTC (rev 5496)
+++ long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c 2006-12-07 22:11:45 UTC (rev 5497)
@@ -168,17 +168,12 @@
double* surfaceMin;
double* surfaceMax;
unsigned curDim;
- Topology* nTopology;
- ElementLayout* eLayout;
- NodeLayout* nLayout;
- MeshDecomp* decomp;
- MeshLayout* layout;
+ CartesianGenerator* gen;
Grid* surfaceGrid;
IndexSet* topSet;
unsigned nTopVerts;
unsigned* topVerts;
UIntMap* map;
- Dictionary* dict;
unsigned d_i, v_i;
assert( codelet );
@@ -195,18 +190,15 @@
*/
/* Get the dimensions of the surface. */
- nDims = spCtx->mesh->topo->nDims - 1;
+ nDims = Mesh_GetDimSize( spCtx->mesh ) - 1;
gSize = (unsigned*)ExtensionManager_Get( spCtx->mesh->info, spCtx->mesh,
- ExtensionManager_GetHandle( spCtx->mesh->info, "cartesianGlobalSize" ) );
- min = (double*)ExtensionManager_Get( spCtx->mesh->info, spCtx->mesh,
- ExtensionManager_GetHandle( spCtx->mesh->info, "cartesianMinCoord" ) );
- max = (double*)ExtensionManager_Get( spCtx->mesh->info, spCtx->mesh,
- ExtensionManager_GetHandle( spCtx->mesh->info, "cartesianMaxCoord" ) );
- surfaceSize = Memory_Alloc_Array_Unnamed( unsigned, nDims );
- surfaceMin = Memory_Alloc_Array_Unnamed( double, nDims );
- surfaceMax = Memory_Alloc_Array_Unnamed( double, nDims );
+ ExtensionManager_GetHandle( spCtx->mesh->info, "vertexGrid" ) );
+ Mesh_GetGlobalCoordRange( spCtx->mesh, min, max );
+ surfaceSize = AllocArray( unsigned, nDims );
+ surfaceMin = AllocArray( double, nDims );
+ surfaceMax = AllocArray( double, nDims );
curDim = 0;
- for( d_i = 0; d_i < spCtx->mesh->topo->nDims; d_i++ ) {
+ for( d_i = 0; d_i < Mesh_GetDimSize( spCtx->mesh ); d_i++ ) {
if( d_i == 1 )
continue;
@@ -216,34 +208,17 @@
}
/* Create the surface mesh. */
- dict = Dictionary_New();
- Dictionary_Add( dict, "meshSizeI", Dictionary_Entry_Value_FromUnsignedInt( surfaceSize[0] + 1 ) );
- if( nDims == 2 )
- Dictionary_Add( dict, "meshSizeJ", Dictionary_Entry_Value_FromUnsignedInt( surfaceSize[1] + 1 ) );
- else
- Dictionary_Add( dict, "meshSizeJ", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
- Dictionary_Add( dict, "meshSizeK", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
- Dictionary_Add( dict, "shadowDepth", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
- Dictionary_Add( dict, "allowUnbalancing", Dictionary_Entry_Value_FromBool( True ) );
- nTopology = (Topology*)IJK6Topology_New( "", dict );
- eLayout = (ElementLayout*)ParallelPipedHexaEL_New( "", nDims, dict );
- nLayout = (NodeLayout*)CornerNL_New( "", dict, eLayout, nTopology );
- decomp = (MeshDecomp*)HexaMD_New( "", dict, MPI_COMM_WORLD, eLayout, nLayout );
- layout = MeshLayout_New( "", eLayout, nLayout, decomp );
- spCtx->surface = Mesh_New( "", layout, 0, 0, spCtx->mesh->extensionMgr_Register, dict );
- spCtx->surface->generator = (MeshGenerator*)CartesianGenerator_New( "" );
- MeshGenerator_AddMesh( spCtx->surface->generator, spCtx->surface );
- CartesianGenerator_SetTopologyParams( spCtx->surface->generator, nDims, surfaceSize, 0, NULL, NULL );
- CartesianGenerator_SetGeometryParams( spCtx->surface->generator, surfaceMin, surfaceMax );
+ gen = CartesianGenerator_New( "" );
+ CartesianGenerator_SetTopologyParams( gen, nDims, surfaceSize, 0, NULL, NULL );
+ CartesianGenerator_SetGeometryParams( gen, surfaceMin, surfaceMax );
+ CartesianGenerator_SetShadowDepth( gen, spCtx->mesh->topo->shadowDepth );
+ spCtx->surface = Mesh_New( "" );
+ Mesh_SetGenerator( spCtx->surface, gen );
Build( spCtx->surface, NULL, False );
surfaceGrid = Grid_New();
Grid_SetNDims( surfaceGrid, nDims );
- for( d_i = 0; d_i < nDims; d_i++ )
- surfaceSize[d_i]++;
Grid_SetSizes( surfaceGrid, surfaceSize );
- for( d_i = 0; d_i < nDims; d_i++ )
- surfaceSize[d_i]--;
FreeArray( surfaceSize );
FreeArray( surfaceMin );
@@ -265,12 +240,11 @@
unsigned surfaceInd;
vDomain = topVerts[v_i];
- if( vDomain >= spCtx->mesh->nodeLocalCount )
+ if( vDomain >= Mesh_GetLocalSize( spCtx->mesh, MT_VERTEX ) )
continue;
- vGlobal = Mesh_NodeMapDomainToGlobal( spCtx->mesh, v_i );
- RegularMeshUtils_Node_1DTo3D( (HexaMD*)spCtx->mesh->layout->decomp, vGlobal,
- &ijk[0], &ijk[1], &ijk[2] );
+ vGlobal = Mesh_DomainToGlobal( spCtx->mesh, MT_VERTEX, v_i );
+ RegularMeshUtils_Node_1DTo3D( spCtx->mesh, vGlobal, ijk );
surfaceInd = Grid_Project( surfaceGrid, ijk );
UIntMap_Insert( map, topVerts[v_i], surfaceInd );
}
@@ -284,17 +258,15 @@
/* Build the 'recv' inter mesh map. */
UIntMap_Clear( map );
- for( v_i = 0; v_i < spCtx->surface->topo->domains[MT_VERTEX]->decomp->nLocals; v_i++ ) {
+ for( v_i = 0; v_i < Mesh_GetLocalSize( spCtx->surface, MT_VERTEX ); v_i++ ) {
unsigned vGlobal;
IJK ijk;
- vGlobal = MeshTopology_DomainToGlobal( spCtx->surface->topo, MT_VERTEX, v_i );
- RegularMeshUtils_Node_1DTo3D( (HexaMD*)spCtx->surface->layout->decomp, vGlobal,
- &ijk[0], &ijk[1], &ijk[2] );
+ vGlobal = MeshTopology_DomainToGlobal( spCtx->surface, MT_VERTEX, v_i );
+ RegularMeshUtils_Node_1DTo3D( spCtx->surface, vGlobal, ijk );
ijk[2] = ijk[1];
ijk[1] = gSize[1];
- vGlobal = RegularMeshUtils_Node_Global3DToGlobal1D( (HexaMD*)spCtx->mesh->layout->decomp,
- ijk[0], ijk[1], ijk[2] );
+ vGlobal = RegularMeshUtils_Node_3DTo1D( spCtx->mesh, ijk );
UIntMap_Insert( map, v_i, vGlobal );
}
@@ -313,43 +285,46 @@
/* Coordinates. */
DecompTransfer_AddArray( spCtx->sendOp,
- &spCtx->mesh->nodeCoord[0][0], &spCtx->surface->nodeCoord[0][0],
- 3 * sizeof(double), 3 * sizeof(double),
+ &spCtx->mesh->verts[0][0], &spCtx->surface->verts[0][0],
+ (nDims + 1) * sizeof(double), nDims * sizeof(double),
sizeof(double) );
DecompTransfer_AddArray( spCtx->recvOp,
- &spCtx->surface->nodeCoord[0][0], &spCtx->mesh->nodeCoord[0][0],
- 3 * sizeof(double), 3 * sizeof(double),
+ &spCtx->surface->verts[0][0], &spCtx->mesh->verts[0][0],
+ nDims * sizeof(double), (nDims + 1) * sizeof(double),
sizeof(double) );
+
if( nDims == 3 ) {
DecompTransfer_AddArray( spCtx->sendOp,
- &spCtx->mesh->nodeCoord[0][2], &spCtx->surface->nodeCoord[0][2],
- 3 * sizeof(double), 3 * sizeof(double),
+ &spCtx->mesh->verts[0][2], &spCtx->surface->verts[0][2],
+ (nDims + 1) * sizeof(double), nDims * sizeof(double),
sizeof(double) );
DecompTransfer_AddArray( spCtx->recvOp,
- &spCtx->surface->nodeCoord[0][2], &spCtx->mesh->nodeCoord[0][2],
- 3 * sizeof(double), 3 * sizeof(double),
+ &spCtx->surface->verts[0][2], &spCtx->mesh->verts[0][2],
+ nDims * sizeof(double), (nDims + 1) * sizeof(double),
sizeof(double) );
}
/* Height values. */
- spCtx->heights = Memory_Alloc_Array( double, spCtx->surface->nodeDomainCount, "Gale_SurfaceProcess::heights" );
+ spCtx->heights = AllocArray( double, Mesh_GetDomainSize( spCtx->surface, MT_VERTEX ) );
DecompTransfer_AddArray( spCtx->sendOp,
- &spCtx->mesh->nodeCoord[0][1], spCtx->heights,
- 3 * sizeof(double), sizeof(double),
+ &spCtx->mesh->verts[0][1], spCtx->heights,
+ (nDims + 1) * sizeof(double), sizeof(double),
sizeof(double) );
DecompTransfer_AddArray( spCtx->recvOp,
- spCtx->heights, &spCtx->mesh->nodeCoord[0][1],
- sizeof(double), 3 * sizeof(double),
+ spCtx->heights, &spCtx->mesh->verts[0][1],
+ sizeof(double), (nDims + 1) * sizeof(double),
sizeof(double) );
/*
** Add the height to the surface's syncronisation.
*/
- Decomp_Sync_AddArray( spCtx->surface->topo->domains[MT_VERTEX],
- spCtx->heights, spCtx->heights + spCtx->surface->topo->domains[MT_VERTEX]->decomp->nLocals,
- sizeof(double), sizeof(double),
- sizeof(double) );
+ spCtx->heightSyncArray = Decomp_Sync_Array_New();
+ Decomp_Sync_Array_SetSync( spCtx->heightSyncArray, spCtx->surface->topo->domains[MT_VERTEX] );
+ Decomp_Sync_Array_SetMemory( spCtx->heightSyncArray,
+ spCtx->heights, spCtx->heights + Mesh_GetLocalSize( spCtx->surface, MT_VERTEX ),
+ sizeof(double), sizeof(double),
+ sizeof(double) );
/*
** Insert the operations into the appropriate entry points.
@@ -375,6 +350,7 @@
void Gale_SurfaceProcess_Send( Gale_SurfaceProcess_Context* spCtx ) {
double* tmpHeights;
+ unsigned nDomains;
unsigned n_i;
assert( spCtx );
@@ -384,38 +360,41 @@
Mesh_Sync( spCtx->surface );
/* Remap the heights to match old mesh ordering. */
- tmpHeights = Memory_Alloc_Array_Unnamed( double, spCtx->surface->nodeDomainCount );
- for( n_i = 0; n_i < spCtx->surface->nodeDomainCount; n_i++ ) {
+ nDomains = Mesh_GetDomainSize( spCtx->surface, MT_VERTEX );
+ tmpHeights = Memory_Alloc_Array_Unnamed( double, nDomains );
+ for( n_i = 0; n_i < nDomains; n_i++ ) {
unsigned global;
unsigned domain;
- global = MeshTopology_DomainToGlobal( spCtx->surface->topo, MT_VERTEX, n_i );
- domain = Mesh_NodeMapGlobalToDomain( spCtx->surface, global );
+ global = Mesh_DomainToGlobal( spCtx->surface, MT_VERTEX, n_i );
+ insist( Mesh_GlobalToDomain( spCtx->surface, MT_VERTEX, global, &domain ) );
tmpHeights[domain] = spCtx->heights[n_i];
}
- memcpy( spCtx->heights, tmpHeights, spCtx->surface->nodeDomainCount * sizeof(double) );
+ memcpy( spCtx->heights, tmpHeights, nDomains * sizeof(double) );
FreeArray( tmpHeights );
}
void Gale_SurfaceProcess_Recv( Gale_SurfaceProcess_Context* spCtx ) {
double* tmpHeights;
+ unsigned nDomains;
unsigned n_i;
assert( spCtx );
/* Remap the heights back to the new mesh's scheme. */
- tmpHeights = Memory_Alloc_Array_Unnamed( double, spCtx->surface->nodeDomainCount );
- for( n_i = 0; n_i < spCtx->surface->nodeDomainCount; n_i++ ) {
+ nDomains = Mesh_GetDomainSize( spCtx->surface, MT_VERTEX );
+ tmpHeights = Memory_Alloc_Array_Unnamed( double, nDomains );
+ for( n_i = 0; n_i < nDomains; n_i++ ) {
unsigned global;
unsigned domain;
- global = MeshTopology_DomainToGlobal( spCtx->surface->topo, MT_VERTEX, n_i );
- domain = Mesh_NodeMapGlobalToDomain( spCtx->surface, global );
+ global = Mesh_DomainToGlobal( spCtx->surface, MT_VERTEX, n_i );
+ insist( Mesh_GlobalToDomain( spCtx->surface, MT_VERTEX, global, &domain ) );
tmpHeights[n_i] = spCtx->heights[domain];
}
- memcpy( spCtx->heights, tmpHeights, spCtx->surface->nodeDomainCount * sizeof(double) );
+ memcpy( spCtx->heights, tmpHeights, nDomains * sizeof(double) );
FreeArray( tmpHeights );
/* Transfer. */
More information about the cig-commits
mailing list