Bookmark and Share FiPy: A Finite Volume PDE Solver Using Python
Version 2.1.3

This Page

Contact

FiPy developers
Jonathan Guyer
Daniel Wheeler
James Warren

Join our mailing list

100 Bureau Drive, M/S 6555
Gaithersburg, MD 20899

301-975-5329 Telephone
301-975-4553 Facsimile

common Package Documentation

This page contains the common Package documentation.

The mesh Module

class fipy.meshes.common.mesh.Mesh

Generic mesh class defining implementation-agnostic behavior.

Make changes to mesh here first, then implement specific implementations in pyMesh and numMesh.

Meshes contain cells, faces, and vertices.

getCellCenters()
getCellVolumes()
getDim()
getExteriorFaces()
getFacesBack()

Return list of faces on back boundary of Grid3D with the z-axis running from front to back.

>>> from fipy import Grid3D, numerix
>>> mesh = Grid3D(nx = 3, ny = 2, nz = 1, dx = 0.5, dy = 2., dz = 4.)
>>> from fipy.tools import parallel
>>> print parallel.procID > 0 or numerix.allequal((6, 7, 8, 9, 10, 11), 
...                              numerix.nonzero(mesh.getFacesBack())[0])
True
getFacesBottom()

Return list of faces on bottom boundary of Grid3D with the y-axis running from bottom to top.

>>> from fipy import Grid2D, Grid3D, numerix
>>> mesh = Grid3D(nx = 3, ny = 2, nz = 1, dx = 0.5, dy = 2., dz = 4.)
>>> from fipy.tools import parallel
>>> print parallel.procID > 0 or numerix.allequal((12, 13, 14), 
...                              numerix.nonzero(mesh.getFacesBottom())[0])
1
>>> x, y, z = mesh.getFaceCenters()
>>> print parallel.procID > 0 or numerix.allequal((12, 13), 
...                              numerix.nonzero(mesh.getFacesBottom() & (x < 1))[0])
1
getFacesDown()

Return list of faces on bottom boundary of Grid3D with the y-axis running from bottom to top.

>>> from fipy import Grid2D, Grid3D, numerix
>>> mesh = Grid3D(nx = 3, ny = 2, nz = 1, dx = 0.5, dy = 2., dz = 4.)
>>> from fipy.tools import parallel
>>> print parallel.procID > 0 or numerix.allequal((12, 13, 14), 
...                              numerix.nonzero(mesh.getFacesBottom())[0])
1
>>> x, y, z = mesh.getFaceCenters()
>>> print parallel.procID > 0 or numerix.allequal((12, 13), 
...                              numerix.nonzero(mesh.getFacesBottom() & (x < 1))[0])
1
getFacesFront()

Return list of faces on front boundary of Grid3D with the z-axis running from front to back.

>>> from fipy import Grid3D, numerix
>>> mesh = Grid3D(nx = 3, ny = 2, nz = 1, dx = 0.5, dy = 2., dz = 4.)
>>> from fipy.tools import parallel
>>> print parallel.procID > 0 or numerix.allequal((0, 1, 2, 3, 4, 5), 
...                              numerix.nonzero(mesh.getFacesFront())[0])
True
getFacesLeft()

Return face on left boundary of Grid1D as list with the x-axis running from left to right.

>>> from fipy import Grid2D, Grid3D
>>> mesh = Grid3D(nx = 3, ny = 2, nz = 1, dx = 0.5, dy = 2., dz = 4.)
>>> from fipy.tools import parallel
>>> print parallel.procID > 0 or numerix.allequal((21, 25), 
...                              numerix.nonzero(mesh.getFacesLeft())[0])
True
>>> mesh = Grid2D(nx = 3, ny = 2, dx = 0.5, dy = 2.)        
>>> print parallel.procID > 0 or numerix.allequal((9, 13), 
...                              numerix.nonzero(mesh.getFacesLeft())[0])
True
getFacesRight()

Return list of faces on right boundary of Grid3D with the x-axis running from left to right.

>>> from fipy import Grid2D, Grid3D, numerix
>>> mesh = Grid3D(nx = 3, ny = 2, nz = 1, dx = 0.5, dy = 2., dz = 4.)
>>> from fipy.tools import parallel
>>> print parallel.procID > 0 or numerix.allequal((24, 28), 
...                              numerix.nonzero(mesh.getFacesRight())[0])
True
>>> mesh = Grid2D(nx = 3, ny = 2, dx = 0.5, dy = 2.)    
>>> print parallel.procID > 0 or numerix.allequal((12, 16), 
...                                               numerix.nonzero(mesh.getFacesRight())[0])
True
getFacesTop()

Return list of faces on top boundary of Grid3D with the y-axis running from bottom to top.

>>> from fipy import Grid2D, Grid3D, numerix
>>> mesh = Grid3D(nx = 3, ny = 2, nz = 1, dx = 0.5, dy = 2., dz = 4.)
>>> from fipy.tools import parallel
>>> print parallel.procID > 0 or numerix.allequal((18, 19, 20), 
...                              numerix.nonzero(mesh.getFacesTop())[0])
True
>>> mesh = Grid2D(nx = 3, ny = 2, dx = 0.5, dy = 2.)        
>>> print parallel.procID > 0 or numerix.allequal((6, 7, 8), 
...                              numerix.nonzero(mesh.getFacesTop())[0])
True
getFacesUp()

Return list of faces on top boundary of Grid3D with the y-axis running from bottom to top.

>>> from fipy import Grid2D, Grid3D, numerix
>>> mesh = Grid3D(nx = 3, ny = 2, nz = 1, dx = 0.5, dy = 2., dz = 4.)
>>> from fipy.tools import parallel
>>> print parallel.procID > 0 or numerix.allequal((18, 19, 20), 
...                              numerix.nonzero(mesh.getFacesTop())[0])
True
>>> mesh = Grid2D(nx = 3, ny = 2, dx = 0.5, dy = 2.)        
>>> print parallel.procID > 0 or numerix.allequal((6, 7, 8), 
...                              numerix.nonzero(mesh.getFacesTop())[0])
True
getInteriorFaceCellIDs()
getInteriorFaceIDs()
getInteriorFaces()
getNearestCell(point)
getNumberOfCells()
setScale(value=1.0)