The graphnics
library solves network models using the finite element method. This is facilitated via the FenicsGraph
class which is an extension of the DiGraph
class in networkx
.
- Introduction to
Graphnics
. - Pulsatile flow in rat tumour vasculature
- Vasomotion in arterial trees
- Solving coupled 3d-1d network models using
fenics_ii
The library fenics_ii
has been used for the implementation as it provides rapid and robust assembly of mixed-dimensional problems. The runtimes for the most computationally expensive model is shown here:
We use networkx
combined with the mixed-dimensional library fenics_ii
created by Miroslav Kuchta.
The environment is provided as a docker container. The container can be built and run locally by executing
git clone https://github.com/IngeborgGjerde/graphnics/
cd graphnics/docker
docker build --no-cache -t graphnics . # build docker image
cd ..
# make container
docker run --name graphnics-container -v "$(pwd):/home/fenics/shared" -d -p 127.0.0.1:8888:8888 graphnics 'jupyter-notebook --ip=0.0.0.0'
You can then enter the container by running
docker exec -it graphnics-container /bin/bash
To connect it to a jupyter notebook, run
docker logs graphnics-container
and enter the html-links it provides in your browser.
This code is currently being prepared for submission to JOSS, titled:
Graphnics: Combining networkx and FEniCS to solve network models by Ingeborg Gjerde
The paper draft can be found here.
You can cite the repo using arxiv preprint
@article{graphnics2022gjerde,
author = {{Gjerde}, Ingeborg G.},
title = "{Graphnics: Combining FEniCS and NetworkX to simulate flow in complex networks}",
journal = {arXiv e-prints},
year = 2022,
month = dec,
archivePrefix = {arXiv},
eprint = {2212.02916}}