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

v2 #53

Merged
merged 66 commits into from
Mar 20, 2024
Merged

v2 #53

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
98d8f60
remove @fastmath from NR method
alemelis Oct 4, 2022
3603051
bump version
alemelis Oct 4, 2022
992177a
rm @inbounds and @simd
alemelis Oct 24, 2022
be562eb
broadcast IO
alemelis Nov 3, 2022
9af396e
add benchmark definitions
alemelis Nov 4, 2022
eaca195
Merge branch 'benchmark' into v2
alemelis Nov 4, 2022
991c9e4
broadcast
alemelis Nov 24, 2022
d6e63b2
up
alemelis Dec 8, 2022
2ea0869
u*
alemelis Jun 6, 2023
b9134e2
version bump
alemelis Jun 6, 2023
f8ebd00
getting there?
alemelis Jun 8, 2023
834dfe3
.
alemelis Jun 22, 2023
4a06a6e
.
alemelis Jun 23, 2023
2b415d6
graphs
alemelis Jul 3, 2023
58100ce
add graphs
alemelis Jul 4, 2023
66cbf30
single input OK
alemelis Nov 20, 2023
916eb09
update ci
alemelis Nov 20, 2023
91326ce
no id
alemelis Nov 20, 2023
59656cc
64bit only
alemelis Nov 20, 2023
121b3d3
update docs
alemelis Nov 20, 2023
53bfb52
logo and docs workflow
alemelis Nov 20, 2023
5a10661
convergence_tolerance
alemelis Nov 20, 2023
c2db406
todos
alemelis Nov 21, 2023
714f71c
fancy progress meter
alemelis Nov 21, 2023
7b32623
no pcn
alemelis Nov 21, 2023
08858e8
add adan56
alemelis Nov 22, 2023
dd65c1c
add cow and invitro models
alemelis Nov 23, 2023
d31ce84
wip
alemelis Nov 23, 2023
a5f29d0
network checks
alemelis Dec 1, 2023
a244695
get
alemelis Dec 15, 2023
244e038
rmse
alemelis Dec 16, 2023
39b5038
fix c
alemelis Dec 17, 2023
74b08c1
no P
alemelis Dec 18, 2023
1ac9fe9
fix dt
alemelis Dec 18, 2023
ad5ff9a
tuples
alemelis Dec 20, 2023
eed86ea
add adan test
alemelis Dec 20, 2023
1369e17
fmt
alemelis Dec 20, 2023
a211ad8
deploy docs
alemelis Dec 20, 2023
67ebe26
refactor readme
alemelis Dec 20, 2023
542ff2c
docs toml
alemelis Dec 20, 2023
ef568f0
Merge branch 'master' into v2
alemelis Dec 20, 2023
ed89ce5
simpler ci
alemelis Dec 21, 2023
a2c3b23
update docs
alemelis Dec 21, 2023
1cb2055
authors
alemelis Dec 21, 2023
faa03c6
Merge branch 'master' into v2
alemelis Dec 21, 2023
cf8a190
update contribution guidelines
alemelis Dec 21, 2023
ecb8f82
refresh license
alemelis Jan 9, 2024
ba9e134
solve parabolic system
alemelis Jan 18, 2024
e108e49
test adan56 elastic
alemelis Jan 18, 2024
493ab87
update test ref
alemelis Jan 29, 2024
2178b04
add adan56ve
alemelis Jan 30, 2024
e21762f
fix inlet parsing
alemelis Jan 30, 2024
38bcbb9
fix P
alemelis Feb 2, 2024
5932b28
update tests
alemelis Feb 8, 2024
f562781
match inlet impedance
alemelis Feb 20, 2024
4ffa7e2
add impedence_matching flag
alemelis Mar 1, 2024
f9889f4
abs(R_tot)
alemelis Mar 13, 2024
9e37b38
add single artery and bifurcation validation files
alemelis Mar 13, 2024
fefafb0
adjust iliac bifurcation figsize
alemelis Mar 13, 2024
e5b4efb
download ref data instead of keeping it on the repo
alemelis Mar 14, 2024
e494a13
fix gist ids
alemelis Mar 14, 2024
2872c0c
rm adan test
alemelis Mar 14, 2024
950cbab
download B2015 data directly
alemelis Mar 20, 2024
2997314
merge validation into models/Boileau2015
alemelis Mar 20, 2024
07e3d63
update readme
alemelis Mar 20, 2024
91fbed9
update ci
alemelis Mar 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
name: CI

on: [push, pull_request]
on: [pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ['1.7', 'nightly']
julia-arch: [x64, x86]
julia-version: ['1.10.2']
julia-arch: [x64]
os: [ubuntu-latest, windows-latest, macOS-latest]
exclude:
- os: macOS-latest
julia-arch: x86

steps:
- uses: actions/checkout@v2
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Documentation

on:
push:
branches:
- master
tags: '*'

jobs:
build:
permissions:
contents: write
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1.6'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia --project=docs/ docs/make.jl
21 changes: 18 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
test/**/*_results/*
**/*_results
**/.DS_Store
cvs_results/*
docs/build/*
docs/build
Manifest.toml
README.html
*.ipynb
Expand All @@ -10,3 +9,19 @@ README.html
*.yaml
*.conv
**/*.swp
plot*
!models/**/*.yaml
!models/**/*.dat
**/__pycache__

# validation
validation/*

# models
models/Boileau2015/*/*_ref
models/Boileau2015/*/*_results
models/**/*.eps
models/**/*.png
!models/Boileau2015/plot.py
!models/Boileau2015/plot_style.txt
!models/Boileau2015/adan56/plot.py
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Following there is a set of guidelins for contributing to openBF development. Fe

### Reporting bugs
- Check the [open issues](https://github.com/INSIGNEO/openBF/issues) to avoid duplicates
- Ensure you are using the latest Julia version compatible with openBF; currently, this is the 0.6.0
- Ensure you are using the latest Julia version compatible with openBF
- Open a bug report (see [here](https://github.com/atom/atom/blob/master/CONTRIBUTING.md#how-do-i-submit-a-good-bug-report) for a _good_ bug report template) OR try to fix it and make a pull request

### Suggest Enhancements
Currently, openBF is in active development and new features will be added in the future. We keep track of the additions in our [roadmap](https://github.com/INSIGNEO/openBF/issues/6). Feel free to suggest more enhancements through the issues tracker.
Currently, openBF is in active development and new features will be added in the future. Feel free to suggest more enhancements through the issues tracker.

### New vascular networks
We collect vascular networks in a separate repository, [openBF-hub](https://github.com/alemelis/openBF-hub). If you have used openBF to analyse a new network, please make a pull request to the hub so that we can keep expanding our model repository.
We collect vascular networks in the [models](models) folder. If you have used openBF to analyse a new network, please make a pull request so that we can keep expanding our model repository.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2022 INSIGNEO Institute for in silico Medicine
Copyright 2023 INSIGNEO Institute for in silico Medicine

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name = "openBF"
uuid = "e815b1a4-10eb-11ea-25f1-272ff651e618"
authors = ["alessandro <[email protected]>"]
version = "1.5.0"
version = "2.0.0"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
171 changes: 11 additions & 160 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,173 +10,24 @@

<a href="https://github.com/INSIGNEO/openBF/actions"><img alt="openbf ci status" src="https://github.com/INSIGNEO/openBF/actions/workflows/ci.yml/badge.svg"></a>

openBF is an open-source 1D blood flow solver based on MUSCL finite-volume numerical scheme, written in [Julia](https://julialang.org/downloads/) and released under [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) free software license.

[_Docs_](#docs) | [_Installation_](#installation) | [_Example_](#example) | [_Plot_](#plotting) | [_Dev_](#how-to-dev) | [_Hub_](#ecosystem) | [_Cite_](#cite)

### Docs

- openBF __≦v0.6.3__ check this [website](https://INSIGNEO.github.io/openBF/Docs/index.html) for documentation and tutorials.
- openBF __v0.7+__ docs can be built as `julia make.jl` inside the `docs/` folder (this requires [Documenter](https://github.com/JuliaDocs/Documenter.jl) package).

### Installation

Provided you already have a Julia v1.x installation (all platforms [download](https://julialang.org/downloads/) and Windows [instructions](http://wallyxie.com/weblog/adding-julia-windows-path-command-prompt/)), you can add openBF as

```
julia> ]
(v1.x) pkg> add https://github.com/INSIGNEO/openBF
```

update it as

```
julia> ]
(v1.x) pkg> update openBF
```

test it as

```
julia> ]
(v1.x) pkg> test openBF
```

and use it as

```julia
julia> using openBF
julia> openBF.runSimulation("<input file name>.yml")
```

You can also create (MacOSX/Linux only) an openBF alias as

```bash
$ echo "alias openBF='cp ~/.julia/v1.x/openBF/main.jl ./main.jl && julia main.jl $1'" >> ~/.bashrc
$ source ~/.bashrc
$ openBF -h
usage: main.jl [-v] [-f] [-c] [-h] input_filename

positional arguments:
input_filename .yml input file name

optional arguments:
-v, --verbose Print STDOUT - default false
-f, --out_files Save complete results story rather than only the
last cardiac cycle
-c, --conv_ceil Ceil convergence value to 100 mmHg (default true)
-h, --help show this help message and exit
```
[![chat](https://dcbadge.vercel.app/api/server/xKfr8BgN)](https://discord.gg/xKfr8BgN)

### Example

```
project name: <project name>
results folder: <path/to/your/results/directory>

blood:
rho: 1060.0 # density
mu: 4.e-3 # kinematic viscosity

solver:
Ccfl: 0.9 # Courant number
cycles: 100 # max number of cardiac cycles
jump: 100
convergence tolerance: 15.0 # convergence min error threshold

network:
- label: <vessel name>
sn: 1
tn: 2
E: 400000 # Young's modulus
L: 0.04 # length
R0: 0.012 # lumen radius
inlet number: 1
inlet: Q
inlet file: <inlet filename>
- label: <vessel name>
sn: 2
tn: 3
E: 400000
L: 0.103
R0: 0.010
outlet: wk2
Cc: 8.2e-11 # peripheral compliance
R1: 8480000000.0 # peripheral resistance
```

### Plotting

Install [Plots.jl](https://github.com/JuliaPlots/Plots.jl)

```
julia> ]
(v1.x) pkg> add Plots
(v1.x) pkg> <backspace>
julia> using Plots
```
(the first time you run this, the library will be compiled and it may takes several minutes)

plot something
```
using DelimitedFiles

# open the result files
v1 = DelimitedFiles.readdlm("v1_P.last")
v2 = DelimitedFiles.readdlm("v2_P.last")

plot(v1[:,1], v1[:,end]/133.332, label="v1")
plot(v2[:,1], v2[:,end]/133.332, label="v2")

xlabel!("time (s)")
ylabel!("pressure (mmHg)")
```
![waveforms](https://user-images.githubusercontent.com/4661737/97332078-f4101d80-1871-11eb-970d-b7761c069688.png)

### How to dev

```
$ git clone https://github.com/INSIGNEO/openBF.git
$ cd openBF
$ julia
julia> ]
(v1.x) pkg> add Revise
(v1.x) pkg> activate .
(openBF) <backspace>
julia> using Revise
julia> using openBF
```

### Ecosystem

- A collection of 1D networks (from literature) solved by means of openBF can be found in the [openBF-hub](https://github.com/alemelis/openBF-hub) repository.
- The scripts to generate a virtual population of ADAN56s can be found in [openBF-db](https://github.com/alemelis/openBF-db) repository.
- The scripts to generate aged versions of a template openBF model can be found in [openBF_ageing](https://github.com/ibenemerito88/openBF_ageing).
- openBF badge [![openBF](https://img.shields.io/badge/-openBF-red.svg?colorA=ffffff&colorB=008080&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAQAAACFzfR7AAAA10lEQVQoz4XQIUvDARCG8R%2BCaUEEqwwMwyKCYbImLCp%2BAoPJpMWyYFnfN1BBP4IGk0FkYBkyDYJgkBXTUOcYbFM8g0M3t%2F98rhz3Pnfh6GfKg7bQ8exG1hh2xE%2B9SCeLuT4xlC39RkeKUr1%2B1uWAGMKF%2Be9wW7gzgzX1IS2EhhVIaQnnSj6HlEerCsKrObgeeSeEPfvy7oUzqCaKVzLy3oUnpnWFsi3txIUP6%2BwKdQvIuh2pvdmAUwcyvfdM2PwjNx0mvz3tRAgVOZPGciw0LfqXmprlwdEX%2F8%2BRhjBYrRoAAAAASUVORK5CYII%3D)](https://github.com/INSIGNEO/openBF)

### Publications
openBF is an open-source 1D blood flow solver based on MUSCL finite-volume numerical scheme, written in [Julia](https://julialang.org/downloads/) and released under [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) free software license.

openBF has been used in the following works:
Read the [documentation](https://insigneo.github.io/openBF) for installation and run instructions.

_Journal Papers_
- Benemerito I, Mustafa A, Wang N, Narata AP, Narracott A, Marzo A. [A multiscale computational framework to evaluate flow alterations during mechanical thrombectomy for treatment of ischaemic stroke](https://www.frontiersin.org/articles/10.3389/fcvm.2023.1117449/full). _Frontiers in Cardiovascular Medicine_, 2023. DOI: 10.3389/fcvm.2023.1117749
- Benemerito I, Narata AP, Narracott A, Marzo A. [Determining clinically-viable biomarkers for ischaemic stroke through a mechanistic and machine learning approach](https://link.springer.com/article/10.1007/s10439-022-02956-7). _Annals of Biomedical Engineering_, 2022. DOI: 10.1007/s10439-022-02956-7
- Melis A, Moura F, Larrabide I, Janot K, Clayton RH, Marzo A. [Improved biomechanical metrics of cerebral vasospasm identified via sensitivity analysis of a 1D cerebral circulation model](https://www.sciencedirect.com/science/article/pii/S0021929019302830). _Journal of Biomechanics_, 2019. DOI: 10.1016/j.biomech.2019.04.019
- Melis A, Clayton RH, Marzo A. [Bayesian sensitivity analysis of a 1D vascular model with Gaussian process emulators](http://rdcu.be/AqLm). _International Journal for Numerical Methods in Biomedical Engineering_, 2017. DOI: 10.1002/cnm.2882
## Release notes

_Conference Papers_
- Ning W, Sharma K, Sourbron SP, Benemerito I, Marzo A. [Distinguishing hypertensive renal injury from diabetic nephropathy using MR imaging and computational modelling of renal blood flow](https://vph-conference.org/), _VPH2022_ September 2022, Porto, PO _In proceedings_
- Benemerito I, Jordan B, Mustafa A, Marzo A. [Quantification of the effects of ageing, hypertension and atherosclerosis on flow reversal during a mechanical thrombectomy procedure](https://www.sheffield.ac.uk/insigneo/overview/events/biomedeng-2021-conference), _BioMedEng21_ September 2021, Sheffield, UK _In proceedings_
- Benemerito I, Narata AP, Narracott A, Marzo A. [Pulsatility indices can inform on distal perfusion following ischaemic stroke](https://www.cmbbe-symposium.com/2021/wp-content/uploads/sites/2/2021/09/Program-CMBBE21-A4.qxp_Detailed.pdf), _CMMBE_ September 2021, Online event, _In proceedings_
- Benemerito I, Narata AP, Narracott A, Marzo A. [Identification of biomarkers for perfusion following an ischaemic event](https://cbmc21.vfairs.com/), _CMBE_ September 2021, Online event, _In proceedings_
- Melis A, Clayton RH, Marzo A. [A more efficient approach to perform sensitivity analyses in 0D/1D cardiovascular models](http://www.compbiomed.net/2015/cmbe-proceedings.htm), _CMBE_ July 2015, Cachan, FR. _In proceedings_
### v2.0.0
This is a complete re-write of openBF solver with several bugfixes and few new functionalities.
Config files should be backward compatible but please refer to the new [documentation](https://insigneo.github.io/openBF) for more details.

_PhD theses_
- Mustafa A. [An efficient computational approach to guide intervention in treatment of stroke](https://etheses.whiterose.ac.uk/29992/). _PhD Thesis_, 2021
- Melis A. [Gaussian process emulators for 1D vascular models](http://etheses.whiterose.ac.uk/19175/). _PhD Thesis_, 2017.
Currently not supported:
- multiple inlets

If your workflow relies on this feature, we recommend to use [release v1.5.1](https://github.com/INSIGNEO/openBF/releases/tag/v1.5.1).

Have you used openBF for your research? Let us know!
---

### Citation

Expand Down
5 changes: 5 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "1.2"
21 changes: 15 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
push!(LOAD_PATH, "../src/")
using Documenter, openBF

makedocs(
format = Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true"),
sitename = "openBF",
pages = [
"Home" => "index.md",
"Manual" => Any[
"Guide" => "man/guide.md",
"man/config.md",
"man/examples.md"
]
])
"Overview" => "man/overview.md",
"Quickstart" => "man/quickstart.md",
"Configuration" => "man/config.md",
"Examples" => "man/examples.md",
],
)


# TODO: add link to dashboard

deploydocs(
repo = "github.com/INSIGNEO/openBF.git",
)
Binary file added docs/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/src/assets/single-artery.png
Binary file not shown.
Loading
Loading