def __init__(self, dx=1., nx=None, origin=(0,), overlap=2): scale = PhysicalField(value=1, unit=PhysicalField(value=dx).getUnit()) self.origin = PhysicalField(value=origin) self.origin /= scale Grid1D.__init__(self, dx=dx, nx=nx, overlap=overlap) self.args['origin'] = origin
def _calcCellVolumes(self): Grid1D._calcCellVolumes(self) self.cellVolumes = self.cellVolumes / 2.
def _calcFaceCenters(self): Grid1D._calcFaceCenters(self) self.faceCenters += self.origin
def getCellCenters(self): return Grid1D.getCellCenters(self) + self.origin
def _calcCellVolumes(self): Grid1D._calcCellVolumes(self) self.cellVolumes *= self.scale['length'] * self.cellCenters[0]