当前位置: 首页>>代码示例>>Python>>正文


Python OptimizeTask.calculate方法代码示例

本文整理汇总了Python中ase.tasks.task.OptimizeTask.calculate方法的典型用法代码示例。如果您正苦于以下问题:Python OptimizeTask.calculate方法的具体用法?Python OptimizeTask.calculate怎么用?Python OptimizeTask.calculate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ase.tasks.task.OptimizeTask的用法示例。


在下文中一共展示了OptimizeTask.calculate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: calculate

# 需要导入模块: from ase.tasks.task import OptimizeTask [as 别名]
# 或者: from ase.tasks.task.OptimizeTask import calculate [as 别名]
 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
开发者ID:gjuhasz,项目名称:ase,代码行数:9,代码来源:molecule.py

示例2: calculate

# 需要导入模块: from ase.tasks.task import OptimizeTask [as 别名]
# 或者: from ase.tasks.task.OptimizeTask import calculate [as 别名]
 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
开发者ID:JConwayAWT,项目名称:PGSS14CC,代码行数:10,代码来源:molecule.py

示例3: calculate

# 需要导入模块: from ase.tasks.task import OptimizeTask [as 别名]
# 或者: from ase.tasks.task.OptimizeTask import calculate [as 别名]
 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
开发者ID:PHOTOX,项目名称:fuase,代码行数:21,代码来源:molecule.py

示例4: calculate

# 需要导入模块: from ase.tasks.task import OptimizeTask [as 别名]
# 或者: from ase.tasks.task.OptimizeTask import calculate [as 别名]
 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
开发者ID:jboes,项目名称:ase,代码行数:41,代码来源:bulk.py

示例5: calculate

# 需要导入模块: from ase.tasks.task import OptimizeTask [as 别名]
# 或者: from ase.tasks.task.OptimizeTask import calculate [as 别名]
 def calculate(self, name, atoms):
     #????
     if self.fit:
         return self.fit_volume(name, atoms)
     else:
         return OptimizeTask.calculate(self, name, atoms)
开发者ID:sr76,项目名称:excitingscripts,代码行数:8,代码来源:bulk.py


注:本文中的ase.tasks.task.OptimizeTask.calculate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。