LCOV - code coverage report
Current view: top level - crystallization - VectorMultiColvar.h (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 7 8 87.5 %
Date: 2018-12-19 07:49:13 Functions: 5 8 62.5 %

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

Generated by: LCOV version 1.13