コード例 #1
0
ファイル: molecule.py プロジェクト: lqcata/ase
 def calculate(self, name, atoms):
     if self.fit and len(atoms) == 2:
         return self.fit_bond_length(name, atoms)
     else:
         data = OptimizeTask.calculate(self, name, atoms)
         self.check_occupation_numbers(atoms)
         return data
コード例 #2
0
ファイル: molecule.py プロジェクト: gjuhasz/ase
 def calculate(self, name, atoms):
     if self.fit and len(atoms) == 2:
         return self.fit_bond_length(name, atoms)
     else:
         data = OptimizeTask.calculate(self, name, atoms)
         self.check_occupation_numbers(atoms)
         return data
コード例 #3
0
ファイル: molecule.py プロジェクト: JConwayAWT/PGSS14CC
 def calculate(self, name, atoms):
     data = OptimizeTask.calculate(self, name, atoms)
     if self.fmax is not None and len(atoms) == 2:
         data['distance'] = atoms.get_distance(0, 1)
     self.check_occupation_numbers(atoms)
     if self.fit and len(atoms) == 2:
         self.fit_bond_length(name, atoms, data)
     return data
コード例 #4
0
 def calculate(self, name, atoms):
     data = OptimizeTask.calculate(self, name, atoms)
     if self.fmax is not None and len(atoms) == 2:
         data['distance'] = atoms.get_distance(0, 1)
     self.check_occupation_numbers(atoms)
     if self.fit and len(atoms) == 2:
         self.fit_bond_length(name, atoms, data)
     return data
コード例 #5
0
 def calculate(self, name, atoms):
     if self.fmax is not None:
         # this performs relaxation of internal degrees of freedom
         data = OptimizeTask.calculate(self, name, atoms)
         data['distance'] = atoms.get_distance(0, -1)
     else:
         # no optimization
         if self.fit is None or len(atoms) != 2:
             # for dimers: only calculate single-point energy if no fit follows
             data = OptimizeTask.calculate(self, name, atoms)
     if self.fit is not None and len(atoms) == 2:
         if self.fmax is not None:
             # fit after optimization
             self.fit_bond_length(name, atoms, data)
         else:
             # fit is the only task performed
             data = self.fit_bond_length(name, atoms)
     self.check_occupation_numbers(atoms)
     return data
コード例 #6
0
ファイル: molecule.py プロジェクト: PHOTOX/fuase
 def calculate(self, name, atoms):
     if self.fmax is not None:
         # this performs relaxation of internal degrees of freedom
         data = OptimizeTask.calculate(self, name, atoms)
         data['distance'] = atoms.get_distance(0, -1)
     else:
         # no optimization
         if self.fit is None or len(atoms) != 2:
             # for dimers: only calculate single-point energy if no fit follows
             data = OptimizeTask.calculate(self, name, atoms)
     if self.fit is not None and len(atoms) == 2:
         if self.fmax is not None:
             # fit after optimization
             self.fit_bond_length(name, atoms, data)
         else:
             # fit is the only task performed
             data = self.fit_bond_length(name, atoms)
     self.check_occupation_numbers(atoms)
     return data
コード例 #7
0
ファイル: bulk.py プロジェクト: martin-stoehr/ase-devel
 def calculate(self, name, atoms):
     #????
     if self.sfmax is not None and self.fmax is not None:
         # this performs first relaxation of internal degrees of freedom
         data = OptimizeTask.calculate(self, name, atoms)
         # writing traj from optimizer does not work for StrainFilter!
         traj = PickleTrajectory(self.get_filename(name, 'traj'), 'a',
                                 atoms)
         sf = StrainFilter(atoms)
         while not self.converged(atoms, sfmax=self.sfmax, fmax=self.fmax):
             # take a step on the cell
             self.soptimize(name, sf, data, trajectory=traj)
             # relax internal degrees of freedom
             OptimizeTask.optimize(self, name, atoms, data, trajectory=traj)
         data['relaxed energy'] = atoms.get_potential_energy()
         data['relaxed volume'] = atoms.get_volume()
     elif self.sfmax is not None:
         # this performs single-point energy calculation
         data = OptimizeTask.calculate(self, name, atoms)
         sf = StrainFilter(atoms)
         # writing traj from optimizer does not work for StrainFilter!
         traj = PickleTrajectory(self.get_filename(name, 'traj'), 'w',
                                 atoms)
         self.soptimize(name, sf, data, trajectory=traj)
         data['relaxed energy'] = atoms.get_potential_energy()
         data['relaxed volume'] = atoms.get_volume()
     elif self.fmax is not None:
         data = OptimizeTask.calculate(self, name, atoms)
     else:
         # no optimization
         if self.fit is None:
             # only calculate single-point energy if no fit follows
             data = OptimizeTask.calculate(self, name, atoms)
     if self.fit is not None:
         if self.sfmax is not None or self.fmax is not None:
             # fit after optimization
             self.fit_volume(name, atoms, data)
         else:
             # fit is the only task performed
             data = self.fit_volume(name, atoms)
     return data
コード例 #8
0
ファイル: bulk.py プロジェクト: jboes/ase
 def calculate(self, name, atoms):
     #????
     if self.sfmax is not None and self.fmax is not None:
         # this performs first relaxation of internal degrees of freedom
         data = OptimizeTask.calculate(self, name, atoms)
         # writing traj from optimizer does not work for StrainFilter!
         traj = Trajectory(self.get_filename(name, 'traj'), 'a', atoms)
         sf = StrainFilter(atoms)
         while not self.converged(atoms, sfmax=self.sfmax, fmax=self.fmax):
             # take a step on the cell
             self.soptimize(name, sf, data, trajectory=traj)
             # relax internal degrees of freedom
             OptimizeTask.optimize(self, name, atoms, data, trajectory=traj)
         data['relaxed energy'] = atoms.get_potential_energy()
         data['relaxed volume'] = atoms.get_volume()
     elif self.sfmax is not None:
         # this performs single-point energy calculation
         data = OptimizeTask.calculate(self, name, atoms)
         sf = StrainFilter(atoms)
         # writing traj from optimizer does not work for StrainFilter!
         traj = Trajectory(self.get_filename(name, 'traj'), 'w', atoms)
         self.soptimize(name, sf, data, trajectory=traj)
         data['relaxed energy'] = atoms.get_potential_energy()
         data['relaxed volume'] = atoms.get_volume()
     elif self.fmax is not None:
         data = OptimizeTask.calculate(self, name, atoms)
     else:
         # no optimization
         if self.fit is None:
             # only calculate single-point energy if no fit follows
             data = OptimizeTask.calculate(self, name, atoms)
     if self.fit is not None:
         if self.sfmax is not None or self.fmax is not None:
             # fit after optimization
             self.fit_volume(name, atoms, data)
         else:
             # fit is the only task performed
             data = self.fit_volume(name, atoms)
     return data
コード例 #9
0
ファイル: bulk.py プロジェクト: lqcata/ase
 def calculate(self, name, atoms):
     #????
     if self.fit:
         return self.fit_volume(name, atoms)
     else:
         return OptimizeTask.calculate(self, name, atoms)
コード例 #10
0
ファイル: bulk.py プロジェクト: sr76/excitingscripts
 def calculate(self, name, atoms):
     #????
     if self.fit:
         return self.fit_volume(name, atoms)
     else:
         return OptimizeTask.calculate(self, name, atoms)