XGCa
|
#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"
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) |
void check_ff_property | ( | const Projection< HostType > & | projection, |
const std::string | label | ||
) |
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 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.
[in] | plane_start | the plane being projected from |
[in] | plane_dest | the plane being projected to |
[in] | phi_start | the toroidal angle of the plane being projected from |
[in] | phi_dest | the toroidal angle of the plane being projected to |
[in] | magnetic_field | the magnetic field for field following |
[in] | tr_node | the triangle-to-node mapping of the destination plane |
[in] | weight_p_on_boundary | whether to weight the nearest node if the projection falls outside the grid |
[out] | tr_d | the triangles on the destination plane |
[out] | nd_d | the nodes on the destination plane |
[out] | p_d | the barycentric weights on the destination plane |
[out] | dx_d | distance traveled along the field line |
[in] | use_two_step_method | whether to use an intermediate value to increase accuracy of dx |
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
[in] | plane | the plane |
[in] | tr_node | the triangle-to-node mapping of the plane |
[in] | x | the coordinates on the plane |
[in] | weight_p_on_boundary | whether to weight the nearest node if the projection falls outside the grid |
[in] | i_simd | the simd index since this is a vectorized operation |
[out] | itr | the index of the nearest triangle |
[out] | p_loc | the barycentric weights on the nearest triangle |
|
static |