diff options
Diffstat (limited to 'Source/Python/WarpXWrappers.cpp')
-rw-r--r-- | Source/Python/WarpXWrappers.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/Python/WarpXWrappers.cpp b/Source/Python/WarpXWrappers.cpp index 201af45c0..5c1964b1a 100644 --- a/Source/Python/WarpXWrappers.cpp +++ b/Source/Python/WarpXWrappers.cpp @@ -257,6 +257,26 @@ extern "C" WARPX_GET_LOVECTS(warpx_getCurrentDensityCPLoVects, WarpX::GetInstance().getcurrent_cp); WARPX_GET_LOVECTS(warpx_getCurrentDensityFPLoVects, WarpX::GetInstance().getcurrent_fp); +#define WARPX_GET_SCALAR(SCALAR, GETTER) \ + amrex::Real** SCALAR(int lev, \ + int *return_size, int *ncomps, int *ngrow, int **shapes) { \ + auto & mf = GETTER(lev); \ + return getMultiFabPointers(mf, return_size, ncomps, ngrow, shapes); \ + } + +#define WARPX_GET_LOVECTS_SCALAR(SCALAR, GETTER) \ + int* SCALAR(int lev, \ + int *return_size, int *ngrow) { \ + auto & mf = GETTER(lev); \ + return getMultiFabLoVects(mf, return_size, ngrow); \ + } + + WARPX_GET_SCALAR(warpx_getChargeDensityCP, WarpX::GetInstance().getrho_cp); + WARPX_GET_SCALAR(warpx_getChargeDensityFP, WarpX::GetInstance().getrho_fp); + + WARPX_GET_LOVECTS_SCALAR(warpx_getChargeDensityCPLoVects, WarpX::GetInstance().getrho_cp); + WARPX_GET_LOVECTS_SCALAR(warpx_getChargeDensityFPLoVects, WarpX::GetInstance().getrho_fp); + #define WARPX_GET_FIELD_PML(FIELD, GETTER) \ amrex::Real** FIELD(int lev, int direction, \ int *return_size, int *ncomps, int *ngrow, int **shapes) { \ |