For the Reader class this should not be a big issue to handle with.
For Solver a draft idea could be to use a std::vector<std::function<double(double)>>, where in our case this would just be a one-dimensional vector.
And additional dimension member would need to be stored.