Skip to content

Add a key getter for parameterized object factory

Keys for this factory are often exposed to the users (e.g., ISTL solver factory). However, when the wrong key is set, diagnostics are not very helpful. This MR enable us to have better diagnostics when this class does not contain a key. Example:

static PreconditionerRegistry<O, X, Y, A> registry;
/* ...registry setup... */
if (registry.contains(key))
  return registry.create(key, op, config, alloc);
else
  DUNE_THROW(IOError{}, fmt::format("The key '{}' does not exist. Allowed keys are {}", key, registry.keys()));
  • Add test
  • Add CHANGELOG
Edited by Santiago Ospina De Los Ríos

Merge request reports

Loading