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,
)
| 1023 | |
| 1024 | |
| 1025 | def 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 | |
| 1055 | def create_rectangle( |