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

Output file: long string name causes wrong format #100

Open
1 task done
chlookaburra opened this issue Feb 13, 2024 · 2 comments
Open
1 task done

Output file: long string name causes wrong format #100

chlookaburra opened this issue Feb 13, 2024 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@chlookaburra
Copy link

Description

If the string name of a blood vessel is too long, then it will append to the pressure_out column, instead of at the start of a new row.

See the attached file, where the first row has the usual time, flow_in, flow_out, pressure_in, pressure_out columns. However, the second and third rows have the name of the next blood vessel in the pressure_out column, which can cut off the value of pressure_out (as in the third row).
Screenshot 2024-02-12 at 7 56 41 PM

Reproduction

One could try naming a blood vessel "RightCommonCarotidArtery," which will reproduce this result.

Expected behavior

We would like svZeroDSolver to throw an error if we enter a blood vessel name that is too long or accept long strings.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@chlookaburra chlookaburra added the bug Something isn't working label Feb 13, 2024
@menon-karthik menon-karthik added the good first issue Good for newcomers label Feb 26, 2024
@mrp089
Copy link
Member

mrp089 commented Mar 5, 2024

While @chlookaburra and I were looking at the code, we noticed two occasions where we're using a fixed-size buffer:

// Create short and long buffer for lines
char sbuff[140];
char lbuff[236];

// Create short and long buffer for lines
char sbuff[87];
char lbuff[110];

I could see a full buffer causing this problem (I don't know if those sizes are hard-coded for performance). As a first step, try increasing them and see if that solves the problem. If yes, we could either dynamically allocate the size (if that doesn't reduce performance) or throw an error if things would be written incorrectly.

@ktbolt
Copy link
Contributor

ktbolt commented Apr 29, 2024

Output should use iostream with iomanip not fixed-size char arrays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants