diff --git a/README.md b/README.md index 54c9ab5ca9b650eafe14d21476c323bca24d1461..0f183242bd9eca226f0456f6d1ab5fdec4bf3a94 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ -1. [ RBComb Simulation Framework. ](#RSF) +<a name="RSF"></a> +# RBComb simulation framework +This project aims at developing a framework that can be used to simulate any project +that is to be undertaken on the RBComb platform. It is designed in modular fashion, +such that it is flexible enough to adapt easily to any given situation. The list of +contents is the following: + +1. [ RBComb simulation framework. ](#RSF) +2. [ Implementing a new project. ](#INP) 2. [ Classes. ](#Classes) - [ Vec2. ](#vec2) - [ Diagonalizer. ](#diagonalizer) @@ -15,15 +23,15 @@ - [ RK4Buffer. ](#rk4b) - [ Rk4Stepper. ](#rk4s) - [ SystemParameters. ](#sysparams) + - [ Grabber. ](#grabber) - [ System. ](#system) +<a name="INP"></a> +## Implementing a new project +In order to implement a new project, follow these steps: - -<a name="RSF"></a> -# RBComb Simulation Framework -This project aims at developing a framework that can be used to simulate any project -that is to be undertaken on the RBComb platform. It is designed in modular fashion, -such that it is flexible enough to adapt easily to any given situation. +1. Identify force + - $d^2_t x = F$ <a name="Classes"></a> ## Classes @@ -311,6 +319,27 @@ the individual functions correctly to accomodate the correct neighbours. - `driver`: The driver_t object of the system - `adjacency_vector`: A `std::vector<std::vector<int> >` representing the adjacency vector +<a name="grabber"></a> +### `Grabber` (grabber.hpp), grabs and saves data +1. Template arguments + - `value_t`: Scalar type + - `drum_t`: Drum type +2. Member functions + - `void init(value_t t_end, value_t dt, std::vector<drum_t>, std::vector<std::vector<int> >)` + - Called upon `System` lifetime start. + - `bool grab(std::vector<drum_t>, value_t time)` + - Grabs data from the drums. + - May use current time to decide if to grab data. + - Returns `true` if data was grabbed. + - `bool save()` + - Saves data to the specified files. + - Is called by `System`. + - Returns `true` on success. +3. Description + - This class needs to be re-implemented whenever either `DrumParameters` or + `DrumVariables` changes. + - One should also implement a helper struct, as seen in `include/grabber.hpp` + <a name="system"></a> ### `System` (system.hpp), holds all parts together 1. Template arguments @@ -323,3 +352,16 @@ the individual functions correctly to accomodate the correct neighbours. - `driver_t`: Driver type - `stepper_t`: Stepper type - `matelecalc_t`: Matrix element calculator type +2. Member functions + - `void simulate()` + - Runs a simulation with the set parameters. + - `void step()` + - Performs one timestep with the set parameters. + - `void reset_time()` + - Resets the simulation time to zero. + - `void set_step(value_t)` + - Sets the timestep. + - `bool save()` + - Calls `grabber_t::save()`. + - `std::vector<value_t> get_matrix(matelecalc_t)` + - Returns the dynamic matrix as provided by the argument.