All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Bias.h
Go to the documentation of this file.
1 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2  Copyright (c) 2013 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-code.org for more information.
6 
7  This file is part of plumed, version 2.0.
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_bias_Bias_h
23 #define __PLUMED_bias_Bias_h
24 
25 #include "core/ActionPilot.h"
26 #include "core/ActionWithValue.h"
27 #include "core/ActionWithArguments.h"
28 
29 #define PLUMED_BIAS_INIT(ao) Action(ao),Bias(ao)
30 
31 namespace PLMD{
32 namespace bias{
33 
34 /**
35 \ingroup INHERIT
36 This is the abstract base class to use for implementing new simulation biases, within it there is
37 information as to how to go about implementing a new bias.
38 */
39 
40 class Bias :
41  public ActionPilot,
42  public ActionWithValue,
43  public ActionWithArguments
44 {
45  std::vector<double> outputForces;
46 protected:
47  void resetOutputForces();
48  void setOutputForce(int i,double g);
49 public:
50  static void registerKeywords(Keywords&);
51  Bias(const ActionOptions&ao);
52  void apply();
53 };
54 
55 inline
56 void Bias::setOutputForce(int i,double f){
57  outputForces[i]=f;
58 }
59 
60 inline
62  for(unsigned i=0;i<outputForces.size();++i) outputForces[i]=0.0;
63 }
64 
65 }
66 }
67 
68 #endif
69 
std::vector< double > outputForces
Definition: Bias.h:45
This is used to create PLMD::Action objects that are run with some set frequency. ...
Definition: ActionPilot.h:39
void resetOutputForces()
Definition: Bias.h:61
This is used to create PLMD::Action objects that take the output from some other Action as input...
Bias(const ActionOptions &ao)
Definition: Bias.cpp:28
Used to create a PLMD::Action that has some scalar or vectorial output that may or may not have some ...
This class holds the keywords and their documentation.
Definition: Keywords.h:36
This class is used to bring the relevant information to the Action constructor.
Definition: Action.h:41
void apply()
Apply an Action.
Definition: Bias.cpp:46
void setOutputForce(int i, double g)
Definition: Bias.h:56
static void registerKeywords(Keywords &)
Definition: Bias.cpp:38
This is the abstract base class to use for implementing new simulation biases, within it there is inf...
Definition: Bias.h:40