RectangleMesh¶
-
class
dolfin.cpp.mesh.RectangleMesh(*args)¶ Bases:
dolfin.cpp.mesh.MeshTriangular mesh of the 2D rectangle spanned by two points p0 and p1. Given the number of cells (nx, ny) in each direction, the total number of triangles will be 2*nx*ny and the total number of vertices will be (nx + 1)*(ny + 1).
// Mesh with 8 cells in each direction on the // set [-1,2] x [-1,2] Point p0(-1, -1); Point p1(2, 2); RectangleMesh mesh(MPI_COMM_WORLD, p0, p1, 8, 8);
Parameters: - comm (MPI_Comm) – (MPI_Comm)
MPIcommunicator - Point & p0 (const) – (
Point) First point. - Point & p1 (const) – (
Point) Second point. - nx (std::size_t) – (double) Number of cells in \(x\) -direction.
- ny (std::size_t) – (double) Number of cells in \(y\) -direction.
- diagonal (std::string) – (string) Direction of diagonals: “left”, “right”, “left/right”, “crossed”
-
static
create()¶ // Mesh with 8 cells in each direction on the // set [-1,2] x [-1,2] Point p0(-1, -1); Point p1(2, 2); auto mesh = RectangleMesh::create(MPI_COMM_WORLD, {p0, p1}, {8, 8});
Parameters: - comm (MPI_Comm) – (MPI_Comm)
MPIcommunicator - std::array< Point, 2 > & p (const) – (std::array<
Point, 2>)Vertexpoints. - std::size_t, 2 > n (std::array<) – (std::array<std::size_t, 2>) Number of cells in each direction
- cell_type (CellType::Type) – (
dolfin::CellType::Type)Celltype - diagonal (std::string) – (string) Direction of diagonals: “left”, “right”, “left/right”, “crossed”
Return type: - comm (MPI_Comm) – (MPI_Comm)
-
thisown¶ The membership flag
- comm (MPI_Comm) – (MPI_Comm)