コード例 #1
0
ファイル: periodicGrid2D.py プロジェクト: calbaker/FiPy-2.1.3
 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()))
コード例 #2
0
    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
コード例 #3
0
 def getCellCenters(self):
     return Grid2D.getCellCenters(self) + self.origin
コード例 #4
0
 def getCellVolumes(self):
     return Grid2D.getCellVolumes(self) * self.getCellCenters()[0]
コード例 #5
0
 def _getFaceAreas(self):
     return Grid2D._getFaceAreas(self) * self.getFaceCenters()[0]