From 05d7c79e00ce6586ba9c285d9cb2a5870c3bc4f9 Mon Sep 17 00:00:00 2001 From: Pascal Engeler <engelerp@phys.ethz.ch> Date: Mon, 20 Jan 2020 15:26:45 +0100 Subject: [PATCH] Added force readme --- README.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 14ed954..69b5ac5 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ where it improves legibility. Consult the source files for more information. - `[]` with `std::size_t` - `<<` with `std::ostream` -## Type `Diagonalizer` (`diagonalizer.hpp`), class to diagonalize symmetric Matrices +### Type `Diagonalizer` (`diagonalizer.hpp`), class to diagonalize symmetric Matrices 1. Member functions - `std::vector<double> ev(std::vector<double> mat, size_t N)` - returns eigenvalues of the symmetric matrix mat of linear size N @@ -57,7 +57,7 @@ where it improves legibility. Consult the source files for more information. 2. Further developments - Only finding eigenvectors and -values in a certain range may be added later on -## Template Type `Drum` (`drum.hpp`), represents a single drum top resonator +### Template Type `Drum` (`drum.hpp`), represents a single drum top resonator 1. Template arguments - `value_t`: Scalar type - `params_t`: Drum parameters container type @@ -82,12 +82,30 @@ where it improves legibility. Consult the source files for more information. 4. Description A drum is described by a set of (static) parameters (stiffness, mass, x-y position, etc), which are to be stored in a container of type `params_t`. The variables (displacement, velocity, -electrode charges, etc.) are stored in a container of type `vars_t`. These containers may need to +electrode charges, etc.) are stored in a container of type `vars_t`. Example classes for +these two types are included in the lib folder. However, these containers likely need to be adapted to the situation at hand. When time evolving, the stepper will use the container of type `sbuffer_t` to store its intermediate results. Note that the default constructor of this class is `delete`d. It should be constructed from an object of type `params_t`. -## Template Type `Rk4Stepper` (`rk4_stepper.hpp`), performs timesteps using rk4 scheme +### Interface template type `Force` (`force.hpp`), force functional +1. Template arguments + - `value_t`: Scalar type + - `params_t`: Drum parameters type + - `vars_t`: Drum variables type + - `buffer_t`: Stepper buffer type +2. Virtual functions + - `value_t operator()(drum_t drum, drum_t n1, drum_t n2, drum_t n3, value_t time)` + - Returns force on `drum` at `time`, given its three neighbours `n1`, `n2`, `n3` +3. Description +This interface is a guide to complete implementation of a force functional. Any force +functional should derive from this class, but the child type should then be used in +order to avoid the vtable penalty. The type `drum_t` is a `Drum` with the given +template arguments. Typically, this functional would make heavy use of the `Drum` +access members `get_parameters()` and `get_variables()`. The `time` argument of the +functional exists to fit special cases as well. + +### Template Type `Rk4Stepper` (`rk4_stepper.hpp`), performs timesteps using rk4 scheme 1. Template arguments - `value_t`: Scalar type - `params_t`: Drum parameters container type -- GitLab