Line data Source code
1 : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 : Copyright (c) 2015-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 : #ifndef __PLUMED_adjmat_ActionWithInputMatrix_h 23 : #define __PLUMED_adjmat_ActionWithInputMatrix_h 24 : 25 : #include "core/ActionWithValue.h" 26 : #include "core/ActionAtomistic.h" 27 : #include "multicolvar/MultiColvarBase.h" 28 : 29 : namespace PLMD { 30 : namespace adjmat { 31 : 32 : class AdjacencyMatrixVessel; 33 : 34 : class ActionWithInputMatrix : public multicolvar::MultiColvarBase { 35 : protected: 36 : /// The vessel that holds the adjacency matrix 37 : AdjacencyMatrixVessel* mymatrix; 38 : /// Get number of base multicolvar types 39 : unsigned getNumberOfNodeTypes() const ; 40 : /// Get number of atoms in each base multicolvar 41 : unsigned getNumberOfAtomsInGroup( const unsigned& igrp ) const ; 42 : /// Get a pointer to the igrp th base multicolvar 43 : multicolvar::MultiColvarBase* getBaseMultiColvar( const unsigned& igrp ) const ; 44 : public: 45 : static void registerKeywords( Keywords& keys ); 46 : explicit ActionWithInputMatrix(const ActionOptions&); 47 : /// Retrieve the vessel that holds the adjacency matrix 48 : AdjacencyMatrixVessel* getAdjacencyVessel() const ; 49 : /// Retrieve the value of the connection 50 : double retrieveConnectionValue( const unsigned& i, const unsigned& j, std::vector<double>& vals ) const ; 51 : /// Get the vector for task ind 52 : void getInputData( const unsigned& ind, const bool& normed, const multicolvar::AtomValuePack& myatoms, std::vector<double>& orient0 ) const override; 53 : /// Add the derivatives on a connection 54 : void addConnectionDerivatives( const unsigned& i, const unsigned& j, MultiValue& myvals, MultiValue& myvout ) const ; 55 : /// Get vector derivatives 56 : MultiValue& getInputDerivatives( const unsigned& ind, const bool& normed, const multicolvar::AtomValuePack& myatoms ) const override; 57 : unsigned getNumberOfDerivatives() override; 58 : /// Get the number of rows/cols in the adjacency matrix vessel 59 : virtual unsigned getNumberOfNodes() const; 60 80 : bool isPeriodic() override { return false; } 61 : unsigned getNumberOfQuantities() const override; 62 : /// 63 : AtomNumber getAbsoluteIndexOfCentralAtom(const unsigned& i) const override; 64 : /// No loop over tasks for ActionWithInputMatrix 65 0 : double compute( const unsigned& tindex, multicolvar::AtomValuePack& myatoms ) const override { plumed_error(); } 66 : /// 67 : Vector getPositionOfAtomForLinkCells( const unsigned& iatom ) const override; 68 : }; 69 : 70 : } 71 : } 72 : #endif