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


Python CustomGBForce.addTabulatedFunction方法代码示例

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


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

示例1: GBSAGBnForce

# 需要导入模块: from simtk.openmm import CustomGBForce [as 别名]
# 或者: from simtk.openmm.CustomGBForce import addTabulatedFunction [as 别名]
def GBSAGBnForce(solventDielectric=78.5, soluteDielectric=1, SA=None,
                  cutoff=None, kappa=0.0):


    """
    Indexing for tables:
        input: radius1, radius2
        index = (radius2*200-20)*21 + (radius1*200-20)
        output: index of desired value in row-by-row, 1D version of Tables 3 & 4
    """


    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("or") # Offset radius
    custom.addPerParticleParameter("sr") # Scaled offset radius

    custom.addTabulatedFunction("getd0", Continuous2DFunction(21, 21, d0, 0.1, 0.2, 0.1, 0.2))
    custom.addTabulatedFunction("getm0", Continuous2DFunction(21, 21, m0, 0.1, 0.2, 0.1, 0.2))

    custom.addComputedValue("I",  "Ivdw+neckScale*Ineck;"
                                  "Ineck=step(radius1+radius2+neckCut-r)*getm0(radius1,radius2)/(1+100*(r-getd0(radius1,radius2))^2+0.3*1000000*(r-getd0(radius1,radius2))^6);"
                                  "Ivdw=step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "radius1=or1+offset; radius2=or2+offset;"
                                  "neckScale=0.361825; neckCut=0.68; offset=0.009", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(1.09511284*psi-1.907992938*psi^2+2.50798245*psi^3)/radius);"
                              "psi=I*or; radius=or+offset; offset=0.009", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, solventDielectric, soluteDielectric, SA, cutoff, kappa, 0.009)
    return custom
开发者ID:Bhattiasif,项目名称:openmm,代码行数:36,代码来源:customgbforces.py

示例2: GBSAGBn2Force

# 需要导入模块: from simtk.openmm import CustomGBForce [as 别名]
# 或者: from simtk.openmm.CustomGBForce import addTabulatedFunction [as 别名]
def GBSAGBn2Force(solventDielectric=78.5, soluteDielectric=1, SA=None,
                  cutoff=None, kappa=0.0):


    """
    Indexing for tables:
        input: radius1, radius2
        index = (radius2*200-20)*21 + (radius1*200-20)
        output: index of desired value in row-by-row, 1D version of Tables 3 & 4
    """


    custom = CustomGBForce()

    custom.addPerParticleParameter("q")
    custom.addPerParticleParameter("radius")
    custom.addPerParticleParameter("scale")
    custom.addPerParticleParameter("alpha")
    custom.addPerParticleParameter("beta")
    custom.addPerParticleParameter("gamma")

    if kappa > 0: custom.addGlobalParameter('kappa', kappa)
    custom.addGlobalParameter("solventDielectric", solventDielectric)
    custom.addGlobalParameter("soluteDielectric", soluteDielectric)
    custom.addGlobalParameter("offset", 0.0195141)
    custom.addGlobalParameter("neckScale", 0.826836)
    custom.addGlobalParameter("neckCut", 0.68)

    custom.addTabulatedFunction("getd0", Discrete1DFunction(d0))
    custom.addTabulatedFunction("getm0", Discrete1DFunction(m0))

    custom.addComputedValue("I",  "Ivdw+neckScale*Ineck;"
                                  "Ineck=step(radius1+radius2+neckCut-r)*getm0(index)/(1+100*(r-getd0(index))^2+0.3*1000000*(r-getd0(index))^6);"
                                  "index = (radius2*200-20)*21 + (radius1*200-20);"
                                  "Ivdw=step(r+sr2-or1)*0.5*(1/L-1/U+0.25*(r-sr2^2/r)*(1/(U^2)-1/(L^2))+0.5*log(L/U)/r);"
                                  "U=r+sr2;"
                                  "L=max(or1, D);"
                                  "D=abs(r-sr2);"
                                  "sr2 = scale2*or2;"
                                  "or1 = radius1-offset; or2 = radius2-offset", CustomGBForce.ParticlePairNoExclusions)

    custom.addComputedValue("B", "1/(1/or-tanh(alpha*psi-beta*psi^2+gamma*psi^3)/radius);"
                              "psi=I*or; or=radius-offset", CustomGBForce.SingleParticle)
    _createEnergyTerms(custom, SA, cutoff, kappa)
    return custom
开发者ID:MrBitKoin,项目名称:openmm,代码行数:47,代码来源:customgbforces.py


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