Line data Source code
1 : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 : Copyright (c) 2019 Jakub Rydzewski (jr@fizyka.umk.pl). All rights reserved. 3 : 4 : See http://www.maze-code.github.io for more information. 5 : 6 : This file is part of maze. 7 : 8 : maze is free software: you can redistribute it and/or modify it under the 9 : terms of the GNU Lesser General Public License as published by the Free 10 : Software Foundation, either version 3 of the License, or (at your option) 11 : any later version. 12 : 13 : maze is distributed in the hope that it will be useful, but WITHOUT ANY 14 : WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 : FOR A PARTICULAR PURPOSE. 16 : 17 : See the 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 maze. If not, see <https://www.gnu.org/licenses/>. 21 : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ 22 : #ifndef __PLUMED_maze_Loss_h 23 : #define __PLUMED_maze_Loss_h 24 : 25 : /** 26 : * @file Loss.h 27 : * 28 : * @author J. Rydzewski (jr@fizyka.umk.pl) 29 : */ 30 : 31 : #include "colvar/Colvar.h" 32 : #include "core/ActionRegister.h" 33 : #include "Core.h" 34 : 35 : namespace PLMD { 36 : namespace maze { 37 : 38 : /** 39 : * @class Loss Loss.h "maze/Loss.h" 40 : * 41 : * @brief Loss function describes a score between a ligand-protein conformation. 42 : * 43 : * Loss function must be defined for an optimizer as it minimizes a loss 44 : * of a ligand-protein conformation in order to simulate the ligand-protein 45 : * dissociation process. 46 : */ 47 : class Loss: public colvar::Colvar { 48 : public: 49 : /** 50 : * PLMD constructor. 51 : * 52 : * @param[in] ao PLMD::ActionOptions&. 53 : */ 54 : explicit Loss(const ActionOptions& ao); 55 : 56 : /** 57 : * Destructor. 58 : */ 59 24 : ~Loss() { /* Nothing to do. */ } 60 : 61 : /** 62 : * Register PLMD keywords. 63 : * 64 : * @param[in] keys Keywords. 65 : */ 66 : static void registerKeywords(Keywords& keys); 67 : 68 : /** 69 : * Calculate a loss of a single pair of ligand-protein atoms. 70 : * 71 : * @param[in] distance Distance between atoms in the pair. 72 : */ 73 : double pairing(double distance); 74 : 75 : // Required by the Colvar class. 76 0 : void calculate() override { /* Nothing to do. */ } 77 : 78 : protected: 79 : //! Parameters of the loss function. 80 : std::vector<double> params_; 81 : }; 82 : 83 : } // namespace maze 84 : } // namespace PLMD 85 : 86 : #endif // __PLUMED_maze_Loss_h