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

Solution output in CGNS format #1387

Merged
merged 11 commits into from
Oct 8, 2021
Merged

Solution output in CGNS format #1387

merged 11 commits into from
Oct 8, 2021

Conversation

baldang
Copy link
Contributor

@baldang baldang commented Oct 1, 2021

Proposed Changes

Added CGNS output format. Master node writes the output files and receives data from other processes (one at a time for each field to avoid memory limit problems). Some suggestions from feature_CGNS_output are included in the code. However, this first version produce a new file, mesh and solution, at each call as in the Paraview format. The code support CGNS and SURFACE_CGNS in the OUTPUT_FILES option

PR Checklist

  • 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, or simply --warnlevel=2 when using meson).
  • 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.

@lgtm-com
Copy link

lgtm-com bot commented Oct 1, 2021

This pull request introduces 2 alerts when merging 963e7c7 into 58c580b - view on LGTM.com

new alerts:

  • 2 for Multiplication result converted to larger type

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.

Nice 👍 The code looks generally ok, but there is room to simplify.

SU2_CFD/include/output/filewriter/CCGNSFileWriter.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/output/filewriter/CCGNSFileWriter.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/output/filewriter/CCGNSFileWriter.hpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/COutput.cpp Show resolved Hide resolved
@baldang
Copy link
Contributor Author

baldang commented Oct 2, 2021

Thank you for all the suggestions. Now, they should be all included in the code. Furthermore, I added the check when SU2 is not built with CGNS support as done in the Tecplot case.

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.

Thank you for the changes.
More suggestions below, you should be able to apply them directly in GitHub, also see the questions below and please add const to all the variables where that is possible.

SU2_CFD/include/output/filewriter/CCGNSFileWriter.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/output/filewriter/CCGNSFileWriter.hpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Oct 2, 2021

This pull request introduces 1 alert when merging 74ce20b into 58c580b - view on LGTM.com

new alerts:

  • 1 for Multiplication result converted to larger type

@lgtm-com
Copy link

lgtm-com bot commented Oct 2, 2021

This pull request introduces 1 alert when merging 9ec9fe2 into 58c580b - view on LGTM.com

new alerts:

  • 1 for Multiplication result converted to larger type

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.

Welcome to SU2 and thank you for the contribution! Give it some more time (~1 week) for people to review and test your contribution and then merge.

SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp Outdated Show resolved Hide resolved
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
@pcarruscag pcarruscag changed the title feature_outputCGNS Solution output in CGNS format Oct 2, 2021
@lgtm-com
Copy link

lgtm-com bot commented Oct 2, 2021

This pull request introduces 1 alert when merging 8b0ae98 into 58c580b - view on LGTM.com

new alerts:

  • 1 for Multiplication result converted to larger type

Copy link
Contributor

@WallyMaier WallyMaier left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -3237,6 +3237,16 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
}
#endif

/*--- Check if SU2 was build with CGNS support, as that is required for CGNS output. ---*/
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@pcarruscag pcarruscag merged commit f12cd07 into su2code:develop Oct 8, 2021
@pr-triage pr-triage bot removed the PR: unreviewed label Oct 8, 2021
@pr-triage pr-triage bot added the PR: merged label Oct 8, 2021
@pcarruscag
Copy link
Member

Hi @baldang, it seems we have some problems with Windows builds -> /~https://github.com/su2code/SU2/runs/3836680912?check_suite_focus=true
Can you have a look please? Seems to be related with the CGNS int types, maybe we need to typedef these in a special way for compatibility with Windows.
However we also use those types in the CGNS mesh reader... maybe @MicK7 can give some quick pointer to the solution.

@baldang
Copy link
Contributor Author

baldang commented Oct 8, 2021

Hi @pcarruscag, it sounds strange this error since before opening the PR I ran the same tests on my repository and it compliled correctly. Here you can have a look at it /~https://github.com/baldang/SU2/runs/3778439078?check_suite_focus=true . I will let you know if I find a solution.

@pcarruscag
Copy link
Member

Hmm ok I'm re-running the tests, maybe something went wrong because I merged without merging develop first.

@baldang
Copy link
Contributor Author

baldang commented Oct 8, 2021

The win build failed again but I have just ran the same tests on my forked repository and it builds correctly.

@baldang
Copy link
Contributor Author

baldang commented Oct 11, 2021

Hi @pcarruscag, I went trough the error in the Windows build and it is related to cgsize_t type definition contained in the CGNS library and not in the implemented code. It sounds strange since that part of code was already present in the code and cgsize_t was already used in CCGNSMeshReaderFVM class. To be sure, I removed the forked SU2 from my repositories and then I forked it again to have an exact copy of develop branch. I ran "Relase Management" pipeline and everything is fine. Do you have any suggestion regarding this issue?

@pcarruscag
Copy link
Member

Hi @baldang, problem solved: bba499e
I kinda found the solution here https://sourceforge.net/p/mingw-w64/mailman/message/24692038/
I don't know why this built in your fork.

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