LCOV - code coverage report
Current view: top level - crystallization - VectorMultiColvar.h (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 6 6 100.0 %
Date: 2024-10-11 08:09:47 Functions: 4 4 100.0 %

          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             : #ifndef __PLUMED_crystallization_VectorMultiColvar_h
      23             : #define __PLUMED_crystallization_VectorMultiColvar_h
      24             : 
      25             : #include "tools/Matrix.h"
      26             : #include "multicolvar/MultiColvarBase.h"
      27             : #include "multicolvar/AtomValuePack.h"
      28             : 
      29             : namespace PLMD {
      30             : namespace crystallization {
      31             : 
      32             : class VectorMultiColvar : public multicolvar::MultiColvarBase {
      33             :   friend class OrientationSphere;
      34             :   friend class VolumeGradientBase;
      35             : private:
      36             : /// Are we storing the director of the vector of the vector
      37             :   bool store_director;
      38             : /// How many components does the vector have
      39             :   unsigned ncomponents;
      40             : /// These are tempory vectors that are used to store values and directors
      41             :   std::vector<double> vv1, vv2;
      42             : protected:
      43             : /// Set the dimensionality of the vector
      44             :   void setVectorDimensionality( const unsigned& );
      45             : /// Used in vector average to add forces from vector the the forces from here
      46             :   void addForcesOnAtoms( const std::vector<double>& inforces );
      47             : public:
      48             :   static void registerKeywords( Keywords& keys );
      49             :   explicit VectorMultiColvar(const ActionOptions&);
      50          52 :   ~VectorMultiColvar() {}
      51             : /// The norm of a vector is not periodic
      52          35 :   virtual bool isPeriodic() { return false; }
      53             : /// Calculate the multicolvar
      54             : //  double doCalculation( const unsigned& taskIndex, multicolvar::AtomValuePack& myatoms ) const ;
      55             : /// This shouldn't do anything
      56             :   double compute( const unsigned& tindex, multicolvar::AtomValuePack& myatoms ) const ;
      57             : /// Calculate the vector
      58             :   virtual void calculateVector( multicolvar::AtomValuePack& myatoms ) const=0;
      59             : /// Get the number of components in the vector
      60             :   unsigned getNumberOfComponentsInVector() const ;
      61             : /// Get the number of quantities we are calculating per step
      62             :   unsigned getNumberOfQuantities() const ;
      63             : /// Can we differentiate the orientation - yes we can the multicolvar is a vector
      64           4 :   bool hasDifferentiableOrientation() const { return true; }
      65             : ///  This makes sure we are not calculating the director when we do LocalAverage
      66             :   virtual void doNotCalculateDirector();
      67             : /// This does normalizeing of vectors for storeDataVessel
      68             :   virtual void normalizeVector( std::vector<double>& vals ) const ;
      69             :   virtual void normalizeVectorDerivatives( MultiValue& myvals ) const ;
      70             : };
      71             : 
      72             : inline
      73             : unsigned VectorMultiColvar::getNumberOfComponentsInVector() const {
      74     1892577 :   return ncomponents;
      75             : }
      76             : 
      77             : inline
      78     1252604 : unsigned VectorMultiColvar::getNumberOfQuantities() const {
      79     1252604 :   return 2 + ncomponents;
      80             : }
      81             : 
      82             : }
      83             : }
      84             : #endif
      85             : 

Generated by: LCOV version 1.15