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","scalar","the largest of the colvars"); 55 4 : keys.needsAction("CUSTOM"); keys.needsAction("GROUP"); 56 4 : keys.needsAction("MORE_THAN"); keys.needsAction("HIGHEST"); 57 2 : } 58 : 59 0 : MFilterMore::MFilterMore(const ActionOptions& ao): 60 : Action(ao), 61 0 : ActionShortcut(ao) 62 : { 63 0 : warning("This action has been depracated. Look at the log to see how the same result is achieved with the new syntax"); 64 0 : bool lowmem; parseFlag("LOWMEM",lowmem); 65 0 : if( lowmem ) warning("LOWMEM flag is deprecated and is no longer required for this action"); 66 0 : std::string dd; parse("DATA",dd); 67 0 : std::string swit; parse("SWITCH",swit); 68 0 : readInputLine( getShortcutLabel() + "_grp: GROUP ATOMS=" + dd + "_grp"); 69 0 : readInputLine( getShortcutLabel() + ": MORE_THAN ARG=" + dd + " SWITCH={" + swit + "}"); 70 0 : bool highest; parseFlag("HIGHEST",highest); 71 0 : if( highest ) { 72 0 : readInputLine( getShortcutLabel() + "_filtered: CUSTOM ARG=" + dd + "," + getShortcutLabel() + " FUNC=x*y PERIODIC=NO"); 73 0 : readInputLine( getShortcutLabel() + "_highest: HIGHEST ARG=" + getShortcutLabel() + "_filtered"); 74 : } 75 0 : } 76 : 77 : } 78 : }