Skip to content

Add API to set initial conditions

Description

Currently we allow to set initial conditions by setting expressions in the configuration files where tiff values are just a very specific type of expression in the parser. This however, is not enough for the C++ API. The current state forces downstream projects to always write TIFF files even when they already have all the data loaded to memory. This is inefficient and rather inconvenient.

Proposal

Create a C++ API to set initial conditions in the models. The idea is that this is a templetized function that the user can instantiate with his own grid function implementation.

class Model
{
  // ...
  template<class GF>
  void interpolate(const GF&);
  // ...
};

How to test the implementation?

Create a .cc file that interpolate a known function and test its output against a vtk generated a parsed expression in the configuration file.

Related issues

See #