mahsa106 / graphnics

Data structures and models for solving flow equations on networks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pytest Docker image Binder

Implementing network models in FEniCS

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.

alt_text

Demos

Runtimes

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:

Installation

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.

Citation

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}}

About

Data structures and models for solving flow equations on networks

License:GNU General Public License v3.0


Languages

Language:Python 96.5%Language:Dockerfile 2.0%Language:TeX 1.5%