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

Merge branch 'master' of git.assembla.com:plumed2

parents 3069a0a3 657b42a8
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,8 @@ nframes(0) ...@@ -56,6 +56,8 @@ nframes(0)
// open the file // open the file
FILE* fp=fopen(reference.c_str(),"r"); FILE* fp=fopen(reference.c_str(),"r");
unsigned nat=0;
std::vector<AtomNumber> aaa;
if (fp!=NULL) if (fp!=NULL)
{ {
log<<"Opening reference file "<<reference.c_str()<<"\n"; log<<"Opening reference file "<<reference.c_str()<<"\n";
...@@ -66,6 +68,11 @@ nframes(0) ...@@ -66,6 +68,11 @@ nframes(0)
do_read=mypdb.readFromFilepointer(fp,plumed.getAtoms().usingNaturalUnits(),0.1/atoms.getUnits().getLength()); do_read=mypdb.readFromFilepointer(fp,plumed.getAtoms().usingNaturalUnits(),0.1/atoms.getUnits().getLength());
if(do_read){ if(do_read){
nframes++; nframes++;
if(mypdb.getAtomNumbers().size()==0) error("number of atoms in a frame should be more than zero");
if(nat==0) 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");
log<<"Found PDB: "<<nframes<<" containing "<<mypdb.getAtomNumbers().size()<<" atoms\n"; log<<"Found PDB: "<<nframes<<" containing "<<mypdb.getAtomNumbers().size()<<" atoms\n";
pdbv.push_back(mypdb); pdbv.push_back(mypdb);
// requestAtoms(mypdb.getAtomNumbers()); // is done in non base classes // requestAtoms(mypdb.getAtomNumbers()); // is done in non base classes
...@@ -78,6 +85,7 @@ nframes(0) ...@@ -78,6 +85,7 @@ nframes(0)
} }
fclose (fp); fclose (fp);
log<<"Found TOTAL "<<nframes<< " PDB in the file "<<reference.c_str()<<" \n"; log<<"Found TOTAL "<<nframes<< " PDB in the file "<<reference.c_str()<<" \n";
if(nframes==0) error("at least one frame expected");
} }
if(neigh_stride>0. || neigh_size>0){ if(neigh_stride>0. || neigh_size>0){
if(neigh_size>nframes){ if(neigh_size>nframes){
......
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