This plugin can be used as a simple demonstration of how SOFA "force fields" components are built up. In this case, the force field API will provide the internal potential energy, residual and jacobian of a Saint-Venant-Kirchhoff material assembled on linear tetrahedral meshes. These three function will be used by the system assembler and ODE solvers of SOFA.
docker run -ti -v $(pwd):/root dolfinx/dolfinx:latest
sudo apt install qtbase5-dev libqt5charts5-dev libqt5opengl5-dev libopengl0 libeigen3-dev libglew-dev zlib1g-dev libboost-dev libboost-filesystem-dev g++ cmake git
export SOFA_SRC=/opt/sofa_src
export SOFA_ROOT=/opt/sofa
git clone https://github.com/sofa-framework/sofa.git $SOFA_SRC
cmake -DCMAKE_INSTALL_PREFIX=$SOFA_ROOT -DCMAKE_BUILD_TYPE=Release -S $SOFA_SRC -B $SOFA_SRC/build
cmake --build $SOFA_SRC/build -j4
cmake --install $SOFA_SRC/build
export SSFF_SRC=/opt/SofaSimpleForceField_FEniCS
git clone git@github.com:Ziemnono/SofaSimpleForceField_FEniCS.git $SSFF_SRC
cmake -DCMAKE_PREFIX_PATH="$SOFA_ROOT/lib/cmake,$CARIBOU_ROOT/lib/cmake" -DCMAKE_INSTALL_PREFIX=$SOFA_ROOT/plugins/SofaSimpleForceField -DCMAKE_BUILD_TYPE=Release -S $SSFF_SRC -B $SSFF_SRC/build
cmake --build $SSFF_SRC/build -j4
cmake --install $SSFF_SRC/build
$SOFA_ROOT/bin/runSofa -l SofaSimpleForceField $SSFF_SRC/cantilever_beam.scn
Slides: https://docs.google.com/presentation/d/1IilG7QVBciP1qHR0bZ5opFlZvQbmStXUiH2ERznvnoE/edit?usp=sharing
Presentation recording: https://youtu.be/xxoUlOtAkWk?t=7735