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 : #include "MultiColvarFunction.h"
23 : #include "core/PlumedMain.h"
24 : #include "core/ActionSet.h"
25 : #include "tools/Pbc.h"
26 : #include "MultiColvarBase.h"
27 :
28 : namespace PLMD {
29 : namespace multicolvar {
30 :
31 47 : void MultiColvarFunction::registerKeywords( Keywords& keys ) {
32 47 : MultiColvarBase::registerKeywords( keys );
33 47 : keys.add("compulsory","DATA","the labels of the action that calculates the multicolvars we are interested in");
34 47 : keys.remove("NUMERICAL_DERIVATIVES");
35 47 : }
36 :
37 35 : MultiColvarFunction::MultiColvarFunction(const ActionOptions& ao):
38 : Action(ao),
39 35 : MultiColvarBase(ao)
40 : {
41 : // Read in the arguments
42 35 : if( keywords.exists("DATA") ) {
43 0 : std::vector<AtomNumber> fake_atoms;
44 0 : if( !parseMultiColvarAtomList("DATA",-1,fake_atoms) ) error("missing DATA keyword");
45 0 : if( fake_atoms.size()>0 ) error("no atoms should appear in the specification for this object. Input should be other multicolvars");
46 : }
47 35 : }
48 :
49 0 : void MultiColvarFunction::buildSets() {
50 0 : nblock = mybasemulticolvars[0]->getFullNumberOfTasks();
51 0 : for(unsigned i=0; i<mybasemulticolvars.size(); ++i) {
52 0 : if( mybasemulticolvars[i]->getFullNumberOfTasks()!=nblock ) {
53 0 : error("mismatch between numbers of tasks in various base multicolvars");
54 : }
55 : }
56 0 : nblock=0; ablocks.resize( mybasemulticolvars.size() );
57 0 : usespecies=false; // current_atoms.resize( mybasemulticolvars.size() );
58 0 : for(unsigned i=0; i<mybasemulticolvars.size(); ++i) {
59 0 : ablocks[i].resize( nblock );
60 0 : for(unsigned j=0; j<nblock; ++j) ablocks[i][j]=i*nblock+j;
61 : }
62 0 : for(unsigned i=0; i<nblock; ++i) addTaskToList( i );
63 0 : std::vector<AtomNumber> fake_atoms; setupMultiColvarBase( fake_atoms );
64 : // mybasedata[0]->resizeTemporyMultiValues( mybasemulticolvars.size() );
65 0 : }
66 :
67 : }
68 2523 : }
69 :
|