diff options
author | 2017-03-23 11:04:52 -0700 | |
---|---|---|
committer | 2017-03-23 11:04:52 -0700 | |
commit | 884bc09083c6c5a99f5e262eb5b8e937c9d7fdb0 (patch) | |
tree | ff0f75bffeb16be9f38e7fb0f9e9398f51f3d6fe /Source/WarpXWrappers.cpp | |
parent | faa4aa365bf133a67e0430e1730e906a251f30c5 (diff) | |
download | WarpX-884bc09083c6c5a99f5e262eb5b8e937c9d7fdb0.tar.gz WarpX-884bc09083c6c5a99f5e262eb5b8e937c9d7fdb0.tar.zst WarpX-884bc09083c6c5a99f5e262eb5b8e937c9d7fdb0.zip |
3 -> BL_SPACEDIM
Diffstat (limited to 'Source/WarpXWrappers.cpp')
-rw-r--r-- | Source/WarpXWrappers.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/WarpXWrappers.cpp b/Source/WarpXWrappers.cpp index 782f464ba..1d0698ffc 100644 --- a/Source/WarpXWrappers.cpp +++ b/Source/WarpXWrappers.cpp @@ -11,14 +11,14 @@ namespace { *ngrow = mf.nGrow(); *num_boxes = mf.local_size(); - *shapes = (int*) malloc(3*(*num_boxes)*sizeof(int)); - double** data = (double**) malloc((*num_boxes)*sizeof(double*)); + *shapes = (int*) malloc(BL_SPACEDIM * (*num_boxes) * sizeof(int)); + double** data = (double**) malloc((*num_boxes) * sizeof(double*)); int i = 0; for ( amrex::MFIter mfi(mf, false); mfi.isValid(); ++mfi, ++i ) { data[i] = (double*) mf[mfi].dataPtr(); - for (int j = 0; j < 3; ++j) { - (*shapes)[3*i+j] = mf[mfi].box().length(j); + for (int j = 0; j < BL_SPACEDIM; ++j) { + (*shapes)[BL_SPACEDIM*i+j] = mf[mfi].box().length(j); } } return data; |