Skip to content
Snippets Groups Projects
Commit 5a1b3f9a authored by Pascal Engeler's avatar Pascal Engeler
Browse files

grabber doc

parent 51a8bc6e
Branches main
No related tags found
No related merge requests found
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) 2. [ Classes. ](#Classes)
- [ Vec2. ](#vec2) - [ Vec2. ](#vec2)
- [ Diagonalizer. ](#diagonalizer) - [ Diagonalizer. ](#diagonalizer)
...@@ -15,15 +23,15 @@ ...@@ -15,15 +23,15 @@
- [ RK4Buffer. ](#rk4b) - [ RK4Buffer. ](#rk4b)
- [ Rk4Stepper. ](#rk4s) - [ Rk4Stepper. ](#rk4s)
- [ SystemParameters. ](#sysparams) - [ SystemParameters. ](#sysparams)
- [ Grabber. ](#grabber)
- [ System. ](#system) - [ System. ](#system)
<a name="INP"></a>
## Implementing a new project
In order to implement a new project, follow these steps:
1. Identify force
<a name="RSF"></a> - $d^2_t x = F$
# 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.
<a name="Classes"></a> <a name="Classes"></a>
## Classes ## Classes
...@@ -311,6 +319,27 @@ the individual functions correctly to accomodate the correct neighbours. ...@@ -311,6 +319,27 @@ the individual functions correctly to accomodate the correct neighbours.
- `driver`: The driver_t object of the system - `driver`: The driver_t object of the system
- `adjacency_vector`: A `std::vector<std::vector<int> >` representing the adjacency vector - `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> <a name="system"></a>
### `System` (system.hpp), holds all parts together ### `System` (system.hpp), holds all parts together
1. Template arguments 1. Template arguments
...@@ -323,3 +352,16 @@ the individual functions correctly to accomodate the correct neighbours. ...@@ -323,3 +352,16 @@ the individual functions correctly to accomodate the correct neighbours.
- `driver_t`: Driver type - `driver_t`: Driver type
- `stepper_t`: Stepper type - `stepper_t`: Stepper type
- `matelecalc_t`: Matrix element calculator 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.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment