Skip to content

Commit 1c0fd6b

Browse files
authored
Merge pull request #89 from SimVascular/JOSS_paper
Merge changes made during JOSS review to main branch.
2 parents a07bc45 + 59d831a commit 1c0fd6b

File tree

14 files changed

+464
-18
lines changed

14 files changed

+464
-18
lines changed

Class.png

180 KB
Loading

Code/Source/svFSI/BF.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ SUBROUTINE SETBFL(lBf, lM, Dg)
138138
RETURN
139139
END SUBROUTINE SETBFL
140140
!####################################################################
141-
! This subroutine is reached only for shell follower pressre loads
141+
! This subroutine is reached only for shell follower pressure loads
142142
! or applying initialization pressure for CMM method. nsd must be
143143
! equal to 3
144144
SUBROUTINE BFCONSTRUCT(lM, e, eNoN, idof, xl, dl, bfl, ptr)

Code/Source/svFSI/CHNL.f

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ SUBROUTINE CHNLOUTPUT(chnl,isTmp)
230230
IF (chnl%oTF) THEN
231231
INQUIRE(UNIT=chnl%fId, OPENED=flag)
232232
IF (.NOT.flag) THEN
233-
IF (appPath .NE. "") CALL SYSTEM("mkdir -p "//TRIM(appPath))
234233
fName = TRIM(appPath)//TRIM(chnl%fName)
235234
INQUIRE(FILE=fName, OPENED=flag)
236235
IF (.NOT.flag) THEN

Code/Source/svFSI/READFILES.f

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ SUBROUTINE READFILES
122122
saveName = ""
123123
appPath = STR(cm%np())//"-procs"//delimiter
124124
END IF
125+
IF (appPath .NE. "") CALL SYSTEM("mkdir -p "//TRIM(appPath))
125126

126127
lPtr => list%get(std%oTS,"Verbose")
127128
lPtr => list%get(wrn%oTS,"Warning")

Docker/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM ubuntu:18.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
# Install supporting packages
6+
RUN apt-get update
7+
RUN apt-get install -yq --no-install-recommends apt-utils
8+
RUN apt-get install -yq git make cmake
9+
RUN apt-get install -yq libblas-dev liblapack-dev
10+
RUN apt-get install -yq gcc g++ gfortran
11+
RUN apt-get install -yq openmpi-bin libopenmpi-dev
12+
13+
# Create directory
14+
RUN mkdir -p /home/test
15+
16+
# Add non-root user and set up home directory
17+
RUN useradd testuser -u 1000 -g 100 -m -s /bin/bash
18+
RUN chown testuser /home/test
19+
USER testuser
20+
WORKDIR /home/test
21+
22+
# Obtain source code
23+
RUN git clone https://github.com/SimVascular/svFSI
24+
25+
# Compile svFSI source code
26+
RUN mkdir Build && \
27+
cd Build && \
28+
cmake ../svFSI && \
29+
make
30+
31+
ENV PATH=$PATH:/home/test/Build/svFSI-build/bin

Docker/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Docker-svFSI
2+
This Dockerfile will build [`svFSI`](https://github.com/SimVascular/svFSI) executable from the most recent source code in the main repository. This procedure has been successfully tested on MacOS Big Sur, Ubuntu 18.04 and Windows 10 with WSL 2. Assuming you already have [Docker](https://docs.docker.com/get-docker/) installed, please follow the steps below to run `svFSI`.
3+
4+
1. Build Docker image. In the current directory (Path_to_svFSI/Docker), run the following command.
5+
6+
```bash
7+
docker build -t svfsi-image .
8+
```
9+
10+
This may take a while. Afterwards, run the command `docker images`, and you should see `svfsi-image`.
11+
12+
3. Download the examples.
13+
14+
```bash
15+
git clone https://github.com/SimVascular/svFSI-Tests
16+
```
17+
18+
4. Run the container in interactive mode.
19+
20+
```bash
21+
docker container run --cap-add=SYS_PTRACE -v "$PWD"/svFSI-Tests:/home/test/svFSI-Tests -it --rm --name svfsi-demo svfsi-image
22+
```
23+
24+
This will open a shell prompt and you can proceed as usual. Here, `--cap-add=SYS_PTRACE` fixes a known [issue](https://github.com/open-mpi/ompi/issues/4948) of running openmpi in Docker.
25+
26+
5. Let's take `04-fluid/06-channel-flow-2D` for example. In the shell prompt, run the following commands to generate the simulation results.
27+
28+
```bash
29+
cd svFSI-Tests/04-fluid/06-channel-flow-2D && \
30+
mpiexec -n 4 svFSI ./svFSI_Taylor-Hood.inp
31+
```
32+
33+
The results will be stored in `4-procs` in vtu format, and can be viewed with [Paraview](https://www.paraview.org).
34+
35+
6. After all tests are done, execute the following commands to exit the docker and delete the image.
36+
37+
```bash
38+
exit && \
39+
docker rmi <IMAGE ID>
40+
```
41+
42+
43+
44+
### Known Issues
45+
46+
`svFSI` built with this Dockerfile won't work with any example that requires Trilinos. Trilinos takes too long to build within the Docker image, and we encourage any user that needs it to build `svFSI` from source. Please report any other issue through the GitHub page.

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# **Build svFSI from Source**
33

4-
Below are the instructions to build svFSI on Ubuntu and MacOS.
4+
If you are interested in testing the new features in the most recent commit, we recommend you to build and run `svFSI` in [Docker container](./Docker/README.md). Otherwise, please follow the instructions below to build `svFSI` on Ubuntu and MacOS.
55

66
<hr style="border:2px solid gray"> </hr>
77

File renamed without changes.

Mesh.png

203 KB
Loading

README.md

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1+
## NOTE
2+
3+
This branch is created from master on Jan 4, 2022 and will be referenced in the manuscript to be submitted for the Journal of Open Source Software (JOSS).
4+
15
## Introduction
26

3-
`svFSI` is a multi-physics finite element solver designed for computational modeling of the cardiovascular system. Some of the unique capabilities of `svFSI` include modeling cardiac electrophysiology, biological tissue mechanics, blood flow, and large deformation fluid-structure interaction (FSI). `svFSI` also offers a wide choice of boundary conditions for performing patient-specific modeling of cardiovascular biomechanics. The code is parallelized using message-passing-interface (MPI) and offers multiple options to choose a linear solver and preconditioner. `svFSI` can be used as part of the [SimVascular](https://simvascular.github.io) software or can be used as a stand-alone solver.
7+
`svFSI` is a multi-physics finite element solver designed for computational modeling of the cardiovascular system. It is a major component of the ongoing SimVascular [**SimCardio**](http://simvascular.github.io/docsSimCardio.html) project that aims to provide the complete pipeline for cardiac modeling, from image segmentation to computational modeling.
8+
9+
Some of the unique capabilities of `svFSI` include modeling cardiac electrophysiology, biological tissue mechanics, blood flow, and large deformation fluid-structure interaction (FSI). `svFSI` also offers a wide choice of boundary conditions for performing patient-specific modeling of cardiovascular biomechanics. The code is parallelized using message-passing-interface (MPI) and offers multiple options to choose a linear solver and preconditioner. `svFSI` can be used as part of the [SimVascular](https://simvascular.github.io) software or can be used as a stand-alone solver. It is distributed under a MIT-like open source license.
10+
11+
## Binary and Container
12+
Precompiled binaries for Ubuntu and MacOS are available for download from [SimTK](https://simtk.org/frs/index.php?group_id=188).
13+
14+
Instructions to build and run `svFSI` in Docker container are provided [here](./Docker/README.md).
415

516
## Dependence
617

@@ -15,9 +26,7 @@ The following packages are required to build and use `svFSI`.
1526

1627
On Ubuntu, most of the dependencies can be installed using `apt install`. On macOS, the dependencies may be installed using `brew`. Apart from GNU compilers, `svFSI` can also be built with Intel oneAPI Toolkits. For more details, please refer to [`INSTALL.md`](./INSTALL.md#Build) and [`INSTALL-DEPS.md`](./INSTALL-DEPS.md#intel-oneapi-toolkitsd).
1728

18-
## Quick Build
19-
20-
Precompiled binaries for Ubuntu and MacOS are available for download from [SimTK](https://simtk.org/frs/index.php?group_id=188).
29+
## Quick Build from Source
2130

2231
Users are recommended to build from the source code to access the most recent features and bug fixes. Instructions for a quick build are provided here for a Linux/Mac OS system.
2332

@@ -34,7 +43,7 @@ Users are recommended to build from the source code to access the most recent fe
3443
```bash
3544
make
3645
```
37-
A successful build will generate a solver binary, called `svFSI` in the following directory `build/svFSI-build/bin`.
46+
A successful build will generate a solver binary called `svFSI` in the following directory `build/svFSI-build/bin`.
3847

3948
For more advanced users, please refer [`INSTALL.md`](./INSTALL.md) for detailed platform-specific instructions to install `svFSI`.
4049

@@ -52,11 +61,11 @@ option(SV_USE_TRILINOS "Use Trilinos Library with svFSI" ON)
5261

5362
In most cases, users can proceed to build `svFSI` following the [Quick Build](#quick-build), and CMake should be able to locate Trilinos automatically through `find_package`. In case the automatic way fails, users can also specify the path to Trilinos through `ccmake -DCMAKE_PREFIX_PATH:PATH="<Path_to_Trilinos>/lib/cmake/Trilinos;<Path_to_any_other_package>;"`.
5463

55-
For more detailed instructions, please refer INSTALL.md.
64+
For more detailed instructions, please refer to [`INSTALL.md`](./INSTALL.md).
5665

5766
## Run Simulation
5867

59-
`svFSI` requires a plain-text input file to specify simulation parameters. The syntax of the input file can be found [here](https://sites.google.com/site/memt63/tools/MUPFES/mupfes-scripting).
68+
`svFSI` requires a plain-text input file to specify simulation parameters. The syntax of the input file can be found [here](http://simvascular.github.io/docssvFSI.html#input).
6069

6170
A master template is provided in the current repository, [svFSI_master.inp](./svFSI_master.inp). Users are also recommended to go through the input files in the [examples](https://github.com/SimVascular/svFSI-Tests) and modify them for their needs.
6271

@@ -66,7 +75,15 @@ mpiexec -np <number of MPI processes> <Path to Build>/svFSI-build/bin/svFSI <Pa
6675
```
6776
## Features
6877

69-
`svFSI` provides the capability to model a variety of physics including unsteady diffusion, linear and nonlinear elastodynamics, convective heat transfer, fluid flows, fluid-structure-interaction (FSI), and cardiac electrophysiology. As the code is modular, the users are provided with a choice to couple these physics depending on their needs. We strongly recommend users to browse through the examples provided in the GitHub repository [svFSI-Tests](https://github.com/SimVascular/svFSI-Tests) to get a detailed insight into the capability of the code.
78+
`svFSI` provides the capability to model a variety of physics including unsteady diffusion, linear and nonlinear elastodynamics, convective heat transfer, fluid flows, fluid-structure-interaction (FSI), and cardiac electrophysiology. As the code is modular, the users are provided with a choice to couple these physics depending on their needs. We strongly recommend users to browse through the examples provided in the GitHub repository [svFSI-Tests](https://github.com/SimVascular/svFSI-Tests) to get a detailed insight into the capability of the code. Also, most of the examples contain established simulation results, which users can use to verify the functionality of `svFSI`. Here is a list of the main features of `svFSI`.
79+
80+
| *Physics Solved* | *Documentation/Tutorial* | *Examples* |
81+
|-------------------|--------------------------|------------|
82+
| Fluid | [Webpage](http://simvascular.github.io/docssvFSI-Fluid.html) | [pipe flow with RCR BC](https://github.com/SimVascular/svFSI-Tests/tree/master/04-fluid/01-pipe3D_RCR);<br>[dye transportation](https://github.com/SimVascular/svFSI-Tests/tree/master/04-fluid/02-dye_AD);<br>[GenBC/cplBC](https://github.com/SimVascular/svFSI-Tests/tree/master/04-fluid/04-3D0D-coupling-BC);<br>[Non-Newtonian flow](https://github.com/SimVascular/svFSI-Tests/tree/master/04-fluid/05-nonNewtonian) |
83+
| Structure | [Webpage](http://simvascular.github.io/docssvFSI-Structure.html); [YouTube](https://www.youtube.com/watch?v=Jm3VSi6Aci8&list=PL1CBZ8Wh-xvRnux0eMmbZPbx-C078Qzqu&index=2) | struct:<br>[block compression](https://github.com/SimVascular/svFSI-Tests/tree/master/05-struct/01-block-compression);<br>[passive inflation of LV model](https://github.com/SimVascular/svFSI-Tests/tree/master/05-struct/02-LV-Guccione-passive)<br>ustruct:<br>[block compression](https://github.com/SimVascular/svFSI-Tests/tree/master/06-ustruct/01-block-compression);<br>[tension of arterial strip](https://github.com/SimVascular/svFSI-Tests/tree/master/06-ustruct/02-tensile-adventitia_HGO);<br>[active inflation of LV model](https://github.com/SimVascular/svFSI-Tests/tree/master/06-ustruct/03-LV-Guccione-active) |
84+
| Electrophysiology | [Webpage](http://simvascular.github.io/docssvFSI-CEP.html); [YouTube](https://www.youtube.com/watch?v=TCK3SmGwBa8&list=PL1CBZ8Wh-xvRnux0eMmbZPbx-C078Qzqu&index=2) | [Aliev-Panfilov model](https://github.com/SimVascular/svFSI-Tests/tree/master/08-cep/01-2Dsqr_AP); <br>[ten-Tusscher-Panfilov model](https://github.com/SimVascular/svFSI-Tests/tree/master/08-cep/03-benchmark_tTP); <br>[Bueno-Orovio-Cherry-Fenton model](https://github.com/SimVascular/svFSI-Tests/tree/master/08-cep/04-2Dspiral_BO); <br>[Purkinje network](https://github.com/SimVascular/svFSI-Tests/tree/master/08-cep/05-Purkinje) |
85+
| FSI | [Webpage](http://simvascular.github.io/docssvFSI-FSI.html); [YouTube](https://www.youtube.com/watch?v=QIpyThIAD7k&list=PL1CBZ8Wh-xvRnux0eMmbZPbx-C078Qzqu&index=4) | ALE:<br>[2D heart valve](https://github.com/SimVascular/svFSI-Tests/tree/master/07-fsi/ale/01-channel-leaflets_2D); <br>[2D flag behind a block](https://github.com/SimVascular/svFSI-Tests/tree/master/07-fsi/ale/02-channel-block-flag_2D); <br>[pressure pulse inside aorta](https://github.com/SimVascular/svFSI-Tests/tree/master/07-fsi/ale/03-pipe_3D)<br>CMM:<br>[pipe flow with RCR BC](https://github.com/SimVascular/svFSI-Tests/tree/master/07-fsi/cmm/01-pipe_RCR);<br>[vein graft](https://github.com/SimVascular/svFSI-Tests/tree/master/07-fsi/cmm/02-vein-graft) |
86+
7087

7188
Below, we provide a list of the available choice of constitutive models for different types of equations being solved. Users are also encouraged to implement new constitutive models. Users may use global search tools such as `grep` to locate the implementations of the available constitutive models in the code using the abbreviated names below.
7289

@@ -107,13 +124,29 @@ Below, we provide a list of the available choice of constitutive models for diff
107124
| cepModel\_FN | Fitzhugh-Nagumo model | "FN", "Fitzhugh-Nagumo" |
108125
| cepModel\_TTP | tenTusscher-Panfilov model | "TTP", "tenTusscher-Panfilov" |
109126

110-
## Additional Resource
111-
More details can be found here:
112-
- Fluid-Structure Interaction (FSI): https://simvascular.github.io/docssvFSI.html
113-
- SimCardio: http://simvascular.github.io/docsSimCardio.html
114-
- Cardiac electrophysiology modeling: http://simvascular.github.io/docsSimCardio.html#cep-modeling
115-
- Cardiac mechanics modeling: http://simvascular.github.io/docsSimCardio.html#mechanics-modeling
116-
- Prescribed-motion LV modeling: https://simvascular.github.io/docsSimCardio.html#automatic-cardiac-modeling
127+
## Documentation
128+
More details can be found on the [**svFSI**](http://simvascular.github.io/docssvFSI.html) page, and direct links to the documentation for different functionalities are provided here:
129+
- [Fluid-Structure Interaction (FSI)](http://simvascular.github.io/docssvFSI-FSI.html)
130+
- [Cardiac electrophysiology modeling](http://simvascular.github.io/docssvFSI-CEP.html)
131+
- [Cardiac mechanics modeling](http://simvascular.github.io/docssvFSI-Structure.html)
132+
- [Prescribed-motion LV modeling](http://simvascular.github.io/docssvFSI-Fluid.html#pres)
133+
134+
## Tutorial
135+
- SimVascular group uploads hands-on tutorials to our [YouTube](https://www.youtube.com/channel/UCT61XgTRqpfb39Hyio9IqGQ) channel periodically. Here are some for `svFSI`:
136+
- Fluid-Structure Interaction (FSI): https://www.youtube.com/watch?v=QIpyThIAD7k
137+
- Cardiac electrophysiology modeling: https://www.youtube.com/watch?v=TCK3SmGwBa8
138+
- Cardiac mechanics modeling: https://www.youtube.com/watch?v=Jm3VSi6Aci8
139+
- We also maintain a large collection of examples that showcase different functionalities of `svFSI`. You can find them here: https://github.com/SimVascular/svFSI-Tests. Each case includes a README file that explains the problem in hand and some key aspects of the software configuration.
140+
141+
## Pre/Post Processing Tool
142+
We are also maintaining a collection of useful pre and post processing tools that are compatible with `svFSI`:
143+
https://github.com/SimVascular/svFSI-Tools
144+
145+
## Contribute to `svFSI`
146+
We welcome and appreciate all types of contributions to `svFSI`.
147+
- Seek support, suggest new features or report bugs, please contact us through [GitHub Issues](https://github.com/SimVascular/svFSI/issues) or [SimTK forum](https://simtk.org/plugins/phpBB/indexPhpbb.php?f=188).
148+
- Contribute your code to `svFSI`, please submit a pull request through GitHub.
149+
- Share your novel applications of `svFSI` with the community, please consider contribute your case to [svFSI-Tests](https://github.com/SimVascular/svFSI-Tests).
117150

118151
## Citation
119152
In preparation.

0 commit comments

Comments
 (0)