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

BGK: generalize initial conditions parser #335

Merged
merged 8 commits into from
Jul 16, 2024

Conversation

JamesMcClung
Copy link
Collaborator

Rewrote the parser for BGK initial conditions in a completely generalized way, without any hardcoded values. The new parser in table.hxx parses an arbitrary file with space-separated values, reading column headers from the first line and treating the remaining lines as data until it hits an empty line or EOF.

This implementation stores the data in a row-major order using vectors (so I suppose it isn't row-major in the same sense that a 2d array would be). There's one big vector containing the rows, which are also vectors. A column-major order might be significantly more performant, but row-major was more convenient for the parsing algorithm, and currently the table is only used during initialization. I almost rewrote it to be column-major, but I figured it should be unit tested first.

Copy link
Contributor

@germasch germasch left a comment

Choose a reason for hiding this comment

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

LGTM

@JamesMcClung JamesMcClung merged commit c0635d3 into psc-code:main Jul 16, 2024
6 checks passed
@JamesMcClung JamesMcClung deleted the pr/bgk-variable-input-cols branch July 16, 2024 19:02
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.

2 participants