PyMembrane#

A modular C++/Python framework for simulations of elastic and liquid membranes on triangulated surfaces.

PyMembrane combines a C++ backend with a Python interface for setting up, running, and extending membrane simulations. It supports triangulated elastic shells, dynamically triangulated liquid membranes, Brownian dynamics, Monte Carlo workflows, minimization, constraints, and lightweight mesh output.

Installation

Create a conda environment, build the extension, and verify that the package imports correctly.

Installation
Examples

Run packaged examples for periodic sheets, shell buckling, liquid membranes, hybrid MC-BD workflows, and size scaling.

Quick Start and Examples
Tutorial notebook

Follow a beginner-friendly Jupyter notebook that walks through a first PyMembrane simulation.

Tutorial Notebook
Command-line arguments

See the available command-line options for each packaged example.

Command-Line Arguments
Python API

Browse the Python interface for boxes, systems, evolvers, forces, integrators, minimizers, and output.

Python API
C++ API and extension points

Inspect the underlying C++ classes and the implementation details used by the Python bindings.

C++ API
Benchmarks

Explore the internal scaling benchmark and scope comparison for spherical meshes and membrane-model workflows.

Performance benchmark and scope comparison
Related examples

Explore the liquid-membrane and hybrid MC-BD examples built on the packaged workflow.

Liquid membrane example

Install and check#

conda create -n pymemb python=3.8 numpy cmake pybind11
conda activate pymemb
pip install -e .
python -c "from pymembrane import *; print('import ok')"

Run an example#

python -m pymembrane.examples.periodic --quick

Packaged examples include their input data and can be run from the installed Python namespace.

What can I simulate?#

  • Elastic membranes and shells

  • Closed and open triangulated surfaces

  • Periodic sheets

  • Bending-dominated liquid membranes with edge flips

  • Hybrid Monte Carlo and Brownian dynamics workflows

  • Energy minimization with constraints

Why PyMembrane?#

PyMembrane is designed for modularity and extensibility. Users can combine forces, integrators, minimizers, constraints, and output routines through a Python interface, while performance-critical components are implemented in C++. The framework is intended for reproducible membrane-modeling workflows and for developing new membrane models.