Coder Social home page Coder Social logo

bloodflow's People

Contributors

agdestein avatar alexdiem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bloodflow's Issues

Application of the model for complex modeling

Can we use this model to model an asymmetric artery tree? Also, practically the values of the 3 elements Windkessel model are not similar in every terminal artery; So, can we change those things to different terminal arteries?

Thanks in advance.

Runtime Error using demo_arterybranch.py

I am running
sudo python3 demo_arterybranch.py config/demo_arterybranch.cfg
in the provided Docker container after quickfix #40 (sudo is needed because of permission issues in the container as we need to create directories).

After a certain number of time steps, I get the error below.
It seems to happen when we try to save our solution to disk.
Any help is appreciated!

sudo python3 demo_arterybranch.py config/demo_arterybranch.cfg
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
--- Instant: compiling ---eration: 0, Time-step 12000999
In instant.recompile: The module did not compile with command 'cmake -DDEBUG=TRUE .', see '/home/fenics/.cache/instant/python3.5/error/dolfin_b22667cb6442e14d73fb79a9460785f63d1930a7/compile.log'
Traceback (most recent call last):
  File "demo_arterybranch.py", line 66, in <module>
    main(sys.argv[1])
  File "demo_arterybranch.py", line 62, in main
    an.solve(q_ins, Nt_store, N_cycles_store, store_area, store_pressure)
  File "/home/fenics/shared/arteryfe/artery_network.py", line 793, in solve
    artery.update_pressure()
  File "/home/fenics/shared/arteryfe/artery.py", line 240, in update_pressure
    f=self.f, A0=self.A0, A=self.Un.split(True)[0]
  File "/usr/lib/python3/dist-packages/dolfin/functions/expression.py", line 679, in __new__
    mpi_comm=kwargs.get("mpi_comm"))
  File "/usr/lib/python3/dist-packages/dolfin/compilemodules/expressions.py", line 266, in compile_expressions
    mpi_comm=mpi_comm)
  File "/usr/lib/python3/dist-packages/dolfin/compilemodules/expressions.py", line 183, in compile_expression_code
    mpi_comm=mpi_comm)
  File "/usr/lib/python3/dist-packages/dolfin/compilemodules/jit.py", line 70, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/dolfin/compilemodules/compilemodule.py", line 603, in compile_extension_module
    **instant_kwargs)
  File "/usr/local/lib/python3.5/dist-packages/instant/build.py", line 577, in build_module
    build_system)
  File "/usr/local/lib/python3.5/dist-packages/instant/build.py", line 158, in recompile
    instant_error(msg % (cmd, compile_log_filename_dest))
  File "/usr/local/lib/python3.5/dist-packages/instant/output.py", line 96, in instant_error
    raise RuntimeError(text)
RuntimeError: In instant.recompile: The module did not compile with command 'cmake -DDEBUG=TRUE .', see '/home/fenics/.cache/instant/python3.5/error/dolfin_b22667cb6442e14d73fb79a9460785f63d1930a7/compile.log'
Aborted (core dumped)

Problem with 1D and XDMF

I found an interesting bug here. The gist of it is that XDMF can't handle 1D very well, so I believe sticking to Matplotlib for visualisation is best.

I suggest the following workflow:

  • Only store 100 or so time steps for visualisation, depending on the mesh resolution maybe reduce that as well for output. You can use the project() function to do this.
  • Store output as csv files. If you convert your solution to a Numpy array you can use np.savetxt('fname.csv', U, delimiter=',') to do this
  • Do all postprocessing of the data in a separate step, for example plot.py or something similar. U = np.loadtxt('fname.csv', delimiter=',') reads the contents of your data back into a Numpy array.

Add example docs to README

This issue is part of this JOSS review.

It would be good to have an explicit command to run the example set up, e.g.:
python3 demo_arterybranch.py config/demo_arterybranch.cfg
in the README, or at least some help when the user just calls:
python3 demo_arterybranch.py
Would help get them started :)

Clash with current version of h5py

Issue:

First steps:

git clone https://github.com/KVSlab/bloodflow.git
git checkout tags/v1.1
docker build  -t arteryfe:2017.2.0 .

With the docker build command, I get an error

  File "/tmp/easy_install-u88_yo62/h5py-3.2.1/setup.py", line 37
    f"numpy >={np_min}; python_version{py_condition}"
                                                    ^
SyntaxError: invalid syntax
The command '/bin/sh -c cd bloodflow && sudo python3 setup.py install && cd ..' returned a non-zero code: 1

Proposed workaround
The file setup.py does not specify a version for h5py, so it seems setuptools tries to download the newest version 3.2.1.
From the release date of your paper I suggest 2.10.0 could work (Sept. 2019).

Do

git clone https://github.com/KVSlab/bloodflow.git
git checkout tags/v1.1

first, then define required version of h5py here:

install_requires=['fenics == 2017.2.0', 'numpy', 'h5py == 2.10.0'], # Optional

Update Dockerfile to use repo that we cloned manually before:

FROM quay.io/fenicsproject/stable:2017.2.0

USER root

RUN sudo apt-get update && sudo apt-get -y install git python3-setuptools
RUN sudo apt-get autoremove
COPY ./* bloodflow/

RUN cd bloodflow && sudo python3 setup.py install && cd ..

The docker build command finishes and I am able to start the container with
docker run --rm -ti -v $(pwd):/home/fenics/shared -w /home/fenics/shared "arteryfe:2017.2.0".

root_vessel and end_vessel parameters in test_artery.py

Where are the parameters root_vessel and end_vessel meant to be defined? From the code in test_artery.py it seems they should be defined in the cfg file, but they are not defined in the cfg files supplied in the package. The tests should run using the same cfg files as a non-testing simulation.

The same problem comes up with parameter "T" in test_artery_network.py.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.