KVSlab / VaMPy

A collection of tools for pre-processing, simulating, and post-processing vascular morphologies.
https://kvslab.github.io/VaMPy
GNU General Public License v3.0
15 stars 8 forks source link

RuntimeError: The network has only one outlet #130

Closed johannesring closed 10 months ago

johannesring commented 10 months ago

After the recent commit aa9d0d, which introduced changes to the setup_model_network function in preprocessing_common.py, I get the following error when trying to generate a mesh for models with only one inlet and one outlet:

Traceback (most recent call last):
  File "/home/johannr/miniconda3/envs/vampy/bin/vampy-mesh", line 8, in <module>
    sys.exit(main_meshing())
  File "/home/johannr/dev/simula/VaMPy/src/vampy/automatedPreprocessing/automated_preprocessing.py", line 630, in main_meshing
    run_pre_processing(**read_command_line())
  File "/home/johannr/dev/simula/VaMPy/src/vampy/automatedPreprocessing/automated_preprocessing.py", line 399, in run_pre_processing
    network, probe_points = setup_model_network(centerlines, file_name_probe_points, region_center, verbose_print,
  File "/home/johannr/dev/simula/VaMPy/src/vampy/automatedPreprocessing/preprocessing_common.py", line 695, in setup_model_network
    flowSplitting.ComputeAlphas(network, verbose_print)
  File "/home/johannr/dev/simula/VaMPy/src/vampy/automatedPreprocessing/NetworkBoundaryConditions.py", line 36, in ComputeAlphas
    raise RuntimeError('The network has only one outlet.')
RuntimeError: The network has only one outlet.

To reproduce this, try to run the mesh generation for a model with only one inlet and one outlet, such as a cylinder or stenosis.

Before the mentioned commit, this worked fine. Is this something that should be supported by vampy-mesh?

hkjeldsberg commented 10 months ago

@johannesring Thanks for reporting this!

Models with one outlet and one inlet must have been overlooked during the commit you referred to. I have made a fix and added a test (one inlet, one outlet model) for this in PR #131.

I hope this resolves the issue.

johannesring commented 10 months ago

Yes, that fixed the problem. Thanks!

johannesring commented 10 months ago

Fixed in PR #131.