Line data Source code
1 : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 : Copyright (c) 2013-2023 The plumed team 3 : (see the PEOPLE file at the root of the distribution for a list of names) 4 : 5 : See http://www.plumed.org for more information. 6 : 7 : This file is part of plumed, version 2. 8 : 9 : plumed is free software: you can redistribute it and/or modify 10 : it under the terms of the GNU Lesser General Public License as published by 11 : the Free Software Foundation, either version 3 of the License, or 12 : (at your option) any later version. 13 : 14 : plumed is distributed in the hope that it will be useful, 15 : but WITHOUT ANY WARRANTY; without even the implied warranty of 16 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 : GNU Lesser General Public License for more details. 18 : 19 : You should have received a copy of the GNU Lesser General Public License 20 : along with plumed. If not, see <http://www.gnu.org/licenses/>. 21 : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ 22 : #include "core/ActionShortcut.h" 23 : #include "core/ActionRegister.h" 24 : 25 : //+PLUMEDOC MCOLVAR MFILTER_MORE 26 : /* 27 : Basically equivalent to MORE_THAN. 28 : 29 : This action has been depracated 30 : 31 : \par Examples 32 : 33 : 34 : */ 35 : //+ENDPLUMEDOC 36 : 37 : namespace PLMD { 38 : namespace multicolvar { 39 : 40 : class MFilterMore : public ActionShortcut { 41 : public: 42 : static void registerKeywords(Keywords& keys); 43 : explicit MFilterMore(const ActionOptions&); 44 : }; 45 : 46 : PLUMED_REGISTER_ACTION(MFilterMore,"MFILTER_MORE") 47 : 48 2 : void MFilterMore::registerKeywords(Keywords& keys) { 49 2 : ActionShortcut::registerKeywords( keys ); 50 4 : keys.add("compulsory","DATA","the vector you wish to transform"); 51 4 : keys.add("compulsory","SWITCH","the switching function that transform"); 52 4 : keys.addFlag("LOWMEM",false,"this flag does nothing and is present only to ensure back-compatibility"); 53 4 : keys.addFlag("HIGHEST",false,"this flag allows you to recover the highest of these variables."); 54 4 : keys.addOutputComponent("highest","HIGHEST","the largest of the colvars"); 55 2 : keys.needsAction("CUSTOM"); 56 2 : keys.needsAction("GROUP"); 57 2 : keys.needsAction("MORE_THAN"); 58 2 : keys.needsAction("HIGHEST"); 59 2 : } 60 : 61 0 : MFilterMore::MFilterMore(const ActionOptions& ao): 62 : Action(ao), 63 0 : ActionShortcut(ao) { 64 0 : warning("This action has been depracated. Look at the log to see how the same result is achieved with the new syntax"); 65 : bool lowmem; 66 0 : parseFlag("LOWMEM",lowmem); 67 0 : if( lowmem ) { 68 0 : warning("LOWMEM flag is deprecated and is no longer required for this action"); 69 : } 70 : std::string dd; 71 0 : parse("DATA",dd); 72 : std::string swit; 73 0 : parse("SWITCH",swit); 74 0 : readInputLine( getShortcutLabel() + "_grp: GROUP ATOMS=" + dd + "_grp"); 75 0 : readInputLine( getShortcutLabel() + ": MORE_THAN ARG=" + dd + " SWITCH={" + swit + "}"); 76 : bool highest; 77 0 : parseFlag("HIGHEST",highest); 78 0 : if( highest ) { 79 0 : readInputLine( getShortcutLabel() + "_filtered: CUSTOM ARG=" + dd + "," + getShortcutLabel() + " FUNC=x*y PERIODIC=NO"); 80 0 : readInputLine( getShortcutLabel() + "_highest: HIGHEST ARG=" + getShortcutLabel() + "_filtered"); 81 : } 82 0 : } 83 : 84 : } 85 : }