Liquid membrane example#
This example demonstrates a bending-dominated dynamically triangulated membrane. Vertex moves update the membrane shape, while edge flips update mesh connectivity.
What This Example Demonstrates#
a simple liquid-membrane workflow built from the standard PyMembrane API
Monte Carlo vertex moves combined with Monte Carlo edge flips
bending energy as the main physical contribution
a weak harmonic regularizer used only to keep the mesh well conditioned in this minimal example
the
Box/System/Evolver/ dumper workflow used throughout the packaged examples
The example uses Mesh>Bending>Dihedral as the main energy term and
Mesh>Limit to keep the mesh in a stable range during the short run. A weak
Mesh>Harmonic term is included only as a regularizer for this minimal
example.
How to Run#
python -m pymembrane.examples.liquid_membrane --quick
For a longer run with files written into a separate directory:
python -m pymembrane.examples.liquid_membrane --steps 1000 --output-dir liquid_output
Command-Line Arguments#
Argument |
Default |
Description |
|---|---|---|
|
|
Run a short version of the example for testing the installation. |
|
|
Number of Monte Carlo steps used in the main simulation run. Runtime
default: |
|
|
Icosphere subdivision level used to build the initial spherical mesh.
Runtime default: |
|
|
Monte Carlo temperature used for the liquid-membrane workflow. |
|
|
Directory where the VTK, OBJ, and summary files are written. |
|
|
Path to the summary JSON file. |
|
|
Base random seed used for the Monte Carlo integrators. |
|
|
Keep the generated temporary mesh input files on disk. |
Expected Output#
The example writes:
initial.vtkfinal.vtkfinal.objsummary.jsonoptionally
mesh_inputs/*.inpwhen generated mesh inputs are retained
Quick Mode#
--quick runs a short version of the same model. It keeps the
same mesh generation, force model, and integrator names while reducing the
number of Monte Carlo steps.
Scope Note#
This example demonstrates a bending-dominated dynamically triangulated membrane. Vertex moves update the membrane shape, while edge flips update mesh connectivity. A weak harmonic term is used only as a regularizer in this minimal example; the liquid-membrane behavior comes from bending energy, limit protection, and Monte Carlo edge flips. For large-scale simulations where maximum performance for fluid membranes is the primary objective, specialized dynamically triangulated membrane packages may be preferable. PyMembrane’s focus is on providing a modular and extensible C++/Python framework in which forces, integrators, minimizers, constraints, and output routines can be combined and extended for new membrane models.