XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
ff_projection.cpp File Reference
#include "plane.hpp"
#include "grid_node_tr_mapping.hpp"
#include "particles.hpp"
#include "xgc_io.hpp"
#include "my_subview.hpp"
#include "send_recv_potential.hpp"
#include "ff_projection.hpp"
Include dependency graph for ff_projection.cpp:

Functions

KOKKOS_INLINE_FUNCTION void use_nearest_triangle (const Plane< DeviceType > &plane, const View< int **, CLayout, DeviceType > &tr_node, const SimdVector2D &x, bool weight_p_on_boundary, int i_simd, Simd< int > &itr, SimdGridVec &p_loc)
 
void project (const Plane< DeviceType > &plane_start, const Plane< DeviceType > &plane_dest, double phi_start, double phi_dest, const MagneticField< DeviceType > &magnetic_field, const View< int **, CLayout, DeviceType > &tr_node, bool weight_p_on_boundary, const View< int *, CLayout, DeviceType > &tr_d, const View< int **, CLayout, DeviceType > &nd_d, const View< double **, CLayout, DeviceType > &p_d, const View< double *, CLayout, DeviceType > &dx_d, bool use_two_step_method)
 
static void write_ff (const Plane< HostType > &plane_start, const Projection< HostType > &projection, const std::string stream_name, const std::string filename, bool reverse)
 
void ff_write_projections_to_file (const Plane< HostType > &midplane, const Plane< HostType > &lplane, const Plane< HostType > &rplane, const Projection< HostType > &half_plane_ff, const Projection< HostType > &ff_lplane_to_neighbors, const Projection< HostType > &ff_to_midplane)
 
void check_ff_property (const Projection< HostType > &projection, const std::string label)
 

Function Documentation

void check_ff_property ( const Projection< HostType > &  projection,
const std::string  label 
)

Here is the caller graph for this function:

void ff_write_projections_to_file ( const Plane< HostType > &  midplane,
const Plane< HostType > &  lplane,
const Plane< HostType > &  rplane,
const Projection< HostType > &  half_plane_ff,
const Projection< HostType > &  ff_lplane_to_neighbors,
const Projection< HostType > &  ff_to_midplane 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void project ( const Plane< DeviceType > &  plane_start,
const Plane< DeviceType > &  plane_dest,
double  phi_start,
double  phi_dest,
const MagneticField< DeviceType > &  magnetic_field,
const View< int **, CLayout, DeviceType > &  tr_node,
bool  weight_p_on_boundary,
const View< int *, CLayout, DeviceType > &  tr_d,
const View< int **, CLayout, DeviceType > &  nd_d,
const View< double **, CLayout, DeviceType > &  p_d,
const View< double *, CLayout, DeviceType > &  dx_d,
bool  use_two_step_method 
)

Initialize the field-aligned mapping between adjacent planes. The routine traces magnetic field lines from each vertex of a plane in both toroidal directions to the adjacent mid-planes and full-step planes, records the triangle in which the field line intersects these planes and the corresponding interpolation weights.

Parameters
[in]plane_startthe plane being projected from
[in]plane_destthe plane being projected to
[in]phi_startthe toroidal angle of the plane being projected from
[in]phi_destthe toroidal angle of the plane being projected to
[in]magnetic_fieldthe magnetic field for field following
[in]tr_nodethe triangle-to-node mapping of the destination plane
[in]weight_p_on_boundarywhether to weight the nearest node if the projection falls outside the grid
[out]tr_dthe triangles on the destination plane
[out]nd_dthe nodes on the destination plane
[out]p_dthe barycentric weights on the destination plane
[out]dx_ddistance traveled along the field line
[in]use_two_step_methodwhether to use an intermediate value to increase accuracy of dx

Here is the call graph for this function:

Here is the caller graph for this function:

KOKKOS_INLINE_FUNCTION void use_nearest_triangle ( const Plane< DeviceType > &  plane,
const View< int **, CLayout, DeviceType > &  tr_node,
const SimdVector2D x,
bool  weight_p_on_boundary,
int  i_simd,
Simd< int > &  itr,
SimdGridVec p_loc 
)

Find the nearest triangle and use it. This algorithm loops over ALL nodes - very inefficient! Should use wall nodes - or last surface if no wall is present

Parameters
[in]planethe plane
[in]tr_nodethe triangle-to-node mapping of the plane
[in]xthe coordinates on the plane
[in]weight_p_on_boundarywhether to weight the nearest node if the projection falls outside the grid
[in]i_simdthe simd index since this is a vectorized operation
[out]itrthe index of the nearest triangle
[out]p_locthe barycentric weights on the nearest triangle

Here is the call graph for this function:

Here is the caller graph for this function:

static void write_ff ( const Plane< HostType > &  plane_start,
const Projection< HostType > &  projection,
const std::string  stream_name,
const std::string  filename,
bool  reverse 
)
static

Here is the call graph for this function:

Here is the caller graph for this function: