Skip to content
Snippets Groups Projects
Commit eb649c59 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Added total bias

A component called "bias" is needed for replica exchange to work properly
parent 6df4916d
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,7 @@ void BiasValue::registerKeywords(Keywords& keys){
"these quantities will named with the arguments of the bias followed by "
"the character string _bias. These quantities tell the user how much the bias is "
"due to each of the colvars.");
keys.addOutputComponent("bias","default","total bias");
}
BiasValue::BiasValue(const ActionOptions&ao):
......@@ -112,15 +113,19 @@ PLUMED_BIAS_INIT(ao)
// ss=getPntrToArgument(i)->getName()+"_bias";
addComponent(ss); componentIsNotPeriodic(ss);
}
addComponent("bias"); componentIsNotPeriodic("bias");
}
void BiasValue::calculate(){
double bias=0.0;
for(unsigned i=0;i< getNumberOfArguments() ;++i){
double val; val=getArgument(i);
// log<<"BIAS "<<val<<"\n";
getPntrToComponent(i)->set(val);
setOutputForce(i,-1.);
bias+=val;
}
getPntrToComponent(getNumberOfArguments())->set(bias);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment