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


Python Features.checkFeatures方法代码示例

本文整理汇总了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
开发者ID:fxia22,项目名称:ASM_xf,代码行数:20,代码来源:NormalModes.py

示例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)
开发者ID:davem22101,项目名称:semanticscience,代码行数:21,代码来源:Minimization.py

示例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)
开发者ID:fxia22,项目名称:ASM_xf,代码行数:64,代码来源:Dynamics.py


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