[cig-commits] commit:
Mercurial
hg at geodynamics.org
Mon Nov 24 11:58:16 PST 2008
changeset: 17:bc405ee8e151
user: LukeHodkinson
date: Wed Jan 09 01:05:55 2008 +0000
files: Mesh/src/Mesh_RegularAlgorithms.c
description:
Fixed a nasty bug in the element-point ownership code
for regular meshes. The separation between elements
was incorrectly being calculated (it was something like
10^(-7) too small) and was resulting in incorrectly
assigned particles for high resolution problems.
diff -r 8b76f11ca8d1 -r bc405ee8e151 Mesh/src/Mesh_RegularAlgorithms.c
--- a/Mesh/src/Mesh_RegularAlgorithms.c Thu Jan 03 04:44:57 2008 +0000
+++ b/Mesh/src/Mesh_RegularAlgorithms.c Wed Jan 09 01:05:55 2008 +0000
@@ -147,7 +147,8 @@ void Mesh_RegularAlgorithms_Update( void
void Mesh_RegularAlgorithms_Update( void* algorithms ) {
Mesh_RegularAlgorithms* self = (Mesh_RegularAlgorithms*)algorithms;
unsigned nDims;
- double minSep;
+ Grid* vGrid;
+ int ii;
assert( self && Stg_CheckType( self, Mesh_RegularAlgorithms ) );
assert( self->mesh );
@@ -156,11 +157,14 @@ void Mesh_RegularAlgorithms_Update( void
_Mesh_Algorithms_Update( self );
nDims = Mesh_GetDimSize( self->mesh );
- self->sep = AllocArray( double, nDims );
self->minCrd = AllocArray( double, nDims );
self->maxCrd = AllocArray( double, nDims );
- Mesh_GetMinimumSeparation( self->mesh, &minSep, self->sep );
Mesh_GetGlobalCoordRange( self->mesh, self->minCrd, self->maxCrd );
+
+ self->sep = AllocArray( double, nDims );
+ vGrid = *Mesh_GetExtension( self->mesh, Grid**, "vertexGrid" );
+ for( ii = 0; ii < nDims; ii++ )
+ self->sep[ii] = (self->maxCrd[ii] - self->minCrd[ii]) / (vGrid->sizes[ii] - 1);
}
Bool _Mesh_RegularAlgorithms_Search( void* algorithms, void* _mesh, double* point,
More information about the CIG-COMMITS
mailing list