Create a mesh of a unit cube. Args: comm: MPI communicator. nx: Number of cells in "x" direction. ny: Number of cells in "y" direction. nz: Number of cells in "z" direction. cell_type: Mesh cell type dtype: Float type for the mesh geometry(``numpy
(
comm: _MPI.Comm,
nx: int,
ny: int,
nz: int,
cell_type=CellType.tetrahedron,
dtype: npt.DTypeLike = default_real_type,
ghost_mode=GhostMode.shared_facet,
partitioner=None,
)
| 1204 | |
| 1205 | |
| 1206 | def create_unit_cube( |
| 1207 | comm: _MPI.Comm, |
| 1208 | nx: int, |
| 1209 | ny: int, |
| 1210 | nz: int, |
| 1211 | cell_type=CellType.tetrahedron, |
| 1212 | dtype: npt.DTypeLike = default_real_type, |
| 1213 | ghost_mode=GhostMode.shared_facet, |
| 1214 | partitioner=None, |
| 1215 | ) -> Mesh: |
| 1216 | """Create a mesh of a unit cube. |
| 1217 | |
| 1218 | Args: |
| 1219 | comm: MPI communicator. |
| 1220 | nx: Number of cells in "x" direction. |
| 1221 | ny: Number of cells in "y" direction. |
| 1222 | nz: Number of cells in "z" direction. |
| 1223 | cell_type: Mesh cell type |
| 1224 | dtype: Float type for the mesh geometry(``numpy.float32`` |
| 1225 | or ``numpy.float64``). |
| 1226 | ghost_mode: Ghost mode used in the mesh partitioning. |
| 1227 | partitioner: Function that computes the parallel distribution of |
| 1228 | cells across MPI ranks. |
| 1229 | |
| 1230 | Returns: |
| 1231 | A mesh of an axis-aligned unit cube with corners at ``(0, 0, 0)`` |
| 1232 | and ``(1, 1, 1)``. |
| 1233 | """ |
| 1234 | return create_box( |
| 1235 | comm, |
| 1236 | [np.array([0.0, 0.0, 0.0]), np.array([1.0, 1.0, 1.0])], |
| 1237 | (nx, ny, nz), |
| 1238 | cell_type, |
| 1239 | dtype, |
| 1240 | ghost_mode, |
| 1241 | partitioner, |
| 1242 | ) |
| 1243 | |
| 1244 | |
| 1245 | def entities_to_geometry( |