GSI_Toolbox 1.0.0
A toolbox for Gas-Surface Interaction simulations
|
Represents a class for the proposed rough surface kernel applied to Poly-Gaussian surfaces. More...
#include <PG_Kernel.h>
Public Member Functions | |
PG_Kernel () | |
Default constructor for PG_Kernel. | |
PG_Kernel (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) | |
Constructor for PG_Kernel. | |
~PG_Kernel () | |
Destructor for PG_Kernel. | |
Gas< T > & | get_gas () |
Get the Gas object. | |
Surface< T > & | get_surface () |
Get the Surface object. | |
T | random_sampler_1D (T(PG_Kernel::*pdf)(T, std::vector< T >), std::vector< T > parameters, T x0, T size, T domain_x[]) |
Perform random sampling in 1D using the Metropolis-Hastings algorithm. | |
std::tuple< T, T > | random_sampler_2D (T(PG_Kernel::*pdf)(T, T, std::vector< T >), std::vector< T > parameters, T x0, T y0, T size_x, T size_y, T domain_x[], T domain_y[]) |
Perform random sampling in 2D using the Metropolis-Hastings algorithm. | |
std::tuple< T, T > | random_sampler_angles (T(PG_Kernel::*pdf)(T, T, std::vector< T >), std::vector< T > parameters, T x0, T y0, T size_x, T size_y, T domain_x[], T domain_y[]) |
Perform random sampling of angles in 2D using the Metropolis-Hastings algorithm. | |
T | mixture_pdf (T gamma, T gamma_dot, std::vector< T > parameters) |
Calculate the PDF of the control process gamma and its derivative gamma_dot, for Poly-Gaussian surfaces. | |
T | kirchhoff_pdf (T theta_r1, T theta_r2, std::vector< T > parameters) |
Calculate the reflected particle angular PDF according to the Kirchhoff model. | |
T | shadow (T theta_r1, T height, int direction) |
Calculate the probability of a reflected particle to escape the surface. | |
T | occlusion (T theta_r1, T height, T distance, int direction) |
Calculate the probability of a reflected particle to escape the surface, given a certain travelled horizontal distance. | |
T | height_0_pdf (T height_0, std::vector< T > parameters) |
Calculate the PDF for the height_0 parameter. | |
T | distance_pdf (T distance, std::vector< T > parameters) |
Calculate the PDF for the distance parameter. | |
Matrix< T > | global_to_local (Matrix< T > global_vector, T theta_i, T theta_r1, T theta_r2) |
Convert global coordinates to local coordinates. | |
Matrix< T > | local_to_global (Matrix< T > local_vector, T theta_i, T theta_r1, T theta_r2) |
Convert local coordinates to global coordinates. | |
Matrix< T > | angles_to_slopes (T theta_i, T theta_r1, T theta_r2) |
Convert angles to slopes. | |
trajectory< T > | sample_particle () |
Sample a single particle trajectory. | |
std::vector< trajectory< T > > | sample_batch () |
Sample a batch of particle trajectories. | |
void | save (std::vector< trajectory< T > > trajectories, std::string filename) |
Save the trajectories to a file. | |
void | combine_files (std::string filename, int num_procs) |
Combine multiple trajectory files into one. | |
void | set_num_particles (unsigned long num_particles) |
Set the number of particles. | |
std::vector< trajectory< T > > | import_data (std::string filename) |
Import trajectory data from a file. | |
std::string & | get_sim_name () |
Get the simulation name. | |
unsigned long | get_num_particles () |
Get the number of particles. | |
Represents a class for the proposed rough surface kernel applied to Poly-Gaussian surfaces.
This class implements the rough GSI kernel algorithm for trajectory sampling. It returns the trajectories of free-molecular-flow gas particles on a rough surface.
T | The type of the elements in the PG_Kernel. |
|
inline |
|
inline |
Matrix< T > PG_Kernel< T >::angles_to_slopes | ( | T | theta_i, |
T | theta_r1, | ||
T | theta_r2 ) |
Convert angles to slopes.
theta_i | The theta_i value. |
theta_r1 | The theta_r1 value. |
theta_r2 | The theta_r2 value. |
void PG_Kernel< T >::combine_files | ( | std::string | filename, |
int | num_procs ) |
Combine multiple trajectory files into one.
filename | The name of the file. |
num_procs | The number of processes. |
T PG_Kernel< T >::distance_pdf | ( | T | distance, |
std::vector< T > | parameters ) |
Calculate the PDF for the distance parameter.
distance | The distance value. |
parameters | Vector of parameters for the PDF function. |
|
inline |
Get the number of particles.
|
inline |
Get the simulation name.
Matrix< T > PG_Kernel< T >::global_to_local | ( | Matrix< T > | global_vector, |
T | theta_i, | ||
T | theta_r1, | ||
T | theta_r2 ) |
Convert global coordinates to local coordinates.
global_vector | The global vector. |
theta_i | The theta_i value. |
theta_r1 | The theta_r1 value. |
theta_r2 | The theta_r2 value. |
T PG_Kernel< T >::height_0_pdf | ( | T | height_0, |
std::vector< T > | parameters ) |
Calculate the PDF for the height_0 parameter.
height_0 | The height_0 value. |
parameters | Vector of parameters for the PDF function. |
std::vector< trajectory< T > > PG_Kernel< T >::import_data | ( | std::string | filename | ) |
Import trajectory data from a file.
filename | The name of the file. |
T PG_Kernel< T >::kirchhoff_pdf | ( | T | theta_r1, |
T | theta_r2, | ||
std::vector< T > | parameters ) |
Calculate the reflected particle angular PDF according to the Kirchhoff model.
theta_r1 | The theta_r1 angle value. |
theta_r2 | The theta_r2 angle value. |
parameters | Auxiliary parameters required: incidence angle and control process values. |
Matrix< T > PG_Kernel< T >::local_to_global | ( | Matrix< T > | local_vector, |
T | theta_i, | ||
T | theta_r1, | ||
T | theta_r2 ) |
Convert local coordinates to global coordinates.
local_vector | The local vector. |
theta_i | The theta_i value. |
theta_r1 | The theta_r1 value. |
theta_r2 | The theta_r2 value. |
T PG_Kernel< T >::mixture_pdf | ( | T | gamma, |
T | gamma_dot, | ||
std::vector< T > | parameters ) |
Calculate the PDF of the control process gamma and its derivative gamma_dot, for Poly-Gaussian surfaces.
gamma | The gamma value. |
gamma_dot | The gamma_dot value. |
parameters | Vector of parameters for the PDF function. |
T PG_Kernel< T >::occlusion | ( | T | theta_r1, |
T | height, | ||
T | distance, | ||
int | direction ) |
Calculate the probability of a reflected particle to escape the surface, given a certain travelled horizontal distance.
theta_r1 | The theta_r1 angle. |
height | The non-dimensional height of the particle. |
distance | The horizontal distance value. |
direction | The direction of the particle trajectory. |
T PG_Kernel< T >::random_sampler_1D | ( | T(PG_Kernel< T >::* | pdf )(T, std::vector< T >), |
std::vector< T > | parameters, | ||
T | x0, | ||
T | size, | ||
T | domain_x[] ) |
Perform random sampling in 1D using the Metropolis-Hastings algorithm.
Pointer to the PDF function. | |
parameters | Vector of parameters for the PDF function. |
x0 | Initial position. |
size | Size of the sampling range. |
domain_x | Array of domain limits. |
std::tuple< T, T > PG_Kernel< T >::random_sampler_2D | ( | T(PG_Kernel< T >::* | pdf )(T, T, std::vector< T >), |
std::vector< T > | parameters, | ||
T | x0, | ||
T | y0, | ||
T | size_x, | ||
T | size_y, | ||
T | domain_x[], | ||
T | domain_y[] ) |
Perform random sampling in 2D using the Metropolis-Hastings algorithm.
Pointer to the PDF function. | |
parameters | Vector of parameters for the PDF function. |
x0 | Initial x position. |
y0 | Initial y position. |
size_x | Size of the x sampling range. |
size_y | Size of the y sampling range. |
domain_x | Array of x domain limits. |
domain_y | Array of y domain limits. |
std::tuple< T, T > PG_Kernel< T >::random_sampler_angles | ( | T(PG_Kernel< T >::* | pdf )(T, T, std::vector< T >), |
std::vector< T > | parameters, | ||
T | x0, | ||
T | y0, | ||
T | size_x, | ||
T | size_y, | ||
T | domain_x[], | ||
T | domain_y[] ) |
Perform random sampling of angles in 2D using the Metropolis-Hastings algorithm.
Pointer to the PDF function. | |
parameters | Vector of parameters for the PDF function. |
x0 | Initial x position. |
y0 | Initial y position. |
size_x | Size of the x sampling range. |
size_y | Size of the y sampling range. |
domain_x | Array of x domain limits. |
domain_y | Array of y domain limits. |
std::vector< trajectory< T > > PG_Kernel< T >::sample_batch | ( | ) |
Sample a batch of particle trajectories.
trajectory< T > PG_Kernel< T >::sample_particle | ( | ) |
Sample a single particle trajectory.
void PG_Kernel< T >::save | ( | std::vector< trajectory< T > > | trajectories, |
std::string | filename ) |
Save the trajectories to a file.
trajectories | The trajectories to save. |
filename | The name of the file. |
|
inline |
Set the number of particles.
num_particles | The number of particles. |
T PG_Kernel< T >::shadow | ( | T | theta_r1, |
T | height, | ||
int | direction ) |
Calculate the probability of a reflected particle to escape the surface.
theta_r1 | The theta_r1 angle. |
height | The non-dimensional height of the particle. |
direction | The direction of the particle trajectory. |