:orphan: # DMPlexCreateTPSMesh Create a distributed, interpolated mesh of a triply-periodic surface ## Synopsis ``` #include "petscdmplex.h" #include "petscdmplex.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 is the simplest member of the triply-periodic minimal surfaces. https://en.wikipedia.org/wiki/Schwarz_minimal_surface#Schwarz_P_(%22Primitive%22) 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. 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 Note The Gyroid mesh does not currently mark boundary sets. ## References - **** -*** Maskery et al, Insights into the mechanical properties of several triply periodic minimal surface lattice structures made by polymer additive manufacturing, 2017. https://doi.org/10.1016/j.polymer.2017.11.049 ## See Also [](ch_unstructured), `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
--- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/plex/plexcreate.c) [Index of all DMPlex routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)