aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp
diff options
context:
space:
mode:
authorGravatar Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com> 2020-04-15 11:11:04 -0700
committerGravatar GitHub <noreply@github.com> 2020-04-15 11:11:04 -0700
commit224a44659d5b6d2329849677e109bae842e8ed00 (patch)
tree10561e8725b8bbb1ef40ac66a47fb06c4d239526 /Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp
parent75e180d8470380cbde55607a889ead2d5e897022 (diff)
downloadWarpX-224a44659d5b6d2329849677e109bae842e8ed00.tar.gz
WarpX-224a44659d5b6d2329849677e109bae842e8ed00.tar.zst
WarpX-224a44659d5b6d2329849677e109bae842e8ed00.zip
Diags with coarsening (#856)
* Start implementation of new averaging with staggering: - face-to-cell-center and edge-to-cell-center replaced so far; - TODO: node-to-cell-center and 1D behavior (AMREX_SPACEDIM=1). * first implementation of Diags base classes * add example, temporarily * Continue implementation of new averaging with staggering: - new function takes reference to single MultiFab (no vector); - TODO: node-to-cell-center still in progress. * Fix small bug and clean up * Fix bug in loop over n=0,...,ncomp-1 and clean up * add more functions * Add Doxygen documentation and clean up * Small clean-up in Doxygen documentation * Compile in single precision: add _rt suffix to avoid unnecessary conversions * Avoid accessing staggering index directly from IntVect in innermost loops * Replace do-while loop with for loop (default ncomp=1) * Remove temporary pointer and pass reference to MultiFab (instead of MultiFab*) * Replace AMREX_LAUNCH_HOST_DEVICE_LAMBDA with ParallelFor * cleaning and initialize output mf * use general average routine * move flush in new class, and implemented the Plotfile derived class * add comments * eol * free memory in destructor * typo * typo * no need to clear MF pointers there * though shalt not break existing tests * FlushRaw doesnt have to be virtual for now * The importance of being constant * Capability to select fields in output files * EOL * revert to old inputs * const in right place * avoid brace initializer there * oops, fix logic error in is_in * user can choose flush interval, same behavior as plot_int * Add option to plot raw fields * eol * replace ter flush with dump to avoid confusion * add options * Diagnostics stores a vector of functors to compute diags on the fly * eol * Field gather from diags to sync particle quantities * New diagnostics handle RZ with same behavior as old ones * cleaning and doc * const ref for string * smarter for loop from Axel and typo fix from Reva * Functors to compute some fields * simplify code following Dave's comments * Create subfolders and add more output options (divE etc.) * eol * rename mode_avg to convertRZmodes2cartesian * Update CellCenterFunctor.H * fill varnames and vector of functors at the same time * output rho_new, not rho_old * WarpX instance not needed here * add const * little bit more of reorganization * Apply suggestions from code review Co-Authored-By: Axel Huebl <axel.huebl@plasma.ninja> * add a bunch of const * Move average_down overload used in WarpX to Average::FineToCoarse * Write Average::FineToCoarse for cell-centered and nodal data * Clean up Average::FineToCoarse (WARNING: interface changed) * Small clean-up * Replace AMREX_LAUNCH_HOST_DEVICE_LAMBDA with ParallelFor * parse input for diag_crse_ratio, mf_avg allocate, call FineToCoarse * eol fix * fix compilation error by adding bool variable * Small clean-up * er-organizing placement for diag_crse_ratio * calling member function for crse_Ratio * cleaning * Change name from Average::FineToCoarse to Average::Coarsen * Add dcomp to interface of Coarsen (different from scomp in general) * fixing RZ build error by adding diag_crse_ratio * Remove ASSERT (general input and output staggerings will be accepted) * Fix averaging from fine nodal to coarse centered * Clean up Doxygen in old Average::ToCellCenter (likely to be removed) * Intermediate layers Average::CoarsenLoop and Average::CoarsenKernel * Revert "Intermediate layers Average::CoarsenLoop and Average::CoarsenKernel" This reverts commit 91f2beaa20617a3fb25df536472b74899942ffc5. * Clean-up * Implement interpolation with coarsening (remove averaging) * Trigger failing source/style checks on Travis CI * merged EZ's coarsen_branch added comments about ba.coarsen * Add ASSERTS to check coarsening ratio and guard cells * clarified a comment * cleaning * Input/output MultiFabs can have different number of components * Call the correct coarsen and interpolate function * adding comments for the input parameter * Use AMReX built-in functions to check if MultiFab is coarsenable * fixing assert * EOL fix * changes based on suggestions in the review * EOL fix * Add Doxygen documentation for new functions * Copy starting from correct component in destination MultiFab * making crse_ratio IntVect a protected variable Co-Authored-By: MaxThevenet <mthevenet@lbl.gov> * removing this function since crse_ratio is protected Co-Authored-By: MaxThevenet <mthevenet@lbl.gov> * removing assert since it is temporaty only for this PR Co-Authored-By: MaxThevenet <mthevenet@lbl.gov> * crse_ratio is protected and can be accessed directly Co-Authored-By: MaxThevenet <mthevenet@lbl.gov> * Pass IntVect to BoxArray method 'coarsenable' directly * Improve comments * Rename 'ratio' as 'crse_ratio' * Extending coarsening to divE and divB functors * Add _rt suffix when necessary * Improve comments * Use method 'toIntVect' instead of 'ixType' * New names: mf_src, arr_src, stag_src, mf_dst, arr_dst, stag_dst * More clean-up * adding coarsening capability to all diag_functors * fixing compilation errors * fix eol * Replace calls to ToCellCenter and fix bug with staggering of temporary BoxArray * Check if coarsenable on BoxArray with destination staggering * clean up * dix eol * typo in comment * Replace remaining calls to Average::ToCellCenter * Remove Average::ToCellCenter * Use amrex::Gpu::ManagedVector<int> to avoid issues on GPUs * Add default value IntVect(1) for coarsening ratio * Add ngrow to possibly fill guard cells too * Add ngrow to Doxygen documentation * Count number of points outside innermost loop * added capability for different user-defined lo and hi for diags * eol fix * Add number of guard cells required to previous ASSERT and force ngrow=0 with coarsening * cleaning up by moving multifab generation to a new function * eol fix * added a small description for function * Update Source/Diagnostics/Diagnostics.H incorporating comments for member variables Co-Authored-By: MaxThevenet <mthevenet@lbl.gov> * Update Source/Diagnostics/Diagnostics.cpp adding comments for a function Co-Authored-By: MaxThevenet <mthevenet@lbl.gov> * Apply suggestions from code review Thanks to Maxence Thevenet for the suggestions from review Co-Authored-By: MaxThevenet <mthevenet@lbl.gov> * adding suggestion from code review directly * Apply suggestions from code review max to prevent negative values due to precision errors Co-Authored-By: MaxThevenet <mthevenet@lbl.gov> * incorporating suggestions and some comments from code review * adding assert to ensure crse ratio is power of 2 * fix eol * cleaned code and added refine,coarsen for ba definition * fix eol * minor fix * Apply suggestions from code review Co-Authored-By: MaxThevenet <mthevenet@lbl.gov> * constexpr instead of const * add a comment clarifying ng=1 for tmp multifabs * eol fix Co-authored-by: Edoardo Zoni <ezoni@lbl.gov> Co-authored-by: MaxThevenet <mthevenet@lbl.gov> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp')
0 files changed, 0 insertions, 0 deletions