def __init__(self, dx = 1., dy = 1., nx = None, ny = None): Grid2D.__init__(self, dx = dx, dy = dy, nx = nx, ny = ny) self.nonPeriodicCellVertexIDs = Grid2D._getCellVertexIDs(self) self.nonPeriodicOrderedCellVertexIDs = Grid2D._getOrderedCellVertexIDs(self) from fipy.tools import numerix self._connectFaces(numerix.nonzero(self.getFacesBottom()), numerix.nonzero(self.getFacesTop()))
def __init__(self, dx=1., dy=1., nx=None, ny=None, origin=((0.,), (0.,)), overlap=2, communicator=parallel): scale = PhysicalField(value=1, unit=PhysicalField(value=dx).getUnit()) self.origin = PhysicalField(value=origin) self.origin /= scale Grid2D.__init__(self, dx=dx, dy=dy, nx=nx, ny=ny, overlap=overlap, communicator=communicator) self.args['origin'] = self.origin
def getCellCenters(self): return Grid2D.getCellCenters(self) + self.origin
def getCellVolumes(self): return Grid2D.getCellVolumes(self) * self.getCellCenters()[0]
def _getFaceAreas(self): return Grid2D._getFaceAreas(self) * self.getFaceCenters()[0]