Currently we do a 4th-order least-squares or Maier-Kelly fit, as directed by the database. These are pertinent to real-life simulations, however, for testing purposes it's annoying that log10(K) and Debye-Huckel parameters can't be easily calculated easily by hand. So, include a piecewise-linear interpolator in EquilibriumConstantInterpolator that does no least-squares stuff.
Design
piecewise-linear interpolator in EquilibriumConstantInterpolator that does no least-squares stuff.
another argument to GeochemicalDatabaseReader: const bool use_piecewise_interpolation = false. If true, this overwrites the interpolation type specified in the database with "piecewise-linear" . Having the default value = false means that developers must explicitly state "true" otherwise in unit/etc tests if they want to activate the piecewise-linear stuff, otherwise whatever is in the database is used.
Reason
Currently we do a 4th-order least-squares or Maier-Kelly fit, as directed by the database. These are pertinent to real-life simulations, however, for testing purposes it's annoying that log10(K) and Debye-Huckel parameters can't be easily calculated easily by hand. So, include a piecewise-linear interpolator in
EquilibriumConstantInterpolator
that does no least-squares stuff.Design
EquilibriumConstantInterpolator
that does no least-squares stuff.const bool use_piecewise_interpolation = false
. If true, this overwrites the interpolation type specified in the database with "piecewise-linear" . Having the default value = false means that developers must explicitly state "true" otherwise in unit/etc tests if they want to activate the piecewise-linear stuff, otherwise whatever is in the database is used.Impact
Much easier unit testing