Skip to content

Commit

Permalink
Merge pull request #64 from adtzlr/simplify-docs
Browse files Browse the repository at this point in the history
clearify benchmarks
  • Loading branch information
adtzlr authored Jul 30, 2021
2 parents 490526d + e8dba6a commit e0998ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
FElupe is an open-source finite element module focussing on the formulation and numerical solution of nonlinear problems in continuum mechanics of solid bodies. Its name is a combination of FE (finite element) and the german word *Lupe* (magnifying glass) as a synonym for getting a little insight how a finite element analysis code looks like under the hood. The user code for defining the integral form of equilibrium equations as well as their linearizations over a region are kept as close as possible to the analytical expressions. FElupe is both written in Python and fast in execution times thanks to NumPy (and optional Numba). No complicated installation, just pure Python. Another key feature is the easy and straightforward definition of mixed field formulations for nearly incompressible material behavior. Several useful utilities are available, i.e. an incremental approach for the application of boundary conditions and subsequent solution of the nonlinear equilibrium equations or the calculation of forces and moments on boundaries. Finally, results are ready to be exported to VTK or XDMF files using meshio.

**Question**: *Okay, why not use existing projects like Fenics or scikit-fem?*
Fenics is great but way too complicated to install on Windows. Scikit-fem is close to perfection but was quite slow for my [problem of interest](https://github.com/kinnala/scikit-fem/issues/616) in combination with hyperelastic material formulations. In fact the utilities of FElupe could also be wrapped around the core code of scikit-fem but in the end I decided to create a code base which works the way I think it should. FElupe is still in its alpha stage and serves as my own finite elements code playground - be warned: module usage may still change in future versions. If one is interested in a comparison of the assembly - times of felupe and [scikit-fem](https://github.com/kinnala/scikit-fem/#Benchmark) both are nearly equal for the poisson problem.
Fenics is great but way too complicated to install on Windows. Scikit-fem is close to perfection but was quite slow for my [problem of interest](https://github.com/kinnala/scikit-fem/issues/616) in combination with hyperelastic material formulations. In fact the utilities of FElupe could also be wrapped around the core code of scikit-fem but in the end I decided to create a code base which works the way I think it should. FElupe is still in its alpha stage and serves as my own finite elements code playground - be warned: module usage may still change in future versions.

## Installation
Install Python, fire up a terminal and run `pip install felupe`; import FElupe as follows in your script.
Expand Down
6 changes: 3 additions & 3 deletions docs/performance.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Benchmark 1 - Poisson problem
The 2d poisson problem from [here](https://github.com/adtzlr/felupe/blob/main/scripts/script_performance_poisson.py) is solved with 4-noded quadrilaterals (linear basis) on a AMD Ryzen 5 2400G / 16GB RAM. The table below contains time spent on both assembly and linear solve as a function of the degrees of freedom. Assembly times do not contain numba JIT (just-in-time) compilation times.
The 2d poisson problem from [here](https://github.com/adtzlr/felupe/blob/main/scripts/script_performance_poisson.py) is solved with 4-noded quadrilaterals (linear basis) on a AMD Ryzen 5 2400G / 16GB RAM. The table below contains time spent on both assembly and linear solve as a function of the degrees of freedom. Assembly times do not contain numba JIT (just-in-time) compilation times. PyPardiso was used as a linear solvers in these examples. The default solver taken from SciPy (SuperLU) may be slower.

Performance without Numba (`b.assemble()`, `A.assemble()`)

Expand Down Expand Up @@ -30,7 +30,7 @@ and performance with Numba (`b.assemble(parallel=True)`, `A.assemble(parallel=Tr

# Benchmark 2 - Hyperelasticity

Another [more practical performance benchmark](https://github.com/adtzlr/felupe/blob/main/scripts/script_performance_neohooke.py) is shown for a quarter model of a rubber block under uniaxial compression. The material is described with an isotropic hyperelastic Neo-Hooke material in its so-called nearly-incompressible formulation. Eight-noded hexahedrons are used in combination with a displacement field only. The time for linear solve represents the time spent for the first Newton-Rhapson iteration. While the assembly process is still acceptable up to 200000 DOF, linear solve time rapidly increases for >100000 DOF. However, this could also be due to the nearly 100% RAM load on the local machine for 500000 DOF.
Another [more practical performance benchmark](https://github.com/adtzlr/felupe/blob/main/scripts/script_performance_neohooke.py) is shown for a quarter model of a rubber block under uniaxial compression. The material is described with an isotropic hyperelastic Neo-Hooke material in its so-called nearly-incompressible formulation. Eight-noded hexahedrons are used in combination with a displacement field only. The time for linear solve (PyPardiso) represents the time spent for the first Newton-Rhapson iteration. While the assembly process is still acceptable up to 200000 DOF, linear solve time rapidly increases for >100000 DOF. However, this could also be due to the nearly 100% RAM load on the local machine for 500000 DOF.

| DOF | Assembly | Linear solve |
| ------- | -------- | ------------ |
Expand All @@ -44,7 +44,7 @@ Another [more practical performance benchmark](https://github.com/adtzlr/felupe/

# Benchmark 3 - Mixed-Field Hyperelasticity

And now the big news. Given a hyperelastic problem with a Neo-Hookean solid in combination with a $(\bm{u},p,J)$ mixed-field-formulation applied on a meshed unit cube out of eight-noded hexahedrons with 9x9x9=729 nodes (=2187 DOF) for nearly-incompressibility takes about 12 seconds per Newton-Rhapson iteration in scikit-fem. Felupe does the same thing in whooping 0.3s which is a 400x speedup in comparison to scikit-fem. Again, please note that felupe timings are without Numba JIT (just-in-time) compilation times and the whole Newton-Rhapson iteration contains the time spent on linear solve. For a detailed comparison see the table below:
And now the big news. Given a hyperelastic problem with a Neo-Hookean solid in combination with a $(\bm{u},p,J)$ mixed-field-formulation applied on a meshed unit cube out of eight-noded hexahedrons with 9x9x9=729 nodes (=2187 DOF) for nearly-incompressibility takes about 0.3s in felupe. Again, please note that felupe timings are without Numba JIT (just-in-time) compilation times and the whole Newton-Rhapson iteration contains the time spent on linear solve (PyPardiso was used in these examples). For a detailed comparison see the table below:

| Nodes per axis (total) | displacement - DOF | felupe | scikit-fem |
| ------------------------ | ------------------ | ------ | ---------- |
Expand Down

0 comments on commit e0998ce

Please sign in to comment.