ORB5X 1.0.0
Performance-portable global electromagnetic gyrokinetic PIC code
orb5x::Quadtree Class Reference

Applies local velocity-space smoothing to marker weights. More...

#include "quadtree.hpp"

Static Public Member Functions

static void quadtree_smoothing_conservative (Kokkos::View< Real ** > &part, int npart, Real pos1min, Real pos1max, Real pos2min, Real pos2max, Real sigma, int maxppc, bool do_2w, bool diagnose, Kokkos::View< int * > &diagnose_array)
 Smooth leaf groups while preserving three velocity moments.
 
static void quadtree_smoothing_non_conservative (Kokkos::View< Real ** > &part, int npart, Real pos1min, Real pos1max, Real pos2min, Real pos2max, Real hv, int maxppc)
 Smooth pairs of marker weights without moment constraints.
 

Detailed Description

Applies local velocity-space smoothing to marker weights.

Markers are adaptively binned in the \((v_\parallel,v_\perp)\) plane. The conservative path processes groups of four in each leaf and constructs replacement weights that preserve the local weighted particle number, parallel momentum, and kinetic-energy moments. The non-conservative path blends pairs toward their mean. In both cases the blend factor decays as a Gaussian of inter-marker distance.

The implementation stages Kokkos Views to the host while building and traversing its std::unique_ptr tree.

Fortran reference
quadtree.F90, module quadtree_mod, and quadtree_non_conservative.F90 for the pairwise variant.

Member Function Documentation

◆ quadtree_smoothing_conservative()

static void orb5x::Quadtree::quadtree_smoothing_conservative ( Kokkos::View< Real ** > &  part,
int  npart,
Real  pos1min,
Real  pos1max,
Real  pos2min,
Real  pos2max,
Real  sigma,
int  maxppc,
bool  do_2w,
bool  diagnose,
Kokkos::View< int * > &  diagnose_array 
)
static

Smooth leaf groups while preserving three velocity moments.

Parameters
[in,out]partMarker data [4][>=npart]: parallel velocity, perpendicular velocity, primary weight, and secondary weight.
[in]npartNumber of marker columns to insert.
[in]pos1minInclusive lower parallel-velocity bound.
[in]pos1maxInclusive upper parallel-velocity bound.
[in]pos2minInclusive lower perpendicular-velocity bound.
[in]pos2maxInclusive upper perpendicular-velocity bound.
[in]sigmaGaussian smoothing length in normalized velocity units.
[in]maxppcMaximum number of markers retained per leaf.
[in]do_2wSmooth the secondary weight as well as the primary weight.
[in]diagnoseAccumulate tree depth and leaf-count statistics.
[in,out]diagnose_arrayFour-element accumulator receiving sums of {depth, depth^2, leaves, leaves^2} when diagnose is true.
Fortran reference quadtree.F90: quadtree_smoothing.

◆ quadtree_smoothing_non_conservative()

static void orb5x::Quadtree::quadtree_smoothing_non_conservative ( Kokkos::View< Real ** > &  part,
int  npart,
Real  pos1min,
Real  pos1max,
Real  pos2min,
Real  pos2max,
Real  hv,
int  maxppc 
)
static

Smooth pairs of marker weights without moment constraints.

Parameters
[in,out]partMarker data [4][>=npart]: parallel velocity, perpendicular velocity, primary weight, and secondary weight.
[in]npartNumber of marker columns to insert.
[in]pos1minInclusive lower parallel-velocity bound.
[in]pos1maxInclusive upper parallel-velocity bound.
[in]pos2minInclusive lower perpendicular-velocity bound.
[in]pos2maxInclusive upper perpendicular-velocity bound.
[in]hvGaussian smoothing length in normalized velocity units.
[in]maxppcMaximum number of markers retained per leaf.
Fortran reference quadtree_non_conservative.F90: quadtree_smoothing.

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