XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
distribute_f0g.cpp File Reference
#include "timer_macro.hpp"
#include "domain_decomposition.hpp"
#include "globals.hpp"
#include "lagrange_weights.hpp"
#include "checkpoint.hpp"
#include "pseudo_inverse_diag.hpp"
#include "view_arithmetic.hpp"
#include "distribute_f0g.hpp"
#include "petscdmplex.h"
#include "petscds.h"
#include "petscdmswarm.h"
#include "petscksp.h"
Include dependency graph for distribute_f0g.cpp:

Functions

template<class Device >
KOKKOS_INLINE_FUNCTION void distribute_f0g_c (const Simulation< Device > &sml, const Grid< Device > &grid, const MagneticField< Device > &magnetic_field, const Species< Device > &species, const VelocityGrid &vgrid, const DomainDecomposition< Device > &pol_decomp, const View< double ***, CLayout, DeviceType > &df0g, const View< double ***, CLayout, DeviceType > &n, const View< double ***, CLayout, DeviceType > &df0g_delete, int i_item)
 
void distribute_f0g_c_pseudo_inv (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const Species< DeviceType > &species, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, const View< double ***, CLayout, DeviceType > &df0g, const View< double ***, CLayout, Kokkos::HostSpace > df0g_h, const View< double ***, CLayout, DeviceType > &n, const View< double ***, CLayout, DeviceType > &df0g_delete, const View< double ***, CLayout, Kokkos::HostSpace > df0g_delete_h, DMWrapper &pseudo_inv_dm, Pseudo_inverse< DeviceType > &pseudo_inv, PseudoInvDiagnostics &pseudo_inv_diag)
 
void distribute_f0g (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Species< DeviceType > &species, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, DMWrapper &pseudo_inv_dm, Pseudo_inverse< DeviceType > &pseudo_inv, VGridDistribution< HostType > &f0_n, VGridDistribution< HostType > &f0_df0g, PseudoInvDiagnostics &pseudo_inv_diag)
 
void all_species_distribute_f0g (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, Plasma &plasma, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, DMWrapper &pseudo_inv_dm, Pseudo_inverse< DeviceType > &pseudo_inv, VGridDistribution< HostType > &f0_n, VGridDistribution< HostType > &f0_df0g, PseudoInvDiagnostics &pseudo_inv_diag)
 

Function Documentation

void all_species_distribute_f0g ( const Simulation< DeviceType > &  sml,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
Plasma plasma,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp,
DMWrapper pseudo_inv_dm,
Pseudo_inverse< DeviceType > &  pseudo_inv,
VGridDistribution< HostType > &  f0_n,
VGridDistribution< HostType > &  f0_df0g,
PseudoInvDiagnostics pseudo_inv_diag 
)

Loops over all non-adiabatic species and adjusts particle weight to distribute f0g distribution function to particles

Parameters
[in]smlcontains simulation control parameters
[in]gridis the spatial grid
[in]magnetic_fieldis the magnetic field
[in]plasmacontains all species info
[in]vgridcontains the velocity grid dimensions
[in]pol_decompcontains poloidal decomposition info
[in]pseudo_inv_dmis the pseudo-inverse mesh object
[in]pseudo_invis the pseudo-inverse object (contains pseudo-inverse arrays)
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function:

void distribute_f0g ( const Simulation< DeviceType > &  sml,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
Species< DeviceType > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp,
DMWrapper pseudo_inv_dm,
Pseudo_inverse< DeviceType > &  pseudo_inv,
VGridDistribution< HostType > &  f0_n,
VGridDistribution< HostType > &  f0_df0g,
PseudoInvDiagnostics pseudo_inv_diag 
)

Copies f0 data to device, then adjusts particle weight to distribute f0g distribution function to particles

Parameters
[in]smlcontains simulation control parameters
[in]gridis the spatial grid
[in]magnetic_fieldis the magnetic field
[in,out]speciescontains species parameters and particles
[in]vgridcontains the velocity grid dimensions
[in]pol_decompcontains poloidal decomposition info
[in]pseudo_inv_dmis the pseudo-inverse mesh object
[in]pseudo_invis the pseudo-inverse object (contains pseudo-inverse arrays)
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Device >
KOKKOS_INLINE_FUNCTION void distribute_f0g_c ( const Simulation< Device > &  sml,
const Grid< Device > &  grid,
const MagneticField< Device > &  magnetic_field,
const Species< Device > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< Device > &  pol_decomp,
const View< double ***, CLayout, DeviceType > &  df0g,
const View< double ***, CLayout, DeviceType > &  n,
const View< double ***, CLayout, DeviceType > &  df0g_delete,
int  i_item 
)

Adjusts particle weight to distribute f0g distribution function to particles, and marks cells for deletion if a particle is found there

Parameters
[in]smlcontains simulation control parameters
[in]gridis the spatial grid
[in]magnetic_fieldis the magnetic field
[in,out]speciescontains species parameters and particles
[in]vgridcontains the velocity grid dimensions
[in]pol_decompcontains poloidal decomposition info
[in]df0gis the part of the distribution function being transferred to particles
[in]nis the normalization for mesh-particle interpolation
[out]df0g_deletetracks which cells successfully transferred their distribution to particles
[in]i_itemis the particle or particle vector index
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function:

void distribute_f0g_c_pseudo_inv ( const Simulation< DeviceType > &  sml,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const Species< DeviceType > &  species,
const VelocityGrid vgrid,
const DomainDecomposition< DeviceType > &  pol_decomp,
const View< double ***, CLayout, DeviceType > &  df0g,
const View< double ***, CLayout, Kokkos::HostSpace >  df0g_h,
const View< double ***, CLayout, DeviceType > &  n,
const View< double ***, CLayout, DeviceType > &  df0g_delete,
const View< double ***, CLayout, Kokkos::HostSpace >  df0g_delete_h,
DMWrapper pseudo_inv_dm,
Pseudo_inverse< DeviceType > &  pseudo_inv,
PseudoInvDiagnostics pseudo_inv_diag 
)

Adjusts particle weight to distribute f0g distribution function to particles, and marks cells for deletion if a particle is found there, pseudo-inverse version. (Implementation based on PETSc v3.17.0 example petsc/src/dm/impls/swarm/tests/ex7.c)

Parameters
[in]smlcontains simulation control parameters
[in]gridspatial grid object
[in]magnetic_fieldmagnetic field object
[in,out]speciescontains species parameters and particles
[in]vgridcontains the velocity grid dimensions
[in]pol_decompcontains poloidal decomposition info
[in]df0gis the part of the distribution function being transferred to particles
[in]df0g_hhost version of df0g
[in]nis the normalization for mesh-particle interpolation
[out]df0g_deletetracks which cells successfully transferred their distribution to particles
[out]df0g_delete_hhost version of df0g_delete
[in]pseudo_inv_dmpseudo-inverse mesh object
[in]pseudo_invpseudo-inverse object (contains pseudo-inverse arrays)
Returns
void

Here is the call graph for this function:

Here is the caller graph for this function: