GSI_Toolbox 1.0.0
A toolbox for Gas-Surface Interaction simulations
|
Class representing a Ray for simulating particle movement in a geometric domain. More...
#include <Ray.h>
Public Member Functions | |
Ray () | |
Default constructor for the Ray class. | |
Ray (Matrix< T > &origin, Matrix< T > &velocity, T m_dot, unsigned int children, int spawn_vertex_index) | |
Parameterized constructor for the Ray class. | |
Ray (const Ray< T > &other) | |
Copy constructor for the Ray class. | |
Ray (Ray< T > &&other) | |
Move constructor for the Ray class. | |
~Ray () | |
Destructor for the Ray class. | |
Ray & | operator= (const Ray &other) |
Copy assignment operator for the Ray class. | |
Ray & | operator= (Ray &&other) |
Move assignment operator for the Ray class. | |
Matrix< T > & | get_velocity () |
Gets the velocity of the ray. | |
void | set_velocity (Matrix< T > new_velocity) |
Sets the velocity of the ray. | |
Matrix< T > & | get_origin () |
Gets the origin of the ray. | |
void | set_origin (Matrix< T > new_origin) |
Sets the origin of the ray. | |
T | get_mass_flux () |
Gets the mass flux of the ray. | |
void | set_mass_flux (T mass_flux) |
Sets the mass flux of the ray. | |
bool | check_vertex_collision (Matrix< T > &p1, Matrix< T > &p2, Matrix< T > &p3, Matrix< T > &normal, Matrix< T > &col_position, T &distance) |
Checks if the ray collides with a triangle defined by three vertices. | |
bool | check_bb_collision (Matrix< T > &bb) |
Checks if the ray collides with a bounding box. | |
std::vector< Ray< T > > | propagate (Geometry< T > &geometry, const Gas< T > &gas, void(*kernel)(T *, T *, T *, T *, T *), unsigned int *collision_index) |
Propagates the ray through the geometry and handles collision and reflection. | |
Class representing a Ray for simulating particle movement in a geometric domain.
The Ray class models the behavior of particles moving in space, handling properties such as velocity, mass flux, and collision detection.
T | The data type used for computations (e.g., float, double). |
Default constructor for the Ray class.
Initializes the ray with default values for origin, velocity, and other properties.
Initializes the ray with default values for origin, velocity, mass flux, and other properties.
Ray< T >::Ray | ( | Matrix< T > & | origin, |
Matrix< T > & | velocity, | ||
T | m_dot, | ||
unsigned int | children, | ||
int | spawn_vertex_index ) |
Parameterized constructor for the Ray class.
Initializes the ray with specific origin, velocity, mass flux, number of children, and spawn vertex index.
origin | Origin point of the ray. |
velocity | Velocity vector of the ray. |
m_dot | Mass flux carried by the ray. |
children | Number of child rays this ray can spawn. |
spawn_vertex_index | Index of the vertex where this ray was spawned. |
Copy constructor for the Ray class.
Initializes a new ray by copying the properties of another ray.
other | The ray object to copy from. |
Move constructor for the Ray class.
Initializes a new ray by moving the properties of another ray.
other | The ray object to move from. |
Destructor for the Ray class.
Resets the properties of the ray to default values.
Checks if the ray collides with a bounding box.
bb | The bounding box to check collision with. |
bool Ray< T >::check_vertex_collision | ( | Matrix< T > & | p1, |
Matrix< T > & | p2, | ||
Matrix< T > & | p3, | ||
Matrix< T > & | normal, | ||
Matrix< T > & | col_position, | ||
T & | distance ) |
Checks if the ray collides with a triangle defined by three vertices.
This function checks if the ray intersects with the triangle defined by points p1, p2, and p3, and updates the collision position and distance if a collision occurs.
p1 | The first vertex of the triangle. |
p2 | The second vertex of the triangle. |
p3 | The third vertex of the triangle. |
normal | The normal vector of the triangle. |
col_position | The position of the collision, if it occurs. |
distance | The distance from the ray origin to the collision point. |
This function determines if the ray intersects with the triangle formed by vertices p1, p2, and p3. If a collision occurs, the position of the collision and the distance to the collision point are updated.
p1 | The first vertex of the triangle. |
p2 | The second vertex of the triangle. |
p3 | The third vertex of the triangle. |
normal | The normal vector of the triangle. |
col_position | The position of the collision (output parameter). |
distance | The distance from the ray origin to the collision point (output parameter). |
|
inline |
Gets the mass flux of the ray.
Gets the origin of the ray.
Gets the velocity of the ray.
Move assignment operator for the Ray class.
Moves the properties from another ray, resetting the source ray.
other | The ray object to move from. |
Moves the properties from another ray, resetting the source ray's properties.
other | The ray object to move from. |
std::vector< Ray< T > > Ray< T >::propagate | ( | Geometry< T > & | geometry, |
const Gas< T > & | gas, | ||
void(* | kernel )(T *, T *, T *, T *, T *), | ||
unsigned int * | collision_index ) |
Propagates the ray through the geometry and handles collision and reflection.
This function propagates the ray, checking for collisions with the geometry, and applies a kernel function to compute the reflected ray properties.
geometry | The geometry through which the ray propagates. |
gas | The gas properties influencing the ray's behavior. |
kernel | The function used to compute reflection or scattering after collision. |
collision_index | Pointer to store the index of the vertex where the collision occurred. |
This function propagates the ray through the given geometry, checking for collisions with the vertices of the geometry. If a collision occurs, the position, distance, and other properties of the collision are computed. The kernel function is used to calculate the reflected velocity of the ray based on the gas and surface properties at the collision point. After collision, child rays are generated and returned.
geometry | The geometry through which the ray propagates. |
gas | The gas properties that affect the ray's behavior during propagation. |
kernel | The kernel function used to compute reflection or scattering after collision. |
collision_index | Pointer to store the index of the vertex where the collision occurred. |
|
inline |
Sets the mass flux of the ray.
mass_flux | The new mass flux to set. |
Sets the origin of the ray.
new_origin | The new origin point to set. |
Sets the velocity of the ray.
new_velocity | The new velocity vector to set. |