|
WarpX
|
#include <ExternalField.H>
Public Member Functions | |
| ExternalFieldReader (std::string read_fields_from_path, std::string F_name, std::string F_component, amrex::GpuArray< amrex::Real, 3 > const &problo, amrex::GpuArray< amrex::Real, 3 > const &pdx, amrex::Box const &dombox, bool distributed) | |
| Constructor. | |
| ExternalFieldView | getView (int li) const |
| Return lightweight view that can be used in kernels. | |
| ExternalFieldView | getView () const |
| Return lightweight view that can be used in kernels. | |
| void | prepare (amrex::BoxArray const &grids, amrex::DistributionMapping const &dmap, amrex::IntVect const &ngrow, std::function< amrex::Real(amrex::Real)> const &get_zlab=nullptr) |
This must be called before calling getView to prepare for loading distributed data. This is usually used during the initialization of particles and fields. | |
| void | prepare (amrex::RealBox const &pbox, int moving_dir, int moving_sign, std::function< amrex::Real(amrex::Real)> const &get_zlab=nullptr) |
| This needs to be called before loading data for moving window. | |
| bool | distributed () const |
| Is the data loaded distributedly? | |
Private Member Functions | |
| void | load_data (amrex::RealBox const &pbox) |
| Read data within this box. | |
| ExternalFieldView | make_view (amrex::BaseFab< double > const &fab) const |
| Used by getView to make ExternalFieldView. | |
| void | make_cache_box (amrex::RealBox const &pbox, int moving_dir, int moving_sign) |
Private Attributes | |
| std::string | m_file |
| std::string | m_name |
| OpenMPD file name. | |
| std::string | m_component |
| Field name. | |
| amrex::GpuArray< amrex::Real, 3 > | m_problo |
| Component name. | |
| amrex::GpuArray< amrex::Real, 3 > | m_probdx |
| WarpX's initial prob lo. | |
| amrex::Box | m_dombox |
| WarpX's cell size. | |
| bool | m_distributed = false |
| WarpX's initial domain. | |
| bool | m_moving_window = false |
| Is the data loaded distributedly? | |
| amrex::RealVect | m_dx |
| In moving window stage? | |
| amrex::RealVect | m_offset |
| amrex::IntVect | m_size |
| amrex::RealBox | m_domain |
| amrex::RealBox | m_cache_domain |
| std::shared_ptr< double > | m_FC_data_cpu |
| amrex::BaseFab< double > | m_fab |
| buffer in cpu memory for loading data | |
| amrex::FabArray< amrex::BaseFab< double > > | m_mf |
| data container for loaded data | |
OpenPMD field data reader
This reads an OpenPMD file for a given field. Then we can get a lightweight object ExternalFieldView that can be use in kernels. This class can be used for the initialization of particles and fields, and during moving window.
| ExternalFieldReader::ExternalFieldReader | ( | std::string | read_fields_from_path, |
| std::string | F_name, | ||
| std::string | F_component, | ||
| amrex::GpuArray< amrex::Real, 3 > const & | problo, | ||
| amrex::GpuArray< amrex::Real, 3 > const & | pdx, | ||
| amrex::Box const & | dombox, | ||
| bool | distributed ) |
|
inlinenodiscard |
Is the data loaded distributedly?
|
nodiscard |
Return lightweight view that can be used in kernels.
|
nodiscard |
Return lightweight view that can be used in kernels.
|
private |
Read data within this box.
|
private |
During the moving window stage, we cache the data for performance. This function makes a Box for caching.
|
nodiscardprivate |
Used by getView to make ExternalFieldView.
| void ExternalFieldReader::prepare | ( | amrex::BoxArray const & | grids, |
| amrex::DistributionMapping const & | dmap, | ||
| amrex::IntVect const & | ngrow, | ||
| std::function< amrex::Real(amrex::Real)> const & | get_zlab = nullptr ) |
This must be called before calling getView to prepare for loading distributed data. This is usually used during the initialization of particles and fields.
| [in] | grids | BoxArray of destionation ParticleContainer/MultiFab |
| [in] | dmap | DistributionMapping of destionation ParticleContainer/MultiFab |
| [in] | ngrow | number of ghost cells in destination MultiFab |
| [in] | get_zlab | optional function for transforming z-coordinates into lab frame |
| void ExternalFieldReader::prepare | ( | amrex::RealBox const & | pbox, |
| int | moving_dir, | ||
| int | moving_sign, | ||
| std::function< amrex::Real(amrex::Real)> const & | get_zlab = nullptr ) |
This needs to be called before loading data for moving window.
| [in] | pbox | target domain |
| [in] | moving_dir | moving window direction |
| [in] | moving_sign | positive or negative direction |
| [in] | get_zlab | optional function for transforming z-coordinates into lab frame |
|
private |
|
private |
Field name.
|
private |
WarpX's initial domain.
|
private |
|
private |
WarpX's cell size.
|
private |
In moving window stage?
|
private |
buffer in cpu memory for loading data
|
private |
|
private |
|
private |
data container for loaded data
|
private |
Is the data loaded distributedly?
|
private |
OpenMPD file name.
|
private |
|
private |
WarpX's initial prob lo.
|
private |
Component name.
|
private |