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

Template class for the implementation g2pd method. More...

#include <particles_imp.h>

Public Member Functions

 g2pd_helper_t (const PVAR_t x_, const 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 dpropx_, PVAR_t dpropy_, 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 dpropx
PVAR_t dpropy
bool apply_mass

Detailed Description

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

Template class for the implementation g2pd method.

Definition at line 394 of file particles_imp.h.

Member Typedef Documentation

◆ idx_t

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

Definition at line 397 of file particles_imp.h.

Constructor & Destructor Documentation

◆ g2pd_helper_t()

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
g2pd_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::g2pd_helper_t ( const PVAR_t x_,
const 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 dpropx_,
PVAR_t dpropy_,
bool apply_mass_ )
inline

Definition at line 412 of file particles_imp.h.

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

Member Function Documentation

◆ operator()()

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

Definition at line 422 of file particles_imp.h.

422 {
423 using qgt = quadgrid_t<GVAR_t>;
424 real_t Nx = 0.0, Ny = 0.0;
425 auto xx = x[ip];
426 auto yy = y[ip];
429
430 for (idx_t inode = 0; inode < 4; ++inode) {
431 Nx = apply_mass ?
432 qgt::shg (xx, yy, 0, inode, c, r, hx, hy) * M[qgt::gt(inode, c, r, nrows)] :
433 qgt::shg (xx, yy, 0, inode, c, r, hx, hy);
434 Ny = apply_mass ?
435 qgt::shg (xx, yy, 1, inode, c, r, hx, hy) * M[qgt::gt(inode, c, r, nrows)] :
436 qgt::shg (xx, yy, 1, inode, c, r, hx, hy);
437 dpropx[ip] += Nx * gvar[qgt::gt(inode, c, r, nrows)];
438 dpropy[ip] += Ny * gvar[qgt::gt(inode, c, r, nrows)];
439
440 }
441 }
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 g2pd_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::apply_mass
private

Definition at line 408 of file particles_imp.h.

◆ dpropx

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
PVAR_t g2pd_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::dpropx
private

Definition at line 406 of file particles_imp.h.

◆ dpropy

template<typename GVAR_t, typename PVAR_t, typename P2C_t, typename GRIDM_t>
PVAR_t g2pd_helper_t< GVAR_t, PVAR_t, P2C_t, GRIDM_t >::dpropy
private

Definition at line 407 of file particles_imp.h.

◆ gvar

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

Definition at line 401 of file particles_imp.h.

◆ hx

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

Definition at line 404 of file particles_imp.h.

◆ hy

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

Definition at line 405 of file particles_imp.h.

◆ M

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

Definition at line 400 of file particles_imp.h.

◆ nrows

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

Definition at line 403 of file particles_imp.h.

◆ ptcl_to_grd

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

Definition at line 402 of file particles_imp.h.

◆ x

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

Definition at line 398 of file particles_imp.h.

◆ y

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

Definition at line 399 of file particles_imp.h.


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