def generate(self, level): self.level = level self.hierarchy = multicomplex.generate(self.group, self.level) self.forcefield = np.zeros (self.complex.shape) self.heightfield = np.ones (self.complex.shape) self.update()
def regenerate(self, level): oldlevel = self.level old = self.hierarchy forcefield = self.complex.D2P0 * self.forcefield self.level = level self.hierarchy = multicomplex.generate(self.group, self.level) ## self.forcefield = np.zeros(self.complex.shape) #scale up forcefield if self.level > oldlevel: for l in range(oldlevel, self.level): forcefield = self.hierarchy[l].interpolate_d2(forcefield) if self.level < oldlevel: for l in range(oldlevel, self.level, -1): forcefield = old[l-1].restrict_d2(forcefield) self.forcefield = self.complex.P0D2 * forcefield self.heightfield = np.ones (self.complex.shape) self.update()