Skip to content
Snippets Groups Projects
Commit 29eb6605 authored by Gareth Tribello's avatar Gareth Tribello
Browse files

Made StoreCentralAtoms class slightly faster. Only slightly though

parent dbe6516a
No related branches found
No related tags found
No related merge requests found
......@@ -99,11 +99,15 @@ void StoreCentralAtomsVessel::chainRuleForCentralAtom( const unsigned& iatom, co
unsigned nder=3*mycolv->colvar_atoms[iatom].getNumberActive();
unsigned nder2=mycolv->getNumberOfDerivatives();
for(unsigned ider=0;ider<nder;++ider){
unsigned jder = iderno*nder2 + mycolv->getOutputDerivativeIndex( iatom, ider );
unsigned ibuf=start[iatom] + 1 + ider; double thisder=0.0;
for(unsigned jcomp=0;jcomp<3;++jcomp){
unsigned ibuf=start[iatom] + jcomp*(nder+1) + 1 + ider;
act->addElementDerivative( jder, df[jcomp]*getBufferElement(ibuf) );
thisder+=df[jcomp]*getBufferElement(ibuf);
ibuf+=(nder+1);
//unsigned ibuf=start[iatom] + jcomp*(nder+1) + 1 + ider;
//act->addElementDerivative( jder, df[jcomp]*getBufferElement(ibuf) );
}
unsigned jder = iderno*nder2 + mycolv->getOutputDerivativeIndex( iatom, ider );
act->addElementDerivative( jder, thisder );
}
}
......
......@@ -44,7 +44,7 @@ public:
/// This does the resizing of the buffer
void resize();
/// This does nothing
std::string description(){ return""; }
std::string description(){ return ""; }
/// This does nothing
void finish(){}
/// Add some force to the atoms
......
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