-
Notifications
You must be signed in to change notification settings - Fork 5
Dynamic Filtering
Felix Maurer edited this page Jun 29, 2021
·
3 revisions
There are two ways regarding how to link a filter into a sequence of the filtering system:
- statically: By added a subnode to the XML node of that sequence. This process is described in Configuration: Filtering
-
dynamically: By calling the
addFilter(..)
member function of theFilterSequence
C++ object. Read the more about that functions interface here or read the Requirements section below for more information.
The above mentioned member function takes two function pointers as parameters: One for processing scalar physical quantities [1.] and one for processing quantities stored in multidimensional vectors [2.]. In C++, these functions must be wrapped by std::function
.
The functions must fit the following signatures:
- (
double[]
,(unsigned int,..,unsigned int)[]
) ->double[]
- (
(double,..,double)[]
,(unsigned int,..,unsigned int)[]
) ->(double,..,double)[]
[]
refers to a list-like data structure. In C++, this is an std::vector
while in Python we use Numpy arrays for this purpose.
The second parameter is in both cases such a list-like data structure containing vector cell indices.
As of now, dynamic filters are used in these contexts:
- Python Interface: In order to be able to use any pair of Python functions of signatures fitting to what was described in Requirements. Note the implicit conversion between C++'s and Python's datastructures provided by pybind11.
- Synthetic MD: The synthetic MD solver available for the Couette scenario has been redesigned as a dynamic filter.