PyMembrane Examples#
Here we demonstrate various applications of PyMembrane to study common problems in the physics of membranes. The examples below are kept in two forms:
The source versions live under
docs/examplesand are useful for developers who want to inspect the documented scripts directly.The installed versions live under
pymembrane.examplesand can be run withpython -mafter installation. Their runtime input files are bundled inside the installed package, so they do not depend ondocs/examplesat runtime.Command-line arguments for the packaged examples are documented on the
command_line_argumentspage.
Primary interface#
Install PyMembrane from the repository root:
pip install -e .
Then run the packaged examples from any working directory:
python -m pymembrane.examples.periodic --quick
python -m pymembrane.examples.buckling --quick
python -m pymembrane.examples.minimizer --quick
python -m pymembrane.examples.disclination --quick
python -m pymembrane.examples.disclination_mc --quick
python -m pymembrane.examples.disclination_verlet --quick
python -m pymembrane.examples.size_scaling --quick
python -m pymembrane.examples.liquid_membrane --quick
Most examples also support --output-dir so that generated files are kept in
one directory:
python -m pymembrane.examples.periodic --quick --output-dir results
Packaged examples#
pymembrane.examples.periodicDemonstrates wrinkling of a periodic elastic sheet under uniaxial compression. Quick mode writes
initial_mesh.vtkandperiodic_t*.vtk. Typical quick-mode runtime is a few seconds on a laptop.pymembrane.examples.bucklingDemonstrates Caspar-Klug shell buckling of a closed triangulated shell using a Monte Carlo vertex move. Quick mode writes
initial mesh.vtk,sphere_t*.vtkandfinal_mesh.vtk. Typical quick-mode runtime is a few seconds.pymembrane.examples.minimizerDemonstrates constant-volume energy minimization of a strained vesicle using the FIRE minimizer. Quick mode writes
initial mesh.vtkandminimization_t*.vtk. Typical quick-mode runtime is a few seconds.pymembrane.examples.disclinationDemonstrates Brownian relaxation of an open
+1disclination. Quick mode writesinitial mesh.vtkandpentagon_t*.vtk. Typical quick-mode runtime is a few seconds.pymembrane.examples.disclination_mcDemonstrates the same disclination problem using a Monte Carlo vertex-move integrator. Quick mode writes
initial mesh.vtk,pentagon_t*.vtkandfinal_mesh.vtk. Typical quick-mode runtime is a few seconds.pymembrane.examples.disclination_verletDemonstrates the same disclination problem using a velocity-Verlet integrator. Quick mode writes
initial mesh.vtkandpentagon_t*.vtk. Typical quick-mode runtime is a few seconds.pymembrane.examples.hybrid_mc_bdDemonstrates a conservative hybrid workflow for the open
+1disclination problem by alternating Brownian dynamics vertex relaxation with Monte Carlo vertex moves. Quick mode writesinitial_mesh.vtkandhybrid_t*.vtk. Typical quick-mode runtime is a few seconds.pymembrane.examples.size_scalingGenerates spherical meshes of increasing resolution and reports the cost of core operations on each size, including energy evaluation, Monte Carlo vertex moves, Monte Carlo edge flips, and Brownian dynamics. Quick mode runs subdivisions
0 1 2with a short benchmark length and repeated timings.pymembrane.examples.liquid_membraneDemonstrates dynamic triangulation with Monte Carlo edge flips and vertex moves. Quick mode writes
initial.vtk,final.vtk,final.objandsummary.json.
Benchmarking#
The size-scaling benchmark and scope comparison page is available here: Performance benchmark and scope comparison.
Dependency note#
The examples require PyMembrane and its runtime dependencies.
No plotting packages are required to run the examples.
Output geometry is written with dumper methods such as
system.dumper.vtk(...).