A computational pipeline that integrates Python-based data manipulation scripts, MPI parallel processing architectures, and the SimVascular hemodynamic solver (
svsolver). The primary objective is to execute parameter sweeps simulating varying human postures by systematically altering numerical boundary conditions (specifically, vascular resistance values) across segmented 3D vascular models.
graph TD
A[PostureConfig DataClass] -->|Angle Bounds| B(Calculate Multiplier Matrix)
B --> C{VesselConfig Resistance}
C -->|Output .flow & .inp| D[subprocess: mpiexec.exe -n 8]
D --> E[svsolver-msmpi-bin.exe]
E --> F[Extract Logs via Regex]
F -->|Compile ndarray| G(Pandas DataFrame)
G -->|Serialize| H[(run_summary.pkl)]
H --> I[Jupyter Notebook Matplotlib]
- The
PostureConfigdataclass defines the geometric constraints. Variablesneck,torso, andlegsdenote rotational angles ( \theta ) in degrees. - These variables are bounded by physical constraints via a
__post_init__method (e.g., neck angle is clamped between -30° and 45°, torso between -15° and 60°).
- The script uses a
VesselConfigclass containing nested dictionariesAORTA_RESISTANCE,ABDOMINAL_RESISTANCE, andCORONARY_RESISTANCE. These dictionaries map distinct surface IDs (e.g., surface 2:btrunk, surface 3:carotid) to their baseline resistance magnitudes. - The input posture angles compute a scalar multiplier matrix. This matrix modifies the baseline resistances, simulating the physiological constriction or dilation of the vascular beds caused by gravitational or biomechanical factors.
- The pipeline relies on the
subprocessmodule to interface with the operating system shell. - It initiates the MPI executable (
mpiexec.exe) mapped to the binarysvsolver-msmpi-bin.exe. The execution defines the number of parallel threads using the-n 8argument, distributing the computational matrix operations across logical cores to accelerate the Navier-Stokes equations resolution.
- Following completion, the script automatically parses the generated log files and output dat files.
- Using Regular Expressions (
remodule), it identifies and slices specific time steps (e.g.,ITERATION_DURATION_MIN = 30) and extracts nodal pressure and velocity vectors. - Extracted vectors are compiled into multi-dimensional NumPy arrays (
np.ndarray) and converted into pandas DataFrames for structured indexing. - The final aggregated data matrix is serialized via the
picklemodule intorun_summary.pklto optimize read I/O during subsequent visualization phases.
Caution
Configured paths pointing to the execution binaries (mpiexec.exe, svsolver) must be strictly set within the global variables of run_summary_extract.py before initiating the Jupyter kernel.
-
System Prerequisites Ensure that Microsoft MPI (or OpenMPI) and the SimVascular suite are installed on your host system.
-
Environment Setup Install the core data science stack required for parsing and visualization:
pip install numpy pandas matplotlib jupyter
-
Execute the Pipeline Launch the Jupyter Notebook server:
jupyter notebook
Open
main.ipynbornew.ipynbin your browser. Configure your desiredPostureConfigangles in the first cell and execute the notebook sequentially to trigger thempiexecsolver instances.
The repository utilizes Jupyter Notebooks (main.ipynb, new.ipynb) as the frontend controller for the pipeline. These environments allow for iterative configuration of the PostureConfig parameters and use matplotlib.pyplot to generate flow waveform graphs comparing pressure gradients across the defined surface IDs under varying geometric states.