diff --git a/CHANGES/v2.5.md b/CHANGES/v2.5.md index a3fe50bb64951a5a3608101a66067d52c90d4f34..b47969a44664717a7f634e5a3a82ea0805ddc4f1 100644 --- a/CHANGES/v2.5.md +++ b/CHANGES/v2.5.md @@ -47,7 +47,7 @@ Changes from version 2.4 which are relevant for users: - \ref RMSD calculation has been optimized. This should positively affect the performances of CVs where many RMSDs are computed on small groups of atoms, such as secondary structure variables. - In \ref METAD, when using a bias factor equal to one (no bias) the `rct` component is set to zero rather than to one. - - New shortcuts are available for selecting atoms: `@all`, `@physical`, `@virtual` (see \ref atomSpecs). + - New shortcuts are available for selecting atoms: `@allatoms` and `@mdatoms` (see \ref atomSpecs). - When using \ref MOLINFO, also the following shortcuts are available for selecting atoms: `@nucleic`, `@protein`, `@water`, `@ions`, `@hydrogens`, `@nonhydrogens`. - When using \ref MOLINFO, individual atoms can be chosen also from water molecules (e.g. `@OW-100`). diff --git a/regtest/basic/rt7/plumed.dat b/regtest/basic/rt7/plumed.dat index 204cfb1c3e3fdc6935677444103751cdcb45cd30..e97de1f9ca93877644a20ee50a448856795ada67 100644 --- a/regtest/basic/rt7/plumed.dat +++ b/regtest/basic/rt7/plumed.dat @@ -9,9 +9,10 @@ DUMPATOMS ATOMS=1-108,c1,c2 STRIDE=10 FILE=wrap.xyz WRAPAROUND ATOMS=1-108 AROUND=1 GROUPBY=12 DUMPATOMS ATOMS=1-108 STRIDE=10 FILE=wrap2.xyz -DUMPATOMS ATOMS=@all STRIDE=1 FILE=all.xyz -DUMPATOMS ATOMS=@physical STRIDE=1 FILE=physical.xyz -DUMPATOMS ATOMS=@virtual STRIDE=1 FILE=virtual.xyz +DUMPATOMS ATOMS=@allatoms STRIDE=1 FILE=all.xyz +DUMPATOMS ATOMS=@mdatoms STRIDE=1 FILE=physical.xyz +virtuals: GROUP ATOMS=@allatoms REMOVE=@mdatoms +DUMPATOMS ATOMS=virtuals STRIDE=1 FILE=virtual.xyz ENDPLUMED diff --git a/src/core/ActionAtomistic.cpp b/src/core/ActionAtomistic.cpp index b16ea4637e5bef203b161816d40f2f57dafd9676..baba14a59ff9e54a273549c83712ed6e85cb7ef6 100644 --- a/src/core/ActionAtomistic.cpp +++ b/src/core/ActionAtomistic.cpp @@ -175,22 +175,16 @@ void ActionAtomistic::interpretAtomList( std::vector<std::string>& strings, std: // here we check if this is a special symbol for MOLINFO if( !ok && strings[i].compare(0,1,"@")==0 ) { std::string symbol=strings[i].substr(1); - if(symbol=="all") { + if(symbol=="allatoms") { const auto n=plumed.getAtoms().getNatoms() + plumed.getAtoms().getNVirtualAtoms(); t.reserve(t.size()+n); for(unsigned i=0; i<n; i++) t.push_back(AtomNumber::index(i)); ok=true; - } else if(symbol=="physical") { + } else if(symbol=="mdatoms") { const auto n=plumed.getAtoms().getNatoms(); t.reserve(t.size()+n); for(unsigned i=0; i<n; i++) t.push_back(AtomNumber::index(i)); ok=true; - } else if(symbol=="virtual") { - const auto n=plumed.getAtoms().getNatoms(); - const auto v=plumed.getAtoms().getNVirtualAtoms(); - t.reserve(t.size()+v); - for(unsigned i=n; i<n+v; i++) t.push_back(AtomNumber::index(i)); - ok=true; } else { vector<SetupMolInfo*> moldat=plumed.getActionSet().select<SetupMolInfo*>(); if( moldat.size()>0 ) { diff --git a/user-doc/Group.md b/user-doc/Group.md index c24dea8eb4e04c178d20c35f6f3362f61bca0e8d..46c470cb291cf394a52a54254db2159fd7fadc6c 100644 --- a/user-doc/Group.md +++ b/user-doc/Group.md @@ -15,15 +15,16 @@ predefined as a \subpage GROUP that can be reused multiple times. Lists of atoms In addition, there are a few shortcuts that can be used: -- `@physical` indicate all the physical atoms present in the MD engine (e.g. `DUMPATOMS ATOMS=@physical`). -- `@virtual` indicate all the \ref vatoms "virtual atoms" defined within PLUMED (e.g. `DUMPATOMS ATOMS=@virtual`). -- `@all` indicates all atoms (e.g. `DUMPATOMS ATOMS=@all`). +- `@mdatoms` indicate all the physical atoms present in the MD engine (e.g. `DUMPATOMS ATOMS=@mdatoms`). +- `@allatoms` indicates all atoms, including \ref vatoms "those defined only in PLUMED" (e.g. `DUMPATOMS ATOMS=@allatoms`). + +The list of the virtual atoms defined in PLUMED can be obtained dy difference with `GROUP ATOMS=@allatoms REMOVE=@mdatoms`. Other shortcuts are available if you loaded the structure of the molecule using the \ref MOLINFO command. All the above methods can be combined just putting one name after the other separated by a comma: \plumedfile -DUMPATOMS ATOMS=1,2,10-20,40-60:5,100-70:-2,@virtual LABEL=g5 FILE=test.xyz +DUMPATOMS ATOMS=1,2,10-20,40-60:5,100-70:-2 LABEL=g5 FILE=test.xyz \endplumedfile Some collective variable must accept a fixed number of atoms, for example a \ref DISTANCE is calculated