本文整理汇总了Python中Features.checkFeatures方法的典型用法代码示例。如果您正苦于以下问题:Python Features.checkFeatures方法的具体用法?Python Features.checkFeatures怎么用?Python Features.checkFeatures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Features
的用法示例。
在下文中一共展示了Features.checkFeatures方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Features [as 别名]
# 或者: from Features import checkFeatures [as 别名]
def __init__(self, universe=None, temperature = 300):
if universe == None:
return
Features.checkFeatures(self, universe)
self.universe = universe
self.temperature = temperature
self.sqrt_mass = Numeric.sqrt(self.universe.masses().array)
self.sqrt_mass = self.sqrt_mass[:, Numeric.NewAxis]
self._forceConstantMatrix()
ev = self._diagonalize()
self.imaginary = Numeric.less(ev, 0.)
self.frequencies = Numeric.sqrt(Numeric.fabs(ev)) / (2.*Units.pi)
self.sort_index = Numeric.argsort(self.frequencies)
self._scale(temperature)
del self.sqrt_mass
示例2: __call__
# 需要导入模块: import Features [as 别名]
# 或者: from Features import checkFeatures [as 别名]
def __call__(self, **options):
self.setCallOptions(options)
Features.checkFeatures(self, self.universe)
configuration = self.universe.configuration()
fixed = self.universe.getAtomBooleanArray('fixed')
nt = self.getOption('threads')
evaluator = self.universe.energyEvaluator(threads=nt).CEvaluator()
args =(self.universe,
configuration.array, fixed.array, evaluator,
self.getOption('steps'), self.getOption('step_size'),
self.getOption('convergence'), self.getActions(),
'Conjugate gradient minimization with ' +
self.optionString(['convergence', 'step_size', 'steps']))
if self.getOption('background'):
if not threading:
raise OSError("background processing not available")
return MinimizerThread(self.universe, conjugateGradient, args)
else:
apply(conjugateGradient, args)
示例3: __call__
# 需要导入模块: import Features [as 别名]
# 或者: from Features import checkFeatures [as 别名]
def __call__(self, **options):
self.setCallOptions(options)
used_features = Features.checkFeatures(self, self.universe)
configuration = self.universe.configuration()
velocities = self.universe.velocities()
if velocities is None:
raise ValueError, "no velocities"
masses = self.universe.masses()
fixed = self.universe.getAtomBooleanArray('fixed')
nt = self.getOption('threads')
comm = self.getOption('mpi_communicator')
evaluator = self.universe.energyEvaluator(threads=nt,
mpi_communicator=comm)
evaluator = evaluator.CEvaluator()
constraints, const_distances_sq, c_blocks = \
_constraintArrays(self.universe)
type = 'NVE'
if Features.NoseThermostatFeature in used_features:
type = 'NVT'
for object in self.universe._environment:
if object.__class__ is Environment.NoseThermostat:
thermostat = object
break
t_parameters = thermostat.parameters
t_coordinates = thermostat.coordinates
else:
t_parameters = Numeric.zeros((0,), Numeric.Float)
t_coordinates = Numeric.zeros((2,), Numeric.Float)
if Features.AndersenBarostatFeature in used_features:
if self.universe.cellVolume() is None:
raise ValueError, "Barostat requires finite volume universe"
if type == 'NVE':
type = 'NPH'
else:
type = 'NPT'
for object in self.universe._environment:
if object.__class__ is Environment.AndersenBarostat:
barostat = object
break
b_parameters = barostat.parameters
b_coordinates = barostat.coordinates
else:
b_parameters = Numeric.zeros((0,), Numeric.Float)
b_coordinates = Numeric.zeros((1,), Numeric.Float)
args = (self.universe,
configuration.array, velocities.array,
masses.array, fixed.array, evaluator,
constraints, const_distances_sq, c_blocks,
t_parameters, t_coordinates,
b_parameters, b_coordinates,
self.getOption('delta_t'), self.getOption('first_step'),
self.getOption('steps'), self.getActions(),
type + ' dynamics trajectory with ' +
self.optionString(['delta_t', 'steps']))
if self.getOption('background'):
if not threading:
raise OSError, "background processing not available"
return MDThread(self.universe, MMTK_dynamics.integrateVV, args)
else:
apply(MMTK_dynamics.integrateVV, args)