|
WaSH Docs
|
TODO: Consider having this as a private header in WISB/WS2ST/etc implementations. More...
Classes | |
| class | ForceKernel |
| Force Kernel Class. More... | |
| class | Kernel |
| Parent Kernel Class. More... | |
| class | Particle |
| class | ReductionKernel |
| Reduction Kernel implements a reduction operation over the particles to a specifed variable. More... | |
| class | UpdateKernel |
| Update Kernel Class. More... | |
| class | Vec |
| Custom vector class for WaSH simulation. More... | |
| class | VoidKernel |
| Void Kernel has no arguments/return. More... | |
Typedefs | |
| using | ForceFuncT = std::function< void(Particle &, const std::vector< Particle >::const_iterator &, const std::vector< Particle >::const_iterator &)> |
| using | UpdateFuncT = std::function< void(Particle &)> |
| using | MapFuncT = std::function< double(const Particle &)> |
| using | VoidFuncT = std::function< void()> |
| using | NeighborsFuncT = std::function< void(Particle &)> |
| using | SimulationVecT = Vec< double, DIM > |
| typedef Vec< double, 2 > | Vec2D |
| typedef Vec< double, 3 > | Vec3D |
Enumerations | |
| enum | ReduceOp { max, min, sum, prod } |
| Type of reduction operation to perform in a reduce kernel. | |
Functions | |
| io::IOManager | create_io (const std::string format, const size_t output_nth, const bool use_gather=false, const size_t rank=0, const size_t size=1, const bool timings=true) |
| Set-up the IO options for the simulation. More... | |
| std::vector< double > | copy_variables () |
| Copy the variables of the simulation. More... | |
| std::vector< std::string > | get_variables_names () |
| template<typename T > | |
| int64_t | diff_ms (std::chrono::time_point< T > time1, std::chrono::time_point< T > time2) |
| template<typename... Args> | |
| std::string | string_format (const std::string &format, Args... args) |
| Helper function to format to a c++ string. More... | |
| template<typename T > | |
| int | sgn (T val) |
| Helper function for the pure sign of a numerical type. More... | |
| template<typename T , size_t N, size_t... I> | |
| auto | make_tuple (std::array< T, N > &arr, std::index_sequence< I... >) |
| template<typename T , size_t N> | |
| auto | make_tuple (std::array< T, N > &arr) |
| template<typename T , size_t N, size_t M> | |
| auto | make_tuple (std::array< T, N > &arr) |
| uint64_t | get_max_iterations () |
| Get the max iterations of the simulation. More... | |
| void | set_max_iterations (const uint64_t iterations) |
| Set the max number of iterations. More... | |
| void | set_bounding_box (const double min, const double max, const bool periodic) |
| Set the bounding box dimensions and periodicity type. More... | |
| void | set_bounding_box (const double xmin, const double xmax, const double ymin, const double ymax, const double zmin, const double zmax, const bool x_periodic, const bool y_periodic, const bool z_periodic) |
| Set the bounding box dimensions and periodicity type in 3 dimensions. | |
| void | add_force_scalar (const std::string force) |
| Add a scalar force to the simulation. More... | |
| void | add_force_vector (const std::string force) |
| Add a n-dim vector force to the simulation. More... | |
| void | add_variable (const std::string variable, double init_value=0.0) |
| Add a scalar variable to the simulation. More... | |
| void | add_init_update_kernel (const UpdateFuncT func) |
| Add an initialisation update kernel (will be executed for each particle) More... | |
| void | add_init_void_kernel (const VoidFuncT func) |
| Add an initialization void kernel to the simulation - run once. More... | |
| void | add_force_kernel (const ForceFuncT func) |
| Add a force kernel to the simulation which will loop over the particles and their neighbourhood. More... | |
| void | add_update_kernel (const UpdateFuncT func) |
| Add an update kernel to the simulation which will loop over the particles. More... | |
| void | add_reduction_kernel (const MapFuncT map_func, const ReduceOp reduce_op, double *variable) |
| Add a reduction kernel to the simulation which will loop over the particles. More... | |
| void | add_void_kernel (const VoidFuncT func) |
| Add a void kernel to the simulation. More... | |
| void | set_default_neighbor_search (const unsigned max_count) |
| Set the neighborhood search to use the provided default which uses the smoothing length of the particle and returns at most max_count neighbours. More... | |
| void | set_neighbor_search_kernel (const NeighborsFuncT func, const unsigned max_count) |
| Sets the neighbourhood search to use a custom function. More... | |
| double | get_variable (const std::string &variable) |
| Get the value of a variable. More... | |
| double * | use_variable (const std::string &variable) |
| Returns a reference to a variable useful for e.g. reduction kernels. More... | |
| void | set_variable (const std::string &variable, const double value) |
| Set the value of a variable. More... | |
| void | start () |
| Get the vector of all particles in the simulation. More... | |
| void | set_simulation_name (const std::string name) |
| Set the name of the simulation, used in IO. More... | |
| void | set_output_file_name (const std::string name) |
| Set the output file name of the simulation. More... | |
| double | eucdist (const Particle &p, const Particle &q) |
| TODO: Move eucdist calculation to the paticle header? More... | |
| void | set_particle_count (const size_t count) |
| Set the number of particles to be used in the simulation. More... | |
| size_t | get_particle_count () |
| Get the number of particles used in the simulation. More... | |
| void | set_dimension (int dim) |
| Set the dimensionality of the simulation. More... | |
| void | set_io (const std::string format, size_t output_nth, bool timings=true) |
| Set the IO parameters used for the simulation. | |
| double constexpr | sqrtNewtonRaphson (double x, double curr, double prev) |
| double constexpr | sqrt (double x) |
| std::vector< Particle > & | get_global_particles () |
| std::vector< Particle > & | get_particles () |
| std::ostream & | operator<< (std::ostream &os, const Particle &p) |
| std::string | get_simulation_name () |
| std::string | get_output_file_name () |
| std::vector< std::string > | get_forces_scalar () |
| std::vector< std::string > | get_forces_vector () |
| std::vector< std::string > | get_variables () |
| std::tuple< int, int > | init_mpi () |
| cstone::Domain< uint64_t, double, cstone::CpuTag > | init_domain (int rank, int n_ranks, size_t num_particles) |
| void | recreate_particles (unsigned count_with_halos, size_t start_idx, size_t end_idx) |
| void | sync_domain (cstone::Domain< uint64_t, double, cstone::CpuTag > &domain, std::vector< size_t > &keys, std::vector< double > &s1, std::vector< double > &s2, std::vector< double > &s3) |
| std::vector< std::string > | get_force_scalars_names () |
| std::vector< std::string > | get_force_vectors_names () |
| void | reset_neighbour_data () |
| void | initialise_particles (size_t particle_count) |
| void | create_particles () |
| ParticleData * | get_particle_data () |
Variables | |
| uint64_t | max_iterations |
| size_t | particle_cnt |
| double | box_xmin |
| double | box_ymin |
| double | box_zmin |
| double | box_xmax |
| double | box_ymax |
| double | box_zmax |
| std::vector< std::unique_ptr< Kernel > > | init_kernels |
| std::vector< std::unique_ptr< Kernel > > | loop_kernels |
| NeighborsFuncT | neighbors_kernel |
| std::function< unsigned(unsigned, unsigned)> | neighbors_func |
| unsigned | neighbors_max |
| std::vector< unsigned > | neighbors_cnt |
| std::vector< unsigned > | neighbors_data |
| std::unordered_map< std::string, double > | variables |
| size_t | force_cnt |
| std::unordered_map< std::string, size_t > | force_map |
| std::array< std::vector< double >, MAX_FORCES > | force_data |
| std::vector< Particle > | particles |
| std::vector< Particle > | local_particles |
| std::string | simulation_name |
| std::string | output_file_name |
| bool | started |
| cstone::BoundaryType | box_xtype |
| cstone::BoundaryType | box_ytype |
| cstone::BoundaryType | box_ztype |
| std::string | out_format |
| size_t | output_nth |
| bool | timings |
| size_t | particle_count |
| size_t | out_nth |
| bool | out_timing |
| NeighborsFuncT | neighbours_kernel |
| unsigned | max_neighbours |
| std::vector< unsigned > | neighbour_counts |
| std::vector< std::vector< Particle > > | neighbour_data |
| std::vector< std::string > | forces_scalar = { "mass", "density", "smoothing_length" } |
| std::vector< std::string > | forces_vector = { "pos", "vel", "acc" } |
| ParticleData * | particle_data = nullptr |
| cstone::Domain< uint64_t, double, cstone::CpuTag > * | domain |
| unsigned | start_idx |
| unsigned | end_idx |
TODO: Consider having this as a private header in WISB/WS2ST/etc implementations.
| void wash::add_force_kernel | ( | const ForceFuncT | func | ) |
Add a force kernel to the simulation which will loop over the particles and their neighbourhood.
| func | Reference to the kernel function |
| void wash::add_force_scalar | ( | const std::string | force | ) |
Add a scalar force to the simulation.
| force | Name of the force |
| void wash::add_force_vector | ( | const std::string | force | ) |
Add a n-dim vector force to the simulation.
| force | Name of the force |
| void wash::add_init_update_kernel | ( | const UpdateFuncT | func | ) |
Add an initialisation update kernel (will be executed for each particle)
| func | Reference to the kernel function |
| void wash::add_init_void_kernel | ( | const VoidFuncT | func | ) |
Add an initialization void kernel to the simulation - run once.
| func | Reference to the kernel function |
| void wash::add_reduction_kernel | ( | const MapFuncT | map_func, |
| const ReduceOp | reduce_op, | ||
| double * | variable | ||
| ) |
Add a reduction kernel to the simulation which will loop over the particles.
Extracts a value from each particle using map_func, then aggregates these values using reduce_op. The result will be saved to variable.
| map_func | Function to map each particle to |
| reduce_op | The reduction operator type to use in the reduction |
| variable | Variable to store the result in |
| void wash::add_update_kernel | ( | const UpdateFuncT | func | ) |
Add an update kernel to the simulation which will loop over the particles.
| func | Reference to the kernel function |
| void wash::add_variable | ( | const std::string | variable, |
| double | init_value = 0.0 |
||
| ) |
Add a scalar variable to the simulation.
| variable | Name of the variable |
| init_value | The initial value of the variable |
| void wash::add_void_kernel | ( | const VoidFuncT | func | ) |
Add a void kernel to the simulation.
| func | Reference to the kernel function |
| std::vector< double > wash::copy_variables | ( | ) |
Copy the variables of the simulation.
| io::IOManager wash::create_io | ( | const std::string | format, |
| const size_t | output_nth, | ||
| const bool | use_gather = false, |
||
| const size_t | rank = 0, |
||
| const size_t | size = 1, |
||
| const bool | timings = true |
||
| ) |
Set-up the IO options for the simulation.
| format | |
| output_nth | |
| rank | MPI Rank |
| size | MPI Size |
TODO: Move eucdist calculation to the paticle header?
Compute the euclidean distance between two particles
| p | First particle |
| q | Second particle |
| uint64_t wash::get_max_iterations | ( | ) |
Get the max iterations of the simulation.
| size_t wash::get_particle_count | ( | ) |
Get the number of particles used in the simulation.
| double wash::get_variable | ( | const std::string & | variable | ) |
Get the value of a variable.
| variable | Name of the variable |
| void wash::set_bounding_box | ( | const double | min, |
| const double | max, | ||
| const bool | periodic | ||
| ) |
Set the bounding box dimensions and periodicity type.
TODO: impl bounding box methods even though they likely don't have any function in wser.
| void wash::set_default_neighbor_search | ( | const unsigned | max_count | ) |
Set the neighborhood search to use the provided default which uses the smoothing length of the particle and returns at most max_count neighbours.
| max_count | Maximum number of neighbours to return |
| void wash::set_dimension | ( | int | dim | ) |
Set the dimensionality of the simulation.
| dim | 2, or 3 |
| void wash::set_max_iterations | ( | const uint64_t | iterations | ) |
Set the max number of iterations.
| iterations |
| void wash::set_neighbor_search_kernel | ( | const NeighborsFuncT | func, |
| const unsigned | max_count | ||
| ) |
Sets the neighbourhood search to use a custom function.
| func | Reference to the search function |
| max_count | Maximum number of neighbours(?) |
| void wash::set_output_file_name | ( | const std::string | name | ) |
Set the output file name of the simulation.
| name | Name to use |
| void wash::set_particle_count | ( | const size_t | count | ) |
Set the number of particles to be used in the simulation.
| count |
| void wash::set_simulation_name | ( | const std::string | name | ) |
Set the name of the simulation, used in IO.
| name | Name to use |
| void wash::set_variable | ( | const std::string & | variable, |
| const double | value | ||
| ) |
Set the value of a variable.
| variable | Name of the variable |
| value | Value to set it to |
| int wash::sgn | ( | T | val | ) |
Helper function for the pure sign of a numerical type.
| T |
| val | numerical value |
| void wash::start | ( | ) |
Get the vector of all particles in the simulation.
TODO: what's this?
TODO: what's this?
| std::string wash::string_format | ( | const std::string & | format, |
| Args... | args | ||
| ) |
Helper function to format to a c++ string.
| Args |
| format | standard style format string |
| args | arguments for the format string |
| double * wash::use_variable | ( | const std::string & | variable | ) |
Returns a reference to a variable useful for e.g. reduction kernels.
| variable |
1.8.14