/* Copyright 2019 Remi Lehe, Edoardo Zoni * * This file is part of WarpX. * * License: BSD-3-Clause-LBNL */ #ifndef WARPX_SPECTRAL_BASE_ALGORITHM_H_ #define WARPX_SPECTRAL_BASE_ALGORITHM_H_ #include "FieldSolver/SpectralSolver/SpectralKSpace.H" #include "Utils/WarpX_Complex.H" #include "FieldSolver/SpectralSolver/SpectralFieldData_fwd.H" #include "FieldSolver/SpectralSolver/SpectralFieldData.H" #include #include #include #include #include #include #include #if WARPX_USE_PSATD /* \brief Class that updates the field in spectral space * and stores the coefficients of the corresponding update equation. * * `SpectralBaseAlgorithm` is only a base class and cannot be used directly. * Instead use its subclasses, which implement the specific field update * equations for a given spectral algorithm. */ class SpectralBaseAlgorithm { public: // Virtual member function ; meant to be overridden in subclasses virtual void pushSpectralFields(SpectralFieldData& f) const = 0; // The destructor should also be a virtual function, so that // a pointer to subclass of `SpectraBaseAlgorithm` actually // calls the subclass's destructor. virtual ~SpectralBaseAlgorithm() {} /** * \brief Virtual function for current correction in Fourier space * ( Vay et al, 2013). * This virtual function is pure and must be defined in derived classes. * * \param[in,out] field_data All fields in Fourier space * \param[in,out] current Array of unique pointers to \c MultiFab storing * the three components of the current density * \param[in] rho Unique pointer to \c MultiFab storing the charge density */ virtual void CurrentCorrection (const int lev, SpectralFieldData& field_data, std::array,3>& current, const std::unique_ptr& rho) = 0; /** * \brief Virtual function for Vay current deposition in Fourier space * ( Vay et al, 2013). * This virtual function is pure and must be defined in derived classes. * * \param[in,out] field_data All fields in Fourier space * \param[in,out] current Array of unique pointers to \c MultiFab storing * the three components of the current density */ virtual void VayDeposition (const int lev, SpectralFieldData& field_data, std::array,3>& current) = 0; /** * \brief Compute spectral divergence of E */ void ComputeSpectralDivE ( const int lev, SpectralFieldData& field_data, const std::array,3>& Efield, amrex::MultiFab& divE ); protected: // Meant to be used in the subclasses amrex::IntVect m_fill_guards; using SpectralRealCoefficients = \ amrex::FabArray< amrex::BaseFab >; using SpectralComplexCoefficients = \ amrex::FabArray< amrex::BaseFab >; /** * \brief Constructor */ 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); SpectralFieldIndex m_spectral_index; // Modified finite-order vectors KVectorComponent modified_kx_vec; #if (AMREX_SPACEDIM==3) KVectorComponent modified_ky_vec; #endif KVectorComponent modified_kz_vec; }; #endif // WARPX_USE_PSATD #endif // WARPX_SPECTRAL_BASE_ALGORITHM_H_ s/hackernews Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-11-19Fix blog example (#1910)Gravatar Matthew Phillips 1-1/+1
2021-11-19Version Packages (next) (#1907)astro@0.21.0-next.10Gravatar github-actions[bot] 23-21/+28
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-11-19Remove further dependence on vite package (#1906)Gravatar Matthew Phillips 3-5/+9
* Remove further dependence on vite package * Adds a changeset * Add graymatter as a regular dep
2021-11-19Version Packages (next) (#1904)astro@0.21.0-next.9Gravatar github-actions[bot] 23-21/+30
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-11-19Remove OSX \x00 workaround (#1901)Gravatar Matthew Phillips 2-5/+5
* Remove OSX \x00 workaround * Adds a changeset
2021-11-19Resolve vite client modules to vendored vite (#1903)Gravatar Matthew Phillips 2-2/+7
* Resolve vite client modules to vendored vite * Adds a changeset
2021-11-19[ci] yarn formatGravatar matthewp 1-3/+3
2021-11-19Add Debug tests (#1882)Gravatar Matthew Phillips 4-0/+62
* Make Debug use the Code component * Use a random port so parallel testing works * some debugging * Skip these tests for now * Dont run these tests on osx
2021-11-19[ci] collect statsGravatar FredKSchott 1-0/+1
2021-11-19Version Packages (next) (#1881)astro@0.21.0-next.8@astrojs/renderer-vue@0.2.0-next.2Gravatar github-actions[bot] 25-23/+42
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-11-18Improve HMR (#1896)Gravatar Drew Powers 2-10/+18
2021-11-18update depsGravatar Fred K. Schott 5-352/+65
2021-11-18fix #1778Gravatar Fred K. Schott 2-1/+8
2021-11-18Update compiler (#1869)Gravatar Nate Moore 3-11/+6
* chore: update compiler * redeploy * fix(www): ensure www can build * chore: update compiler Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2021-11-18remove unused remark dependency (#1894)Gravatar Fred K. Schott 2-245/+13
2021-11-18Improve error messages (#1875)Gravatar Drew Powers 39-61/+448
* Fix error handling in correct scope Also improve Vite IDs for better module graph lookups * Improve code frame * Add changeset * maybeLoc can be undefined * Add tests Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2021-11-18pin astro compiler to older versionGravatar Fred K. Schott 2-5/+5
2021-11-18Update yarn.lock to reflect the state of the package.json files (#1892)Gravatar Jonathan Neal 5-1300/+1000
* update dependencies * update file to fix build:all
2021-11-19[ci] yarn formatGravatar FredKSchott 1-5/+3