diff options
author | yye00 <yye00@fa3da13c-9f13-4301-a575-cf5b8c5e1907> | 2005-12-05 20:57:51 +0000 |
---|---|---|
committer | yye00 <yye00@fa3da13c-9f13-4301-a575-cf5b8c5e1907> | 2005-12-05 20:57:51 +0000 |
commit | 25199b8966ade69506cf2cc3f931b977ff31133a (patch) | |
tree | 25c7b1fd7fb8ac26eaa727471bad3d7ece3fd399 /src/Flat.c | |
parent | 22b7e1280384d7b41d0bfb0f0f0761056baf7422 (diff) |
changes to ELLSOR to use new reduction api, removed references to pointwise from ReduceArraysGlobally, removed unused variables and added the LocalReduce thorn to a .par file
git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllSOR/trunk@96 fa3da13c-9f13-4301-a575-cf5b8c5e1907
Diffstat (limited to 'src/Flat.c')
-rw-r--r-- | src/Flat.c | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -71,7 +71,17 @@ int SORFlat3D(cGH *GH, int FieldIndex, int MIndex, int NIndex, CCTK_REAL dx2rec, dy2rec, dz2rec; char *robin = NULL; char *sor_accel = NULL; - + int ierr = 0; + const void* input_array[1]; + void* reduction_value[1]; + int input_array_dim[1]; + int input_array_type_codes[1]; + + input_array[0] = (CCTK_REAL *)&resnorm; + input_array_dim[0] = 0; + reduction_value[0] = (CCTK_REAL *)&glob_residual; + input_array_type_codes[0] = CCTK_VARIABLE_REAL; + /* Boundary conditions */ int use_robin = 0; @@ -79,7 +89,7 @@ int SORFlat3D(cGH *GH, int FieldIndex, int MIndex, int NIndex, RelTol = RelTol; /* Get the reduction handle */ - sum_handle = CCTK_ReductionArrayHandle("sum"); + sum_handle = CCTK_LocalArrayReductionHandle("sum"); if (sum_handle<0) { CCTK_WARN(1,"SORFlat3D: Cannot get reduction handle for sum operation"); @@ -285,11 +295,16 @@ int SORFlat3D(cGH *GH, int FieldIndex, int MIndex, int NIndex, } } } - + /* reduction operation on processor-local residual values */ - - if (CCTK_ReduceLocScalar(GH, -1, sum_handle, - &resnorm, &glob_residual, CCTK_VARIABLE_REAL)<0) + ierr = ierr = CCTK_ReduceArraysGlobally(GH, -1,sum_handle, -1, 1,input_array,0, + input_array_dim, + input_array_type_codes, + 1, + input_array_type_codes, + reduction_value); + + if (ierr<0) { CCTK_WARN(1,"SORFlat3D: Reduction of Norm failed"); } |