MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / create_unit_cube

Function create_unit_cube

python/dolfinx/mesh.py:1206–1242  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

1204
1205
1206def 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
1245def entities_to_geometry(

Callers 15

meshFunction · 0.90
test_cffi_expressionFunction · 0.90
test_block_sizeFunction · 0.90
test_P_simplex_built_inFunction · 0.90
test_P_tp_built_in_meshFunction · 0.90
test_S_tp_built_in_meshFunction · 0.90
test_mixed_elementFunction · 0.90
test_dof_coords_3dFunction · 0.90
meshFunction · 0.90

Calls 2

create_boxFunction · 0.70
arrayMethod · 0.45

Tested by 15

meshFunction · 0.72
test_cffi_expressionFunction · 0.72
test_block_sizeFunction · 0.72
test_P_simplex_built_inFunction · 0.72
test_P_tp_built_in_meshFunction · 0.72
test_S_tp_built_in_meshFunction · 0.72
test_mixed_elementFunction · 0.72
test_dof_coords_3dFunction · 0.72
meshFunction · 0.72