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

#include <PsatdAlgorithm.H>

Inheritance diagram for PsatdAlgorithm:
SpectralBaseAlgorithm

Public Member Functions

 PsatdAlgorithm (const SpectralKSpace &spectral_kspace, const amrex::DistributionMapping &dm, const SpectralFieldIndex &spectral_index, const int norder_x, const int norder_y, const int norder_z, const bool nodal, const amrex::IntVect &fill_guards, const amrex::Array< amrex::Real, 3 > &v_galilean, const amrex::Real dt, const bool update_with_rho, const bool time_averaging, const bool J_linear_in_time, const bool dive_cleaning, const bool divb_cleaning)
 Constructor of the class PsatdAlgorithm. More...
 
virtual void pushSpectralFields (SpectralFieldData &f) const override final
 Updates the E and B fields in spectral space, according to the relevant PSATD equations. More...
 
void InitializeSpectralCoefficients (const SpectralKSpace &spectral_kspace, const amrex::DistributionMapping &dm, const amrex::Real dt)
 Initializes the coefficients used in pushSpectralFields to update the E and B fields. More...
 
void InitializeSpectralCoefficientsAvgLin (const SpectralKSpace &spectral_kspace, const amrex::DistributionMapping &dm, const amrex::Real dt)
 Initialize additional coefficients used in pushSpectralFields to update E,B, required only when using time averaging with the assumption that J is linear in time. More...
 
void InitializeSpectralCoefficientsAveraging (const SpectralKSpace &spectral_kspace, const amrex::DistributionMapping &dm, const amrex::Real dt)
 Initializes additional coefficients used in pushSpectralFields to update the E and B fields, required only when using time averaging with large time steps. More...
 
virtual void CurrentCorrection (const int lev, SpectralFieldData &field_data, std::array< std::unique_ptr< amrex::MultiFab >, 3 > &current, const std::unique_ptr< amrex::MultiFab > &rho) override final
 Virtual function for current correction in Fourier space (Vay et al, 2013). This function overrides the virtual function CurrentCorrection in the base class SpectralBaseAlgorithm and cannot be overridden by further derived classes. More...
 
virtual void VayDeposition (const int lev, SpectralFieldData &field_data, std::array< std::unique_ptr< amrex::MultiFab >, 3 > &current) override final
 Virtual function for Vay current deposition in Fourier space (Vay et al, 2013). This function overrides the virtual function VayDeposition in the base class SpectralBaseAlgorithm and cannot be overridden by further derived classes. More...
 
- Public Member Functions inherited from SpectralBaseAlgorithm
virtual ~SpectralBaseAlgorithm ()
 
void ComputeSpectralDivE (const int lev, SpectralFieldData &field_data, const std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, amrex::MultiFab &divE)
 Compute spectral divergence of E. More...
 

Private Attributes

SpectralRealCoefficients C_coef
 
SpectralRealCoefficients S_ck_coef
 
SpectralComplexCoefficients T2_coef
 
SpectralComplexCoefficients X1_coef
 
SpectralComplexCoefficients X2_coef
 
SpectralComplexCoefficients X3_coef
 
SpectralComplexCoefficients X4_coef
 
SpectralComplexCoefficients X5_coef
 
SpectralComplexCoefficients X6_coef
 
SpectralComplexCoefficients Psi1_coef
 
SpectralComplexCoefficients Psi2_coef
 
SpectralComplexCoefficients Y1_coef
 
SpectralComplexCoefficients Y2_coef
 
SpectralComplexCoefficients Y3_coef
 
SpectralComplexCoefficients Y4_coef
 
SpectralFieldIndex m_spectral_index
 
KVectorComponent modified_kx_vec_centered
 
KVectorComponent modified_ky_vec_centered
 
KVectorComponent modified_kz_vec_centered
 
amrex::Array< amrex::Real, 3 > m_v_galilean
 
amrex::Real m_dt
 
bool m_update_with_rho
 
bool m_time_averaging
 
bool m_J_linear_in_time
 
bool m_dive_cleaning
 
bool m_divb_cleaning
 
bool m_is_galilean
 

Additional Inherited Members

- Protected Types inherited from SpectralBaseAlgorithm
using SpectralRealCoefficients = amrex::FabArray< amrex::BaseFab< amrex::Real > >
 
using SpectralComplexCoefficients = amrex::FabArray< amrex::BaseFab< Complex > >
 
- Protected Member Functions inherited from SpectralBaseAlgorithm
 SpectralBaseAlgorithm (const SpectralKSpace &spectral_kspace, const amrex::DistributionMapping &dm, const SpectralFieldIndex &spectral_index, const int norder_x, const int norder_y, const int norder_z, const bool nodal, const amrex::IntVect &fill_guards)
 Constructor. More...
 
- Protected Attributes inherited from SpectralBaseAlgorithm
amrex::IntVect m_fill_guards
 
SpectralFieldIndex m_spectral_index
 
KVectorComponent modified_kx_vec
 
KVectorComponent modified_ky_vec
 
KVectorComponent modified_kz_vec
 

Constructor & Destructor Documentation

◆ PsatdAlgorithm()

PsatdAlgorithm::PsatdAlgorithm ( const SpectralKSpace spectral_kspace,
const amrex::DistributionMapping &  dm,
const SpectralFieldIndex spectral_index,
const int  norder_x,
const int  norder_y,
const int  norder_z,
const bool  nodal,
const amrex::IntVect &  fill_guards,
const amrex::Array< amrex::Real, 3 > &  v_galilean,
const amrex::Real  dt,
const bool  update_with_rho,
const bool  time_averaging,
const bool  J_linear_in_time,
const bool  dive_cleaning,
const bool  divb_cleaning 
)

Constructor of the class PsatdAlgorithm.

Parameters
[in]spectral_kspacespectral space
[in]dmdistribution mapping
[in]spectral_indexobject containing indices to access data in spectral space
[in]norder_xorder of the spectral solver along x
[in]norder_yorder of the spectral solver along y
[in]norder_zorder of the spectral solver along z
[in]nodalwhether the E and B fields are defined on a fully nodal grid or a Yee grid
[in]v_galileanGalilean velocity (three-dimensional array)
[in]dttime step of the simulation
[in]update_with_rhowhether the update equation for E uses rho or not
[in]time_averagingwhether to use time averaging for large time steps
[in]J_linear_in_timewhether to use two currents computed at the beginning and the end of the time interval (instead of using one current computed at half time)

Member Function Documentation

◆ CurrentCorrection()

void PsatdAlgorithm::CurrentCorrection ( const int  lev,
SpectralFieldData field_data,
std::array< std::unique_ptr< amrex::MultiFab >, 3 > &  current,
const std::unique_ptr< amrex::MultiFab > &  rho 
)
finaloverridevirtual

Virtual function for current correction in Fourier space (Vay et al, 2013). This function overrides the virtual function CurrentCorrection in the base class SpectralBaseAlgorithm and cannot be overridden by further derived classes.

Parameters
[in,out]field_dataAll fields in Fourier space
[in,out]currentArray of unique pointers to MultiFab storing the three components of the current density
[in]rhoUnique pointer to MultiFab storing the charge density

Implements SpectralBaseAlgorithm.

◆ InitializeSpectralCoefficients()

void PsatdAlgorithm::InitializeSpectralCoefficients ( const SpectralKSpace spectral_kspace,
const amrex::DistributionMapping &  dm,
const amrex::Real  dt 
)

Initializes the coefficients used in pushSpectralFields to update the E and B fields.

Parameters
[in]spectral_kspacespectral space
[in]dmdistribution mapping
[in]dttime step of the simulation

◆ InitializeSpectralCoefficientsAveraging()

void PsatdAlgorithm::InitializeSpectralCoefficientsAveraging ( const SpectralKSpace spectral_kspace,
const amrex::DistributionMapping &  dm,
const amrex::Real  dt 
)

Initializes additional coefficients used in pushSpectralFields to update the E and B fields, required only when using time averaging with large time steps.

Parameters
[in]spectral_kspacespectral space
[in]dmdistribution mapping
[in]dttime step of the simulation

◆ InitializeSpectralCoefficientsAvgLin()

void PsatdAlgorithm::InitializeSpectralCoefficientsAvgLin ( const SpectralKSpace spectral_kspace,
const amrex::DistributionMapping &  dm,
const amrex::Real  dt 
)

Initialize additional coefficients used in pushSpectralFields to update E,B, required only when using time averaging with the assumption that J is linear in time.

Parameters
[in]spectral_kspacespectral space
[in]dmdistribution mapping
[in]dttime step of the simulation

◆ pushSpectralFields()

void PsatdAlgorithm::pushSpectralFields ( SpectralFieldData f) const
finaloverridevirtual

Updates the E and B fields in spectral space, according to the relevant PSATD equations.

Parameters
[in,out]fall the fields in spectral space

Implements SpectralBaseAlgorithm.

◆ VayDeposition()

void PsatdAlgorithm::VayDeposition ( const int  lev,
SpectralFieldData field_data,
std::array< std::unique_ptr< amrex::MultiFab >, 3 > &  current 
)
finaloverridevirtual

Virtual function for Vay current deposition in Fourier space (Vay et al, 2013). This function overrides the virtual function VayDeposition in the base class SpectralBaseAlgorithm and cannot be overridden by further derived classes.

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

Implements SpectralBaseAlgorithm.

Member Data Documentation

◆ C_coef

SpectralRealCoefficients PsatdAlgorithm::C_coef
private

◆ m_divb_cleaning

bool PsatdAlgorithm::m_divb_cleaning
private

◆ m_dive_cleaning

bool PsatdAlgorithm::m_dive_cleaning
private

◆ m_dt

amrex::Real PsatdAlgorithm::m_dt
private

◆ m_is_galilean

bool PsatdAlgorithm::m_is_galilean
private

◆ m_J_linear_in_time

bool PsatdAlgorithm::m_J_linear_in_time
private

◆ m_spectral_index

SpectralFieldIndex PsatdAlgorithm::m_spectral_index
private

◆ m_time_averaging

bool PsatdAlgorithm::m_time_averaging
private

◆ m_update_with_rho

bool PsatdAlgorithm::m_update_with_rho
private

◆ m_v_galilean

amrex::Array<amrex::Real,3> PsatdAlgorithm::m_v_galilean
private

◆ modified_kx_vec_centered

KVectorComponent PsatdAlgorithm::modified_kx_vec_centered
private

◆ modified_ky_vec_centered

KVectorComponent PsatdAlgorithm::modified_ky_vec_centered
private

◆ modified_kz_vec_centered

KVectorComponent PsatdAlgorithm::modified_kz_vec_centered
private

◆ Psi1_coef

SpectralComplexCoefficients PsatdAlgorithm::Psi1_coef
private

◆ Psi2_coef

SpectralComplexCoefficients PsatdAlgorithm::Psi2_coef
private

◆ S_ck_coef

SpectralRealCoefficients PsatdAlgorithm::S_ck_coef
private

◆ T2_coef

SpectralComplexCoefficients PsatdAlgorithm::T2_coef
private

◆ X1_coef

SpectralComplexCoefficients PsatdAlgorithm::X1_coef
private

◆ X2_coef

SpectralComplexCoefficients PsatdAlgorithm::X2_coef
private

◆ X3_coef

SpectralComplexCoefficients PsatdAlgorithm::X3_coef
private

◆ X4_coef

SpectralComplexCoefficients PsatdAlgorithm::X4_coef
private

◆ X5_coef

SpectralComplexCoefficients PsatdAlgorithm::X5_coef
private

◆ X6_coef

SpectralComplexCoefficients PsatdAlgorithm::X6_coef
private

◆ Y1_coef

SpectralComplexCoefficients PsatdAlgorithm::Y1_coef
private

◆ Y2_coef

SpectralComplexCoefficients PsatdAlgorithm::Y2_coef
private

◆ Y3_coef

SpectralComplexCoefficients PsatdAlgorithm::Y3_coef
private

◆ Y4_coef

SpectralComplexCoefficients PsatdAlgorithm::Y4_coef
private

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