Skip to content

Commit

Permalink
k
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam committed Jul 8, 2024
1 parent 9613a8b commit 0eac3d0
Showing 1 changed file with 70 additions and 31 deletions.
101 changes: 70 additions & 31 deletions firedrake/utility_meshes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0eac3d0

Please sign in to comment.