Hi Guys,
i would like to stress the importance of creating new setting class with default simulation parameters.
Why do we need the settings class?
1) Right now it is quite unclear which objects are instantiated in the simulation class. Simulation creates some default values in its constructor, so does the grid. Later on in InitialConditions we overwrite some of these values with new values. Consequently, it is hard to tell for example what kind of field solver are we really using. Furthermore, it is very hard to determine the default value reliably since we are changing it at different places.
2) With the settings class we can easily introduce the possibility of setting the simulation parameters on command line or in a settings file.
3) When I am refactoring some code I often need to change every single method in the IntialConditions class. If we had a setting class, then all the different methods in InitialConditions can be replaced with different setting files and a single method for parsing the file. Thus, changes need to be done only to one method.
What do we require from the settings class?
1) It needs to specify default values for simulation parameters.
2) It should not change throughout the simulation (as Andreas wisely mentioned), so that we can easily rerun the simulation.
3) It should be able to parse the command line.
4) It should be able to parse a file.
If I am missing something, please add it.
How can such a simulation class look like?
See the attachment for the prototype of the settings class. If you see some crucial problems with the prototype please mention them.
I believe Kirill wanted to tackle this problem. If you are happy with the enclosed prototype I would very much appreciate if I can use it in the code of the distributed version I am writing now. Once Kirill starts working on the problem he can add the further non-trivial functionality.
Cheers,
Jan