GSI_Toolbox 1.0.0
A toolbox for Gas-Surface Interaction simulations
Loading...
Searching...
No Matches
Raytracer< T > Class Template Reference

A class that simulates ray tracing through a surface and gas environment. More...

#include <Raytracer.h>

Public Member Functions

 Raytracer ()
 Default constructor.
 
 Raytracer (Surface< T > surface, Gas< T > gas, void(*local_kernel)(T *, T *, T *, T *, T *), Matrix< T > incident_velocity, unsigned long num_particles, std::string sim_name)
 Parameterized constructor for the Raytracer class.
 
 ~Raytracer ()
 Destructor for the Raytracer class.
 
std::vector< trajectory< T > > simulate ()
 Simulates ray tracing and generates ray trajectories.
 
std::vector< trajectory< T > > import_data (std::string filename)
 Imports trajectory data from a file.
 
void save (std::vector< trajectory< T > > trajectories, std::string filename)
 Saves the simulated trajectories to a file.
 
void combine_files (std::string filename, int num_procs)
 Combines output files from multiple processes into a single file.
 
void set_num_particles (unsigned long num_particles)
 Sets the number of particles to simulate.
 
std::string & get_sim_name ()
 Retrieves the name of the simulation.
 
unsigned long get_num_particles ()
 Retrieves the number of particles in the simulation.
 

Detailed Description

template<typename T>
class Raytracer< T >

A class that simulates ray tracing through a surface and gas environment.

The Raytracer class is responsible for simulating the propagation of particles (rays) through a surface and gas medium, tracking their interactions, and saving the resulting trajectories.

Template Parameters
TType parameter for numerical data (typically float or double).

Constructor & Destructor Documentation

◆ Raytracer() [1/2]

template<typename T >
Raytracer< T >::Raytracer ( )
inline

Default constructor.

Initializes the Raytracer class with default values.

◆ Raytracer() [2/2]

template<typename T >
Raytracer< T >::Raytracer ( Surface< T > surface,
Gas< T > gas,
void(* local_kernel )(T *, T *, T *, T *, T *),
Matrix< T > incident_velocity,
unsigned long num_particles,
std::string sim_name )

Parameterized constructor for the Raytracer class.

Initializes the raytracer class with a surface, gas type, local kernel, incident particle velocity, number of particles, and a simulation name.

Parameters
surfaceThe surface object used by the simulation.
gasThe gas object used by the simulation.
local_kernelThe kernel describing the local dynamics of the gas-surface interaction.
incident_velocityThe incident velocity vector.
num_particlesThe total number of rays to be simulated.
sim_nameName of the simulation.

Member Function Documentation

◆ combine_files()

template<typename T >
void Raytracer< T >::combine_files ( std::string filename,
int num_procs )

Combines output files from multiple processes into a single file.

This method is used in parallel simulations to combine partial results from multiple processes into one final output file.

Parameters
filenameThe base name of the files to combine.
num_procsThe number of processes (files) to combine.

◆ get_num_particles()

template<typename T >
unsigned long Raytracer< T >::get_num_particles ( )
inline

Retrieves the number of particles in the simulation.

Returns
The number of particles to be simulated.

◆ get_sim_name()

template<typename T >
std::string & Raytracer< T >::get_sim_name ( )
inline

Retrieves the name of the simulation.

Returns
A reference to the simulation name.

◆ import_data()

template<typename T >
std::vector< trajectory< T > > Raytracer< T >::import_data ( std::string filename)

Imports trajectory data from a file.

Reads simulation data from the specified file and returns the corresponding particle trajectories.

Parameters
filenameThe name of the file containing trajectory data.
Returns
A vector of imported trajectories.

◆ save()

template<typename T >
void Raytracer< T >::save ( std::vector< trajectory< T > > trajectories,
std::string filename )

Saves the simulated trajectories to a file.

This method saves the positions and velocities of each particle to the specified file.

Parameters
trajectoriesThe vector of particle trajectories to be saved.
filenameThe name of the file to save the data.

◆ set_num_particles()

template<typename T >
void Raytracer< T >::set_num_particles ( unsigned long num_particles)
inline

Sets the number of particles to simulate.

Parameters
num_particlesThe number of particles for the simulation.

◆ simulate()

template<typename T >
std::vector< trajectory< T > > Raytracer< T >::simulate ( )

Simulates ray tracing and generates ray trajectories.

This method propagates the rays through the surface and gas medium, tracks their positions and velocities, and returns the trajectories for each particle.

Returns
A vector of trajectories, each containing the positions and velocities of the particles.

The documentation for this class was generated from the following file: