|
Graph Framework
|
Benchmark Case for the Rays code. More...
#include <iostream>#include <thread>#include <random>#include "../graph_framework/solver.hpp"#include "../graph_framework/timing.hpp"#include "../graph_framework/output.hpp"#include "../graph_framework/absorption.hpp"#include "../graph_framework/commandline_parser.hpp"Functions | |
| template<jit::float_scalar T> | |
| std::normal_distribution< T > | set_distribution (const T mean, const T sigma) |
| Set the normal distribution. | |
| template<jit::float_scalar T> | |
| std::normal_distribution< std::complex< T > > | set_distribution (const std::complex< T > mean, const std::complex< T > sigma) |
| Set the normal distribution. | |
| template<jit::float_scalar T, bool SAFE_MATH> | |
| void | set_variable (const commandline::parser &cl, graph::shared_leaf< T, SAFE_MATH > var, const std::string &name, std::mt19937_64 &engine, const size_t num_rays) |
| Initialize value. | |
| template<jit::float_scalar T, bool SAFE_MATH> | |
| void | set_xy_variables (const commandline::parser &cl, graph::shared_leaf< T, SAFE_MATH > x, graph::shared_leaf< T, SAFE_MATH > y, std::mt19937_64 &engine, const size_t num_rays) |
| Initialize the x and y direction. | |
| template<solver::method SOLVER_METHOD> | |
| void | run_solver (const commandline::parser &cl, graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > omega, graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > kx, graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > ky, graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > kz, graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > x, graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > y, graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > z, graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > t, graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > dt, equilibrium::shared< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > &eq, const size_t num_steps, const size_t sub_steps, std::mt19937_64 &engine, const std::string &filename="", const size_t num_rays=0, const size_t index=0) |
| Run Solver. | |
| template<dispersion::function DISPERSION_FUNCTION> | |
| void | run_dispersion (const commandline::parser &cl, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > omega, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > kx, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > ky, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > kz, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > x, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > y, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > z, graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > t, const typename DISPERSION_FUNCTION::base dt, equilibrium::shared< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > &eq, const size_t num_steps, const size_t sub_steps, std::mt19937_64 &engine, const std::string &filename="", const size_t num_rays=0, const size_t index=0) |
| Run Dispersion. | |
| template<jit::float_scalar T, bool SAFE_MATH = false> | |
| equilibrium::shared< T, SAFE_MATH > | make_equilibrium (const commandline::parser &cl) |
| Make an equilibrium. | |
| std::mt19937_64 | make_engine (const commandline::parser &cl, const size_t index) |
| Generate the engine. | |
| template<jit::float_scalar T, bool SAFE_MATH = false> | |
| void | trace_ray (const commandline::parser &cl, const size_t num_times, const size_t sub_steps, const size_t num_rays) |
| Trace the rays. | |
| template<absorption::model ABSORPTION_MODEL> | |
| void | run_absorption (const commandline::parser &cl, graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > kamp, graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > omega, graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > kx, graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > ky, graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > kz, graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > x, graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > y, graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > z, graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > t, equilibrium::shared< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > &eq, const size_t num_steps, const std::string &filename="", const size_t index=0) |
| Run absorption model. | |
| template<jit::float_scalar T, bool SAFE_MATH = false> | |
| void | calculate_power (const commandline::parser &cl, const size_t num_times, const size_t sub_steps, const size_t num_rays) |
| Calculate absorption. | |
| template<jit::float_scalar T, bool SAFE_MATH = false> | |
| void | bin_power (const commandline::parser &cl, const size_t num_times, const size_t sub_steps, const size_t num_rays) |
| Bin power. | |
| commandline::parser | parse_commandline (int argc, const char *argv[]) |
| Setup and parse commandline options. | |
| int | main (int argc, const char *argv[]) |
| Main program of the driver. | |
Benchmark Case for the Rays code.
Driver program for the rays library.
| void bin_power | ( | const commandline::parser & | cl, |
| const size_t | num_times, | ||
| const size_t | sub_steps, | ||
| const size_t | num_rays ) |
Bin power.
| T | Base type of the calculation. |
| SAFE_MATH | Use Safe Math operations. |
| [in] | cl | Parsed commandline. |
| [in] | num_times | Total number of time steps. |
| [in] | sub_steps | Number of sub-steps to push the rays. |
| [in] | num_rays | Number of rays to trace. |
| void calculate_power | ( | const commandline::parser & | cl, |
| const size_t | num_times, | ||
| const size_t | sub_steps, | ||
| const size_t | num_rays ) |
Calculate absorption.
| T | Base type of the calculation. |
| SAFE_MATH | Use Safe Math operations. |
| [in] | cl | Parsed commandline. |
| [in] | num_times | Total number of time steps. |
| [in] | sub_steps | Number of sub-steps to push the rays. |
| [in] | num_rays | Number of rays to trace. |
| int main | ( | int | argc, |
| const char * | argv[] ) |
Main program of the driver.
| [in] | argc | Number of commandline arguments. |
| [in] | argv | Array of commandline arguments. |
| std::mt19937_64 make_engine | ( | const commandline::parser & | cl, |
| const size_t | index ) |
Generate the engine.
| [in] | cl | Parsed commandline. |
| [in] | index | Thread index. |
| equilibrium::shared< T, SAFE_MATH > make_equilibrium | ( | const commandline::parser & | cl | ) |
Make an equilibrium.
| T | Base type of the calculation. |
| SAFE_MATH | Use Safe Math operations. |
| [in] | cl | Parsed commandline. |
| commandline::parser parse_commandline | ( | int | argc, |
| const char * | argv[] ) |
Setup and parse commandline options.
| [in] | argc | Number of commandline arguments. |
| [in] | argv | Array of commandline arguments. |
| void run_absorption | ( | const commandline::parser & | cl, |
| graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > | kamp, | ||
| graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > | omega, | ||
| graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > | kx, | ||
| graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > | ky, | ||
| graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > | kz, | ||
| graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > | x, | ||
| graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > | y, | ||
| graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > | z, | ||
| graph::shared_leaf< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > | t, | ||
| equilibrium::shared< typename ABSORPTION_MODEL::base, ABSORPTION_MODEL::safe_math > & | eq, | ||
| const size_t | num_steps, | ||
| const std::string & | filename = "", | ||
| const size_t | index = 0 ) |
Run absorption model.
| ABSORPTION_MODEL | Absorption model to use. |
| [in] | cl | Parsed commandline. |
| [in] | kamp | Wave number amplitude. |
| [in] | omega | Wave frequency. |
| [in] | kx | Wave number in x direction. |
| [in] | ky | Wave number in y direction. |
| [in] | kz | Wave number in z direction. |
| [in] | x | Initial position in x direction. |
| [in] | y | Initial position in y direction. |
| [in] | z | Initial position in z direction. |
| [in] | t | Initial position in t direction. |
| [in] | eq | Equilibrium object. |
| [in] | num_steps | Number of time steps. |
| [in] | filename | Result filename, empty names will be blank. |
| [in] | index | Concurrent index. |
| void run_dispersion | ( | const commandline::parser & | cl, |
| graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > | omega, | ||
| graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > | kx, | ||
| graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > | ky, | ||
| graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > | kz, | ||
| graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > | x, | ||
| graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > | y, | ||
| graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > | z, | ||
| graph::shared_leaf< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > | t, | ||
| const typename DISPERSION_FUNCTION::base | dt, | ||
| equilibrium::shared< typename DISPERSION_FUNCTION::base, DISPERSION_FUNCTION::safe_math > & | eq, | ||
| const size_t | num_steps, | ||
| const size_t | sub_steps, | ||
| std::mt19937_64 & | engine, | ||
| const std::string & | filename = "", | ||
| const size_t | num_rays = 0, | ||
| const size_t | index = 0 ) |
Run Dispersion.
| DISPERSION_FUNCTION | The dispersion method. |
| [in] | cl | Parsed commandline. |
| [in] | omega | Wave frequency. |
| [in] | kx | Wave number in x direction. |
| [in] | ky | Wave number in y direction. |
| [in] | kz | Wave number in z direction. |
| [in] | x | Initial position in x direction. |
| [in] | y | Initial position in y direction. |
| [in] | z | Initial position in z direction. |
| [in] | t | Initial position in t direction. |
| [in] | dt | Initial dt. |
| [in] | eq | Equilibrium object. |
| [in] | num_steps | Equilibrium object. |
| [in] | sub_steps | Equilibrium object. |
| [in,out] | engine | Random engine. |
| [in] | filename | Result filename, empty names will be blank. |
| [in] | num_rays | Number of rays to write. |
| [in] | index | Concurrent index. |
| void run_solver | ( | const commandline::parser & | cl, |
| graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > | omega, | ||
| graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > | kx, | ||
| graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > | ky, | ||
| graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > | kz, | ||
| graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > | x, | ||
| graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > | y, | ||
| graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > | z, | ||
| graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > | t, | ||
| graph::shared_leaf< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > | dt, | ||
| equilibrium::shared< typename SOLVER_METHOD::base, SOLVER_METHOD::safe_math > & | eq, | ||
| const size_t | num_steps, | ||
| const size_t | sub_steps, | ||
| std::mt19937_64 & | engine, | ||
| const std::string & | filename = "", | ||
| const size_t | num_rays = 0, | ||
| const size_t | index = 0 ) |
Run Solver.
| SOLVER_METHOD | The solver method. |
| [in] | cl | Parsed commandline. |
| [in] | omega | Wave frequency. |
| [in] | kx | Wave number in x direction. |
| [in] | ky | Wave number in y direction. |
| [in] | kz | Wave number in z direction. |
| [in] | x | Initial position in x direction. |
| [in] | y | Initial position in y direction. |
| [in] | z | Initial position in z direction. |
| [in] | t | Initial position in t direction. |
| [in] | dt | Initial dt. |
| [in] | eq | Equilibrium object. |
| [in] | num_steps | Equilibrium object. |
| [in] | sub_steps | Equilibrium object. |
| [in,out] | engine | Random engine. |
| [in] | filename | Result filename, empty names will be blank. |
| [in] | num_rays | Number of rays to write. |
| [in] | index | Concurrent index. |
| std::normal_distribution< std::complex< T > > set_distribution | ( | const std::complex< T > | mean, |
| const std::complex< T > | sigma ) |
Set the normal distribution.
| T | Base type of the calculation. |
| [in] | mean | Mean value. |
| [in] | sigma | Sigma value. |
| std::normal_distribution< T > set_distribution | ( | const T | mean, |
| const T | sigma ) |
Set the normal distribution.
| T | Base type of the calculation. |
| [in] | mean | Mean value. |
| [in] | sigma | Sigma value. |
| void set_variable | ( | const commandline::parser & | cl, |
| graph::shared_leaf< T, SAFE_MATH > | var, | ||
| const std::string & | name, | ||
| std::mt19937_64 & | engine, | ||
| const size_t | num_rays ) |
Initialize value.
| T | Base type of the calculation. |
| SAFE_MATH | Use Safe Math operations. |
| [in] | cl | Parsed commandline. |
| [in,out] | var | Variable to set. |
| [in] | name | Variable name. |
| [in,out] | engine | Random engine. |
| [in] | num_rays | Numbers of rays. |
| void set_xy_variables | ( | const commandline::parser & | cl, |
| graph::shared_leaf< T, SAFE_MATH > | x, | ||
| graph::shared_leaf< T, SAFE_MATH > | y, | ||
| std::mt19937_64 & | engine, | ||
| const size_t | num_rays ) |
Initialize the x and y direction.
| [in] | cl | Parsed commandline. |
| [in,out] | x | X variable to set. |
| [in,out] | y | Y variable to set. |
| [in,out] | engine | Random engine. |
| [in] | num_rays | Numbers of rays. |
| void trace_ray | ( | const commandline::parser & | cl, |
| const size_t | num_times, | ||
| const size_t | sub_steps, | ||
| const size_t | num_rays ) |
Trace the rays.
| T | Base type of the calculation. |
| SAFE_MATH | Use Safe Math operations. |
| [in] | cl | Parsed commandline. |
| [in] | num_times | Total number of time steps. |
| [in] | sub_steps | Number of sub-steps to push the rays. |
| [in] | num_rays | Number of rays to trace. |