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

cppcheck

(style) warnings
parent dbaf6790
No related branches found
No related tags found
No related merge requests found
......@@ -131,10 +131,9 @@ PLUMED_COLVAR_INIT(ao),squared(true)
// check the units for reading this file: how can they make sense?
do_read=mypdb.readFromFilepointer(fp,plumed.getAtoms().usingNaturalUnits(),0.1/atoms.getUnits().getLength());
if(do_read){
unsigned nat=0;
neigenvects++;
if(mypdb.getAtomNumbers().size()==0) error("number of atoms in a frame should be more than zero");
if(nat==0) nat=mypdb.getAtomNumbers().size();
unsigned nat=mypdb.getAtomNumbers().size();
if(nat!=mypdb.getAtomNumbers().size()) error("frames should have the same number of atoms");
if(aaa.empty()) aaa=mypdb.getAtomNumbers();
if(aaa!=mypdb.getAtomNumbers()) error("frames should contain same atoms in same order");
......
......@@ -136,7 +136,7 @@ void ActionAtomistic::calculateAtomicNumericalDerivatives( ActionWithValue* a, c
for(int j=0;j<nval;j++){
Value* v=a->copyOutput(j);
double ref=v->get();
if(v->hasDerivatives()>0){
if(v->hasDerivatives()){
for(int i=0;i<natoms;i++) for(int k=0;k<3;k++) {
double d=(value[j*natoms+i][k]-ref)/delta;
v->addDerivative(startnum+3*i+k,d);
......
......@@ -87,7 +87,7 @@ bool PointWiseMapping::mappingNeedsSetup() const {
inline
void PointWiseMapping::copyFrameDerivatives( const unsigned& from, const unsigned& to ){
plumed_dbg_assert( to>=frames.size()/2 & from<frames.size()/2 );
plumed_dbg_assert( to>=frames.size()/2 && from<frames.size()/2 );
frames[to]->copyDerivatives( frames[from] );
}
......
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