-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest_RigidMol.py
More file actions
executable file
·63 lines (45 loc) · 2 KB
/
test_RigidMol.py
File metadata and controls
executable file
·63 lines (45 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/python
import sys
import os
import numpy as np
import pyMolecular.RigidMol as rmol
os.chdir("/u/25/prokoph1/unix/git/SimpleSimulationEngine/cpp/Build/apps/MolecularEditor2")
# ========= Molecules
rmol.initParams( "common_resources/AtomTypes.dat", "common_resources/BondTypes.dat" )
water = rmol.loadMolType( "inputs/water_T5_ax.xyz" );
Na = rmol.loadMolType( "inputs/NaIon.xyz" );
Cl = rmol.loadMolType( "inputs/ClIon.xyz" );
rot = np.array([[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]])
print rmol.insertMolecule( water, np.array([0.0,0.0,4.0]), rot, True );
print rmol.insertMolecule( water, np.array([4.0,0.0,4.0]), rot, True );
print rmol.insertMolecule( Na, np.array([4.0,6.0,5.0]), rot, True );
print rmol.insertMolecule( Na, np.array([4.0,4.0,2.0]), rot, True );
print rmol.insertMolecule( Na, np.array([4.0,8.0,2.0]), rot, True );
print rmol.insertMolecule( Cl, np.array([2.0,6.0,2.0]), rot, True );
print rmol.insertMolecule( Cl, np.array([6.0,6.0,2.0]), rot, True );
rmol.save2xyz( "world_debug_00.xyz" )
# ========= RigidSurface
'''
print "pyDEBUG 1"
print "pyDEBUG 2"
rmol.initRigidSubstrate( "inputs/NaCl_wo4.xyz", np.array([60,60,100],dtype=np.int32), np.array([0.0,0.0,4.5]), np.array([[12.0173,0.0,0.0],[0.0,12.0173,0.0],[0.0,0.0,20.0]]) )
#rmol.initRigidSubstrate( "inputs/NaCl_wo4.xyz", np.array([60,60,100],dtype=np.int32), np.array([0.0,0.0,0.0]), np.array([[12.0173,0.0,0.0],[0.0,12.0173,0.0],[0.0,0.0,20.0]]) )
print "pyDEBUG 3"
if os.path.isfile("data/FFPauli.bin"):
print "gridFF found on disk => loading "
rmol.loadGridFF()
else:
print "gridFF not found on disk => recalc "
rmol.recalcGridFF( np.array([1,1,1],dtype=np.int32) )
rmol.saveGridFF()
rmol.debugSaveGridFF( "FFtot_z_Na.xsf", np.array([1.3,0.0447214,0.0]) )
'''
# ========= Relaxation
rmol.bakeMMFF()
rmol.prepareOpt()
fout = rmol.openf( "movie.xyz", -1, "w" )
for i in range(50):
print ">>> i ", i
rmol.relaxNsteps( 1, 0.0 )
rmol.write2xyz( fout )
#rmol.save2xyz( "world_debug_%03i.xyz" %i )