neko
neko copied to clipboard
Explicitly list all types in factories for friendly error messages
This is a suggestion to enhance all our json-based factories with a KNOWN_TYPES list with the names of all the types the factory can create. We can then output this list when an unknown type is provided by the user in the case file.
This has proven to be a nice way of exploring what is available in the code in e.g. OpenFOAM. One intentionally puts a jibberish string in the "type" just to see the options. The minus is a bit of extra burden on the developers, but I think it is tolerable.
So far "don't merge" as I will extend it to all factories upon approval.
Question: is the string concatenation routine ok? Will it just reallocate the result to the necessary size as we are concating in new items to it?