Closed MaxThevenet closed 4 years ago
Since AMReX supports this now, our goal should be to compile successfully with
make BL_NO_FORT=TRUE
(and then change the default to that).
Do we want to try to replace the functions above with the function Average::CoarsenAndInterpolate
introduced in #853 as a first step? Or do we want to write a specific new function that possibly interpolates over more than 1 or 2 points? Since the functions above are used for I/O purposes, I would expect Average::CoarsenAndInterpolate
to be enough, but I would like to receive feedback on this.
Can CoarsenAndInterpolate
reproduce the behavior of all functions above to machine precision, or do some of them use several-point averaging?
Ah, the comment above doesn't apply to amrex_interp_div_free_bfield
, which is doing a more elaborate interpolation but we don't need that.
Thanks for the feedback, I will check each of the functions above and report here.
My conclusion so far is that we cannot use Average::CoarsenAndInterpolate
for the functions above, as they seem to be used for interpolating fields from coarse grids to fine grids (hence refining and not coarsening). The replacement of the functions mentioned in this issue would also correspond to resolving the fifth point "Output of raw data: Interpolation of fields from coarse to fine" mentioned in issue 797.
Finalized with #1103
WarpX still calls some AMReX Fortran functions, in particular in
Diagnostics/FieldIO.cpp
andUtils/Interpolate.cpp
, for instanceamrex_interp_efield
amrex_interp_bfield
amrex_interp_cc_efield
amrex_interp_cc_bfield
amrex_interp_nd_efield
[ ]
amrex_interp_div_free_bfield
(probably not needed in loop anymore; just in diags)etc. These function are just meant to compute cell-centered arrays from non-cell-centered multifabs for diagnostics. We don't need these interpolations to be
div free
etc., we were just using the existing amrex functions.Instead of re-writing all of these functions, let's check if we can call other existing C++ functions instead, like
amrex::average_face_to_cellcenter
etc.