Skip to content

Commit

Permalink
Merge pull request #10 from tum-pbs/develop
Browse files Browse the repository at this point in the history
Periodic domains
  • Loading branch information
the-rccg authored Feb 18, 2020
2 parents 6d02565 + ec0323e commit 36f8020
Show file tree
Hide file tree
Showing 64 changed files with 2,179 additions and 1,186 deletions.
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ language: python
python:
- "2.7"
- "3.6"
- "3.7"
- "3.8"

matrix:
allow_failures:
- python: "3.8"

before_install:
- pip install -U pip

install:
- pip install --quiet tensorflow==1.14.0 nbformat ipython pylint
- if [[ $TRAVIS_PYTHON_VERSION != 3.8 ]]; then pip install --quiet tensorflow==1.14.0; fi
- if [[ $TRAVIS_PYTHON_VERSION == "3.8" ]]; then pip install --quiet https://github.com/ppwwyyxx/tensorflow-wheels/releases/download/v0.2/tensorflow-1.15.0-cp38-cp38-linux_x86_64.whl numba llvmlite pytest; fi
- pip install nbformat ipython pylint;
- pip install .

script:
Expand Down
1 change: 1 addition & 0 deletions documentation/Contributing.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ Additional style choices
- Code comments that describe multiple lines precede the block and have the format `# --- Comment ---`.
- No empty lines inside of methods. To separate code blocks use multi-line comments as described above.
- Use the apostrophe character ' to enclose strings that affect the program / are not displayed to the user.
- **Sphinx Docstring** format is used throughout the code base
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.com/tum-pbs/PhiFlow.svg?token=8vG2QPsZzeswTApmkekH&branch=master)](https://travis-ci.com/tum-pbs/PhiFlow)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/phiflow.svg)](https://pypi.org/project/phiflow/)
[![PyPI license](https://img.shields.io/pypi/l/phiflow.svg)](https://pypi.org/project/phiflow/)
[<img src="https://colab.research.google.com/assets/colab-badge.svg" align="center">](https://colab.research.google.com/drive/1S21OY8hzh1oZK2wQyL3BNXvSlrMTtRbV#offline=true&sandboxMode=true)
[![Google Collab Book](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1S21OY8hzh1oZK2wQyL3BNXvSlrMTtRbV#offline=true&sandboxMode=true)

![Gui](documentation/figures/WebInterface.png)

Expand Down Expand Up @@ -34,7 +34,7 @@ See the [detailed installation instructions](documentation/Installation_Instruct

## Documentation and Guides

| [Index](documentation) | [Demos](demos) / [Tests](tests) | [Source](phi) | ![image](https://www.tensorflow.org/images/colab_logo_32px.png) [Fluids Tutorial](https://colab.research.google.com/drive/1S21OY8hzh1oZK2wQyL3BNXvSlrMTtRbV#offline=true&sandboxMode=true) / [Playground](https://colab.research.google.com/drive/1zBlQbmNguRt-Vt332YvdTqlV4DBcus2S#offline=true&sandboxMode=true) |
| [Index](documentation) | [Demos](demos) / [Tests](tests) | [Source](phi) | [<img src="https://www.tensorflow.org/images/colab_logo_32px.png" height=16> Fluids Tutorial](https://colab.research.google.com/drive/1S21OY8hzh1oZK2wQyL3BNXvSlrMTtRbV#offline=true&sandboxMode=true) / [Playground](https://colab.research.google.com/drive/1zBlQbmNguRt-Vt332YvdTqlV4DBcus2S#offline=true&sandboxMode=true) |
|------------------------|---------------------------------|---------------| -----------------------------|

If you would like to get right into it and have a look at some code, check out the
Expand Down Expand Up @@ -83,7 +83,7 @@ Resampling / Advection: NumPy interpolation handles the boundaries slightly diff

## Contributions

Contributions are welcome! Check out [this document](documentation/Contributing.md) for guidelines.
Contributions are welcome! Check out [this document](CONTRIBUTING.md) for guidelines.

## Acknowledgements

Expand Down
5 changes: 3 additions & 2 deletions demos/simple_tfmodel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# coding=utf-8
from phi.tf.flow import *


RESOLUTION = y, x = 64, 64
DOMAIN = Domain([64, 64], boundaries=OPEN) # [y, x]
DATAPATH = os.path.expanduser('~/phi/data/smoke/') # at least 10 sims, has to match RESOLUTION
DESCRIPTION = u"""
Train a neural network to reproduce the flow field given the marker density.
Expand Down Expand Up @@ -46,7 +47,7 @@ class TrainingTest(LearningApp):
def __init__(self):
LearningApp.__init__(self, 'Training', DESCRIPTION, learning_rate=2e-4, validation_batch_size=4, training_batch_size=8)
# --- Setup simulation and placeholders ---
smoke_in, load_dict = load_state(Fluid(Domain(RESOLUTION)))
smoke_in, load_dict = load_state(Fluid(DOMAIN))
# --- Build neural network ---
with self.model_scope():
pred_vel = network(smoke_in.density.data)
Expand Down
2 changes: 1 addition & 1 deletion documentation/Package_Info.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ To install phiflow with web interface, run
$ pip install phiflow[gui]
```

To run phiflow with custom CUDA operators, you have to install it from source, see the [detailed installation instructions](documentation/Installation_Instructions.md).
To run phiflow with custom CUDA operators, you have to install it from source, see the [detailed installation instructions](https://github.com/tum-pbs/PhiFlow/blob/master/documentation/Installation_Instructions.md).
14 changes: 7 additions & 7 deletions documentation/Software_Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@

## Context

![Context](documentation/figures/Context.png)
![Context](./figures/Context.png)

| Actor / System | Description |
|----------------------|-------------------------------------------------------------------------------------------------|
| ML Researcher | Scientist interested in training ML models, publishing results |
| User | Person who wants to run built-in simulations and store / analyse the results |
| NumPy | Non-differentiable Python computing library |
| TensorFlow | Machine-learning framework supporting GPU computations and reverse-mode differentiation |
| TensorFlow, PyTorch | Machine-learning frameworks supporting GPU computation and reverse-mode differentiation |

## Building Blocks

![Building Blocks](documentation/figures/Building_Blocks.png)
![Building Blocks](./figures/Building_Blocks.png)

| Actor / System | Description |
|-------------------|-------------------------------------------------------------------------------------------------------|
| Model | Allows setting up simulations and GUI |
| TF Model | Trains neural networks, creates logs, visualizes results with UI |
| App | Allows setting up simulations and GUI |
| LearningApp | Trains neural networks, creates logs, visualizes results with UI |
| Data | Writes and loads data from disc |
| UI | Hosts web server to display data of Model |
| UI | Hosts web server to display data of Model |
| Physics | Defines simulation classes, implements built-in simulations like Navier-Stokes, Schrödinger |

## Module dependencies

![Module Diagram](documentation/figures/Module_Diagram.png)
![Module Diagram](./figures/Module_Diagram.png)
Loading

0 comments on commit 36f8020

Please sign in to comment.