Skip to content

Conversation

@arsLibera
Copy link
Contributor

Clean up input file parsers and add system tests for JSON input files

Current situation

I'm currently working on adding JSON input file support:

#114

We added JSON input file support previously. There are a rough patches in the input file parser and there are no system tests for the JSON input files or the conversion from legacy files to JSON input files.

Release Notes

Enable joint node associations

Enable direct joint node assocations by using the jointNode options variable when the model is created. This uses joint node associations defined in JSON input files. The legacy serializer behavior is preserved -- instead of using the listed joint node, we use sequential nodes from the node list to correspond to the joints. That's how createAndRunModel used to extract the node associations.

Clean up global usage

Additional clean up of options: (1) eliminate direct global population from legacy serializer. The output options are (for now) part of the options struct... until we can house them elsewhere. This frees the options from interactions with any global variables. (2) Updates to the json serializer: actually use node assocations now that the model will utilize them. Also include outputType and vtkOutputType until we move them.

Add system tests and documentation

Add system tests for conversion to JSON input files and simulation using JSON input files. Add documentation for the executable usage and running unit and system tests

Documentation

See updated readme.md

Testing

Manually ran tests and verified tests ran in GitHub actions

Code of Conduct & Contributing Guidelines

…ariable when the model is created. This uses joint node associations defined in JSON input files. The legacy serializer behavior is preserved -- instead of using the listed joint node, we use sequential nodes from the node list to correspond to the joints. That's how createAndRunModel used to extract the node associations.
…n from legacy serializer. The output options are (for now) part of the options struct... until we can house them elsewhere. This frees the options from interactions with any global variables. (2) Updates to the json serializer: actually use node assocations now that the model will utilize them. Also include outputType and vtkOutputType until we move them.
…st_integration.py) with an option for the binary location passed to pytest. That enables simple running of pytest regardless of the particular location of the binary directory. For example: pytest Tests/SystemTests --relativeExePath="../svOneDSolver_build/bin/OneDSolver" Also: make the system tests actually execute tests in the temporary directory so that we don't have artifacts generated in whatever directory we run the tests from.
…ing JSON input files. Add documentation for the executable usage and running unit and system tests
@arsLibera arsLibera mentioned this pull request Mar 2, 2025
1 task
Copy link
Member

@mrp089 mrp089 left a comment

Choose a reason for hiding this comment

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

Once again, looks great!

pip install numpy pytest-xdist
```

With `xdist` available, run the tests in parallel (`-n <number of cores>`).
Copy link
Member

Choose a reason for hiding this comment

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

I did not know that this was possible. Smart!!

('flow', 1, -1, -1, 'point', 3.9925, 1e-6),
('flow', 2, -1, -1, 'point', 3.9925, 1e-6),
])
]
Copy link
Member

Choose a reason for hiding this comment

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

I am to blame for this mess. I opened #122 to fix that in the future.


The one-dimensional equations for the flow of a Newtonian, incompressible fluid in a deforming, elastic domain consist of the continuity equation, a single axial momentum balance equation, a constitutive equation, and suitable initial and boundary conditions.

## Usage
Copy link
Member

Choose a reason for hiding this comment

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

Good idea to add that!

@mrp089 mrp089 merged commit 66b31b4 into SimVascular:master Mar 6, 2025
3 checks passed
@arsLibera arsLibera deleted the systemTests branch March 16, 2025 10:44
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