quadgrid 0.1
simple cartesian quad grid with particles for c++/octave
Loading...
Searching...
No Matches
g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t > Class Template Reference

Template class for the implementation of the g2p method. More...

#include <particles_imp.h>

Public Member Functions

 g2p_helper_t (const PVAR_t x_, const PVAR_t y_, GRIDM_t M_, const GVAR_t gvar_, const P2C_t ptcl_to_grd_, const idx_t nrows_, const real_t hx_, const real_t hy_, PVAR_t dprop_, bool apply_mass_)
DEVICE void operator() (idx_t ip)

Private Types

using idx_t = particles_t::idx_t

Private Attributes

PVAR_t x
PVAR_t y
const GRIDM_t M
const GVAR_t gvar
const P2C_t ptcl_to_grd
const idx_t nrows
const real_t hx
const real_t hy
PVAR_t dprop
bool apply_mass

Detailed Description

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
class g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >

Template class for the implementation of the g2p method.

Definition at line 279 of file particles_imp.h.

Member Typedef Documentation

◆ idx_t

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
using g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::idx_t = particles_t::idx_t
private

Definition at line 282 of file particles_imp.h.

Constructor & Destructor Documentation

◆ g2p_helper_t()

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::g2p_helper_t ( const PVAR_t x_,
const PVAR_t y_,
GRIDM_t M_,
const GVAR_t gvar_,
const P2C_t ptcl_to_grd_,
const idx_t nrows_,
const real_t hx_,
const real_t hy_,
PVAR_t dprop_,
bool apply_mass_ )
inline

Definition at line 296 of file particles_imp.h.

299 : x(x_), y(y_), M(M_), gvar(gvar_),
Template class for the implementation of the g2p method.
const idx_t nrows
const P2C_t ptcl_to_grd
const real_t hy
const GVAR_t gvar
const real_t hx
const GRIDM_t M

Member Function Documentation

◆ operator()()

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
DEVICE void g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::operator() ( idx_t ip)
inline

Definition at line 305 of file particles_imp.h.

305 {
306 using qgt = quadgrid_t<GVAR_t>;
307 real_t N = 0.0;
308 auto xx = x[ip];
309 auto yy = y[ip];
312 dprop[ip] = 0.;
313 for (idx_t inode = 0; inode < 4; ++inode) {
314 N = apply_mass ? qgt::shp (xx, yy, inode, c, r, hx, hy) * M[qgt::gt(inode, c, r, nrows)] :
315 qgt::shp (xx, yy, inode, c, r, hx, hy);
316 dprop[ip] += N * gvar[qgt::gt(inode, c, r, nrows)];
317 }
318 }
particles_t::idx_t idx_t

Member Data Documentation

◆ apply_mass

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
bool g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::apply_mass
private

Definition at line 292 of file particles_imp.h.

◆ dprop

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
PVAR_t g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::dprop
private

Definition at line 291 of file particles_imp.h.

◆ gvar

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
const GVAR_t g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::gvar
private

Definition at line 286 of file particles_imp.h.

◆ hx

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
const real_t g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::hx
private

Definition at line 289 of file particles_imp.h.

◆ hy

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
const real_t g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::hy
private

Definition at line 290 of file particles_imp.h.

◆ M

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
const GRIDM_t g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::M
private

Definition at line 285 of file particles_imp.h.

◆ nrows

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
const idx_t g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::nrows
private

Definition at line 288 of file particles_imp.h.

◆ ptcl_to_grd

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
const P2C_t g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::ptcl_to_grd
private

Definition at line 287 of file particles_imp.h.

◆ x

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
PVAR_t g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::x
private

Definition at line 283 of file particles_imp.h.

◆ y

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
PVAR_t g2p_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::y
private

Definition at line 284 of file particles_imp.h.


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