From 0eac3d0209d96c1b5ed525cf07d6c450db618321 Mon Sep 17 00:00:00 2001 From: ksagiyam Date: Mon, 8 Jul 2024 16:06:36 +0100 Subject: [PATCH] k --- firedrake/utility_meshes.py | 101 +++++++++++++++++++++++++----------- 1 file changed, 70 insertions(+), 31 deletions(-) diff --git a/firedrake/utility_meshes.py b/firedrake/utility_meshes.py index 4599c53d99..62f27ebff9 100644 --- a/firedrake/utility_meshes.py +++ b/firedrake/utility_meshes.py @@ -1849,23 +1849,44 @@ def PeriodicBoxMesh( ): """Generate a periodic mesh of a 3D box. - :arg nx: The number of cells in the x direction - :arg ny: The number of cells in the y direction - :arg nz: The number of cells in the z direction - :arg Lx: The extent in the x direction - :arg Ly: The extent in the y direction - :arg Lz: The extent in the z direction - :kwarg reorder: (optional), should the mesh be reordered? - :kwarg distribution_parameters: options controlling mesh - distribution, see :func:`.Mesh` for details. - :kwarg comm: Optional communicator to build the mesh on. - :kwarg name: Optional name of the mesh. - :kwarg distribution_name: the name of parallel distribution used - when checkpointing; if `None`, the name is automatically - generated. - :kwarg permutation_name: the name of entity permutation (reordering) used - when checkpointing; if `None`, the name is automatically - generated. + Parameters + ---------- + nx : int + Number of cells in the x direction. + ny : int + Number of cells in the y direction. + nz : int + Number of cells in the z direction. + Lx : float + Extent in the x direction. + Ly : float + Extent in the y direction. + Lz : float + Extent in the z direction. + directions : list or tuple or None + Directions of periodicity; if `None`, the mesh is made periodic in all directions. + hexahedral : bool + Whether to make hexahedral mesh or not. + reorder : bool or None + Whether to reorder the mesh. + distribution_parameters : dict or None + Options controlling mesh distribution, see :func:`.Mesh` for details. + comm : + Communicator to build the mesh on. + name : str + Name of the mesh. + distribution_name : str or None + Name of parallel distribution used when checkpointing; + if `None`, the name is automatically generated. + permutation_name : str or None + Name of entity permutation (reordering) used when checkpointing; + if `None`, the name is automatically generated. + + Returns + ------- + MeshGeometry + The mesh. + """ for n in (nx, ny, nz): if n < 3: @@ -2014,20 +2035,38 @@ def PeriodicUnitCubeMesh( ): """Generate a periodic mesh of a unit cube - :arg nx: The number of cells in the x direction - :arg ny: The number of cells in the y direction - :arg nz: The number of cells in the z direction - :kwarg reorder: (optional), should the mesh be reordered? - :kwarg distribution_parameters: options controlling mesh - distribution, see :func:`.Mesh` for details. - :kwarg comm: Optional communicator to build the mesh on. - :kwarg name: Optional name of the mesh. - :kwarg distribution_name: the name of parallel distribution used - when checkpointing; if `None`, the name is automatically - generated. - :kwarg permutation_name: the name of entity permutation (reordering) used - when checkpointing; if `None`, the name is automatically - generated. + Parameters + ---------- + nx : int + Number of cells in the x direction. + ny : int + Number of cells in the y direction. + nz : int + Number of cells in the z direction. + directions : list or tuple or None + Directions of periodicity; if `None`, the mesh is made periodic in all directions. + hexahedral : bool + Whether to make hexahedral mesh or not. + reorder : bool or None + Should the mesh be reordered? + distribution_parameters : dict or None + Options controlling mesh distribution, see :func:`.Mesh` for details. + comm : + Communicator to build the mesh on. + name : str + Name of the mesh. + distribution_name : str or None + Name of parallel distribution used when checkpointing; + if `None`, the name is automatically generated. + permutation_name : str or None + Name of entity permutation (reordering) used when checkpointing; + if `None`, the name is automatically generated. + + Returns + ------- + MeshGeometry + The mesh. + """ return PeriodicBoxMesh( nx,