LCOV - code coverage report
Current view: top level - analysis - AnalysisWithLandmarks.cpp (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 23 27 85.2 %
Date: 2020-11-18 11:20:57 Functions: 7 12 58.3 %

          Line data    Source code
       1             : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       2             :    Copyright (c) 2013-2019 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 "AnalysisWithLandmarks.h"
      23             : #include "LandmarkRegister.h"
      24             : #include "LandmarkSelectionBase.h"
      25             : 
      26             : //+PLUMEDOC INTERNAL landmarkselection
      27             : /*
      28             : This is currently a filler page.
      29             : 
      30             : Just use LANDMARKS=ALL.  More complex versions will appear in later versions.
      31             : 
      32             : */
      33             : //+ENDPLUMEDOC
      34             : 
      35             : namespace PLMD {
      36             : namespace analysis {
      37             : 
      38           2 : void AnalysisWithLandmarks::registerKeywords( Keywords& keys ) {
      39           2 :   Analysis::registerKeywords( keys );
      40          10 :   keys.add("compulsory","LANDMARKS","ALL","only use a subset of the data that was collected. "
      41             :            "For more information on the landmark selection algorithms that are available in "
      42             :            "plumed see \\ref landmarkselection.");
      43           2 : }
      44             : 
      45           1 : AnalysisWithLandmarks::AnalysisWithLandmarks( const ActionOptions& ao):
      46             :   Action(ao),
      47             :   Analysis(ao),
      48           1 :   data_to_analyze(NULL)
      49             : {
      50           2 :   std::string linput; parse("LANDMARKS",linput);
      51           2 :   std::vector<std::string> words=Tools::getWords(linput);
      52           2 :   landmarkSelector=landmarkRegister().create( LandmarkSelectionOptions(words,this) );
      53           3 :   log.printf("  %s\n", landmarkSelector->description().c_str() );
      54           1 : }
      55             : 
      56           2 : AnalysisWithLandmarks::~AnalysisWithLandmarks() {
      57           1 :   delete landmarkSelector;
      58           1 : }
      59             : 
      60           1 : void AnalysisWithLandmarks::setDataToAnalyze( MultiReferenceBase* mydata ) {
      61           1 :   data_to_analyze=mydata;
      62           1 : }
      63             : 
      64           0 : unsigned AnalysisWithLandmarks::getNumberOfLandmarks() const {
      65           0 :   return landmarkSelector->getNumberOfLandmarks();
      66             : }
      67             : 
      68           2 : void AnalysisWithLandmarks::performAnalysis() {
      69           2 :   plumed_assert( data_to_analyze );
      70           2 :   landmarkSelector->selectLandmarks( data_to_analyze );
      71           2 :   analyzeLandmarks();
      72           2 : }
      73             : 
      74           0 : void AnalysisWithLandmarks::performTask( const unsigned& taskIndex, const unsigned& current, MultiValue& myvals ) const {
      75           0 :   plumed_merror("Should not be here");
      76             : }
      77             : 
      78             : }
      79        4839 : }

Generated by: LCOV version 1.13