t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
Functions
t8_cmesh_examples.h File Reference

We provide example coarse meshes in this file. More...

#include <t8_cmesh.h>
#include <p4est_connectivity.h>
#include <p8est_connectivity.h>

Go to the source code of this file.

Functions

t8_cmesh_t t8_cmesh_new_from_p4est (p4est_connectivity_t *conn, sc_MPI_Comm comm, int do_partition)
 Constructs a cmesh from a given p4est_connectivity structure. More...
 
t8_cmesh_t t8_cmesh_new_from_p8est (p8est_connectivity_t *conn, sc_MPI_Comm comm, int do_partition)
 Constructs a cmesh from a given p8est_connectivity structure. More...
 
t8_cmesh_t t8_cmesh_new_empty (sc_MPI_Comm comm, int do_partition, int dimension)
 Construct a cmesh that has no trees. More...
 
t8_cmesh_t t8_cmesh_new_from_class (t8_eclass_t eclass, sc_MPI_Comm comm)
 Constructs a cmesh that consists only of one tree of a given element class. More...
 
t8_cmesh_t t8_cmesh_new_hypercube (t8_eclass_t eclass, sc_MPI_Comm comm, int do_bcast, int do_partition, int periodic)
 Construct a hypercube forest from one primitive tree class. More...
 
t8_cmesh_t t8_cmesh_new_hypercube_hybrid (sc_MPI_Comm comm, int do_partition, int periodic)
 Hybercube with 6 Tets, 6 Prism, 4 Hex. More...
 
t8_cmesh_t t8_cmesh_new_periodic (sc_MPI_Comm comm, int dim)
 Construct a unit interval/square/cube coarse mesh that is periodic in each direction. More...
 
t8_cmesh_t t8_cmesh_new_periodic_tri (sc_MPI_Comm comm)
 Construct a unit square of two triangles that is periodic in x and y. More...
 
t8_cmesh_t t8_cmesh_new_periodic_hybrid (sc_MPI_Comm comm)
 Construct a unit square of two quads and four triangles that is periodic in x and y. More...
 
t8_cmesh_t t8_cmesh_new_periodic_line_more_trees (sc_MPI_Comm comm)
 Construct a unit interval coarse mesh that consists of 3 trees and is periodic. More...
 
t8_cmesh_t t8_cmesh_new_bigmesh (t8_eclass_t eclass, int num_trees, sc_MPI_Comm comm)
 Construct a mesh consisting of a given number of same type trees. More...
 
t8_cmesh_t t8_cmesh_new_line_zigzag (sc_MPI_Comm comm)
 Construct a forest of three connected askew lines. More...
 
t8_cmesh_t t8_cmesh_new_prism_cake (sc_MPI_Comm comm, int num_of_prisms)
 Construct a forest of num_of_prisms connected prism, all with one edge in 0, except for num_of_prisms = 2, then the return is the hypercube mesh. More...
 
t8_cmesh_t t8_cmesh_new_prism_deformed (sc_MPI_Comm comm)
 Construct a single deformed prism. More...
 
t8_cmesh_t t8_cmesh_new_pyramid_deformed (sc_MPI_Comm comm)
 Construct a single deformed pyramid. More...
 
t8_cmesh_t t8_cmesh_new_prism_cake_funny_oriented (sc_MPI_Comm comm)
 Construct a forest of six connected noncannoical oriented prisms. More...
 
t8_cmesh_t t8_cmesh_new_prism_geometry (sc_MPI_Comm comm)
 Construct a forest of six connected noncannoical oriented prisms. More...
 
t8_cmesh_t t8_cmesh_new_disjoint_bricks (t8_gloidx_t num_x, t8_gloidx_t num_y, t8_gloidx_t num_z, int x_periodic, int y_periodic, int z_periodic, sc_MPI_Comm comm)
 Create a partitoned cmesh of quads whose local trees are given by an num_x by num_y brick connectivity from p4est or a num_x by num_y by num_z brick connectivity from p8est. More...
 
t8_cmesh_t t8_cmesh_new_tet_orientation_test (sc_MPI_Comm comm)
 Construct a tetrahedral cmesh that has all possible face to face connections and orientations. More...
 
t8_cmesh_t t8_cmesh_new_hybrid_gate (sc_MPI_Comm comm)
 Construct a hybrid cmesh with 2 tets, 2 prism, 1 hex. More...
 
t8_cmesh_t t8_cmesh_new_hybrid_gate_deformed (sc_MPI_Comm comm)
 Construct a hybrid cmesh with 2 tets, 2 prism, 1 hex and all are deformed. More...
 
t8_cmesh_t t8_cmesh_new_full_hybrid (sc_MPI_Comm comm)
 Construct a full hybrig cmesh, with 1 hex, 1 pyra, 1 prism and 1 tet This cmesh is used for testing and debugging. More...
 
t8_cmesh_t t8_cmesh_new_pyramid_cake (sc_MPI_Comm comm, int num_of_pyra)
 Construct a mesh out of num_of_pyra many pyramids. More...
 
t8_cmesh_t t8_cmesh_new_long_brick_pyramid (sc_MPI_Comm comm, int num_cubes)
 Construct a bigger mesh, consisting of many cubes made by pyramids. More...
 
t8_cmesh_t t8_cmesh_new_row_of_cubes (t8_locidx_t num_trees, const int set_attributes, sc_MPI_Comm comm)
 Construct num_trees many cubes each of length 1 connected along the x-axis without any additional attributes than the tree-vertices, or with additional attributes. More...
 

Detailed Description

We provide example coarse meshes in this file.

Function Documentation

◆ t8_cmesh_new_bigmesh()

t8_cmesh_t t8_cmesh_new_bigmesh ( t8_eclass_t  eclass,
int  num_trees,
sc_MPI_Comm  comm 
)

Construct a mesh consisting of a given number of same type trees.

Parameters
[in]eclassThis element class determines the dimension and the type trees used.
[in]num_treesThe number of trees to use.
[in]commThe MPI_Communicator used to commit the cmesh.
Returns
A valid cmesh, as if _init and _commit had been called.

◆ t8_cmesh_new_disjoint_bricks()

t8_cmesh_t t8_cmesh_new_disjoint_bricks ( t8_gloidx_t  num_x,
t8_gloidx_t  num_y,
t8_gloidx_t  num_z,
int  x_periodic,
int  y_periodic,
int  z_periodic,
sc_MPI_Comm  comm 
)

Create a partitoned cmesh of quads whose local trees are given by an num_x by num_y brick connectivity from p4est or a num_x by num_y by num_z brick connectivity from p8est.

num_x and num_y and num_z can be different for different MPI ranks.

Parameters
[in]num_xThe number of trees in x direction for this rank. Must be >= 0.
[in]num_yThe number of trees in y direction for this rank. Must be >= 0.
[in]num_yThe number of trees in z direction for this rank. Must be >= 0. If nonzero, the cmesh is 3 dimensional.
[in]x_periodicIf nonzero, the local brick connectivity is periodic in x direction.
[in]y_periodicIf nonzero, the local brick connectivity is periodic in y direction.
[in]y_periodicIf nonzero and num_z > 0, the local brick connectivity is periodic in z direction.
[in]commThe MPI communicator used to commit the cmesh.
Returns
A committed and partitioned cmesh. The process local trees form a num_x by num_y (by num_z) brick. It is possible for num_x or num_y to be set to zero. In this case the local part of the cmesh will be empty. If num_z is set to zero, the cmesh is 2 dimensional.

◆ t8_cmesh_new_empty()

t8_cmesh_t t8_cmesh_new_empty ( sc_MPI_Comm  comm,
int  do_partition,
int  dimension 
)

Construct a cmesh that has no trees.

We do not know a special use case, this function is merely for debugging and to show the possibility.

Parameters
[in]commmpi communicator to be used with the new cmesh.
[in]do_partitionFlag whether the cmesh should be partitioned or not.
[in]dimensionAn empty cmesh requires a dimension nevertheless 0 <= dimension <= 4.
Returns
A committed t8_cmesh structure that has no trees.

◆ t8_cmesh_new_from_class()

t8_cmesh_t t8_cmesh_new_from_class ( t8_eclass_t  eclass,
sc_MPI_Comm  comm 
)

Constructs a cmesh that consists only of one tree of a given element class.

Parameters
[in]eclassThe element class.
[in]commmpi communicator to be used with the new cmesh.
[in]do_dupFlag whether the communicator shall be duplicated or not.
Returns
A committed t8_cmesh structure with one tree of class eclass.

◆ t8_cmesh_new_from_p4est()

t8_cmesh_t t8_cmesh_new_from_p4est ( p4est_connectivity_t *  conn,
sc_MPI_Comm  comm,
int  do_partition 
)

Constructs a cmesh from a given p4est_connectivity structure.

Parameters
[in]connThe p4est connectivity.
[in]commmpi communicator to be used with the new cmesh.
[in]do_partitionFlag whether the cmesh should be partitioned or not.
Returns
A t8_cmesh structure that holds the same connectivity information as conn.
Note
This function requires that p4est is initialized. Make sure to call p4est_init before using this routine. If this is not the case, a warning is issued and p4est_init is called from within this function.

◆ t8_cmesh_new_from_p8est()

t8_cmesh_t t8_cmesh_new_from_p8est ( p8est_connectivity_t *  conn,
sc_MPI_Comm  comm,
int  do_partition 
)

Constructs a cmesh from a given p8est_connectivity structure.

Parameters
[in]connThe p8est connectivity.
[in]commmpi communicator to be used with the new cmesh.
[in]do_dupFlag whether the communicator shall be duplicated or not.
[in]do_partitionFlag whether the cmesh should be partitioned or not.
Returns
A t8_cmesh structure that holds the same connectivity information as conn.
Note
This function requires that p4est is initialized. Make sure to call p4est_init before using this routine. If this is not the case, a warning is issued and p4est_init is called from within this function.

◆ t8_cmesh_new_full_hybrid()

t8_cmesh_t t8_cmesh_new_full_hybrid ( sc_MPI_Comm  comm)

Construct a full hybrig cmesh, with 1 hex, 1 pyra, 1 prism and 1 tet This cmesh is used for testing and debugging.

Parameters
[in]commThe MPI communicator used to commit the cmesh.
Returns
A committed and replicated hybrid cmesh of 4 trees.

◆ t8_cmesh_new_hybrid_gate()

t8_cmesh_t t8_cmesh_new_hybrid_gate ( sc_MPI_Comm  comm)

Construct a hybrid cmesh with 2 tets, 2 prism, 1 hex.

This cmesh is used for testing and debugging.

Parameters
[in]commThe MPI communicator used to commit the cmesh.
Returns
A committed and replicated hybrid cmesh of 5 trees.

◆ t8_cmesh_new_hybrid_gate_deformed()

t8_cmesh_t t8_cmesh_new_hybrid_gate_deformed ( sc_MPI_Comm  comm)

Construct a hybrid cmesh with 2 tets, 2 prism, 1 hex and all are deformed.

This cmesh is used for testing and debugging.

Parameters
[in]commThe MPI communicator used to commit the cmesh.
Returns
A committed and replicated hybrid cmesh of 5 trees.

◆ t8_cmesh_new_hypercube()

t8_cmesh_t t8_cmesh_new_hypercube ( t8_eclass_t  eclass,
sc_MPI_Comm  comm,
int  do_bcast,
int  do_partition,
int  periodic 
)

Construct a hypercube forest from one primitive tree class.

Parameters
[in]eclassThis element class determines the dimension and the number of trees needed to construct a cube.
[in]commThe mpi communicator to be used.
[in]do_bcastIf this flag is nonzero the cmesh is only constructed on processor 0 and then broadcasted to the other processors in comm. TODO: this parameter will be moved to internal.
[in]do_partitionCreate a partitioned cmesh.
[in]periodicIf true, the coarse mesh will be periodic in each direction. Not possible with eclass pyramid.

◆ t8_cmesh_new_hypercube_hybrid()

t8_cmesh_t t8_cmesh_new_hypercube_hybrid ( sc_MPI_Comm  comm,
int  do_partition,
int  periodic 
)

Hybercube with 6 Tets, 6 Prism, 4 Hex.

Parameters
[in]commThe mpi communicator to be used.
[in]do_partitionIf non-zero create a partitioned cmesh.
[in]periodicIf non-zero create a periodic cmesh in each direction
Returns
A comitted cmesh consisting of 6 Tets, 6 prism and 4 hex. Together, they form a cube.

◆ t8_cmesh_new_line_zigzag()

t8_cmesh_t t8_cmesh_new_line_zigzag ( sc_MPI_Comm  comm)

Construct a forest of three connected askew lines.

Parameters
[in]commThe mpi communicator to use.
Returns
A valid cmesh, as if _init and _commit had been called.

◆ t8_cmesh_new_long_brick_pyramid()

t8_cmesh_t t8_cmesh_new_long_brick_pyramid ( sc_MPI_Comm  comm,
int  num_cubes 
)

Construct a bigger mesh, consisting of many cubes made by pyramids.

Parameters
[in]commThe MPI communicator used to commit the cmesh
[in]num_cubesThe number of cubes of pyramids
Returns
A cmesh with num_cubes many hypercubes

◆ t8_cmesh_new_periodic()

t8_cmesh_t t8_cmesh_new_periodic ( sc_MPI_Comm  comm,
int  dim 
)

Construct a unit interval/square/cube coarse mesh that is periodic in each direction.

Element class? Hypercube? TODO: redundant, remove.

Parameters
[in]commThe mpi communicator to use.
[in]dimThe dimension of the forest, 1, 2 or 3.
Returns
A valid cmesh, as if _init and _commit had been called.

◆ t8_cmesh_new_periodic_hybrid()

t8_cmesh_t t8_cmesh_new_periodic_hybrid ( sc_MPI_Comm  comm)

Construct a unit square of two quads and four triangles that is periodic in x and y.

Parameters
[in]commThe mpi communicator to use.
Returns
A valid cmesh, as if _init and _commit had been called.

◆ t8_cmesh_new_periodic_line_more_trees()

t8_cmesh_t t8_cmesh_new_periodic_line_more_trees ( sc_MPI_Comm  comm)

Construct a unit interval coarse mesh that consists of 3 trees and is periodic.

Parameters
[in]commThe mpi communicator to use.
Returns
A valid cmesh, as is _init and _commit had been called.

◆ t8_cmesh_new_periodic_tri()

t8_cmesh_t t8_cmesh_new_periodic_tri ( sc_MPI_Comm  comm)

Construct a unit square of two triangles that is periodic in x and y.

Parameters
[in]commThe mpi communicator to use.
Returns
A valid cmesh, as if _init and _commit had been called.

◆ t8_cmesh_new_prism_cake()

t8_cmesh_t t8_cmesh_new_prism_cake ( sc_MPI_Comm  comm,
int  num_of_prisms 
)

Construct a forest of num_of_prisms connected prism, all with one edge in 0, except for num_of_prisms = 2, then the return is the hypercube mesh.

Parameters
[in]commThe mpi communicator to use.
[in]num_of_prismsThe number of prisms to be used.
Returns
A valid cmesh, as if _init and _commit had been called.

◆ t8_cmesh_new_prism_cake_funny_oriented()

t8_cmesh_t t8_cmesh_new_prism_cake_funny_oriented ( sc_MPI_Comm  comm)

Construct a forest of six connected noncannoical oriented prisms.

Parameters
[in]commThe mpi communicator to use.
Returns
A valid cmesh, as if _init and _commit had been called.

◆ t8_cmesh_new_prism_deformed()

t8_cmesh_t t8_cmesh_new_prism_deformed ( sc_MPI_Comm  comm)

Construct a single deformed prism.

Parameters
[in]commThe mpi communicator to use.
Returns
A valid cmesh; as if _init and _commit had been called.

◆ t8_cmesh_new_prism_geometry()

t8_cmesh_t t8_cmesh_new_prism_geometry ( sc_MPI_Comm  comm)

Construct a forest of six connected noncannoical oriented prisms.

Parameters
[in]commThe mpi communicator to use.
Returns
A valid cmesh, as if _init and _commit had been called.

◆ t8_cmesh_new_pyramid_cake()

t8_cmesh_t t8_cmesh_new_pyramid_cake ( sc_MPI_Comm  comm,
int  num_of_pyra 
)

Construct a mesh out of num_of_pyra many pyramids.

They form a circle, face 0 is connected with face 1 of the next pyramid.

Parameters
[in]commThe MPI communicator used to commit the cmesh
[in]num_of_pyraThe number of pyramids to construct. Should be larger than 2
Returns
A cmesh with num_of_pyra many pyramids

◆ t8_cmesh_new_pyramid_deformed()

t8_cmesh_t t8_cmesh_new_pyramid_deformed ( sc_MPI_Comm  comm)

Construct a single deformed pyramid.

Parameters
[in]commThe mpi communicator to use.
Returns
A valid cmesh; as if _init and _commit had been called.

◆ t8_cmesh_new_row_of_cubes()

t8_cmesh_t t8_cmesh_new_row_of_cubes ( t8_locidx_t  num_trees,
const int  set_attributes,
sc_MPI_Comm  comm 
)

Construct num_trees many cubes each of length 1 connected along the x-axis without any additional attributes than the tree-vertices, or with additional attributes.

Parameters
[in]num_treesThe number of trees along the x-axis
[in]set_attributesIf 1, set tree_id and num_trees as additional attribute for each tree.
[in]commThe MPI communicator used to commit the cmesh
Returns
A cmesh with num_trees many hexahedrons.

◆ t8_cmesh_new_tet_orientation_test()

t8_cmesh_t t8_cmesh_new_tet_orientation_test ( sc_MPI_Comm  comm)

Construct a tetrahedral cmesh that has all possible face to face connections and orientations.

This cmesh is used for testing and debugging.

Parameters
[in]commThe MPI communicator used to commit the cmesh.
Returns
A committed and replicated cmesh of 24 tetrahedron trees in which each (face -> face, orientation) face connection is set at least once. Note that most faces in this cmesh are boundary faces.