fipy.meshes.factoryMeshes

Functions

CylindricalGrid1D([dr, nr, Lr, dx, nx, Lx, ...])

Create a 2D cylindrical mesh

CylindricalGrid2D([dr, dz, nr, nz, Lr, Lz, ...])

Create a 2D cylindrical mesh

Grid1D([dx, nx, Lx, overlap, communicator])

Create a 1D Cartesian mesh

Grid2D([dx, dy, nx, ny, Lx, Ly, overlap, ...])

Create a 2D Cartesian mesh

Grid3D([dx, dy, dz, nx, ny, nz, Lx, Ly, Lz, ...])

Create a 3D Cartesian mesh

SphericalGrid1D([dr, nr, Lr, dx, nx, Lx, ...])

Create a 1D spherical mesh

fipy.meshes.factoryMeshes.CylindricalGrid1D(dr=None, nr=None, Lr=None, dx=1.0, nx=None, Lx=None, origin=(0,), overlap=2, communicator=DummyComm())

Create a 2D cylindrical mesh

Factory function to select between CylindricalUniformGrid1D and CylindricalNonUniformGrid1D. If Lr is specified the length of the domain is always Lr regardless of dr, unless dr is a list of spacings, in which case Lr will be the sum of dr.

Parameters:
  • dr (float) – Grid spacing in the radial direction. Alternative: dx.

  • nr (int) – Number of cells in the radial direction. Alternative: nx.

  • Lr (float) – Domain length in the radial direction. Alternative: Lx.

  • overlap (int) – the number of overlapping cells for parallel simulations. Generally 2 is adequate. Higher order equations or discretizations require more.

  • communicator (CommWrapper) – MPI communicator to use. Select serialComm to create a serial mesh when running in parallel; mostly used for test purposes. (default: parallelComm).

fipy.meshes.factoryMeshes.CylindricalGrid2D(dr=None, dz=None, nr=None, nz=None, Lr=None, Lz=None, dx=1.0, dy=1.0, nx=None, ny=None, Lx=None, Ly=None, origin=((0,), (0,)), overlap=2, communicator=DummyComm())

Create a 2D cylindrical mesh

Factory function to select between CylindricalUniformGrid2D and CylindricalNonUniformGrid2D. If Lr is specified the length of the domain is always Lr regardless of dr, unless dr is a list of spacings, in which case Lr will be the sum of dr.

Parameters:
  • dr (float) – Grid spacing in the radial direction. Alternative: dx.

  • dz (float) – grid spacing in the vertical direction. Alternative: dy.

  • nr (int) – Number of cells in the radial direction. Alternative: nx.

  • nz (int) – Number of cells in the vertical direction. Alternative: ny.

  • Lr (float) – Domain length in the radial direction. Alternative: Lx.

  • Lz (float) – Domain length in the vertical direction. Alternative: Ly.

  • overlap (int) – the number of overlapping cells for parallel simulations. Generally 2 is adequate. Higher order equations or discretizations require more.

  • communicator (CommWrapper) – MPI communicator to use. Select serialComm to create a serial mesh when running in parallel; mostly used for test purposes. (default: parallelComm).

fipy.meshes.factoryMeshes.Grid1D(dx=1.0, nx=None, Lx=None, overlap=2, communicator=DummyComm())

Create a 1D Cartesian mesh

Factory function to select between UniformGrid1D and NonUniformGrid1D. If Lx is specified the length of the domain is always Lx regardless of dx, unless dx is a list of spacings, in which case Lx will be the sum of dx and nx will be the count of dx.

Parameters:
  • dx (float) – Grid spacing in the horizontal direction

  • nx (int) – Number of cells in the horizontal direction

  • Lx (float) – Domain length in the horizontal direction

  • overlap (int) – Number of overlapping cells for parallel simulations. Generally 2 is adequate. Higher order equations or discretizations require more.

  • communicator (CommWrapper) – MPI communicator to use. Select serialComm to create a serial mesh when running in parallel; mostly used for test purposes. (default: parallelComm).

fipy.meshes.factoryMeshes.Grid2D(dx=1.0, dy=1.0, nx=None, ny=None, Lx=None, Ly=None, overlap=2, communicator=DummyComm())

Create a 2D Cartesian mesh

Factory function to select between UniformGrid2D and NonUniformGrid2D. If L{x,y} is specified, the length of the domain is always L{x,y} regardless of d{x,y}, unless d{x,y} is a list of spacings, in which case L{x,y} will be the sum of d{x,y} and n{x,y} will be the count of d{x,y}.

>>> print(Grid2D(Lx=3., nx=2).dx)
1.5
Parameters:
  • dx (float) – Grid spacing in the horizontal direction

  • dy (float) – Grid spacing in the vertical direction

  • nx (int) – Number of cells in the horizontal direction

  • ny (int) – Number of cells in the vertical direction

  • Lx (float) – Domain length in the horizontal direction

  • Ly (float) – Domain length in the vertical direction

  • overlap (int) – Number of overlapping cells for parallel simulations. Generally 2 is adequate. Higher order equations or discretizations require more.

  • communicator (CommWrapper) – MPI communicator to use. Select serialComm to create a serial mesh when running in parallel; mostly used for test purposes. (default: parallelComm).

fipy.meshes.factoryMeshes.Grid3D(dx=1.0, dy=1.0, dz=1.0, nx=None, ny=None, nz=None, Lx=None, Ly=None, Lz=None, overlap=2, communicator=DummyComm())

Create a 3D Cartesian mesh

Factory function to select between UniformGrid3D and NonUniformGrid3D. If L{x,y,z} is specified, the length of the domain is always L{x,y,z} regardless of d{x,y,z}, unless d{x,y,z} is a list of spacings, in which case L{x,y,z} will be the sum of d{x,y,z} and n{x,y,z} will be the count of d{x,y,z}.

Parameters:
  • dx (float) – Grid spacing in the horizontal direction

  • dy (float) – Grid spacing in the vertical direction

  • dz (float) – Grid spacing in the depth direction

  • nx (int) – Number of cells in the horizontal direction

  • ny (int) – Number of cells in the vertical direction

  • nz (int) – Number of cells in the depth direction

  • Lx (float) – Domain length in the horizontal direction

  • Ly (float) – Domain length in the vertical direction

  • Lz (float) – Domain length in the depth direction

  • overlap (int) – Number of overlapping cells for parallel simulations. Generally 2 is adequate. Higher order equations or discretizations require more.

  • communicator (CommWrapper) – MPI communicator to use. Select serialComm to create a serial mesh when running in parallel; mostly used for test purposes. (default: parallelComm).

fipy.meshes.factoryMeshes.SphericalGrid1D(dr=None, nr=None, Lr=None, dx=1.0, nx=None, Lx=None, origin=(0,), overlap=2, communicator=DummyComm())

Create a 1D spherical mesh

Factory function to select between SphericalUniformGrid1D and SphericalNonUniformGrid1D. If Lr is specified the length of the domain is always Lr regardless of dr, unless dr is a list of spacings, in which case Lr will be the sum of dr.

Parameters:
  • dr (float) – Grid spacing in the radial direction. Alternative: dx.

  • nr (int) – Number of cells in the radial direction. Alternative: nx.

  • Lr (float) – Domain length in the radial direction. Alternative: Lx.

  • overlap (int) – the number of overlapping cells for parallel simulations. Generally 2 is adequate. Higher order equations or discretizations require more.

  • communicator (CommWrapper) – MPI communicator to use. Select serialComm to create a serial mesh when running in parallel; mostly used for test purposes. (default: parallelComm).

Last updated on Jun 26, 2024. Created using Sphinx 7.1.2.