Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
cpu_acc_intersections.cpp File Reference
#include <algorithm>
#include <cmath>
#include <utility>
#include <Eigen/Geometry>
#include "../common.h"
#include "cpu_acc_intersections.hpp"
#include "cpu_acc_transform.hpp"
Include dependency graph for cpu_acc_intersections.cpp:

Go to the source code of this file.

Functions

void compute_cell_intersections (spatial_cell::SpatialCell *spatial_cell, const uint popID, const uint map_order, const Real &dt, int intersections_id)
Eigen::Matrix< Real, 3, 1 > line_plane_intersection (const Eigen::Matrix< Real, 3, 1 > &l_point, const Eigen::Matrix< Real, 3, 1 > &l_direction, const Eigen::Matrix< Real, 3, 1 > &p_point, const Eigen::Matrix< Real, 3, 1 > &p_normal)
void compute_intersections_1st (const vmesh::VelocityMesh *vmesh, const Transform< Real, 3, Affine > &bwd_transform, const Transform< Real, 3, Affine > &fwd_transform, const uint dimension, Real &intersection, Real &intersection_di, Real &intersection_dj, Real &intersection_dk)
void compute_intersections_2nd (const vmesh::VelocityMesh *vmesh, const Transform< Real, 3, Affine > &bwd_transform, const Transform< Real, 3, Affine > &fwd_transform, const uint dimension, Real &intersection, Real &intersection_di, Real &intersection_dj, Real &intersection_dk)
void compute_intersections_3rd (const vmesh::VelocityMesh *vmesh, const Transform< Real, 3, Affine > &bwd_transform, const Transform< Real, 3, Affine > &fwd_transform, const uint dimension, Real &intersection, Real &intersection_di, Real &intersection_dj, Real &intersection_dk)

Function Documentation

◆ compute_cell_intersections()

void compute_cell_intersections ( spatial_cell::SpatialCell * spatial_cell,
const uint popID,
const uint map_order,
const Real & dt,
int intersections_id )

Wrapper for computing all rotation intersections for a single cycle of acceleration for a given spatial cell

Parameters
spatial_cellSpatial cell to compute
popIDActive population
map_orderorder in which to perform Cartesian shears, randomized from time step
dtLength of current time step or substep
intersections_idPhiprof identifier for timer inside parallel region

Definition at line 44 of file cpu_acc_intersections.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_intersections_1st()

void compute_intersections_1st ( const vmesh::VelocityMesh * vmesh,
const Transform< Real, 3, Affine > & bwd_transform,
const Transform< Real, 3, Affine > & fwd_transform,
const uint dimension,
Real & intersection,
Real & intersection_di,
Real & intersection_dj,
Real & intersection_dk )

Computes the first intersection data; this is z~ in section 2.4 in Zerroukat et al (2012). We assume all velocity cells have the same dimensions. Intersection z coordinate for (i,j,k) is: intersection + i * intersection_di + j * intersection_dj + k * intersection_dk

Parameters
spatial_cellspatial cell that is accelerated
fwd_transformTransform that describes acceleration forward in time
bwd_transformTransform that describes acceleration backward in time, used to compute the lagrangian departure gri
dimensionAlong which dimension is this intersection/mapping computation done. It is assumed the three mappings are in order 012, 120 or 201
intersectionIntersection z coordinate at i,j,k=0
intersection_diChange in z-coordinate for a change in i index of 1
intersection_djChange in z-coordinate for a change in j index of 1
intersection_dkChange in z-coordinate for a change in k index of 1

Definition at line 132 of file cpu_acc_intersections.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_intersections_2nd()

void compute_intersections_2nd ( const vmesh::VelocityMesh * vmesh,
const Transform< Real, 3, Affine > & bwd_transform,
const Transform< Real, 3, Affine > & fwd_transform,
const uint dimension,
Real & intersection,
Real & intersection_di,
Real & intersection_dj,
Real & intersection_dk )

Computes the second intersection data; this is x~ in section 2.4 in Zerroukat et al (2012). We assume all velocity cells have the same dimensions. Intersection x coordinate for (i,j,k) is: intersection + i * intersection_di + j * intersection_dj + k * intersection_dk

Parameters
spatial_cellspatial cell that is accelerated
fwd_transformTransform that describes acceleration forward in time
bwd_transformTransform that describes acceleration backward in time, used to compute the lagrangian departure grid
dimensionAlong which dimension is this intersection/mapping computation done. It is assumed the three mappings are in order 012, 120 or 201
intersectionIntersection x-coordinate at i,j,k=0
intersection_diChange in x-coordinate for a change in i index of 1
intersection_djChange in x-coordinate for a change in j index of 1
intersection_dkChange in x-coordinate for a change in k index of 1

Definition at line 246 of file cpu_acc_intersections.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_intersections_3rd()

void compute_intersections_3rd ( const vmesh::VelocityMesh * vmesh,
const Transform< Real, 3, Affine > & bwd_transform,
const Transform< Real, 3, Affine > & fwd_transform,
const uint dimension,
Real & intersection,
Real & intersection_di,
Real & intersection_dj,
Real & intersection_dk )

Computes the third intersection data; this is y intersections in Zerroukat et al (2012). We assume all velocity cells have the same dimensions. Intersection y-coordinate for (i,j,k) is: intersection + i * intersection_di + j * intersection_dj + k * intersection_dk

Parameters
spatial_cellspatial cell that is accelerated
fwd_transformTransform that describes acceleration forward in time
bwd_transformTransform that describes acceleration backward in time, used to compute the lagrangian departure grid
dimensionAlong which dimension is this intersection/mapping computation done. It is assumed the three mappings are in order 012, 120 or 201
intersectionIntersection y-coordinate at i,j,k=0
intersection_diChange in y-coordinate for a change in i index of 1
intersection_djChange in y-coordinate for a change in j index of 1
intersection_dkChange in y-coordinate for a change in k index of 1

euclidian y goes from vy_min to vy_max, this is mapped to wherever y plane is in lagrangian.

Definition at line 376 of file cpu_acc_intersections.cpp.

Here is the caller graph for this function:

◆ line_plane_intersection()

Eigen::Matrix< Real, 3, 1 > line_plane_intersection ( const Eigen::Matrix< Real, 3, 1 > & l_point,
const Eigen::Matrix< Real, 3, 1 > & l_direction,
const Eigen::Matrix< Real, 3, 1 > & p_point,
const Eigen::Matrix< Real, 3, 1 > & p_normal )

Computes the intersection point of a plane and a line

Parameters
l_pointPoint on the line
l_directionVector in the direction of the line
p_pointPoint on plane
p_normalNormal vector to plane
intersectionThe function will set this to the intersection point.

Definition at line 112 of file cpu_acc_intersections.cpp.

Here is the caller graph for this function: