def setUp(self): for virtvar in ['dtype', 'parstride_bands']: assert getattr(self, virtvar) is not None, 'Virtual "%s"!' % virtvar parsize, parsize_bands = create_parsize_maxbands( self.nbands, world.size) assert self.nbands % np.prod(parsize_bands) == 0 domain_comm, kpt_comm, band_comm = distribute_cpus( parsize, parsize_bands, self.nspins, self.nibzkpts) # Set up band descriptor: self.bd = BandDescriptor(self.nbands, band_comm, self.parstride_bands) # Set up grid descriptor: res, ngpts = shapeopt(100, self.G**3, 3, 0.2) cell_c = self.h * np.array(ngpts) pbc_c = (True, False, True) self.gd = GridDescriptor(ngpts, cell_c, pbc_c, domain_comm, parsize) # Create Kohn-Sham layouts for these band and grid descriptors: self.ksl = self.create_kohn_sham_layouts() # What to do about kpoints? self.kpt_comm = kpt_comm
def setUp(self): for virtvar in ['dtype','parstride_bands']: assert getattr(self,virtvar) is not None, 'Virtual "%s"!' % virtvar parsize_domain, parsize_bands = create_parsize_maxbands(self.nbands, world.size) assert self.nbands % parsize_bands == 0 comms = distribute_cpus(parsize_domain, parsize_bands, self.nspins, self.nibzkpts) domain_comm, kpt_comm, band_comm, block_comm = \ [comms[name] for name in 'dkbK'] self.block_comm = block_comm # Set up band descriptor: self.bd = BandDescriptor(self.nbands, band_comm, self.parstride_bands) # Set up grid descriptor: res, ngpts = shapeopt(100, self.G**3, 3, 0.2) cell_c = self.h * np.array(ngpts) pbc_c = (True, False, True) self.gd = GridDescriptor(ngpts, cell_c, pbc_c, domain_comm, parsize_domain) # Create Kohn-Sham layouts for these band and grid descriptors: self.ksl = self.create_kohn_sham_layouts() # What to do about kpoints? self.kpt_comm = kpt_comm
def setUp(self): for virtvar in []: assert getattr(self,virtvar) is not None, 'Virtual "%s"!' % virtvar parsize_domain, parsize_bands = create_parsize_maxbands(self.nbands, world.size) self.parallel = {'domain': parsize_domain, 'band': parsize_bands} self.atoms = molecule('Na2') self.atoms.center(vacuum=4.0) self.atoms.set_pbc(False) cell_c = np.sum(self.atoms.get_cell()**2, axis=1)**0.5 / Bohr ngpts = 16 * np.round(cell_c / (self.h * 16)) self.gsname = 'ut_tddft_gs' self.gscalc = GPAW(gpts=ngpts, nbands=self.nbands, basis='dzp', setups={'Na': '1'}, spinpol=(self.nspins==2), parallel=self.parallel, txt=self.gsname + '.txt')
def setUp(self): for virtvar in []: assert getattr(self, virtvar) is not None, 'Virtual "%s"!' % virtvar parsize_domain, parsize_bands = create_parsize_maxbands(self.nbands, world.size) self.parallel = {"domain": parsize_domain, "band": parsize_bands} self.atoms = molecule("Na2") self.atoms.center(vacuum=4.0) self.atoms.set_pbc(False) cell_c = np.sum(self.atoms.get_cell() ** 2, axis=1) ** 0.5 / Bohr ngpts = 16 * np.round(cell_c / (self.h * 16)) self.gsname = "ut_tddft_gs" self.gscalc = GPAW( gpts=ngpts, nbands=self.nbands, basis="dzp", setups={"Na": "1"}, spinpol=(self.nspins == 2), parallel=self.parallel, txt=self.gsname + ".txt", )