Skip to content
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

Multiline config option values and Paraview vtu default output #996

Merged
merged 8 commits into from
May 28, 2020

Conversation

talbring
Copy link
Member

@talbring talbring commented May 20, 2020

Proposed Changes

This PR just contains two small changes:

  1. I added the capability to use multi-line statements in the config file. That should make the file a little bit more readable, especially for list options. To continue a statement in the next line, use \ at the end of the current line. Commented lines and everything after the \ are skipped. That means the following way to specify an option works now:
SCREEN_OUTPUT=(INNER_ITER, \ % A comment that is ignored
               WALL_TIME, \
               RMS_DENSITY, \
               LIFT, \
               DRAG, \
              %CAUCHY_SENS_PRESS, \ Option value is ignored
               CAUCHY_DRAG, \
              %RMS_ADJ_DENSITY, \ Option value is ignored
               RMS_ADJ_ENERGY)

Furthermore, if an error occurs now during the processing of the config file, the line number is also printed in order to quickly identify the location.

  1. Paraview XML format is now the default format (*.vtu) if the option OUTPUT_FILES is not present. I wanted to do that already when I added the XML format in January, but I simply forgot... The old format can be used with PARAVIEW_LEGACY and SURFACE_PARAVIEW_LEGACY.

Related Work

Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags).
  • My contribution is commented and consistent with SU2 style.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple lines?! Take my money!

Copy link
Contributor

@TobiKattmann TobiKattmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this 💐
It makes especially DEFINITION_DV a lot easier to handle:)

@@ -2834,6 +2834,7 @@ void CConfig::SetConfig_Parsing(char case_filename[MAX_STRING_SIZE]) {

int err_count = 0; // How many errors have we found in the config file
int max_err_count = 30; // Maximum number of errors to print before stopping
int line_count = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a short description here

continue

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a small comment here maybe like "# Unify lines that end with a continuation char '' "

@talbring talbring merged commit 626be8f into develop May 28, 2020
@talbring talbring deleted the feature_multiline branch May 28, 2020 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants