diff --git a/regtest/basic/rt-readmasscharge/Makefile b/regtest/basic/rt-readmasscharge/Makefile new file mode 100644 index 0000000000..3703b27cea --- /dev/null +++ b/regtest/basic/rt-readmasscharge/Makefile @@ -0,0 +1 @@ +include ../../scripts/test.make diff --git a/regtest/basic/rt-readmasscharge/config b/regtest/basic/rt-readmasscharge/config new file mode 100644 index 0000000000..be45ea9686 --- /dev/null +++ b/regtest/basic/rt-readmasscharge/config @@ -0,0 +1,4 @@ +type=driver +# this is to test a different name +arg="--plumed=plumed.dat --timestep=0.05 --ixyz trajectory.xyz" +extra_files="../../trajectories/trajectory.xyz" diff --git a/regtest/basic/rt-readmasscharge/mc.reference b/regtest/basic/rt-readmasscharge/mc.reference new file mode 100644 index 0000000000..6ff6235e22 --- /dev/null +++ b/regtest/basic/rt-readmasscharge/mc.reference @@ -0,0 +1,109 @@ +#! FIELDS index mass charge + 0 1 1 + 1 2 0 + 2 3 1 + 3 2 0 + 4 1 1 + 5 2 0 + 6 3 1 + 7 2 0 + 8 1 10 + 9 2 0 + 10 3 20 + 11 1 1 + 12 1 1 + 13 1 1 + 14 1 1 + 15 1 1 + 16 1 1 + 17 1 1 + 18 1 1 + 19 1 1 + 20 1 1 + 21 1 1 + 22 1 1 + 23 1 1 + 24 1 1 + 25 1 1 + 26 1 1 + 27 1 1 + 28 1 1 + 29 1 1 + 30 1 1 + 31 1 1 + 32 1 1 + 33 1 1 + 34 1 1 + 35 1 1 + 36 1 1 + 37 1 1 + 38 1 1 + 39 1 1 + 40 1 1 + 41 1 1 + 42 1 1 + 43 1 1 + 44 1 1 + 45 1 1 + 46 1 1 + 47 1 1 + 48 1 1 + 49 1 1 + 50 1 1 + 51 1 1 + 52 1 1 + 53 1 1 + 54 1 1 + 55 1 1 + 56 1 1 + 57 1 1 + 58 1 1 + 59 1 1 + 60 1 1 + 61 1 1 + 62 1 1 + 63 1 1 + 64 1 1 + 65 1 1 + 66 1 1 + 67 1 1 + 68 1 1 + 69 1 1 + 70 1 1 + 71 1 1 + 72 1 1 + 73 1 1 + 74 1 1 + 75 1 1 + 76 1 1 + 77 1 1 + 78 1 1 + 79 1 1 + 80 1 1 + 81 1 1 + 82 1 1 + 83 1 1 + 84 1 1 + 85 1 1 + 86 1 1 + 87 1 1 + 88 1 1 + 89 1 1 + 90 1 1 + 91 1 1 + 92 1 1 + 93 1 1 + 94 1 1 + 95 1 1 + 96 1 1 + 97 1 1 + 98 1 1 + 99 1 1 + 100 1 1 + 101 1 1 + 102 1 1 + 103 1 1 + 104 1 1 + 105 1 1 + 106 1 1 + 107 1 10 diff --git a/regtest/basic/rt-readmasscharge/plumed.dat b/regtest/basic/rt-readmasscharge/plumed.dat new file mode 100644 index 0000000000..21e015ba11 --- /dev/null +++ b/regtest/basic/rt-readmasscharge/plumed.dat @@ -0,0 +1,3 @@ +mq: READMASSCHARGE PDBFILE=test.pdb +DUMPMASSCHARGE FILE=mc + diff --git a/regtest/basic/rt-readmasscharge/test.pdb b/regtest/basic/rt-readmasscharge/test.pdb new file mode 100644 index 0000000000..32c805761f --- /dev/null +++ b/regtest/basic/rt-readmasscharge/test.pdb @@ -0,0 +1,108 @@ +ATOM 1 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 2 Ar 0.000 0.000 0.000 2.00 0.00 +ATOM 3 Ar 0.000 0.000 0.000 3.00 1.00 +ATOM 4 Ar 0.000 0.000 0.000 2.00 0.00 +ATOM 5 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 6 Ar 0.000 0.000 0.000 2.00 0.00 +ATOM 7 Ar 0.000 0.000 0.000 3.00 1.00 +ATOM 8 Ar 0.000 0.000 0.000 2.00 0.00 +ATOM 9 Ar 0.000 0.000 0.000 1.00 10.00 +ATOM 10 Ar 0.000 0.000 0.000 2.00 0.00 +ATOM 11 Ar 0.000 0.000 0.000 3.00 20.00 +ATOM 12 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 13 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 14 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 15 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 16 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 17 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 18 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 19 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 20 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 21 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 22 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 23 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 24 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 25 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 26 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 27 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 28 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 29 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 30 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 31 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 32 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 33 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 34 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 35 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 36 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 37 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 38 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 39 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 40 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 41 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 42 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 43 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 44 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 45 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 46 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 47 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 48 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 49 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 50 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 51 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 52 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 53 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 54 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 55 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 56 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 57 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 58 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 59 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 60 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 61 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 62 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 63 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 64 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 65 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 66 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 67 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 68 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 69 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 70 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 71 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 72 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 73 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 74 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 75 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 76 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 77 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 78 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 79 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 80 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 81 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 82 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 83 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 84 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 85 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 86 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 87 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 88 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 89 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 90 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 91 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 92 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 93 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 94 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 95 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 96 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 97 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 98 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 99 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 100 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 101 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 102 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 103 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 104 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 105 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 106 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 107 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 108 Ar 0.000 0.000 0.000 1.00 10.00 diff --git a/regtest/basic/rt-readmasscharge2/Makefile b/regtest/basic/rt-readmasscharge2/Makefile new file mode 100644 index 0000000000..3703b27cea --- /dev/null +++ b/regtest/basic/rt-readmasscharge2/Makefile @@ -0,0 +1 @@ +include ../../scripts/test.make diff --git a/regtest/basic/rt-readmasscharge2/config b/regtest/basic/rt-readmasscharge2/config new file mode 100644 index 0000000000..be45ea9686 --- /dev/null +++ b/regtest/basic/rt-readmasscharge2/config @@ -0,0 +1,4 @@ +type=driver +# this is to test a different name +arg="--plumed=plumed.dat --timestep=0.05 --ixyz trajectory.xyz" +extra_files="../../trajectories/trajectory.xyz" diff --git a/regtest/basic/rt-readmasscharge2/mc.reference b/regtest/basic/rt-readmasscharge2/mc.reference new file mode 100644 index 0000000000..6ff6235e22 --- /dev/null +++ b/regtest/basic/rt-readmasscharge2/mc.reference @@ -0,0 +1,109 @@ +#! FIELDS index mass charge + 0 1 1 + 1 2 0 + 2 3 1 + 3 2 0 + 4 1 1 + 5 2 0 + 6 3 1 + 7 2 0 + 8 1 10 + 9 2 0 + 10 3 20 + 11 1 1 + 12 1 1 + 13 1 1 + 14 1 1 + 15 1 1 + 16 1 1 + 17 1 1 + 18 1 1 + 19 1 1 + 20 1 1 + 21 1 1 + 22 1 1 + 23 1 1 + 24 1 1 + 25 1 1 + 26 1 1 + 27 1 1 + 28 1 1 + 29 1 1 + 30 1 1 + 31 1 1 + 32 1 1 + 33 1 1 + 34 1 1 + 35 1 1 + 36 1 1 + 37 1 1 + 38 1 1 + 39 1 1 + 40 1 1 + 41 1 1 + 42 1 1 + 43 1 1 + 44 1 1 + 45 1 1 + 46 1 1 + 47 1 1 + 48 1 1 + 49 1 1 + 50 1 1 + 51 1 1 + 52 1 1 + 53 1 1 + 54 1 1 + 55 1 1 + 56 1 1 + 57 1 1 + 58 1 1 + 59 1 1 + 60 1 1 + 61 1 1 + 62 1 1 + 63 1 1 + 64 1 1 + 65 1 1 + 66 1 1 + 67 1 1 + 68 1 1 + 69 1 1 + 70 1 1 + 71 1 1 + 72 1 1 + 73 1 1 + 74 1 1 + 75 1 1 + 76 1 1 + 77 1 1 + 78 1 1 + 79 1 1 + 80 1 1 + 81 1 1 + 82 1 1 + 83 1 1 + 84 1 1 + 85 1 1 + 86 1 1 + 87 1 1 + 88 1 1 + 89 1 1 + 90 1 1 + 91 1 1 + 92 1 1 + 93 1 1 + 94 1 1 + 95 1 1 + 96 1 1 + 97 1 1 + 98 1 1 + 99 1 1 + 100 1 1 + 101 1 1 + 102 1 1 + 103 1 1 + 104 1 1 + 105 1 1 + 106 1 1 + 107 1 10 diff --git a/regtest/basic/rt-readmasscharge2/mcinpt b/regtest/basic/rt-readmasscharge2/mcinpt new file mode 100644 index 0000000000..6ff6235e22 --- /dev/null +++ b/regtest/basic/rt-readmasscharge2/mcinpt @@ -0,0 +1,109 @@ +#! FIELDS index mass charge + 0 1 1 + 1 2 0 + 2 3 1 + 3 2 0 + 4 1 1 + 5 2 0 + 6 3 1 + 7 2 0 + 8 1 10 + 9 2 0 + 10 3 20 + 11 1 1 + 12 1 1 + 13 1 1 + 14 1 1 + 15 1 1 + 16 1 1 + 17 1 1 + 18 1 1 + 19 1 1 + 20 1 1 + 21 1 1 + 22 1 1 + 23 1 1 + 24 1 1 + 25 1 1 + 26 1 1 + 27 1 1 + 28 1 1 + 29 1 1 + 30 1 1 + 31 1 1 + 32 1 1 + 33 1 1 + 34 1 1 + 35 1 1 + 36 1 1 + 37 1 1 + 38 1 1 + 39 1 1 + 40 1 1 + 41 1 1 + 42 1 1 + 43 1 1 + 44 1 1 + 45 1 1 + 46 1 1 + 47 1 1 + 48 1 1 + 49 1 1 + 50 1 1 + 51 1 1 + 52 1 1 + 53 1 1 + 54 1 1 + 55 1 1 + 56 1 1 + 57 1 1 + 58 1 1 + 59 1 1 + 60 1 1 + 61 1 1 + 62 1 1 + 63 1 1 + 64 1 1 + 65 1 1 + 66 1 1 + 67 1 1 + 68 1 1 + 69 1 1 + 70 1 1 + 71 1 1 + 72 1 1 + 73 1 1 + 74 1 1 + 75 1 1 + 76 1 1 + 77 1 1 + 78 1 1 + 79 1 1 + 80 1 1 + 81 1 1 + 82 1 1 + 83 1 1 + 84 1 1 + 85 1 1 + 86 1 1 + 87 1 1 + 88 1 1 + 89 1 1 + 90 1 1 + 91 1 1 + 92 1 1 + 93 1 1 + 94 1 1 + 95 1 1 + 96 1 1 + 97 1 1 + 98 1 1 + 99 1 1 + 100 1 1 + 101 1 1 + 102 1 1 + 103 1 1 + 104 1 1 + 105 1 1 + 106 1 1 + 107 1 10 diff --git a/regtest/basic/rt-readmasscharge2/plumed.dat b/regtest/basic/rt-readmasscharge2/plumed.dat new file mode 100644 index 0000000000..3d40503f93 --- /dev/null +++ b/regtest/basic/rt-readmasscharge2/plumed.dat @@ -0,0 +1,3 @@ +mq: READMASSCHARGE FILE=mcinpt +DUMPMASSCHARGE FILE=mc + diff --git a/regtest/basic/rt-readmasscharge2/test.pdb b/regtest/basic/rt-readmasscharge2/test.pdb new file mode 100644 index 0000000000..32c805761f --- /dev/null +++ b/regtest/basic/rt-readmasscharge2/test.pdb @@ -0,0 +1,108 @@ +ATOM 1 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 2 Ar 0.000 0.000 0.000 2.00 0.00 +ATOM 3 Ar 0.000 0.000 0.000 3.00 1.00 +ATOM 4 Ar 0.000 0.000 0.000 2.00 0.00 +ATOM 5 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 6 Ar 0.000 0.000 0.000 2.00 0.00 +ATOM 7 Ar 0.000 0.000 0.000 3.00 1.00 +ATOM 8 Ar 0.000 0.000 0.000 2.00 0.00 +ATOM 9 Ar 0.000 0.000 0.000 1.00 10.00 +ATOM 10 Ar 0.000 0.000 0.000 2.00 0.00 +ATOM 11 Ar 0.000 0.000 0.000 3.00 20.00 +ATOM 12 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 13 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 14 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 15 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 16 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 17 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 18 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 19 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 20 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 21 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 22 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 23 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 24 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 25 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 26 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 27 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 28 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 29 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 30 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 31 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 32 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 33 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 34 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 35 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 36 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 37 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 38 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 39 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 40 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 41 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 42 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 43 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 44 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 45 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 46 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 47 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 48 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 49 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 50 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 51 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 52 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 53 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 54 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 55 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 56 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 57 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 58 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 59 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 60 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 61 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 62 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 63 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 64 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 65 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 66 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 67 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 68 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 69 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 70 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 71 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 72 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 73 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 74 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 75 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 76 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 77 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 78 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 79 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 80 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 81 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 82 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 83 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 84 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 85 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 86 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 87 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 88 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 89 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 90 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 91 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 92 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 93 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 94 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 95 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 96 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 97 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 98 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 99 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 100 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 101 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 102 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 103 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 104 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 105 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 106 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 107 Ar 0.000 0.000 0.000 1.00 1.00 +ATOM 108 Ar 0.000 0.000 0.000 1.00 10.00 diff --git a/src/cltools/Benchmark.cpp b/src/cltools/Benchmark.cpp index 4b03ec95ad..9f251fc6f0 100644 --- a/src/cltools/Benchmark.cpp +++ b/src/cltools/Benchmark.cpp @@ -456,6 +456,7 @@ void Benchmark::registerKeywords( Keywords& keys ) { keys.add("compulsory","--maxtime","-1","maximum number of seconds (-1 means forever)"); keys.add("compulsory","--sleep","0","number of seconds of sleep, mimicking MD calculation"); keys.add("compulsory","--atom-distribution","line","the kind of possible atomic displacement at each step"); + keys.add("optional","--dump-trajectory","dump the trajectory to this file"); keys.addFlag("--domain-decomposition",false,"simulate domain decomposition, implies --shuffle"); keys.addFlag("--shuffled",false,"reshuffle atoms"); } @@ -663,6 +664,35 @@ int Benchmark::main(FILE* in, FILE*out,Communicator& pc) { distribution = getAtomDistribution(atomicDistr); log << "Using --atom-distribution=" << atomicDistr << "\n"; } + + { + std::string fileToDump; + if(parse("--dump-trajectory",fileToDump)) { + log << "Saving the trajectory to \"" << fileToDump << "\" and exiting\n"; + std::vector cell(9); + std::vector pos(natoms); + std::ofstream ofile(fileToDump); + if (nf<0) { + //if the user accidentally sets infinite steps, we set it to print only one + nf=1; + } + for(int step=0; steppositions(pos,step,atomicGenerator); + distribution->box(cell,natoms,step,atomicGenerator); + ofile << natoms << "\n" + << cell[0] << " " << cell[1] << " " << cell[2] << " " + << cell[3] << " " << cell[4] << " " << cell[5] << " " + << cell[6] << " " << cell[7] << " " << cell[8] << "\n"; + for(int i=0; i #include #include "ActionWithValue.h" +#include "ActionShortcut.h" #include "Group.h" #include "ActionWithVirtualAtom.h" #include "tools/Exception.h" @@ -46,6 +47,7 @@ ActionAtomistic::ActionAtomistic(const ActionOptions&ao): lockRequestAtoms(false), donotretrieve(false), donotforce(false), + massesWereSet(false), chargesWereSet(false) { ActionWithValue* bv = plumed.getActionSet().selectWithLabel("Box"); @@ -57,6 +59,16 @@ ActionAtomistic::ActionAtomistic(const ActionOptions&ao): } void ActionAtomistic::getAtomValuesFromPlumedObject( const PlumedMain& plumed, std::vector& xpos, std::vector& ypos, std::vector& zpos, std::vector& masv, std::vector& chargev ) { + std::vector shortcuts = plumed.getActionSet().select(); bool foundpdb=false; + for(const auto & ss : shortcuts ) { + if( ss->getName()=="READMASSCHARGE" ) { + foundpdb=true; + ActionWithValue* mv = plumed.getActionSet().selectWithLabel( ss->getShortcutLabel() + "_mass"); + plumed_assert( mv ); masv.push_back( mv->copyOutput(0) ); + ActionWithValue* qv = plumed.getActionSet().selectWithLabel( ss->getShortcutLabel() + "_charges"); + plumed_assert( qv ); chargev.push_back( qv->copyOutput(0) ); + } + } std::vector vatoms = plumed.getActionSet().select(); for(const auto & vv : vatoms ) { plumed_assert(vv); // needed for following calls, see #1046 @@ -65,8 +77,8 @@ void ActionAtomistic::getAtomValuesFromPlumedObject( const PlumedMain& plumed, s if( ap->getRole()=="x" ) xpos.push_back( ap->copyOutput(0) ); if( ap->getRole()=="y" ) ypos.push_back( ap->copyOutput(0) ); if( ap->getRole()=="z" ) zpos.push_back( ap->copyOutput(0) ); - if( ap->getRole()=="m" ) masv.push_back( ap->copyOutput(0) ); - if( ap->getRole()=="q" ) chargev.push_back( ap->copyOutput(0) ); + if( !foundpdb && ap->getRole()=="m" ) masv.push_back( ap->copyOutput(0) ); + if( !foundpdb && ap->getRole()=="q" ) chargev.push_back( ap->copyOutput(0) ); } ActionWithVirtualAtom* av = vv->castToActionWithVirtualAtom(); if( av || vv->getName()=="ARGS2VATOM" ) { @@ -339,10 +351,16 @@ void ActionAtomistic::retrieveAtoms( const bool& force ) { plumed_assert( pbca ); pbc=pbca->pbc; } if( donotretrieve || indexes.size()==0 ) return; + auto * mtr=masv[0]->getPntrToAction(); + plumed_assert(mtr); // needed for following calls, see #1046 + ActionToPutData* mv = mtr->castToActionToPutData(); + if(mv) massesWereSet=mv->hasBeenSet(); + else if( (masv[0]->getPntrToAction())->getName()=="CONSTANT" ) massesWereSet=true; // Read masses from PDB file auto * ptr=chargev[0]->getPntrToAction(); plumed_assert(ptr); // needed for following calls, see #1046 ActionToPutData* cv = ptr->castToActionToPutData(); if(cv) chargesWereSet=cv->hasBeenSet(); + else if( (chargev[0]->getPntrToAction())->getName()=="CONSTANT" ) chargesWereSet=true; // Read masses from PDB file unsigned j = 0; // for(const auto & a : atom_value_ind) { diff --git a/src/core/ActionAtomistic.h b/src/core/ActionAtomistic.h index da8c1266b7..377d1c6ccb 100644 --- a/src/core/ActionAtomistic.h +++ b/src/core/ActionAtomistic.h @@ -80,6 +80,7 @@ class ActionAtomistic : std::vector xpos, ypos, zpos, masv, chargev; void updateUniqueLocal( const bool& useunique, const std::vector& g2l ); protected: + bool massesWereSet; bool chargesWereSet; void setExtraCV(const std::string &name); /// Used to interpret whether this index is a virtual atom or a real atom @@ -202,6 +203,7 @@ const Vector & ActionAtomistic::getPosition(int i)const { inline double ActionAtomistic::getMass(int i)const { + if( !massesWereSet ) log.printf("WARNING: masses were not passed to plumed\n"); return masses[i]; } diff --git a/src/generic/MassChargeInput.cpp b/src/generic/MassChargeInput.cpp new file mode 100644 index 0000000000..986f7533ed --- /dev/null +++ b/src/generic/MassChargeInput.cpp @@ -0,0 +1,108 @@ +/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Copyright (c) 2012-2023 The plumed team + (see the PEOPLE file at the root of the distribution for a list of names) + + See http://www.plumed.org for more information. + + This file is part of plumed, version 2. + + plumed is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + plumed is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with plumed. If not, see . ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ +#include "core/ActionShortcut.h" +#include "core/ActionRegister.h" +#include "core/ActionToPutData.h" +#include "core/ActionAnyorder.h" +#include "core/ActionSetup.h" +#include "core/PlumedMain.h" +#include "core/ActionSet.h" +#include "tools/IFile.h" +#include "tools/PDB.h" + +namespace PLMD { +namespace generic { + +//+PLUMEDOC COLVAR READMASSCHARGE +/* +Set the masses and charges from an input PDB file. + +\par Examples + +*/ +//+ENDPLUMEDOC + +class MassChargeInput : public ActionShortcut { +public: + static void registerKeywords(Keywords& keys); + explicit MassChargeInput(const ActionOptions&); +}; + +PLUMED_REGISTER_ACTION(MassChargeInput,"READMASSCHARGE") + +void MassChargeInput::registerKeywords(Keywords& keys) { + ActionShortcut::registerKeywords( keys ); + keys.add("optional","FILE","input file that contains the masses and charges that should be used"); + keys.add("compulsory","PDBFILE","a pdb file that contains the masses and charges of the atoms in the beta and occupancy columns"); + keys.addOutputComponent("mass","default","the masses of the atoms in the system"); + keys.addOutputComponent("charges","default","the masses of the atoms in the system"); + keys.needsAction("CONSTANT"); +} + +MassChargeInput::MassChargeInput(const ActionOptions& ao): + Action(ao), + ActionShortcut(ao) +{ + const ActionSet& actionset(plumed.getActionSet()); + for(const auto & p : actionset) { + // check that all the preceding actions are ActionSetup + if( !dynamic_cast(p.get()) && !dynamic_cast(p.get()) && !dynamic_cast(p.get()) ) { + error("Action " + getLabel() + " is a setup action, and should be only preceded by other setup actions or by actions that can be used in any order."); + } else if( (p.get())->getName()=="READMASSCHARGE" ) error("should only be one READMASSCHARGE action in the input file"); + } + // Check for correct number of atoms + unsigned natoms=0; std::vector inputs=plumed.getActionSet().select(); + for(const auto & pp : inputs ) { + if( pp->getRole()=="x" ) natoms = (pp->copyOutput(0))->getShape()[0]; + } + std::string input; parse("FILE",input); std::vector masses( natoms ), charges( natoms ); + if( input.length()>0 ) { + log.printf(" reading masses and charges from file named %s \n", input.c_str() ); + IFile ifile; ifile.open( input ); int index; double mass; double charge; + while(ifile.scanField("index",index).scanField("mass",mass).scanField("charge",charge).scanField()) { + if( index>=natoms ) error("indices of atoms in input file are too large"); + masses[index]=mass; charges[index]=charge; + } + ifile.close(); + } else { + std::string pdbinpt; parse("PDBFILE",pdbinpt); PDB pdb; + log.printf(" reading masses and charges from pdb file named %s \n", pdbinpt.c_str() ); + if( !pdb.read(pdbinpt, false, 1.0 ) ) error("error reading pdb file containing masses and charges"); + if( natoms!=pdb.size() ) error("mismatch between number of atoms passed from MD code and number of atoms in PDB file"); + masses = pdb.getOccupancy(); charges = pdb.getBeta(); + } + + // Now get masses and charges + std::string nnn, qstr, mstr; + Tools::convert( masses[0], mstr ); + Tools::convert( charges[0], qstr ); + for(unsigned i=1; i