duchaoyu / fabsim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fabsim - Tools for fabrication & simulation

codecov

Fabsim is a small c++14 library comprising different material models for simulating rods, membranes and shells Implemented models include:

  • Discrete Elastic Rods (both for individual rods and rod networks)
  • Discrete Shells
  • Saint-Venant Kirchhoff, neo-hookean and incompressible neo-hookean membrane energies
  • Mass-spring system

These implementations include computation of the energy, gradients and hessian and are all performed using Eigen, the only dependency of this library. If available, fabsim will also make use of OpenMP to assemble the hessian in parallel.

The goal of this library is to provide a simple interface to manipulate material models that might be difficult to implement from scratch without introducing bugs in the derivatives (e.g. the DER model). All models have an energy, gradient and hessian method that take as input a 1D vector stacking all degrees of freedom. These methods can then be used in any optimization library of your choice, see this project for an example.

Due to the stencil-based approach, it is also simple to implement your own material models by deriving from the ElementBase class. Debugging the derivatives is made easy thanks to the finite difference-based tools available in the test suite

How to build

If your project uses CMake, simply add

add_subdirectory("path/to/fabsim")
// ...
target_link_libraries(YOUR_TARGET fabsim)

to your CMakeLists.txt, just make sure you have Eigen installed somewhere.

To get started, you can try the example project

About

License:Mozilla Public License 2.0


Languages

Language:C++ 99.4%Language:CMake 0.5%Language:C 0.0%