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

  1. Buildmake all (Linux) or make all -f makefile.OSX (macOS) after installing OpenCL, OpenGL, GLUT, GLEW and Python‑numpy.
  2. Run./Release/Sibernetic for the graphical demo, or add flags such as:
    • -no_g  run without graphics (useful for batch jobs)
    • -l_to  record simulation state to disk
    • -export_vtk  write VTK files for external visualisation
    • -f worm  load the full worm body configuration and start the Python muscle‑signal module.
    • device=gpu  force GPU execution.
  3. Couple with neurons – add -nrn <hoc_file> to launch the NEURON bridge, or use the provided sibernetic_c302.py script to drive the simulation with the c302 NeuroML model.
  4. Analyse – load the generated state_*.vtp files 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-get packages required.
  • macOS users must set a few PYTHON* environment variables before invoking the OSX‑specific makefile.
  • After building, add the repository root to PYTHONPATH so 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


All details are taken directly from the repository’s README; no external assumptions have been added.

Related

  • Project
  • Project
  • Project
  • Project
  • Project