WarpX
Functions
ScalarFieldGather.H File Reference

Go to the source code of this file.

Functions

AMREX_GPU_HOST_DEVICE AMREX_INLINE void compute_weights_nodal (const amrex::ParticleReal xp, const amrex::ParticleReal yp, const amrex::ParticleReal zp, amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &plo, amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &dxi, int &i, int &j, int &k, amrex::Real W[AMREX_SPACEDIM][2]) noexcept
 Compute weight of each surrounding node in interpolating a nodal field to the given coordinates. More...
 
AMREX_GPU_HOST_DEVICE AMREX_INLINE amrex::Real interp_field_nodal (int i, int j, int k, const amrex::Real W[AMREX_SPACEDIM][2], amrex::Array4< const amrex::Real > const &scalar_field) noexcept
 Interpolate nodal field value based on surrounding indices and weights. More...
 
AMREX_GPU_HOST_DEVICE AMREX_INLINE amrex::Real doGatherScalarFieldNodal (const amrex::ParticleReal xp, const amrex::ParticleReal yp, const amrex::ParticleReal zp, amrex::Array4< const amrex::Real > const &scalar_field, amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &dxi, amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &lo) noexcept
 Scalar field gather for a single particle. The field has to be defined at the cell nodes (see https://amrex-codes.github.io/amrex/docs_html/Basics.html#id2) More...
 

Function Documentation

◆ compute_weights_nodal()

AMREX_GPU_HOST_DEVICE AMREX_INLINE void compute_weights_nodal ( const amrex::ParticleReal  xp,
const amrex::ParticleReal  yp,
const amrex::ParticleReal  zp,
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &  plo,
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &  dxi,
int &  i,
int &  j,
int &  k,
amrex::Real  W[AMREX_SPACEDIM][2] 
)
noexcept

Compute weight of each surrounding node in interpolating a nodal field to the given coordinates.

Parameters
xp,yp,zpParticle position coordinates
scalar_fieldArray4 of the nodal scalar field, either full array or tile.
ploIndex lower bounds of domain.
dxi3D cell spacing
i,j,pVariables to store indices of position on grid
W2D array of weights to store each neighbouring node

◆ doGatherScalarFieldNodal()

AMREX_GPU_HOST_DEVICE AMREX_INLINE amrex::Real doGatherScalarFieldNodal ( const amrex::ParticleReal  xp,
const amrex::ParticleReal  yp,
const amrex::ParticleReal  zp,
amrex::Array4< const amrex::Real > const &  scalar_field,
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &  dxi,
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &  lo 
)
noexcept

Scalar field gather for a single particle. The field has to be defined at the cell nodes (see https://amrex-codes.github.io/amrex/docs_html/Basics.html#id2)

Parameters
xp,yp,zpParticle position coordinates
scalar_fieldArray4 of the nodal scalar field, either full array or tile.
dxi3D cell spacing
loIndex lower bounds of domain.

◆ interp_field_nodal()

AMREX_GPU_HOST_DEVICE AMREX_INLINE amrex::Real interp_field_nodal ( int  i,
int  j,
int  k,
const amrex::Real  W[AMREX_SPACEDIM][2],
amrex::Array4< const amrex::Real > const &  scalar_field 
)
noexcept

Interpolate nodal field value based on surrounding indices and weights.

Parameters
i,j,pIndices of position on grid
W2D array of weights for each neighbouring node
scalar_fieldArray4 of the nodal scalar field, either full array or tile.