2. Manifold & mesh#

2.1. Manifold#

We define an abstract bounded, connected and contractible computational domain (manifold) by calling ph.manifold method,

manifold(ndim, sym_repr=None, lin_repr=None, is_periodic=False)[source]#

Generate an abstract manifold. It is actually a wrapper of the __init__ method of Manifold.

Parameters:
ndimint

The dimensions of the manifold. It must be lower than or equal to dimensions of the embedding space.

sym_repr{None, str}, optional

The symbolic representation of the manifold. If it is None, we will use a pre-set symbolic representation. The default is None.

lin_repr{None, str}, optional

The linguistic representation of the manifold. If it is None, we will use a pre-set linguistic representation. The default is None.

is_periodicbool, optional

If this is set to True, the manifold is a periodic. Otherwise, it is not periodic. The default is True.

Returns:
manifoldManifold

The abstract manifold instance.

A common call is

>>> manifold = ph.manifold(2)

The output, manifold, is an instance of Manifold. It is abstract at this stage because we do not specify any exact parameters, for example size and shape, of it.

class Manifold(ndim, sym_repr=None, lin_repr=None, is_periodic=False)[source]#
property m#

The dimensions of the embedding space.

property n#

The dimensions of the manifold.

2.2. Mesh#

We define an abstract mesh based on an abstract manifold by calling ph.mesh method,

mesh(manifold, sym_repr=None, lin_repr=None)[source]#

Generate an abstract mesh over an abstract manifold. It is actually a wrapper of the __init__ method of Mesh.

Parameters:
manifoldManifold

The abstract manifold this mesh is built on.

sym_repr{None, str}, optional

The symbolic representation of the mesh. If it is None, we will use a pre-set symbolic representation. The default is None.

lin_repr{None, str}, optional

The linguistic representation of the mesh. If it is None, we will use a pre-set linguistic representation. The default is None.

Returns:
meshMesh

The abstract mesh instance.

As an example,

>>> mesh = ph.mesh(manifold)

The output, mesh, is an instance of Mesh. And similarly, it is abstract at this stage.

class Mesh(manifold, sym_repr=None, lin_repr=None)[source]#
property m#

The dimensions of the embedding space.

property manifold#

The manifold this mesh is built on.

property n#

The dimensions of the manifold.

You can print a list of defined meshes by

>>> ph.list_meshes()  
Existing meshes:...

Note

Since so far everything is at the abstract level, we cannot visualize the manifold (i.e. the computational domain) or the mesh.

We have the freedom to further define the manifold to be an exact one of particular size, shape, etc., and to define the mesh to be an exact one of certain amount of triangulated or quadrilateral cells (elements). These processes will be done when we invoke a particular implementation.


↩️ Back to Documentations.