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

Remove VTK_cartesian config key and corresponding code #34

Conversation

RobinSattler
Copy link
Contributor

As mentioned in issue #33, the plan was to fix the Cartesian VTK output since it contained a few bugs. I realized that the fix is quite complex due to the transformation $t = \tau \cdot \cosh(\eta)$ and the resulting spread of values over multiple Cartesian time files (which is not considered in the code at the moment). Furthermore, this output is probably not used by anyone and since it is not useful because of the bugs, Niklas and I decided to simply remove it. A fortunate side point is that the removal decreased runtime when VTK output is used.

What I did

  • Removed the VTK_cartesian config key and all corresponding code in src/vtk.h and src/vtk.cpp.
  • Optimized the VTK code in a few locations.

What I tested

  • Created VTK output for eps, mub, muq, mus, nb, nq, ns, p, pi, and T with my changes and with the stable_ebe branch (with the same config and IC) and compared the outputs. They were identical, so my changes shouldn't have changed anything output-wise.
  • Left the old config key VTK_cartesian 1 in in one run and as expected it was not taken into account.

@NGoetz, could you check the changes and comment or approve?
@yukarpenko, as soon as Niklas approved it would be nice if you could take a look and comment or merge.

This commit restructures a part of the VTK source code to get rid of
a few lines of unnecessary or duplicated code. The function
`write_vtk_tensor` was not restructured (e.g., by just calling
`write_vtk_scalar(file, h, quantity+std::to_string(i)+std::to_string(j));`
inside the two for-loops and implementing an else-if-statement for the
components of `pi` in `write_vtk_scalar`) because this led to an
increase in runtime of 20-25% w.r.t. leaving the code duplicate.
The VTK_cartesian output included a few bugs which are quite complex
to solve due to the transformation t = \tau \cosh(\eta) which leads to
a spread of values over multiple Cartesian time files. Since this
output was more of a pet project and is not used, this commit removes
it entirely.
@nilssass nilssass requested a review from yukarpenko January 6, 2025 11:59
@NGoetz
Copy link
Contributor

NGoetz commented Jan 6, 2025

Looks good to me!

@yukarpenko
Copy link
Owner

Looks good to me as well.

@yukarpenko yukarpenko merged commit 4036b21 into yukarpenko:stable_ebe Jan 6, 2025
@RobinSattler RobinSattler deleted the sattler/remove-cartesian-vtk-output branch January 6, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants