UnitSquareMesh¶
-
class
dolfin.cpp.mesh.
UnitSquareMesh
(*args)¶ Bases:
dolfin.cpp.mesh.RectangleMesh
Triangular/quadrilateral mesh of the 2D unit square [0,1] x [0,1]. 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). std::string diagonal (“left”, “right”, “right/left”, “left/right”, or “crossed”) indicates the direction of the diagonals.
Create a uniform finite element
Mesh
over the unit square [0,1] x [0,1].UnitSquareMesh mesh1(MPI_COMM_WORLD, 32, 32); UnitSquareMesh mesh2(MPI_COMM_WORLD, 32, 32, "crossed");
Parameters: - comm (MPI_Comm) – (MPI_Comm)
MPI
communicator - nx (std::size_t) – (std::size_t) Number of cells in horizontal direction.
- ny (std::size_t) – (std::size_t) Number of cells in vertical direction.
- diagonal (std::string) – (std::string) Optional argument: A std::string indicating the direction of the diagonals.
-
static
create
()¶ Create a uniform finite element
Mesh
over the unit square [0,1] x [0,1].auto mesh1 = UnitSquareMesh::create(MPI_COMM_WORLD, 32, 32); auto mesh2 = UnitSquareMesh::create(MPI_COMM_WORLD, 32, 32, "crossed");
Parameters: - comm (MPI_Comm) – (MPI_Comm)
MPI
communicator - std::size_t, 2 > n (std::array<) – (std:::array<std::size_t, 2>) Number of cells in each direction.
- cell_type (CellType::Type) – Triangle or quadrilateral.
- diagonal (std::string) – (std::string) Optional argument: A std::string indicating the direction of the diagonals.
Return type: - comm (MPI_Comm) – (MPI_Comm)
-
thisown
¶ The membership flag
- comm (MPI_Comm) – (MPI_Comm)