XGCa
|
#include "timer_macro.hpp"
#include "domain_decomposition.hpp"
#include "globals.hpp"
#include "lagrange_weights.hpp"
#include "checkpoint.hpp"
#include "pseudo_inverse_diag.hpp"
#include "toroidal_average.hpp"
#include "view_arithmetic.hpp"
#include "distribute_f0g.hpp"
#include "petscdmplex.h"
#include "petscds.h"
#include "petscdmswarm.h"
#include "petscksp.h"
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< DeviceType > &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< DeviceType > &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< DeviceType > & | 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
[in] | sml | contains simulation control parameters |
[in] | grid | is the spatial grid |
[in] | magnetic_field | is the magnetic field |
[in] | plasma | contains all species info |
[in] | vgrid | contains the velocity grid dimensions |
[in] | pol_decomp | contains poloidal decomposition info |
[in] | pseudo_inv_dm | is the pseudo-inverse mesh object |
[in] | pseudo_inv | is the pseudo-inverse object (contains pseudo-inverse arrays) |
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< DeviceType > & | 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
[in] | sml | contains simulation control parameters |
[in] | grid | is the spatial grid |
[in] | magnetic_field | is the magnetic field |
[in,out] | species | contains species parameters and particles |
[in] | vgrid | contains the velocity grid dimensions |
[in] | pol_decomp | contains poloidal decomposition info |
[in] | pseudo_inv_dm | is the pseudo-inverse mesh object |
[in] | pseudo_inv | is the pseudo-inverse object (contains pseudo-inverse arrays) |
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
[in] | sml | contains simulation control parameters |
[in] | grid | is the spatial grid |
[in] | magnetic_field | is the magnetic field |
[in,out] | species | contains species parameters and particles |
[in] | vgrid | contains the velocity grid dimensions |
[in] | pol_decomp | contains poloidal decomposition info |
[in] | df0g | is the part of the distribution function being transferred to particles |
[in] | n | is the normalization for mesh-particle interpolation |
[out] | df0g_delete | tracks which cells successfully transferred their distribution to particles |
[in] | i_item | is the particle or particle vector index |
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)
[in] | sml | contains simulation control parameters |
[in] | grid | spatial grid object |
[in] | magnetic_field | magnetic field object |
[in,out] | species | contains species parameters and particles |
[in] | vgrid | contains the velocity grid dimensions |
[in] | pol_decomp | contains poloidal decomposition info |
[in] | df0g | is the part of the distribution function being transferred to particles |
[in] | df0g_h | host version of df0g |
[in] | n | is the normalization for mesh-particle interpolation |
[out] | df0g_delete | tracks which cells successfully transferred their distribution to particles |
[out] | df0g_delete_h | host version of df0g_delete |
[in] | pseudo_inv_dm | pseudo-inverse mesh object |
[in] | pseudo_inv | pseudo-inverse object (contains pseudo-inverse arrays) |