160 if ( reload )
NAMD_die(
"Molecular structure reloading not supported for Amber input files.\n");
162 molInfoFilename = parmFilename;
171 molecule =
new Molecule(simParameters, parameters, amber);
172 if (coorFilename != NULL)
173 pdb =
new PDB(coorFilename->
data,amber);
177 NAMD_die(
"Failed to read AMBER parm file!");
181 if ( reload )
NAMD_die(
"Molecular structure reloading not supported for Gromacs input files.\n");
183 molInfoFilename = topFilename;
191 if (coorFilename != NULL)
192 pdb =
new PDB(coorFilename->
data,gromacsFile);
194 molecule =
new Molecule(simParameters, parameters, gromacsFile);
206 #ifdef MEM_OPT_VERSION
207 NAMD_die(
"Using plugin IO is not supported in memory optimized version!");
210 NAMD_bug(
"NamdState::loadStructure pdbFilename non-null with usePluginIO\n");
215 iout <<
iWARN <<
"Plugin-based I/O is still in development and may still have bugs\n" <<
endi;
217 molfile_plugin_t *pIOHandle = pIOMgr->
getPlugin();
218 if (pIOHandle == NULL) {
219 NAMD_die(
"ERROR: Failed to match requested plugin type");
221 if ( pIOHandle->open_file_read == NULL )
222 NAMD_die(
"ERROR: Selected plugin type cannot open files");
223 if ( pIOHandle->read_structure == NULL )
224 NAMD_die(
"ERROR: Selected plugin type cannot read structures");
225 if ( pIOHandle->read_next_timestep == NULL )
226 NAMD_die(
"ERROR: Selected plugin type cannot read coordinates");
229 molInfoFilename = moleculeFilename;
230 if ( ! molFilename ) molFilename = moleculeFilename->
data;
235 parameters =
new Parameters(simParameters, parameterFilename);
241 void *plgFile = pIOHandle->open_file_read(molFilename,
242 pIOHandle->name, &numAtoms);
243 if(plgFile == NULL) {
244 NAMD_die(
"ERROR: Opening structure file failed!");
247 double fileReadTime = CmiWallTimer();
248 molecule =
new Molecule(simParameters, parameters, pIOHandle, plgFile, numAtoms);
249 iout <<
iINFO <<
"TIME FOR LOAD MOLECULE STRUCTURE INFORMATION: " << CmiWallTimer() - fileReadTime <<
"\n" <<
endi;
253 fileReadTime = CmiWallTimer();
259 iout <<
iINFO <<
"TIME FOR LOADING ATOMS' COORDINATES INFORMATION: " << CmiWallTimer() - fileReadTime <<
"\n" <<
endi;
262 pIOHandle->close_file_read(plgFile);
269 molInfoFilename = moleculeFilename;
270 if ( ! molFilename ) molFilename = moleculeFilename->
data;
275 parameters =
new Parameters(simParameters, parameterFilename);
281 double fileReadTime = CmiWallTimer();
282 molecule =
new Molecule(simParameters, parameters, (
char*)molFilename, configList);
283 iout <<
iINFO <<
"TIME FOR READING PSF FILE: " << CmiWallTimer() - fileReadTime <<
"\n" <<
endi;
288 #ifdef MEM_OPT_VERSION
294 int numprocs = estval>>26;
297 }
else if(numprocs>CkNumPes()){
304 long estval = (
sizeof(
Vector)*2)*((long)(numatoms));
305 int numprocs = estval>>26;
308 }
else if(numprocs>CkNumPes()){
319 double fileReadTime = CmiWallTimer();
320 molecule->load_fixed_atoms(configList->
find(
"fixedAtomListFile"));
321 iout <<
iINFO <<
"TIME FOR READING FIXED ATOMS FILE: " << CmiWallTimer() - fileReadTime <<
"\n" <<
endi;
325 double fileReadTime = CmiWallTimer();
326 molecule->load_constrained_atoms(configList->
find(
"consAtomListFile"));
327 iout <<
iINFO <<
"TIME FOR READING CONSTRAINED ATOMS FILE: " << CmiWallTimer() - fileReadTime <<
"\n" <<
endi;
338 double fileReadTime = CmiWallTimer();
340 iout <<
"Finished compressing molecule information, which takes " << CmiWallTimer()-fileReadTime <<
"(s)\n"<<
endi;
350 double fileReadTime = CmiWallTimer();
352 iout <<
iINFO <<
"Reading pdb file " << pdbFilename <<
"\n" <<
endi;
353 pdb =
new PDB(pdbFilename);
355 coordinateFilename = configList->
find(
"coordinates");
356 if (coordinateFilename != NULL) {
357 iout <<
iINFO <<
"Reading pdb file " << coordinateFilename->
data <<
"\n" <<
endi;
358 pdb =
new PDB(coordinateFilename->
data);
362 NAMD_die(
"Number of pdb and psf atoms are not the same!");
364 iout <<
iINFO <<
"TIME FOR READING PDB FILE: " << CmiWallTimer() - fileReadTime <<
"\n" <<
endi;
374 if (coordinateFilename != NULL) {
375 if(strcasecmp(coordinateFilename->
data, consRefFile->
data)==0)
377 if(strcasecmp(coordinateFilename->
data, consKFile->
data)==0)
382 configList->
find(
"conskcol"),
389 if (simParameters->
stirOn)
394 configList->
find(
"stirredAtomsCol"),
400 #ifndef MEM_OPT_VERSION
404 configList->
find(
"fixedatomscol"),
414 configList->
find(
"gridforcecol"),
415 configList->
find(
"gridforcechargecol"),
416 configList->
find(
"gridforcepotfile"),
424 char *filename = NULL;
425 if (configList->
find(
"consforcefile"))
426 filename = configList->
find(
"consforcefile")->
data;
432 configList->
find(
"excludeFromPressureFile"),
433 configList->
find(
"excludeFromPressureCol"),
440 configList->
find(
"movDragCol"),
441 configList->
find(
"movDragVelFile"),
449 configList->
find(
"rotDragCol"),
450 configList->
find(
"rotDragAxisFile"),
451 configList->
find(
"rotDragPivotFile"),
452 configList->
find(
"rotDragVelFile"),
453 configList->
find(
"rotDragVelCol"),
461 configList->
find(
"consTorqueCol"),
462 configList->
find(
"consTorqueAxisFile"),
463 configList->
find(
"consTorquePivotFile"),
464 configList->
find(
"consTorqueValFile"),
465 configList->
find(
"consTorqueValCol"),
470 #ifndef MEM_OPT_VERSION
477 configList->
find(
"langevincol"),
491 configList->
find(
"tcouplecol"),
498 if (simParameters->
alchOn) {
500 configList->
find(
"alchcol"), pdb, NULL,
"alch" );
503 if (configList->
find(
"unperturbedBondFile") == NULL) {
504 NAMD_die(
"Input file for Shobana's bond terms is required with sdScaling on");
511 if (simParameters->
lesOn) {
512 if (simParameters->
alchOn)
NAMD_bug(
"FEP/TI and LES are incompatible!");
514 configList->
find(
"lescol"), pdb, NULL,
"les");
518 configList->
find(
"soluteScalingCol"), pdb, NULL);
522 configList->
find(
"pairInteractionCol"), pdb, NULL,
"pairInteraction");
526 configList->
find(
"pressureProfileAtomTypesCol"), pdb, NULL,
527 "pressureProfileAtomTypes");
530 #ifdef OPENATOM_VERSION
531 if (simParameters->openatomOn) {
532 molecules->build_qmmm_flags(configList->
find(
"openatomPdbFile",
533 configList->
find(
"openatomPdbCol"), pdb, NULL,
"openatomPdb")
539 #ifdef MEM_OPT_VERSION
540 NAMD_die(
"QM forces are not supported in memory-optimized builds.");
544 NAMD_die(
"QM forces are not compatible with CUDA at this time");
551 parameters, configList);
552 else if (pdbFilename)
554 parameters, configList);
557 parameters, configList);
569 #ifdef MEM_OPT_VERSION
570 NAMD_die(
"Go forces are not supported in memory-optimized builds.");
575 StringList *goStructureFilename = configList->
find(
"goCoordinates");
580 int goMethod = simParameters->
goMethod;
584 }
else if (goMethod == 2) {
587 }
else if (goMethod == 3) {
591 NAMD_die(
"Failed to read goMethod variable in NamdState.C");
597 #ifndef MEM_OPT_VERSION
598 iout <<
iINFO <<
"****************************\n";
599 iout << iINFO <<
"STRUCTURE SUMMARY:\n";
612 <<
" DIHEDRALS WITH MULTIPLE PERIODICITY (BASED ON PSF FILE)\n";
617 <<
" DIHEDRALS WITH MULTIPLE PERIODICITY IGNORED (BASED ON PSF FILE) \n";
619 <<
" CHARMM MULTIPLICITIES BASED ON PARAMETER FILE INFO! \n";
626 <<
" IMPROPERS WITH MULTIPLE PERIODICITY\n";
637 if (simParameters->
stirOn)
653 " RIGID BONDS BETWEEN FIXED ATOMS\n";
661 <<
" GRIDS ACTIVE\n";
666 if (simParameters->
alchOn) {
667 iout << iINFO <<
"ALCH: "
669 " ATOMS TO DISAPPEAR IN FINAL STATE\n";
670 iout << iINFO <<
"ALCH: "
672 " ATOMS TO APPEAR IN FINAL STATE\n";
674 iout <<
iWARN <<
"ALCH: SUSPICIOUS BONDS BETWEEN INITIAL AND " <<
675 "FINAL GROUPS WERE FOUND" <<
"\n" <<
endi;
678 iout << iINFO <<
"ALCH: "
680 " ANGLES LINKING INITIAL AND FINAL ATOMS DELETED\n";
683 iout << iINFO <<
"ALCH: "
685 " DIHEDRALS LINKING INITIAL AND FINAL ATOMS DELETED\n";
688 iout << iINFO <<
"ALCH: "
690 " IMPROPERS LINKING INITIAL AND FINAL ATOMS DELETED\n";
695 if (simParameters->
lesOn) {
697 " LOCALLY ENHANCED ATOMS ENABLED\n";
701 iout << iINFO <<
" SOLUTE SCALING ENABLED\n";
705 iout << iINFO <<
"PAIR INTERACTION GROUP 1 CONTAINS "
708 iout << iINFO <<
"PAIR INTERACTION GROUP 2 CONTAINS "
721 <<
" DEGREES OF FREEDOM\n";
725 iout << iINFO << g_com <<
" DRUDE COM DEGREES OF FREEDOM\n";
726 iout << iINFO << g_bond <<
" DRUDE BOND DEGREES OF FREEDOM\n";
733 int64 numDegFreedom = 3 * numAtoms;
736 if ( numFixedAtoms ) numDegFreedom -= 3 * numFixedAtoms;
741 if (numLonepairs) numDegFreedom -= 3 * numLonepairs;
746 numDegFreedom -= ( numRigidBonds - numFixedRigidBonds - numLonepairs);
747 iout << iINFO << numDegFreedom <<
" DEGREES OF FREEDOM\n";
753 <<
" ATOMS IN LARGEST HYDROGEN GROUP\n";
756 <<
" ATOMS IN LARGEST MIGRATION GROUP\n";
760 " HYDROGEN GROUPS WITH ALL ATOMS FIXED\n";
767 for ( i = 0; i < molecule->
numAtoms; ++i ) {
771 iout << iINFO <<
"TOTAL MASS = " << totalMass <<
" amu\n";
772 iout << iINFO <<
"TOTAL CHARGE = " << totalCharge <<
" e\n";
776 iout << iINFO <<
"MASS DENSITY = "
777 << ((totalMass/volume) / 0.6022) <<
" g/cm^3\n";
778 iout << iINFO <<
"ATOM DENSITY = "
779 << (molecule->
numAtoms/volume) <<
" atoms/A^3\n";
783 iout << iINFO <<
"*****************************\n";
787 StringList *binCoordinateFilename = configList->
find(
"bincoordinates");
788 if ( binCoordinateFilename && ! reload ) {
792 DebugM(4,
"::configFileInit() - printing Molecule Information\n");
800 DebugM(4,
"::configFileInit() - done printing Molecule Information\n");
801 DebugM(1,
"::configFileInit() - done\n");
void build_gridforce_params(StringList *, StringList *, StringList *, StringList *, PDB *, char *)
std::ostream & iINFO(std::ostream &s)
void print_bonds(Parameters *)
void build_extra_bonds(Parameters *parameters, StringList *file)
molfile_plugin_t * getPlugin()
static void exit(int status=0)
std::ostream & iWARN(std::ostream &s)
void build_go_arrays(StringList *, char *)
int64_t num_deg_freedom(int isInitialReport=0) const
void print_param_summary()
void build_langevin_params(BigReal coupling, BigReal drudeCoupling, Bool doHydrogen)
int numLonepairs
Number of lone pairs.
const float * getBFactorData()
void NAMD_bug(const char *err_msg)
void build_constraint_params(StringList *, StringList *, StringList *, PDB *, char *)
void build_constorque_params(StringList *, StringList *, StringList *, StringList *, StringList *, StringList *, PDB *, char *)
void set_qm_replaceAll(Bool newReplaceAll)
void prepare_qm(const char *pdbFileName, Parameters *params, ConfigList *cfgList)
void build_stirred_atoms(StringList *, StringList *, PDB *, char *)
const float * getOccupancyData()
void NAMD_die(const char *err_msg)
void build_ss_flags(const StringList *ssfile, const StringList *sscol, PDB *initial_pdb, const char *cwd)
void build_rotdrag_params(StringList *, StringList *, StringList *, StringList *, StringList *, StringList *, PDB *, char *)
BigReal volume(void) const
int maxMigrationGroupSize
void build_fep_flags(StringList *, StringList *, PDB *, char *, const char *)
void build_alch_unpert_bond_lists(char *)
void compress_molecule_info(Molecule *mol, char *psfFileName, Parameters *param, SimParameters *simParam, ConfigList *cfgList)
void build_fixed_atoms(StringList *, StringList *, PDB *, char *)
void compute_LJcorrection()
int pressureProfileAtomTypes
void print_atoms(Parameters *)
void build_go_sigmas(StringList *, char *)
Real atomcharge(int anum) const
void delete_alch_bonded(void)
StringList * find(const char *name) const
void build_exPressure_atoms(StringList *, StringList *, PDB *, char *)
void build_constant_forces(char *)
Real atommass(int anum) const
int numDrudeAtoms
Number of Drude particles.
infostream & endi(infostream &s)
void build_movdrag_params(StringList *, StringList *, StringList *, PDB *, char *)
char qmParamPDB[NAMD_FILENAME_BUFFER_SIZE]
void build_go_params(StringList *)
void build_go_sigmas2(StringList *, char *)