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


Python GridDescriptor.get_boxes方法代码示例

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


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

示例1: GridDescriptor

# 需要导入模块: from gpaw.grid_descriptor import GridDescriptor [as 别名]
# 或者: from gpaw.grid_descriptor.GridDescriptor import get_boxes [as 别名]
from __future__ import print_function
import numpy as np
from gpaw.grid_descriptor import GridDescriptor
from gpaw.localized_functions import create_localized_functions
from gpaw.spline import Spline

s=Spline(0, 1.2, [1, 0.6, 0.1, 0.0])
a = 4.0
n = 24
gd = GridDescriptor((n, n, n), (a, a, a))
print(gd.get_boxes((0, 0, 0), 1.2, 0))
if 0:
    p = create_localized_functions([s], gd, (0.0, 0.0, 0.0), cut=True)
    a = np.zeros((n, n, n))
    p.add(a, np.array([2.0]))
    print(a[1,0])
开发者ID:ryancoleman,项目名称:lotsofcoresbook2code,代码行数:18,代码来源:gp2.py

示例2: GridDescriptor

# 需要导入模块: from gpaw.grid_descriptor import GridDescriptor [as 别名]
# 或者: from gpaw.grid_descriptor.GridDescriptor import get_boxes [as 别名]
import numpy as np
from gpaw.grid_descriptor import GridDescriptor
from gpaw.localized_functions import create_localized_functions
from gpaw.spline import Spline

s=Spline(0, 1.2, [1, 0.6, 0.1, 0.0])
a = 4.0
n = 24
gd = GridDescriptor((n, n, n), (a, a, a))
print gd.get_boxes((0, 0, 0), 1.2, 0)
if 0:
    p = create_localized_functions([s], gd, (0.0, 0.0, 0.0), cut=True)
    a = np.zeros((n, n, n))
    p.add(a, np.array([2.0]))
    print a[1,0]
开发者ID:eojons,项目名称:gpaw-scme,代码行数:17,代码来源:gp2.py


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