Block-Structured AMR Software Framework
amrex::ParticleInterpolator::Nearest Struct Reference

A class the implements nearest grid point particle/mesh interpolation. More...

#include <AMReX_ParticleInterpolators.H>

Inheritance diagram for amrex::ParticleInterpolator::Nearest:
amrex::ParticleInterpolator::Base< Nearest, int >

Public Member Functions

template<typename P >
AMREX_GPU_DEVICE AMREX_FORCE_INLINE Nearest (const P &p, amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &plo, amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &dxi)
 
- Public Member Functions inherited from amrex::ParticleInterpolator::Base< Nearest, int >
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void ParticleToMesh (const P &p, amrex::Array4< V > const &arr, int src_comp, int dst_comp, int num_comps, F const &f)
 A general function for doing particle-to-mesh interpolation for one particle. More...
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void MeshToParticle (P &p, amrex::Array4< const V > const &arr, int src_comp, int dst_comp, int num_comps, F const &f, G const &g)
 A general function for doing mesh-to-particle interpolation for one particle. More...
 

Public Attributes

int weights [3 *stencil_width]
 
- Public Attributes inherited from amrex::ParticleInterpolator::Base< Nearest, int >
int index [3]
 
int * w
 

Static Public Attributes

static constexpr int stencil_width = 1
 
static constexpr int nx = (AMREX_SPACEDIM >= 1) ? stencil_width - 1 : 0
 
static constexpr int ny = (AMREX_SPACEDIM >= 2) ? stencil_width - 1 : 0
 
static constexpr int nz = (AMREX_SPACEDIM >= 3) ? stencil_width - 1 : 0
 

Detailed Description

A class the implements nearest grid point particle/mesh interpolation.

Usage:

ParticleInterpolator::Nearest interp(p, plo, dxi);
interp.MeshToParticle(p, count, 0, 0, 1,
int i, int j, int k, int comp)
{
return arr(i, j, k, comp); // no weighting
},
[=] AMREX_GPU_DEVICE (MyParticleContainer::ParticleType& part,
int comp, int val)
{
part.idata(comp) = val;
});
#define AMREX_GPU_DEVICE
Definition: AMReX_GpuQualifiers.H:18
Definition: AMReX_Array4.H:61

Constructor & Destructor Documentation

◆ Nearest()

template<typename P >
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::ParticleInterpolator::Nearest::Nearest ( const P &  p,
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &  plo,
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &  dxi 
)
inline

Member Data Documentation

◆ nx

constexpr int amrex::ParticleInterpolator::Nearest::nx = (AMREX_SPACEDIM >= 1) ? stencil_width - 1 : 0
staticconstexpr

◆ ny

constexpr int amrex::ParticleInterpolator::Nearest::ny = (AMREX_SPACEDIM >= 2) ? stencil_width - 1 : 0
staticconstexpr

◆ nz

constexpr int amrex::ParticleInterpolator::Nearest::nz = (AMREX_SPACEDIM >= 3) ? stencil_width - 1 : 0
staticconstexpr

◆ stencil_width

constexpr int amrex::ParticleInterpolator::Nearest::stencil_width = 1
staticconstexpr

◆ weights

int amrex::ParticleInterpolator::Nearest::weights[3 *stencil_width]

The documentation for this struct was generated from the following file: