Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh documentation #1587

Merged
merged 6 commits into from
Jul 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions hoomd/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@

.. rubric:: Mesh triangles and mesh bonds

``Mesh.triangles`` is a list of triangle data that constitutes the
triangulation. Each triangle is defined by a triplet of particle tags.
For a given triangulation HOOMD-blue also constructs a list of mesh bonds
automatically. Each mesh bond is defined by a pair of particle tags. The
corresponding vertex particles share a common edge in the triangulation.
``Mesh.triangulation`` is a dictionary with a list of triangles that
constitutes the triangulation. Each triangle is defined by a triplet of
particle tags. For a given triangulation HOOMD-blue also constructs a
list of mesh bonds automatically. Each mesh bond is defined by a pair
of particle tags. The corresponding vertex particles share a common edge
in the triangulation.


.. rubric:: Mesh potentials
Expand Down Expand Up @@ -47,8 +48,8 @@ class Mesh(_HOOMDBaseObject):

The mesh is defined by an array of triangles that make up a
triangulated surface of particles. Each triangle consists of
three particle tags. The mesh object consists of only one
mesh triangle type with the default type name "mesh".
three particle tags and is assigned to a defined triangle
type.

Examples::

Expand All @@ -57,6 +58,24 @@ class Mesh(_HOOMDBaseObject):
mesh_obj.triangulation = dict(type_ids = [0,0,0,0],
triangles = [[0,1,2],[0,2,3],[0,1,3],[1,2,3]])

.. py:attribute:: types

Names of the triangle types.

Type: `list` [`str`]

.. py:attribute:: triangulation

The mesh triangulation. The dictionary has the following keys:

* ``type_ids`` ((*N*) `numpy.ndarray` of ``uint32``): List of
triangle type ids.
* ``triangles`` ((*N*, 3) `numpy.ndarray` of ``uint32``): List
of triplets of particle tags which encodes the triangulation
of the mesh structure.

Type: `dict`

"""

def __init__(self):
Expand Down