Skip to content
Replicability data for Poly-Spline Finite-Element Method
Jupyter Notebook
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
meshes
LICENSE
Poly-Spline-Finite-Element-Method.ipynb
README.md
environment.yml
problem.png
ui.png

README.md

Poly-Spline Finite-Element Method

This repository contains the scripts to regenerate the figures in the paper:

Decoupling Simulation Accuracy from Mesh Quality

@article{Schneider:2019:PFM,
 author = {Schneider, Teseo and Dumas, J{\'e}r{\'e}mie and Gao, Xifeng and Botsch, Mario and Panozzo, Daniele and Zorin, Denis},
 title = {Poly-Spline Finite-Element Method},
 journal = {ACM Transactions on Graphics},
 month = {3},
 number = {3},
 pages = {19:1--19:16},
 publisher = {Association for Computing Machinery (ACM)},
 volume = {38},
 year = {2019},
}

CPP installation

First clone the polyfem repository:

git clone https://github.com/polyfem/polyfem.git

and follow the instructions to compile it.

Note the examples in the paper use Padiso which requires a licence. It is free for academia or can be obtained trough MKL. This is however not necessary to reproduce the data.

UI

You can then run the UI with

./PolyFEM_bin

❗️ The default function in polyfem is the Franke function. For this work we used an old variation of it. To reproduce the data select FrankeOld from the problem dropdown. Problem selection

load the mesh and click the "run all" button.

To enable splines check the "spline" checkbox. Similarly you can use quadratic bases by increasing "discr" from 1 to 2. Spline checkbox

Command line

You can run the same experiment trough the command line. You need to create a JSON file with the configuration

{
    "mesh": <path to the mesh>,
    "discr_order": 1/2,
    "problem": "FrankeOld",
    "quadrature_order": 4,
    "scalar_formulation": "Laplacian",
    "solver_type": "Eigen::UmfPackLU",
    "use_spline": true/false,
    "n_refs": 1,
    "export": {
        "vis_mesh": "solution.vtu"
    }
}

Note if you have Pardiso installed, remove "solver_type": "Eigen::UmfPackLU", from the JSON file to fallback to the default Pardiso solver.

then run Polyfem with

./PolyFEM_bin --json <path to the json> --cmd

You can then see the solution.vtu using Paraview.

Python

We created a simple jupyter notebook with an example to generate Fig 13.

❗️ The problem FrankeOld is not yet available on the conda version of Polyfem. This however doesn't change how to use Polyfem, stay tuned for updates.

Binder

This notebook can be interactively run with binder! It is a free service and it is slow.

Binder

Local run

Install conda form https://anaconda.org or a minimal version miniconda. It is a python package manager.

Simple install

Create a conda environment directly from the environment file

conda env create -f environment.yml

then activate the new environment

conda activate polyspline

and launch the notebook

jupyter notebook

to run the examples. Here you can find a intro to jupyter notebooks.

Advanced install

Create an environnement

conda create -n polyspline

activate it

conda activate polyspline

and add conda forge to the package manager channels

conda config --add channels conda-forge

At this point you can install all packages

conda install numpy
conda install meshplot
conda install polyfempy
conda install plotly
conda install jupyter

and launch the notebook

jupyter notebook

Dependencies

PolyFEM

All figures where generated with PolyFEM. Refer to the turorial and the JSON api for details.

Make sure that PARDISO is found and enabled, otherwise you might not be able to generate certain figures (see below). In PolyFEM, FindPardiso.cmake will look for the PARDISO library in ~/.local or ~/.pardiso. If you installed PARDISO in a different location, you may need to update this file accordingly.

Solver

As stated in the paper, we use PARDISO for the all figures.

If you use the python version (or don't have PARDISO), polyfem will fallback to the algebraic multigrid solver HYPRE.

If you try to generate the any figure with an iterative solver, running times may be exceedingly long, so it is not recommended.

Data

The 2D mesh dataset can be found here, the 3D hybrid meshes can be found here, and the 3D pure hex here.

Smaller meshes used for the convergence plot can be downloaded here.

You can’t perform that action at this time.