Skip to content

Dynamic Filtering

Felix Maurer edited this page Jun 29, 2021 · 3 revisions

Introduction

There are two ways regarding how to link a filter into a sequence of the filtering system:

  1. statically: By added a subnode to the XML node of that sequence. This process is described in Configuration: Filtering
  2. dynamically: By calling the addFilter(..) member function of the FilterSequence C++ object. Read the more about that functions interface here or read the Requirements section below for more information.

Requirements

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:

  1. ( double[], (unsigned int,..,unsigned int)[] ) -> double[]
  2. ( (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.

Use Cases

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.