WarpX
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SpectralSolver Class Reference

Top-level class for the electromagnetic spectral solver. More...

#include <SpectralSolver.H>

Public Member Functions

 SpectralSolver (const amrex::BoxArray &realspace_ba, const amrex::DistributionMapping &dm, const int norder_x, const int norder_y, const int norder_z, const bool nodal, const amrex::Array< amrex::Real, 3 > &v_galilean, const amrex::RealVect dx, const amrex::Real dt, const bool pml=false, const bool periodic_single_box=false, const bool update_with_rho=false, const bool fft_do_time_averaging=false)
 
void ForwardTransform (const amrex::MultiFab &mf, const int field_index, const int i_comp=0)
 Transform the component i_comp of MultiFab mf to spectral space, and store the corresponding result internally (in the spectral field specified by field_index) More...
 
void BackwardTransform (amrex::MultiFab &mf, const int field_index, const int i_comp=0)
 Transform spectral field specified by field_index back to real space, and store it in the component i_comp of mf More...
 
void pushSpectralFields ()
 Update the fields in spectral space, over one timestep. More...
 
void ComputeSpectralDivE (const std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, amrex::MultiFab &divE)
 Public interface to call the member function ComputeSpectralDivE of the base class SpectralBaseAlgorithm from objects of class SpectralSolver. More...
 
void CurrentCorrection (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &current, const std::unique_ptr< amrex::MultiFab > &rho)
 Public interface to call the virtual function CurrentCorrection, defined in the base class SpectralBaseAlgorithm and possibly overridden by its derived classes (e.g. PsatdAlgorithm, GalileanAlgorithm), from objects of class SpectralSolver through the private unique pointer algorithm. More...
 
void VayDeposition (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &current)
 Public interface to call the virtual function VayDeposition, declared in the base class SpectralBaseAlgorithm and defined in its derived classes, from objects of class SpectralSolver through the private unique pointer algorithm. More...
 

Private Member Functions

void ReadParameters ()
 

Private Attributes

SpectralFieldData field_data
 
std::unique_ptr< SpectralBaseAlgorithmalgorithm
 

Detailed Description

Top-level class for the electromagnetic spectral solver.

Stores the field in spectral space, and has member functions to Fourier-transform the fields between real space and spectral space and to update fields in spectral space over one time step.

Constructor & Destructor Documentation

◆ SpectralSolver()

SpectralSolver::SpectralSolver ( const amrex::BoxArray &  realspace_ba,
const amrex::DistributionMapping &  dm,
const int  norder_x,
const int  norder_y,
const int  norder_z,
const bool  nodal,
const amrex::Array< amrex::Real, 3 > &  v_galilean,
const amrex::RealVect  dx,
const amrex::Real  dt,
const bool  pml = false,
const bool  periodic_single_box = false,
const bool  update_with_rho = false,
const bool  fft_do_time_averaging = false 
)

Member Function Documentation

◆ BackwardTransform()

void SpectralSolver::BackwardTransform ( amrex::MultiFab &  mf,
const int  field_index,
const int  i_comp = 0 
)

Transform spectral field specified by field_index back to real space, and store it in the component i_comp of mf

◆ ComputeSpectralDivE()

void SpectralSolver::ComputeSpectralDivE ( const std::array< std::unique_ptr< amrex::MultiFab >, 3 > &  Efield,
amrex::MultiFab &  divE 
)
inline

Public interface to call the member function ComputeSpectralDivE of the base class SpectralBaseAlgorithm from objects of class SpectralSolver.

◆ CurrentCorrection()

void SpectralSolver::CurrentCorrection ( std::array< std::unique_ptr< amrex::MultiFab >, 3 > &  current,
const std::unique_ptr< amrex::MultiFab > &  rho 
)
inline

Public interface to call the virtual function CurrentCorrection, defined in the base class SpectralBaseAlgorithm and possibly overridden by its derived classes (e.g. PsatdAlgorithm, GalileanAlgorithm), from objects of class SpectralSolver through the private unique pointer algorithm.

Parameters
[in,out]currentthree-dimensional array of unique pointers to MultiFab storing the three components of the current density
[in]rhounique pointer to MultiFab storing the charge density

◆ ForwardTransform()

void SpectralSolver::ForwardTransform ( const amrex::MultiFab &  mf,
const int  field_index,
const int  i_comp = 0 
)

Transform the component i_comp of MultiFab mf to spectral space, and store the corresponding result internally (in the spectral field specified by field_index)

◆ pushSpectralFields()

void SpectralSolver::pushSpectralFields ( )

Update the fields in spectral space, over one timestep.

◆ ReadParameters()

void SpectralSolver::ReadParameters ( )
private

◆ VayDeposition()

void SpectralSolver::VayDeposition ( std::array< std::unique_ptr< amrex::MultiFab >, 3 > &  current)
inline

Public interface to call the virtual function VayDeposition, declared in the base class SpectralBaseAlgorithm and defined in its derived classes, from objects of class SpectralSolver through the private unique pointer algorithm.

Parameters
[in,out]currentArray of unique pointers to MultiFab storing the three components of the current density

Member Data Documentation

◆ algorithm

std::unique_ptr<SpectralBaseAlgorithm> SpectralSolver::algorithm
private

◆ field_data

SpectralFieldData SpectralSolver::field_data
private

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