openworm/sibernetic
This is a C++/OpenCL implementation of the PCISPH algorithm supplemented with a set of biomechanics related features applied to C. elegans locomotion
Sibernetic – a biomechanical simulator for C. elegans
What it is – Sibernetic is a C++/OpenCL physics engine that models fluids, elastic matter, membranes and contractile tissue. It was created for the OpenWorm project to simulate the physical body of the nematode Caenorhabditis elegans together with its neural activity.
Why it matters – By providing a realistic, GPU‑accelerated environment for soft‑body dynamics, Sibernetic lets researchers couple a worm’s biomechanics with neuronal models (NEURON, c302, etc.). This makes it a concrete platform for embodied‑intelligence studies: the same code that moves a virtual worm can be driven by real neural simulations, enabling closed‑loop experiments on locomotion, muscle activation, and fluid‑structure interaction.
Core features
- PCISPH fluid solver (Predictive‑Corrective Incompressible Smoothed Particle Hydrodynamics) for incompressible liquids.
- Elastic‑matter simulation, liquid‑impermeable membranes, surface tension and boundary handling.
- GPU support via OpenCL; can fall back to CPU.
- 3‑D OpenGL visualisation with interactive controls (pause, switch demos, rotate/scale scene).
- Command‑line options to run head‑less, log steps, export VTK files for Paraview, or save raw buffers.
- Integration with the NEURON simulator (via the sibernetic_NEURON bridge) and with the c302 NeuroML pipeline, allowing muscle‑signal input from real neural models.
Typical workflow
- Build –
make all(Linux) ormake all -f makefile.OSX(macOS) after installing OpenCL, OpenGL, GLUT, GLEW and Python‑numpy. - Run –
./Release/Siberneticfor the graphical demo, or add flags such as:-no_grun without graphics (useful for batch jobs)-l_torecord simulation state to disk-export_vtkwrite VTK files for external visualisation-f wormload the full worm body configuration and start the Python muscle‑signal module.device=gpuforce GPU execution.
- Couple with neurons – add
-nrn <hoc_file>to launch the NEURON bridge, or use the providedsibernetic_c302.pyscript to drive the simulation with the c302 NeuroML model. - Analyse – load the generated
state_*.vtpfiles in Paraview, or replay saved buffers with-l_from.
Installation notes
- Linux users need OpenCL drivers (AMD works best; Intel is an alternative). The README lists the exact
apt-getpackages required. - macOS users must set a few
PYTHON*environment variables before invoking the OSX‑specific makefile. - After building, add the repository root to
PYTHONPATHso the Python helper modules can be imported.
Who might use it
- Computational biologists studying worm locomotion.
- Robotics researchers interested in soft‑body simulation and neuromechanical coupling.
- Anyone needing a GPU‑accelerated SPH fluid/elastic solver for research or teaching.
Links
- Main repo: https://github.com/openworm/sibernetic
- NEURON bridge: https://github.com/openworm/sibernetic_NEURON
- OpenWorm project: http://www.openworm.org
All details are taken directly from the repository’s README; no external assumptions have been added.
Related
- Project
- Project
- Project
- Project
- Project