diff --git a/.github/workflows/test_warpmesh.yml b/.github/workflows/test_warpmesh.yml index c683f50..fc0b5f5 100644 --- a/.github/workflows/test_warpmesh.yml +++ b/.github/workflows/test_warpmesh.yml @@ -5,6 +5,8 @@ on: branches: - main + pull_request: + jobs: test-warpmesh: name: Test WarpMesh @@ -14,24 +16,29 @@ jobs: options: --user root steps: - uses: actions/checkout@v3 - - name: Install movement + - name: Install Movement run: | - git clone https://github.com/pyroteus/movement.git + . /home/firedrake/firedrake/bin/activate + git clone https://github.com/mesh-adaptation/movement.git cd movement - pip install -e . - - name: Install warpmesh + python3 -m pip install -e . + - name: Install PyTorch run: | . /home/firedrake/firedrake/bin/activate - pwd - pip install -e . - - name: install warpmesh dependencies + python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu + - name: Install PyTorch3d run: | . /home/firedrake/firedrake/bin/activate - pip install -r requirements.txt - - name: test warpmesh + python3 -m pip install 'git+https://github.com/facebookresearch/pytorch3d.git' + - name: Install other WarpMesh dependencies run: | . /home/firedrake/firedrake/bin/activate - cd ./tests - python -m pytest ./test* -v - - + python3 -m pip install -r requirements.txt + - name: Install WarpMesh + run: | + . /home/firedrake/firedrake/bin/activate + python3 -m pip install -e . + - name: Run WarpMesh test suite + run: | + . /home/firedrake/firedrake/bin/activate + python3 -m pytest tests/test* -v diff --git a/.gitmodules b/.gitmodules index f61c010..7b0fdb6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "install/movement"] path = install/movement - url = https://github.com/pyroteus/movement.git + url = https://github.com/mesh-adaptation/movement.git diff --git a/README.md b/README.md index 2be4401..7b957c9 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,14 @@ Just navigate to **project root** folder, open terminaland execute the `install/ sh ./install/install.sh ``` -This will install [firedrake](https://www.firedrakeproject.org/download.html) and [movement](https://github.com/pyroteus/movement) under `install` folder, as well as the `WarpMesh` package. +This will install [firedrake](https://www.firedrakeproject.org/download.html) and [movement](https://github.com/mesh-adaptation/movement) under `install` folder, as well as the `WarpMesh` package. ### The hard way (in case the easy way did not went well or you want to challenge yourself): 1. The mesh generation relies on firedrake, which is a python package. To install firedrake, please follow the instructions on [firedrakeproject.org](https://www.firedrakeproject.org/download.html). -2. The movement of the mesh is implemented by `pyroteus/movement`, install it in the firedrake venv. To install, run `pip install -e .` in the `pyroteus/movement` directory. Here is a link to that repo: [pyroteus/movement](https://github.com/pyroteus/movement). +2. The movement of the mesh is implemented by `mesh-adaptation/movement`, install it in the firedrake venv. To install, run `pip install -e .` in the `mesh-adaptation/movement` directory. Here is a link to that repo: [mesh-adaptation/movement](https://github.com/mesh-adaptation/movement). 3. Use the venv provided by firedrake to install the dependencies of this project. The venv is located at `~/firedrakevenv/bin/activate`. To activate the venv, run `source ~/firedrakevenv/bin/activate`. Then run `pip install -r requirements.txt` to install the dependencies. diff --git a/install/install.sh b/install/install.sh old mode 100644 new mode 100755 index e209eb7..ca4c7ee --- a/install/install.sh +++ b/install/install.sh @@ -2,59 +2,54 @@ # This script will install necessary packages for the project -function yellow_log(){ - local DATE_N=`date "+%Y-%m-%d %H:%M:%S"` +function yellow_log() { + local DATE_N=$(date "+%Y-%m-%d %H:%M:%S") local color="\033[33m" echo -e "$DATE_N$color $* \033[0m" } -function green_log(){ - local DATE_N=`date "+%Y-%m-%d %H:%M:%S"` +function green_log() { + local DATE_N=$(date "+%Y-%m-%d %H:%M:%S") local color="\033[32m" echo -e "$DATE_N$color $* \033[0m" } yellow_log "Please deactivate conda enviroment before running this script, otherwise it will fail." -# Download pyroteus/movement package. -green_log "Start downloading movement..." +# Download mesh-adaptation/movement package. +green_log "Start downloading Movement..." -if [ -d ./install/movement ] -then -yellow_log "movement dir exists, abort downloading" +if [ -d ./install/movement ]; then + yellow_log "Movement dir exists, abort downloading" fi -if [ ! -d ./install/movement ] -then -yellow_log "movement does not exist, start downloading movement" -git submodule add https://github.com/pyroteus/movement.git install/movement +if [ ! -d ./install/movement ]; then + yellow_log "Movement does not exist, start downloading Movement" + git submodule add https://github.com/mesh-adaptation/movement.git install/movement fi - # Download & install firedrake cd ./install # If previous file exists -if [ -d ./firedrake ] -then -green_log "The directory has existed, nothing to be done" +if [ -d ./firedrake ]; then + green_log "The directory has existed, nothing to be done" fi -if [ ! -d ./firedrake ] -then -curl -O https://raw.githubusercontent.com/firedrakeproject/firedrake/master/scripts/firedrake-install -python3 firedrake-install --disable-ssh -green_log "firedrake has been installed" +if [ ! -d ./firedrake ]; then + curl -O https://raw.githubusercontent.com/firedrakeproject/firedrake/master/scripts/firedrake-install + python3 firedrake-install --disable-ssh + green_log "Firedrake has been installed" fi -# activate firedrake enviroment +# Activate Firedrake enviroment . ./firedrake/bin/activate -# Install movement +# Install Movement cd movement pip install -e . -# Install warpmesh +# Install WarpMesh cd ../.. pip install -r requirements.txt pip install -e . diff --git a/requirements.txt b/requirements.txt index a0e23fd..69a775c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -numpy >= 1.13.0 +numpy pandas meshio matplotlib @@ -7,9 +7,10 @@ pytest pytest-timeout jupyter ipython -torch == 1.13.1 -torch_geometric == 2.5.3 -torch_sparse == 0.6.18 +seaborn +torch +torch_geometric +torch_sparse tensorboardX torch_scatter rich @@ -18,4 +19,4 @@ ipython pep8 sphinx einops -gmsh \ No newline at end of file +gmsh