Skip to main content
`Ctrl`+`K`

# DMPlexCreateTPSMesh

Create a distributed, interpolated mesh of a triply-periodic surface

## Synopsis

    #include "petscdmplex.h"
    #include "petscdmplextransform.h"
    PetscErrorCode DMPlexCreateTPSMesh(MPI_Comm comm, DMPlexTPSType tpstype, const PetscInt extent[], const DMBoundaryType periodic[], PetscBool tps_distribute, PetscInt refinements, PetscInt layers, PetscReal thickness, DM *dm)

Collective

## Input Parameters

- comm - The communicator for the `DM` object

- tpstype - Type of triply-periodic surface

- extent - Array of length 3 containing number of periods in each direction

- periodic - array of length 3 with periodicity, or `NULL` for non-periodic

- tps_distribute - Distribute 2D manifold mesh prior to refinement and extrusion (more scalable)

- refinements - Number of factor-of-2 refinements of 2D manifold mesh

- layers - Number of cell layers extruded in normal direction

- thickness - Thickness in normal direction

## Output Parameter

- dm - The `DM` object

## Notes

This meshes the surface of the Schwarz P or Gyroid surfaces. Schwarz P is the simplest member of the triply-periodic minimal surfaces. https://en.wikipedia.org/wiki/Schwarz_minimal_surface#Schwarz_P_(“Primitive”) and can be cut with “clean” boundaries. The Gyroid https://en.wikipedia.org/wiki/Gyroid is another triply-periodic minimal surface with applications in additive manufacturing; it is much more difficult to “cut” since there are no planes of symmetry. Our implementation creates a very coarse mesh of the surface and refines (by 4-way splitting) as many times as requested. On each refinement, all vertices are projected to their nearest point on the surface. This projection could readily be extended to related surfaces.

See [MSA+18]

The face (edge) sets for the Schwarz P surface are numbered \(1(-x), 2(+x), 3(-y), 4(+y), 5(-z), 6(+z)\). When the mesh is refined, “Face Sets” contain the new vertices (created during refinement). Use `DMPlexLabelComplete()` to propagate to coarse-level vertices.

## Developer Notes

The Gyroid mesh does not currently mark boundary sets.

## References

[MSA+18]

Ian Maskery, Logan Sturm, Adedeji O Aremu, Ajit Panesar, Christopher B Williams, Christopher J Tuck, Ricky D Wildman, Ian A Ashcroft, and Richard JM Hague. Insights into the mechanical properties of several triply periodic minimal surface lattice structures made by polymer additive manufacturing. Polymer, 152:62–71, 2018.

## See Also

DMPlex: Unstructured Grids, `DM`, `DMPLEX`, `DMPlexCreateSphereMesh()`, `DMSetType()`, `DMCreate()`

## Level

beginner

## Location

src/dm/impls/plex/plexcreate.c

## Examples

src/dm/impls/plex/tutorials/ex13.c

## Implementations

DMPlexCreateTPSMesh_Internal() in src/dm/impls/plex/plexcreate.c

Index of all DMPlex routines
Table of Contents for all manual pages
Index of all manual pages