-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added some methods for function arguments
- Loading branch information
Showing
7 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../../scripts/test.make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#! FIELDS time fPY.py-difference fPY.py-bringBackInPbc dz | ||
#! SET min_dz 0.0 | ||
#! SET max_dz 1.3 | ||
0.000000 0.000000 0.000000 0.000000 | ||
1.000000 0.300000 0.000000 0.000000 | ||
2.000000 -0.400000 0.600000 0.300000 | ||
3.000000 -0.100000 0.900000 0.300000 | ||
4.000000 0.200000 1.200000 0.300000 | ||
5.000000 0.200000 0.000000 0.000000 | ||
6.000000 -0.500000 0.500000 0.300000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
type=driver | ||
arg="--plumed plumed.dat --ixyz traj.xyz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
LOAD GLOBAL FILE=../../../../PythonCVInterface.so | ||
|
||
d12c: DISTANCE ATOMS=1,2 COMPONENTS | ||
|
||
dz: COMBINE ARG=d12c.z PERIODIC=0.0,1.3 | ||
|
||
fPY: ... | ||
PYFUNCTION | ||
IMPORT=unitTest | ||
INIT=initForF | ||
CALCULATE=function | ||
ARG=dz | ||
... | ||
|
||
PRINT FILE=colvar.out ARG=fPY.py-difference,fPY.py-bringBackInPbc,dz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
3 | ||
100 100 100 | ||
X 0 0 0 | ||
X 99 0 0 | ||
X 99 0 50 | ||
3 | ||
100 100 100 | ||
X 0 0 0 | ||
X 0 99 0 | ||
X 0 99 50 | ||
3 | ||
100 100 100 | ||
X 0 0 0 | ||
X 0 0 99 | ||
X 0 0 50 | ||
3 | ||
100 100 100 | ||
X 0 0 0 | ||
X 0 99 99 | ||
X 50 99 50 | ||
3 | ||
100 100 100 | ||
X 0 0 0 | ||
X 99 0 99 | ||
X 98 0 50 | ||
3 | ||
100 100 100 | ||
X 0 0 0 | ||
X 99 99 0 | ||
X 99 98 50 | ||
3 | ||
100 100 100 | ||
X 0 0 0 | ||
X 99 99 99 | ||
X 99 99 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import plumedCommunications as PLMD | ||
import numpy | ||
|
||
log = open("pydist.log", "w") | ||
|
||
print("Imported my pydist+.", file=log) | ||
|
||
initForF = { | ||
"COMPONENTS": { | ||
"difference": PLMD.defaults.COMPONENT_NODEV, | ||
"bringBackInPbc": PLMD.defaults.COMPONENT_NODEV, | ||
} | ||
} | ||
|
||
|
||
def function(action: PLMD.PythonFunction): | ||
arg = action.arguments() | ||
|
||
return { | ||
"difference": action.difference(0, action.getStep(), arg[0]), | ||
"bringBackInPbc": action.bringBackInPbc(0, arg[0] * action.getStep()), | ||
} |