... | ... | @@ -43,7 +43,7 @@ They will allow you to write functions for (1) defining your metastable states o |
|
|
|
|
|
`get_pbc()` : returns periodic boundary conditions as a table pbc with members pbc.a pbc.b pbc.c, each being a xyz vector (i.e. pbc.a.x pbc.a.y pbc.a.z) .
|
|
|
|
|
|
[set_pbc(pbc)](url) : set the openmm periodic boundary conditions to be used, the argument is a table pbc as described above.
|
|
|
`set_pbc(pbc)` : set the openmm periodic boundary conditions to be used, the argument is a table pbc as described above.
|
|
|
|
|
|
**NOTE** the following 3 functions are possibly slow (especially if a copy to a OCL or CUDA device is required), use rarely for performance.
|
|
|
|
... | ... | @@ -60,32 +60,34 @@ get_mass(n) : function returning the mass of atom n in a.m.u.; |
|
|
|
|
|
`get_COM()` : function returning the center of mass of the system as a tuple x,y,z.
|
|
|
|
|
|
`get_COM_idxs(idxs)` : function returning the center of mass of a subset of the system as a tuple x,y,z.
|
|
|
**NOTE** this time idxs is indexed directly in C++ style for example get_COM_idxs({1,2,3}) to get COM of atoms 1, 2 and 3 (C++ : atoms 0, 1, 2)
|
|
|
`get_COM_idxs(idxs)` : function returning the center of mass of a subset of the system as a tuple x,y,z;
|
|
|
**NOTE** this time idxs is indexed directly in C++ style for example get_COM_idxs({1,2,3}) to get COM of atoms 1, 2 and 3 (C++ : atoms 0, 1, 2).
|
|
|
|
|
|
`get_minimised_energy(tolerance,maxSteps)` : this function returns the minimised energy of the system, using the OpenMM L-BFGS minimiser.
|
|
|
**NOTE** that coordinates are not affected, it just returns the minimum epot of the bassin in which dynamics currently evolves.
|
|
|
It returns a 3-tuple ep,ek,et (potential, kinetic and total energy).
|
|
|
|
|
|
`get_minimised_crdvels(tolerance,maxSteps)` : this function returns a 2-tuple (crds,vels) containing
|
|
|
a copy of coordinates and velocities after minimisation.
|
|
|
crds and vels are both tables with x,y,z members, each of size natoms, : e.g. crds.x[i] returns the x coordinate of atom i, idem for vels.x[i]
|
|
|
note that C++/OpenMM coordinates are not modified if modifying this table : this is a safe read-only copy
|
|
|
the tolerance and maxSteps can be the above defined simulation.minimisationTolerance and simulation.minimisationMaxSteps
|
|
|
NOTE lua indexing, starting from 1
|
|
|
a copy of coordinates and velocities after minimisation.
|
|
|
crds and vels are both tables with x,y,z members, each of size natoms, : e.g. crds.x[i] returns the x coordinate of atom i, idem for vels.x[i].
|
|
|
**NOTE** that C++/OpenMM coordinates are not modified if modifying this table : this is a safe read-only copy.
|
|
|
**NOTE** lua indexing, starting from 1
|
|
|
|
|
|
get_minimised_energy_crdvels(tolerance,maxSteps) : this returns a 5-tuple (ep,ek,et,crds,vels)
|
|
|
This does the same as the two previous functions but with only one call
|
|
|
`get_minimised_energy_crdvels(tolerance,maxSteps)` : this returns a 5-tuple (ep,ek,et,crds,vels).
|
|
|
This does the same as the two previous functions but with only one call
|
|
|
|
|
|
hr_timer() : returns a variable representing a c++ high precision timer : can be used for measuring execution time.
|
|
|
do not try to modify it or even read it, it should only be used as argument for the following hr_timediff_* functions.
|
|
|
`hr_timer()` : returns a variable representing a c++ high precision timer : can be used for measuring execution time.
|
|
|
**NOTE** Do not try to modify it or even read it, it should only be used as argument for the following hr_timediff_* functions.
|
|
|
|
|
|
hr_timediff_ns(before,after) : returns the time difference in nanoseconds between two hr_timer() 'before' and 'after' : usage:
|
|
|
`hr_timediff_ns(before,after)` : returns the time difference in nanoseconds between two hr_timer() 'before' and 'after' : usage:
|
|
|
|
|
|
``` lua
|
|
|
local bf = hr_timer()
|
|
|
function_to_profile()
|
|
|
local af = hr_timer()
|
|
|
print('Exec. time of function function_to_profile() is (ns) : ',hr_timediff_ns(bf,af))
|
|
|
```
|
|
|
|
|
|
hr_timediff_us() and hr_timediff_ms() : same as above but exec time is returned respectively in microseconds and milliseconds
|
|
|
|
|
|
`hr_timediff_us()` and `hr_timediff_ms()` : same as above but exec time is returned respectively in microseconds and milliseconds.
|
|
|
|