GOMC-WSU / GOMC

GOMC - GPU Optimized Monte Carlo is a parallel molecular simulation code designed for high-performance simulation of large systems
https://gomc-wsu.org
MIT License
76 stars 36 forks source link

"Error: Molecule not found in PDB file. Exiting." when simulating two atoms (different site types) #45

Closed mostafa-razavi closed 7 years ago

mostafa-razavi commented 7 years ago

I tried to run the attached NVT simulation of a box containing two atoms (one NE and one AR) but it gives the error "Error: Molecule not found in PDB file. Exiting."

NE_AR.zip

msoroush commented 7 years ago

Hi @mostafa-razavi, Thank you for reaching to us. There was a small issue with the logic of reading PDB and PSF file. In PDBSetub.cpp file, in Assign function we had to check the resName with currResname in addition to resNum and currRes. This fix would solve your issue for Single atom molecule.

For bigger molecule there was another issue regarding reading Bond, Angle, and Dihedral is PSFReading. The bug was it stuck to infinite loop due to logic that used in MolSetup.cpp file, ReadPSFBonds, ReadPSFAngles, ReadPSFDihedrals functions. In while loop we need to check the dummy to see if it reads correct value or not. In case of Bonds, Angles, and Dihedrals the dummy should be 2, 3, and 4 respectively. If it was other than that, it has to exit from loop.

These fixes are pushed to adsorption and bondsampling branch. Since you made your branch from bondsampling, please replace the following files (Coordinates.cpp, PDBSetup.cpp, PDBSetup.h, MolSetup.cpp) with yours.

Please try it and let us know if it solves your issue or not.