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

Function create_unit_interval

python/dolfinx/mesh.py:1025–1052  ·  view source on GitHub ↗

Create a mesh on the unit interval. Args: comm: MPI communicator. nx: Number of cells. dtype: Float type for the mesh geometry(``numpy.float32`` or ``numpy.float64``). ghost_mode: Ghost mode used in the mesh partitioning. Options are ``Gho

(
    comm: _MPI.Comm,
    nx: int,
    dtype: npt.DTypeLike = default_real_type,
    ghost_mode=GhostMode.shared_facet,
    partitioner=None,
    gdim: int = 1,
)

Source from the content-addressed store, hash-verified

1023
1024
1025def create_unit_interval(
1026 comm: _MPI.Comm,
1027 nx: int,
1028 dtype: npt.DTypeLike = default_real_type,
1029 ghost_mode=GhostMode.shared_facet,
1030 partitioner=None,
1031 gdim: int = 1,
1032) -> Mesh:
1033 """Create a mesh on the unit interval.
1034
1035 Args:
1036 comm: MPI communicator.
1037 nx: Number of cells.
1038 dtype: Float type for the mesh geometry(``numpy.float32``
1039 or ``numpy.float64``).
1040 ghost_mode: Ghost mode used in the mesh partitioning. Options
1041 are ``GhostMode.none`` and ``GhostMode.shared_facet``.
1042 partitioner: Partitioning function to use for determining the
1043 parallel distribution of cells across MPI ranks.
1044 gdim: Geometric dimension. The interval lies along the first
1045 coordinate axis; remaining components are zero.
1046
1047 Returns:
1048 A unit interval mesh with end points at 0 and 1.
1049 """
1050 return create_interval(
1051 comm, nx, [0.0, 1.0], dtype=dtype, ghost_mode=ghost_mode, partitioner=partitioner, gdim=gdim
1052 )
1053
1054
1055def create_rectangle(

Callers 15

test_block_size_realFunction · 0.90
test_disjoint_submeshesFunction · 0.90
test_facet_area1DFunction · 0.90
test_distance_intervalFunction · 0.90
test_ghost_facet_1dFunction · 0.90
mesh_1dFunction · 0.90
test_submesh_fullFunction · 0.90
test_submesh_boundaryFunction · 0.90
test_empty_treeFunction · 0.90

Calls 1

create_intervalFunction · 0.70

Tested by 15

test_block_size_realFunction · 0.72
test_disjoint_submeshesFunction · 0.72
test_facet_area1DFunction · 0.72
test_distance_intervalFunction · 0.72
test_ghost_facet_1dFunction · 0.72
mesh_1dFunction · 0.72
test_submesh_fullFunction · 0.72
test_submesh_boundaryFunction · 0.72
test_empty_treeFunction · 0.72