UnitCubeMesh.h

Note

The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded.

class UnitCubeMesh

Parent class(es)

Tetrahedral/hexahedral mesh of the 3D unit cube [0,1] x [0,1] x [0,1]. Given the number of cells (nx, ny, nz) in each direction, the total number of tetrahedra will be 6*nx*ny*nz and the total number of vertices will be (nx + 1)*(ny + 1)*(nz + 1).

static Mesh create(std::array<std::size_t, 3> n, CellType::Type cell_type)

Create a uniform finite element Mesh over the unit cube [0,1] x [0,1] x [0,1].

@param n (std::array<std::size_t, 3>)
Number of cells in each direction.
@param cell_type
Tetrahedron or hexahedron

@code{.cpp}

auto mesh = UnitCubeMesh::create(32, 32, 32, CellType::Type::tetrahedron);

@endcode

static Mesh create(MPI_Comm comm, std::array<std::size_t, 3> n, CellType::Type cell_type)

Create a uniform finite element Mesh over the unit cube [0,1] x [0,1] x [0,1].

@param comm (MPI_Comm)
MPI communicator
@param n (std::aray<std::size_t, 3>)
Number of cells in each direction.
@param cell_type
Tetrahedron or hexahedron
@code{.cpp}
auto mesh = UnitCubeMesh::create(MPI_COMM_WORLD, {32, 32, 32}, CellType::Type::hexahedron);

@endcode

UnitCubeMesh(std::size_t nx, std::size_t ny, std::size_t nz)

Create a uniform finite element Mesh over the unit cube [0,1] x [0,1] x [0,1].

@param nx (std::size_t)
Number of cells in \(x\) direction.
@param ny (std::size_t)
Number of cells in \(y\) direction.
@param nz (std::size_t)
Number of cells in \(z\) direction.

@code{.cpp}

UnitCubeMesh mesh(32, 32, 32);

@endcode

UnitCubeMesh(MPI_Comm comm, std::size_t nx, std::size_t ny, std::size_t nz)

Create a uniform finite element Mesh over the unit cube [0,1] x [0,1] x [0,1].

@param comm (MPI_Comm)
MPI communicator
@param nx (std::size_t)
Number of cells in \(x\) direction.
@param ny (std::size_t)
Number of cells in \(y\) direction.
@param nz (std::size_t)
Number of cells in \(z\) direction.
@code{.cpp}
UnitCubeMesh mesh(MPI_COMM_WORLD, 32, 32, 32);

@endcode