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


Python System.monitor方法代码示例

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


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

示例1: MonitorName

# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import monitor [as 别名]
#              output="BOND-A1A2.dat")
#histoAnalysis(nbins=nbins,
#              avgnrg = system.monitor( MonitorName("total_energy") ).accumulator().average(),
#              values=system.monitor( MonitorName("bond23") ).accumulator().values(),
#              mode="bond",
#              output="BOND-A2A3.dat")
#histoAnalysis(nbins=nbins,
#              avgnrg = system.monitor( MonitorName("total_energy") ).accumulator().average(),
#              values=system.monitor( MonitorName("bond34") ).accumulator().values(),
#              mode="bond",
#              output="BOND-A3A4.dat")
#histoAnalysis(nbins=nbins,
#              avgnrg = system.monitor( MonitorName("total_energy") ).accumulator().average(),
#              values=system.monitor( MonitorName("theta123") ).accumulator().values(),
#              mode="angle",
#              output="ANGLE-A1A2A3.dat")
#histoAnalysis(nbins=nbins,
#              avgnrg = system.monitor( MonitorName("total_energy") ).accumulator().average(),
#              values=system.monitor( MonitorName("theta234") ).accumulator().values(),
#              mode="angle",
#              output="ANGLE-A2A3A4.dat")
histoAnalysis(nbins=nbins,
              avgnrg = system.monitor( MonitorName("total_energy") ).accumulator().average(),
              values=list(system.monitor( MonitorName("phi1234") ).accumulator().values()),
              mode="angle",
              output="DIHEDRAL-A1A2A3A4.dat")


#**  Output the trajectory
#system.monitor( MonitorName("trajectory") ).writeToDisk("outputXXXXXX.pdb")
开发者ID:Alwnikrotikz,项目名称:sire,代码行数:32,代码来源:movermove-abcd.py

示例2: RDFMonitor

# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import monitor [as 别名]
rdf2 = RDFMonitor( 0*angstrom, 10*angstrom, 0.05*angstrom )
rdf2.add( MolIdx(0) + AtomName("O00"), AtomName("H01") )
rdf2.add( MolIdx(0) + AtomName("O00"), AtomName("H02") )

system.add(cljff)
system.add("O-O RDF", rdf)
system.add("O-H RDF", rdf2)

t.start()
system.collectStats()

ms = t.elapsed()

print("Collecting stats took %d ms" % ms)

rdf = system.monitor( MonitorName("O-O RDF") )

print("\nO-O RDF")

for i in range(0,rdf.nBins()):
    print(rdf[i].middle().to(angstrom), rdf[i].value())

rdf = system.monitor( MonitorName("O-H RDF") )

print("\nO-H RDF")

for i in range(0,rdf.nBins()):
    print(rdf[i].middle().to(angstrom), rdf[i].value())

开发者ID:Alwnikrotikz,项目名称:sire,代码行数:30,代码来源:rdf.py

示例3: print

# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import monitor [as 别名]
            lj_mol = lj_mol.atom(atoms[j].index()).edit() \
                           .setProperty("b-factor",beta_ljnrg).molecule().commit()

            total_mol = total_mol.atom(atoms[j].index()).edit() \
                                 .setProperty("b-factor",beta_total).molecule().commit()

        coul_group.update(coul_mol)
        lj_group.update(lj_mol)
        total_group.update(total_mol)

    print("Total energies: %f  %f  %f" % (cnrg, ljnrg, cnrg+ljnrg))

    PDB().write(coul_group, "test_coul_%0004d.pdb" % id)
    PDB().write(lj_group, "test_lj_%0004d.pdb" % id)
    PDB().write(total_group, "test_total_%0004d.pdb" % id)

print("Running a simulation...")

for i in range(1,11):
    system = moves.move(system, 2000, True)

    nrgmon = system.monitor( MonitorName("solute_shell") )

    PDB().write(system.molecules(), "test_sim_%0004d.pdb" % i)

    system.clearStatistics()

    print("Step %d of 10: Energy = %s" % (i, system.energy()))

    view(nrgmon, i)
开发者ID:Alwnikrotikz,项目名称:sire,代码行数:32,代码来源:energymonitor.py

示例4: SameMoves

# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import monitor [as 别名]
            break
    moves = SameMoves(solute_mover)

print("Production")
for i in range(0,nblocks):
    print("Running block %d " % i)
    system = moves.move(system, nmoves, True)
#sys.exit(-1)
print("Analysis...")
# make an histogram...
nbins=31

for bond in var_bonds:
    bmonitor = "b_%s_%s" % (bond.atom0().value(),bond.atom1().value()) 
    histoAnalysis(nbins=nbins,
                  values=list(system.monitor( MonitorName(bmonitor) ).accumulator().values()),
                  avgnrg = system.monitor( MonitorName("total_energy") ).accumulator().average(),
                  mode="bond",
                  output="BOND-%s.dat" % bmonitor)


for angle in var_angles:
    amonitor = "a_%s_%s_%s" % (angle.atom0().value(), 
                               angle.atom1().value(),
                               angle.atom2().value() ) 
    histoAnalysis(nbins=nbins,
                  values=list(system.monitor( MonitorName(amonitor) ).accumulator().values()),
                  avgnrg = system.monitor( MonitorName("total_energy") ).accumulator().average(),
                  mode="angle",
                  output="ANGLE-%s.dat" % amonitor)
开发者ID:Alwnikrotikz,项目名称:sire,代码行数:32,代码来源:movermove-dimedone.py

示例5: QTime

# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import monitor [as 别名]
t = QTime()
t.start()

# Run the simulation
for i in range(0,nblocks):
   print("Running nmove...")
   t.restart()
   system = moves.move(system, nmoves, True)
   print("...took %d ms" % t.elapsed())

print("Analysis...")
# make an histogram...
nbins=31
histoAnalysis(nbins=nbins,
              values=list(system.monitor( MonitorName("bond12") ).accumulator().values()),
              mode="bond",
              output="BOND-A1A2.dat")

histoAnalysis(nbins=nbins,
              values=list(system.monitor( MonitorName("bond23") ).accumulator().values()),
              mode="bond",
              output="BOND-A2A3.dat")

histoAnalysis(nbins=nbins,
              values=list(system.monitor( MonitorName("angle123") ).accumulator().values()),
              mode="angle",
              output="ANGLE-A1A2A3.dat")

#**  Output the trajectory
#system.monitor( MonitorName("trajectory") ).writeToDisk("outputXXXXXX.pdb")
开发者ID:Alwnikrotikz,项目名称:sire,代码行数:32,代码来源:testmonitors.py

示例6: MonitorComponent

# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import monitor [as 别名]
e_total = system.totalComponent()
system.add( "total_energy", MonitorComponent(e_total, Average()) )

#system.add( "trajectory", TrajectoryMonitor(system[MGIdx(0)]), 1 )

# Run the simulation
for i in range(0,nblocks):
    print("Running nmove...")
    system = moves.move(system, nmoves, True)

print("Analysis...")
# make an histogram...
nbins=31
histoAnalysis(nbins=nbins,
              values=list(system.monitor( MonitorName("bond12") ).accumulator().values()),
              avgnrg = system.monitor( MonitorName("total_energy") ).accumulator().average(),
              mode="bond",
              output="BOND-A1A2.dat")
histoAnalysis(nbins=nbins,
              values=list(system.monitor( MonitorName("bond23") ).accumulator().values()),
              avgnrg = system.monitor( MonitorName("total_energy") ).accumulator().average(),
              mode="bond",
              output="BOND-A2A3.dat")
histoAnalysis(nbins=nbins,
              values=list(system.monitor( MonitorName("angle123") ).accumulator().values()),
              avgnrg = system.monitor( MonitorName("total_energy") ).accumulator().average(),
              mode="angle",
              output="ANGLE-A1A2A3.dat")

#**  Output the trajectory
开发者ID:Alwnikrotikz,项目名称:sire,代码行数:32,代码来源:movermove-triatomic.py


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