New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormattedTable needs refactoring #3233
Comments
Here is my design proposal. First, I think we should make it a MooseObject to give us the InputParameters interface. This would allow all of the settings such as the terminal width, output precision, delimiter, etc... to be specified and stored via the InputParameters, which will eliminate the multitude of set methods for each of the parameters. If we don't make it a MooseObject I still think we should user InputParameters for the settings and provide template setters/getters. class FormattedTable : public MooseObject // I will discuss this at the end // Allow for the independent variable to be set at construction; default to time, but allow it // This stays the same, except time is now more generic. However, this will // Printing complete table and partial table to stream // Writing to files, the type of write GNU, CSV, ... handled via filename extension protected: printTablePiece(...) }; |
On another note, do we want to be able to print VectorPostprocessor tables to the screen? If so, what should we do to minimize major screen dump. Perhaps, we print the first few values and the last few with ... in the middle. distance value |
I vote against making it a MooseObject. That would make it much less flexible and harder to unit test. In light of that I would also vote against using input parameters. This type of thing is a pure CS project and it should conform to good object-oriented coding practices. |
I do agree that it needs to be refactored though! |
I recently refactored FormattedTable quite a bit (#10199). It's properly stateful now so it can be stored on disk and recovered. It no longer writes entire files when asked to append. It also has a new addData interface specifically to handle VectorPostprocessors (i.e. add a Column Vector). I stopped short of making the underlying data structure a vector of vectors though which might be the final "nice" improvement. It has been refactors so that the outer part of the structure is a vector, but the inner part is still a map. I think I'll close this ticket and allow someone to open a new specific ticket for something that needs to be fixed if it's needed. |
Once we finalize what we want to do for VectorPostprocessor output the FormattedTable object needs to be reformatted. It seems to be getting messy, I just added some more mess with #3229.
I will do this, but just want us to all agree on what the VectorPostprocessor output will look like before I start.
The text was updated successfully, but these errors were encountered: