Line data Source code
1 : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 : Copyright (c) 2017-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/ActionRegister.h" 23 : #include "core/ActionSet.h" 24 : #include "core/PlumedMain.h" 25 : 26 : namespace PLMD { 27 : namespace generic { 28 : 29 : //+PLUMEDOC GENERIC ENDPLUMED 30 : /* 31 : Terminate plumed input. 32 : 33 : As the following example illlustrates this action can be used to effectively comment out the rest of the input file. 34 : This can be useful if you want to quickly ignore part of a long input file. However, __you do not need to include an ENDPLUMED 35 : command at the end of every PLUMED input file__ 36 : 37 : ```plumed 38 : d: DISTANCE ATOMS=1,10 39 : PRINT ARG=d FILE=COLVAR STRIDE=10 40 : ENDPLUMED 41 : commands here are ignored 42 : PRINT ARG=d FILE=COLVAR STRIDE=1 43 : ``` 44 : 45 : If you are using the ENDPLUMED command you should keep in mind that when opening the file it might be difficult to 46 : find where the commented out part begins. Regular comments (with `#`) are 47 : usually easier to read. Notice that if you use the VIM syntax it should be able 48 : to detect this command and properly mark the rest of the file as a comment, 49 : although since vim doesn't parse the whole file it might fail in doing so for long 50 : input files. 51 : 52 : 53 : */ 54 : //+ENDPLUMEDOC 55 : class EndPlumed: 56 : public Action { 57 : public: 58 : explicit EndPlumed(const ActionOptions&ao); 59 : /// Register all the relevant keywords for the action 60 : static void registerKeywords( Keywords& keys ); 61 0 : void calculate() override {} 62 0 : void apply() override {} 63 : }; 64 : 65 : PLUMED_REGISTER_ACTION(EndPlumed,"ENDPLUMED") 66 : 67 296 : void EndPlumed::registerKeywords( Keywords& keys ) { 68 296 : Action::registerKeywords( keys ); 69 296 : } 70 : 71 294 : EndPlumed::EndPlumed(const ActionOptions&ao): 72 294 : Action(ao) { 73 294 : checkRead(); 74 294 : plumed.setEndPlumed(); 75 294 : } 76 : 77 : } 78 : } 79 :