Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
Public Member Functions | List of all members
HenryPeriodic Class Reference

Generic distributed-memory 3D FFT filter. More...

#include <HenryPeriodic.hpp>

Public Member Functions

 HenryPeriodic (const int n[3], const double lo[3], const double hi[3], const int m[3], const int id[3])
 
size_t bytes () const
 
template<typename F >
void filter (const size_t bytes, double *const before, double *const after, const F f) const
 

Detailed Description

Generic distributed-memory 3D FFT filter.

Constructor & Destructor Documentation

◆ HenryPeriodic()

HenryPeriodic::HenryPeriodic ( const int  n[3],
const double  lo[3],
const double  hi[3],
const int  m[3],
const int  id[3] 
)
Parameters
[in]n[3]{ Global number of cells in each dimension, without ghost cells. }
[in]lo[3]{ Physical location of the global lower bound of each dimension. }
[in]hi[3]{ Physical location of the global upper bound of each dimension, minus one grid cell. The one-cell difference is because of the periodic domain. See PotentialParis3D::Initialize for an example computation of these arguments. }
[in]m[3]{ Number of MPI tasks in each dimension. }
[in]id[3]{ Coordinates of this MPI task, starting at {0,0,0}. }

Member Function Documentation

◆ bytes()

size_t HenryPeriodic::bytes ( ) const
inline
Returns
{ Number of bytes needed for array arguments for filter. }

◆ filter()

template<typename F >
void HenryPeriodic::filter ( const size_t  bytes,
double *const  before,
double *const  after,
const F  f 
) const

@detail { Performs a 3D FFT on the real input field, applies the provided filter in frequency space, and perform the inverse 3D FFT. Expects fields in 3D block distribution with no ghost cells. }

Template Parameters
F{ Type of functor that will applied in frequency space. Should be resolved implicitly by the compiler. }
Parameters
[in]bytes{ Number of bytes allocated for arguments before and after. Used to ensure that the arrays have enough extra work space. }
[in,out]before{ Input field for filtering. Modified as a work array. Must be at least bytes() bytes, likely larger than the original field. }
[out]after{ Output field, filtered. Modified as a work array. Must be at least bytes() bytes, likely larger than the actual output field. }
[in]f{ Functor or lambda function to be used as a filter. The operator should have the following prototype.
complex f(int i, int j, int k, complex before)
Arguments i, j, and k are the frequency-space coordinates. Argument before is the input value at those indices, after the FFT. The function should return the filtered value. }

The documentation for this class was generated from the following file: