aboutsummaryrefslogtreecommitdiff
path: root/src/IsoSurfacer.c
diff options
context:
space:
mode:
authorjshalf <jshalf@bfcf8e34-485d-4d46-a995-1fd6fa6fb178>2000-12-15 09:04:26 +0000
committerjshalf <jshalf@bfcf8e34-485d-4d46-a995-1fd6fa6fb178>2000-12-15 09:04:26 +0000
commit630488ceb5e2419de52ed7d1c0c4ea665cdd60ce (patch)
tree1aa5bbaced6b2abcc2481af298d48a8a31158273 /src/IsoSurfacer.c
parent0ccc9a60fa04d9a2f03ad7a65e3777d730fa07ec (diff)
Added parallel collection of vertex normals.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IsoSurfacer/trunk@29 bfcf8e34-485d-4d46-a995-1fd6fa6fb178
Diffstat (limited to 'src/IsoSurfacer.c')
-rw-r--r--src/IsoSurfacer.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/IsoSurfacer.c b/src/IsoSurfacer.c
index c9c6b86..d811495 100644
--- a/src/IsoSurfacer.c
+++ b/src/IsoSurfacer.c
@@ -202,7 +202,7 @@ static void computeIso(int index, cGH *GH, isosurfacerGH *myGH)
i = CCTK_CoordIndex (-1,"z","cart3d");
zcoords = (CCTK_REAL *) CCTK_VarDataPtrI (GH, timelevel, i);
/* Actually perform the Isosurfacing Operation */
- NuFindSurface(data,nx,ny,nz,xcoords,ycoords,zcoords,myGH->isovalue,0,&(myGH->perprocessor));
+ NuFindSurface(data,nx,ny,nz,xcoords,ycoords,zcoords,myGH->isovalue,myGH->ComputeNormals,&(myGH->perprocessor));
/* And collect the geometry to node 0 */
CollectData(GH, &(myGH->perprocessor), &(myGH->totals));
/* and for the writers, collect min,max to node 0 */
@@ -354,6 +354,10 @@ void CollectData(cGH *GH, polypatch *perprocessor, polypatch *totals) {
totals->nverts /= 3;
totals->npolys /= 3;
+ if(compute_normals)
+ totals->nnorms=totals->nverts;
+ else
+ totals->nnorms=0;
/*
Kludge:
@@ -366,12 +370,15 @@ void CollectData(cGH *GH, polypatch *perprocessor, polypatch *totals) {
*/
if(lastNverts < totals->nverts){
REALLOC(totals->verts, 3+3*totals->nverts, CCTK_REAL4);
+ if(compute_normals){
+ REALLOC(totals->norms, 3+3*totals->nverts, CCTK_REAL4);
+ }
lastNverts = totals->nverts;
}
if(lastNpolys < totals->npolys){
REALLOC(totals->polys, 3+3*totals->npolys, CCTK_INT4);
lastNpolys = totals->npolys;
- }
+ }
} /* end processor 0 setup */
/* Gather the vertex lists from all processors */
@@ -383,6 +390,11 @@ void CollectData(cGH *GH, polypatch *perprocessor, polypatch *totals) {
CACTUS_MPI_ERROR (MPI_Gatherv (perprocessor->polys, perprocessor->npolys*3,
PUGH_MPI_INT4, totals->polys, pcount, pdispl, PUGH_MPI_INT4,
0, pughGH->PUGH_COMM_WORLD));
+ if(compute_normals){
+ CACTUS_MPI_ERROR (MPI_Gatherv (perprocessor->norms, perprocessor->nnorms*3,
+ PUGH_MPI_REAL4, totals->norms, vcount, vdispl, PUGH_MPI_REAL4,
+ 0, pughGH->PUGH_COMM_WORLD));
+ }
/* JMS Comment:
Now we need to re-number the connectivity list so that
they can be combined in the master list (remember, the