Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

NamdState Class Reference

#include <NamdState.h>

List of all members.

Public Member Functions

 NamdState (void)
 ~NamdState ()
int configFileInit (char *)
int configListInit (ConfigList *)
int status ()
void useController (Controller *controllerPtr)
void runController (void)

Friends

class Namd
class Node
class Controller
class ScriptTcl


Constructor & Destructor Documentation

NamdState::NamdState void   ) 
 

Definition at line 33 of file NamdState.C.

00034 {
00035     configList = NULL;
00036     simParameters = NULL;
00037     parameters = NULL;
00038     molecule = NULL;
00039     pdb = NULL;
00040 }

NamdState::~NamdState  )  [inline]
 

Definition at line 37 of file NamdState.h.

00037 {}


Member Function Documentation

int NamdState::configFileInit char *   ) 
 

int NamdState::configListInit ConfigList  ) 
 

Definition at line 85 of file NamdState.C.

References Molecule::alchDroppedAngles, Molecule::alchDroppedDihedrals, Molecule::alchDroppedImpropers, SimParameters::alchFepOn, SimParameters::alchOn, SimParameters::alchThermIntOn, SimParameters::amberOn, Ambertoppar, Molecule::atomcharge(), Molecule::atommass(), BigReal, Molecule::build_constant_forces(), Molecule::build_constorque_params(), Molecule::build_constraint_params(), Molecule::build_exPressure_atoms(), Molecule::build_extra_bonds(), Molecule::build_fep_flags(), Molecule::build_fixed_atoms(), Molecule::build_gridforce_params(), Molecule::build_langevin_params(), Molecule::build_movdrag_params(), Molecule::build_rotdrag_params(), Molecule::build_stirred_atoms(), SimParameters::comMove, compress_molecule_info(), SimParameters::consForceOn, SimParameters::consTorqueOn, SimParameters::constraintsOn, StringList::data, DebugM, Molecule::delete_alch_bonded(), SimParameters::drudeOn, SimParameters::excludeFromPressure, SimParameters::extraBondsOn, ConfigList::find(), SimParameters::fixedAtomsOn, Molecule::freeBFactorData(), Molecule::freeOccupancyData(), SimParameters::genCompressedPsf, Molecule::getBFactorData(), Molecule::getOccupancyData(), PluginIOMgr::getPlugin(), SimParameters::gromacsOn, iINFO(), iout, iWARN(), SimParameters::langevinDamping, SimParameters::langevinHydrogen, SimParameters::langevinOn, SimParameters::lattice, SimParameters::lesOn, SimParameters::mgridforceOn, SimParameters::minimizeCGOn, SimParameters::movDragOn, NAMD_bug(), NAMD_die(), PDB::num_atoms(), Molecule::num_deg_freedom(), Molecule::numAngles, Molecule::numAtoms, Molecule::numBonds, Molecule::numConsForce, Molecule::numConstraints, Molecule::numCrossterms, Molecule::numDihedrals, Molecule::numDrudeAtoms, Molecule::numExclusions, Molecule::numFepFinal, Molecule::numFepInitial, Molecule::numFixedAtoms, Molecule::numFixedGroups, Molecule::numFixedRigidBonds, Molecule::numGridforceGrids, Molecule::numHydrogenGroups, Molecule::numImpropers, Molecule::numLonepairs, Molecule::numMultipleDihedrals, Molecule::numMultipleImpropers, Molecule::numRigidBonds, Molecule::numStirredAtoms, ConfigList::okay(), SimParameters::pairInteractionOn, SimParameters::pairInteractionSelf, SimParameters::paraTypeCharmmOn, SimParameters::paraTypeXplorOn, SimParameters::pressureProfileAtomTypes, Molecule::print_atoms(), Molecule::print_bonds(), Molecule::print_exclusions(), Parameters::print_param_summary(), read_binary_coors(), parm::readparm(), SimParameters::rigidBonds, SimParameters::rotDragOn, SimParameters::stirOn, Molecule::suspiciousAlchBonds, SimParameters::tCoupleOn, SimParameters::useCompressedPsf, SimParameters::usePluginIO, SimParameters::vdwscale14, and Lattice::volume().

00085                                                  {
00086   configList = cfgList;
00087   if (!configList->okay()) {
00088     NAMD_die("Simulation config file is incomplete or contains errors.");
00089   }
00090   DebugM(1,"NamdState::configFileInit configList okay\n");
00091 
00092   char *currentdir = 0;
00093   simParameters =  new SimParameters(configList,currentdir);
00094   fflush(stdout);
00095   lattice = simParameters->lattice;
00096 
00097   StringList *molInfoFilename;
00098   // If it's AMBER force field, read the AMBER style files;
00099   // if it's GROMACS, read the GROMACS files;
00100   // Otherwise read the CHARMM style files
00101 
00102   if (simParameters->amberOn)
00103   { StringList *parmFilename = configList->find("parmfile");
00104     molInfoFilename = parmFilename;
00105     StringList *coorFilename = configList->find("ambercoor");
00106     // "amber" is a temporary data structure, which records all
00107     // the data from the parm file. After copying them into
00108     // molecule, parameter and pdb structures, it will be deleted.
00109     Ambertoppar *amber;
00110     amber = new Ambertoppar;
00111     if (amber->readparm(parmFilename->data))
00112     { parameters = new Parameters(amber, simParameters->vdwscale14);
00113       molecule = new Molecule(simParameters, parameters, amber);
00114       if (coorFilename != NULL)
00115         pdb = new PDB(coorFilename->data,amber);
00116       delete amber;
00117     }
00118     else
00119       NAMD_die("Failed to read AMBER parm file!");
00120     parameters->print_param_summary();
00121   }
00122   else if (simParameters->gromacsOn) {
00123     StringList *topFilename = configList->find("grotopfile");
00124     molInfoFilename = topFilename;
00125     StringList *coorFilename = configList->find("grocoorfile");
00126     // "gromacsFile" is a temporary data structure, which records all
00127     // the data from the topology file. After copying it into the
00128     // molecule and parameter and pdb, it will be deleted.
00129     GromacsTopFile *gromacsFile;
00130     gromacsFile = new GromacsTopFile(topFilename->data);
00131     parameters = new Parameters(gromacsFile,simParameters->minimizeCGOn);
00132     if (coorFilename != NULL)
00133       pdb = new PDB(coorFilename->data,gromacsFile);
00134 
00135     molecule = new Molecule(simParameters, parameters, gromacsFile);
00136     // XXX does Molecule(needAll,these,arguments)?
00137 
00138     delete gromacsFile; // XXX unimplemented
00139 
00140     // XXX add error handling when the file doesn't exist
00141     // XXX make sure the right things happen when the parameters are
00142     // not even specified.
00143     // NAMD_die("Failed to read AMBER parm file!");
00144     parameters->print_param_summary();
00145   }
00146   else if (simParameters->usePluginIO){
00147     if(simParameters->useCompressedPsf) {
00148         NAMD_die("Compressed psf file is not supported currently when using plugin IO");
00149     }
00150     PluginIOMgr *pIOMgr = new PluginIOMgr();
00151     
00152     iout << iWARN << "Plugin-based I/O is still in development and may still have bugs" << endl;
00153 
00154     molfile_plugin_t *pIOHandle = pIOMgr->getPlugin();
00155     if (pIOHandle == NULL) {
00156         NAMD_die("ERROR: Failed to match requested plugin type");
00157     }
00158     if ( pIOHandle->open_file_read == NULL )
00159        NAMD_die("ERROR: Selected plugin type cannot open files"); 
00160     if ( pIOHandle->read_structure == NULL )
00161        NAMD_die("ERROR: Selected plugin type cannot read structures"); 
00162     if ( pIOHandle->read_next_timestep == NULL )
00163        NAMD_die("ERROR: Selected plugin type cannot read coordinates"); 
00164 
00165     StringList *moleculeFilename = configList->find("structure");
00166     molInfoFilename = moleculeFilename;
00167     StringList *parameterFilename = configList->find("parameters");
00168     //****** BEGIN CHARMM/XPLOR type changes
00169     // For AMBER use different constructor based on parm_struct!!!  -JCP
00170     parameters = new Parameters(simParameters, parameterFilename);
00171     parameters->print_param_summary();
00172 
00173     int numAtoms = 0;
00174     //TODO: not sure about the name field in the handler
00175     void *plgFile = pIOHandle->open_file_read(moleculeFilename->data, 
00176                                               pIOHandle->name, &numAtoms);
00177     if(plgFile ==  NULL) {
00178         NAMD_die("ERROR: Opening structure file failed!");
00179     }
00180 
00181     double fileReadTime = CmiWallTimer();
00182     molecule = new Molecule(simParameters, parameters, pIOHandle, plgFile, numAtoms);
00183     iout << iINFO << "TIME FOR LOAD MOLECULE STRUCTURE INFORMATION: " << CmiWallTimer() - fileReadTime << "\n" << endi;
00184 
00185     /* If we are only generating compressed molecule information, the PDB object is not needed */
00186     if(!simParameters->genCompressedPsf) {        
00187         fileReadTime = CmiWallTimer();
00188         //get the occupancy data from the Molecule object and then free it
00189         //as it is stored in the Molecule object.
00190         pdb = new PDB(pIOHandle, plgFile, molecule->numAtoms, molecule->getOccupancyData(), molecule->getBFactorData());
00191         molecule->freeOccupancyData();
00192         molecule->freeBFactorData();
00193         iout << iINFO << "TIME FOR LOADING ATOMS' COORDINATES INFORMATION: " << CmiWallTimer() - fileReadTime << "\n" << endi;
00194     }
00195 
00196     pIOHandle->close_file_read(plgFile);
00197     delete pIOMgr;
00198   }
00199   else
00200   { StringList *moleculeFilename = configList->find("structure");
00201     molInfoFilename = moleculeFilename; 
00202     StringList *parameterFilename = configList->find("parameters");
00203     //****** BEGIN CHARMM/XPLOR type changes
00204     // For AMBER use different constructor based on parm_struct!!!  -JCP
00205     parameters = new Parameters(simParameters, parameterFilename);
00206     //****** END CHARMM/XPLOR type changes    
00207 
00208     parameters->print_param_summary();
00209 
00210     double fileReadTime = CmiWallTimer();
00211     molecule = new Molecule(simParameters, parameters, moleculeFilename->data, configList);
00212     iout << iINFO << "TIME FOR READING PSF FILE: " << CmiWallTimer() - fileReadTime << "\n" << endi;    
00213   }
00214   fflush(stdout);
00215 
00216   if (simParameters->extraBondsOn) {        
00217     //The extra bonds building will be executed in read_compressed_psf in
00218     //the memory optimized version, so avoid calling this function in the 
00219     //memory optimized run.
00220     if(!simParameters->useCompressedPsf)
00221       molecule->build_extra_bonds(parameters, configList->find("extraBondsFile"));         
00222   }
00223   if(simParameters->genCompressedPsf) {
00224     #ifdef MEM_OPT_VERSION
00225       iout << "In the memory optimized version, the compression of molecule information is not supported! "
00226               << "Please use the non-memory optimized version.\n" <<endi;
00227     #else
00228       double fileReadTime = CmiWallTimer();
00229       compress_molecule_info(molecule, molInfoFilename->data, parameters, simParameters, configList);
00230       iout << "Finished compressing molecule information, which takes " << CmiWallTimer()-fileReadTime <<"(s)\n"<<endi;
00231     #endif
00232       CkExit();
00233   }
00234 
00235   //If using plugin-based IO, the PDB object is already created!
00236   StringList *coordinateFilename = NULL;
00237   if(!simParameters->usePluginIO) {
00238       coordinateFilename = configList->find("coordinates");
00239     
00240       double fileReadTime = CmiWallTimer();
00241     #ifdef MEM_OPT_VERSION
00242       if (coordinateFilename != NULL)
00243         pdb = new PDB(coordinateFilename->data, molecule->numAtoms);
00244     #else
00245       if (coordinateFilename != NULL)
00246         pdb = new PDB(coordinateFilename->data);
00247       if (pdb->num_atoms() != molecule->numAtoms) {
00248         NAMD_die("Number of pdb and psf atoms are not the same!");
00249       }
00250     #endif
00251       iout << iINFO << "TIME FOR READING PDB FILE: " << CmiWallTimer() - fileReadTime << "\n" << endi;
00252       iout << iINFO << "\n" << endi;
00253   }
00254 
00255   StringList *binCoordinateFilename = configList->find("bincoordinates");
00256   if ( binCoordinateFilename ) {
00257     read_binary_coors(binCoordinateFilename->data, pdb);
00258   }
00259   
00260 
00261         //  If constraints are active, build the parameters necessary
00262         if (simParameters->constraintsOn)
00263         {
00264            StringList *consRefFile = configList->find("consref");
00265            StringList *consKFile = configList->find("conskfile");
00266 
00267           if (coordinateFilename != NULL) {
00268            if(strcasecmp(coordinateFilename->data, consRefFile->data)==0)
00269                 consRefFile = NULL;
00270            if(strcasecmp(coordinateFilename->data, consKFile->data)==0)
00271                 consKFile = NULL;
00272           }
00273 
00274            molecule->build_constraint_params(consRefFile, consKFile,
00275                                              configList->find("conskcol"),
00276                                              pdb,
00277                                              NULL);
00278         }
00279         //CkPrintf ("DEBUG--check if StirOn to build stir params..\n");
00280         if (simParameters->stirOn)
00281         {       
00282         //CkPrintf ("DEBUG--now to build stir params..\n");
00283           
00284            molecule->build_stirred_atoms(configList->find("stirFilename"),
00285                                        configList->find("stirredAtomsCol"),
00286                                        pdb,
00287                                        NULL);
00288         }
00289 
00290         /*if (simParameters->extraBondsOn) {
00291        #ifdef MEM_OPT_VERSION
00292        iout << "Information about the extra bonds have been already integrated into the compressed psf file!\n" <<endi;
00293        #else
00294            molecule->build_extra_bonds(parameters,
00295                                 configList->find("extraBondsFile"));
00296        #endif
00297         }*/
00298         
00299         if (simParameters->fixedAtomsOn)
00300         {
00301            molecule->build_fixed_atoms(configList->find("fixedatomsfile"),
00302                                         configList->find("fixedatomscol"),
00303                                         pdb,
00304                                         NULL);
00305         }
00306         
00307         /* BEGIN gf */
00308         if (simParameters->mgridforceOn)
00309         {
00310             molecule->build_gridforce_params(configList->find("gridforcefile"),
00311                                              configList->find("gridforcecol"),
00312                                              configList->find("gridforcechargecol"),
00313                                              configList->find("gridforcepotfile"),
00314                                              pdb,
00315                                              NULL);
00316         }
00317         /* END gf */
00318 
00319         // If constant forces are active, read the forces necessary
00320         if (simParameters->consForceOn) {
00321     char *filename = NULL;
00322     if (configList->find("consforcefile"))
00323       filename = configList->find("consforcefile")->data;
00324     molecule->build_constant_forces(filename);
00325   }
00326 
00327         if (simParameters->excludeFromPressure) {
00328            molecule->build_exPressure_atoms(
00329              configList->find("excludeFromPressureFile"),
00330              configList->find("excludeFromPressureCol"),
00331              pdb, NULL);
00332         }
00333 
00334         // If moving drag is active, build the parameters necessary
00335         if (simParameters->movDragOn) {
00336           molecule->build_movdrag_params(configList->find("movDragFile"),
00337                                          configList->find("movDragCol"),
00338                                          configList->find("movDragVelFile"),
00339                                          pdb,
00340                                          NULL);
00341         }
00342 
00343         // If rotating drag is active, build the parameters necessary
00344         if (simParameters->rotDragOn) {
00345           molecule->build_rotdrag_params(configList->find("rotDragFile"),
00346                                          configList->find("rotDragCol"),
00347                                          configList->find("rotDragAxisFile"),
00348                                          configList->find("rotDragPivotFile"),
00349                                          configList->find("rotDragVelFile"),
00350                                          configList->find("rotDragVelCol"),
00351                                          pdb,
00352                                          NULL);
00353         }
00354 
00355         // If "constant" torque is active, build the parameters necessary
00356         if (simParameters->consTorqueOn) {
00357           molecule->build_constorque_params(configList->find("consTorqueFile"),
00358                                        configList->find("consTorqueCol"),
00359                                        configList->find("consTorqueAxisFile"),
00360                                        configList->find("consTorquePivotFile"),
00361                                        configList->find("consTorqueValFile"),
00362                                        configList->find("consTorqueValCol"),
00363                                        pdb,
00364                                        NULL);
00365         }
00366 
00367         //  If langevin dynamics or temperature coupling are active, build 
00368         //  the parameters necessary
00369         if (simParameters->langevinOn)
00370         {
00371           if (simParameters->langevinDamping == 0.0) {
00372             molecule->build_langevin_params(configList->find("langevinfile"),
00373                                             configList->find("langevincol"),
00374                                             pdb,
00375                                             NULL);
00376           } else {
00377             molecule->build_langevin_params(simParameters->langevinDamping,
00378                                             simParameters->langevinHydrogen);
00379           }
00380         }
00381         else if (simParameters->tCoupleOn)
00382         {
00383            //  Temperature coupling uses the same parameters, but with different
00384            //  names . . .
00385            molecule->build_langevin_params(configList->find("tcouplefile"),
00386                                             configList->find("tcouplecol"),
00387                                             pdb,
00388                                             NULL);
00389         }
00390 
00391 //Modifications for alchemical fep
00392      //identify the mutant atoms for fep simulation
00393         if (simParameters->alchOn) {
00394            molecule->build_fep_flags(configList->find("alchfile"),
00395                 configList->find("alchcol"), pdb, NULL);
00396 #ifndef MEM_OPT_VERSION
00397            molecule->delete_alch_bonded();
00398 #else
00399            iout << iWARN << "ALCH: AUTOMATIC DELETION OF BONDED INTERACTIONS "
00400            << "BETWEEN INITIAL AND FINAL GROUPS IS NOT SUPPORTED IN MEMORY "
00401            << "OPTIMISED VERSION - MANUAL PROCESSING IS NECESSARY\n" << endi;
00402 #endif
00403         }
00404 //fepe
00405         if (simParameters->lesOn) {
00406            if (simParameters->alchFepOn || simParameters->alchThermIntOn) NAMD_bug("FEP/TI and LES are incompatible!");
00407            molecule->build_fep_flags(configList->find("lesfile"),
00408                 configList->find("lescol"), pdb, NULL);
00409         }
00410         if (simParameters->pairInteractionOn) {
00411            molecule->build_fep_flags(configList->find("pairInteractionFile"),
00412                 configList->find("pairInteractionCol"), pdb, NULL);
00413         }      
00414         if (simParameters->pressureProfileAtomTypes > 1) {
00415           molecule->build_fep_flags(configList->find("pressureProfileAtomTypesFile"),
00416                 configList->find("pressureProfileAtomTypesCol"), pdb, NULL);
00417         }
00418 
00419         iout << iINFO << "****************************\n";
00420         iout << iINFO << "STRUCTURE SUMMARY:\n";
00421         iout << iINFO << molecule->numAtoms << " ATOMS\n";
00422         iout << iINFO << molecule->numBonds << " BONDS\n";
00423         iout << iINFO << molecule->numAngles << " ANGLES\n";
00424         iout << iINFO << molecule->numDihedrals << " DIHEDRALS\n";
00425         iout << iINFO << molecule->numImpropers << " IMPROPERS\n";
00426         iout << iINFO << molecule->numCrossterms << " CROSSTERMS\n";
00427         iout << iINFO << molecule->numExclusions << " EXCLUSIONS\n";
00428 
00429         //****** BEGIN CHARMM/XPLOR type changes
00430         if ((molecule->numMultipleDihedrals) && (simParameters->paraTypeXplorOn))
00431         {
00432                 iout << iINFO << molecule->numMultipleDihedrals 
00433              << " DIHEDRALS WITH MULTIPLE PERIODICITY (BASED ON PSF FILE)\n";
00434         }
00435         if ((molecule->numMultipleDihedrals) && (simParameters->paraTypeCharmmOn))
00436         {
00437                 iout << iINFO << molecule->numMultipleDihedrals 
00438          << " DIHEDRALS WITH MULTIPLE PERIODICITY IGNORED (BASED ON PSF FILE) \n";
00439                 iout << iINFO  
00440          << " CHARMM MULTIPLICITIES BASED ON PARAMETER FILE INFO! \n";
00441         }
00442         //****** END CHARMM/XPLOR type changes
00443 
00444         if (molecule->numMultipleImpropers)
00445         {
00446                 iout << iINFO << molecule->numMultipleImpropers 
00447                          << " IMPROPERS WITH MULTIPLE PERIODICITY\n";
00448         }
00449         
00450         if (simParameters->constraintsOn)
00451         {
00452            iout << iINFO << molecule->numConstraints << " CONSTRAINTS\n";
00453         }
00454 
00455         if (simParameters->consForceOn)
00456           iout << iINFO << molecule->numConsForce << " CONSTANT FORCES\n";
00457 
00458         if (simParameters->stirOn)
00459           iout << iINFO << molecule->numStirredAtoms << " STIRRED ATOMS\n";
00460 
00461         if (simParameters->fixedAtomsOn)
00462         {
00463            iout << iINFO << molecule->numFixedAtoms << " FIXED ATOMS\n";
00464         }
00465 
00466         if (simParameters->rigidBonds)
00467         {
00468            iout << iINFO << molecule->numRigidBonds << " RIGID BONDS\n";
00469         }
00470 
00471         if (simParameters->fixedAtomsOn && simParameters->rigidBonds)
00472         {
00473            iout << iINFO << molecule->numFixedRigidBonds <<
00474                         " RIGID BONDS BETWEEN FIXED ATOMS\n";
00475         }
00476         
00477         /* BEGIN gf */
00478         if (simParameters->mgridforceOn)
00479         {
00480             int i;
00481             iout << iINFO << molecule->numGridforceGrids 
00482                  << " GRIDS ACTIVE\n";
00483         }
00484         /* END gf */
00485 
00486 //Modifications for alchemical fep
00487         if (simParameters->alchFepOn || simParameters->alchThermIntOn) {
00488           iout << iINFO << "ALCH: " 
00489                << molecule->numFepInitial <<
00490                " ATOMS TO DISAPPEAR IN FINAL STATE\n";
00491            iout << iINFO << "ALCH: " 
00492                <<  molecule->numFepFinal <<
00493                " ATOMS TO APPEAR IN FINAL STATE\n";
00494            if (molecule->suspiciousAlchBonds) {
00495              iout << iWARN << "ALCH: SUSPICIOUS BONDS BETWEEN INITIAL AND " <<
00496              "FINAL GROUPS WERE FOUND" << "\n" << endi;
00497            }
00498            if (molecule->alchDroppedAngles) {
00499              iout << iINFO << "ALCH: " 
00500                  << molecule->alchDroppedAngles <<
00501                  " ANGLES LINKING INITIAL AND FINAL ATOMS DELETED\n";
00502            }
00503            if (molecule->alchDroppedDihedrals) {
00504              iout << iINFO << "ALCH: "
00505                  << molecule->alchDroppedDihedrals <<
00506                  " DIHEDRALS LINKING INITIAL AND FINAL ATOMS DELETED\n";
00507            }
00508            if (molecule->alchDroppedImpropers) {
00509              iout << iINFO << "ALCH: "
00510                  << molecule->alchDroppedImpropers <<
00511                  " IMPROPERS LINKING INITIAL AND FINAL ATOMS DELETED\n";
00512            }
00513         }
00514 //fepe
00515 
00516         if (simParameters->lesOn) {
00517            iout << iINFO << molecule->numFepInitial <<
00518                " LOCALLY ENHANCED ATOMS ENABLED\n";
00519         }
00520        
00521         if (simParameters->pairInteractionOn) {
00522            iout << iINFO << "PAIR INTERACTION GROUP 1 CONTAINS "
00523                 <<  molecule->numFepInitial << " ATOMS\n";
00524            if (!simParameters->pairInteractionSelf) {
00525              iout << iINFO << "PAIR INTERACTION GROUP 2 CONTAINS "
00526                   <<  molecule->numFepFinal << " ATOMS\n";
00527            }
00528         }
00529            
00530 #if 1
00531         if (molecule->numLonepairs != 0) {
00532           iout << iINFO << molecule->numLonepairs << " LONE PAIRS\n";
00533         }
00534         if (molecule->numDrudeAtoms != 0) {
00535           iout << iINFO << molecule->numDrudeAtoms << " DRUDE ATOMS\n";
00536         }
00537         iout << iINFO << molecule->num_deg_freedom(1)
00538              << " DEGREES OF FREEDOM\n";
00539         if (simParameters->drudeOn) {
00540           int g_bond = 3 * molecule->numDrudeAtoms;
00541           int g_com = molecule->num_deg_freedom(1) - g_bond;
00542           iout << iINFO << g_com << " DRUDE COM DEGREES OF FREEDOM\n";
00543           iout << iINFO << g_bond << " DRUDE BOND DEGREES OF FREEDOM\n";
00544         }
00545 #endif
00546 #if 0
00547         {
00548           // Copied from Controller::printEnergies()
00549           int numAtoms = molecule->numAtoms;
00550           int numDegFreedom = 3 * numAtoms;
00551     int numLonepairs = molecule->numLonepairs;
00552           int numFixedAtoms = molecule->numFixedAtoms;
00553           if ( numFixedAtoms ) numDegFreedom -= 3 * numFixedAtoms;
00554           if ( ! ( numFixedAtoms || molecule->numConstraints
00555                 || simParameters->comMove || simParameters->langevinOn ) ) {
00556             numDegFreedom -= 3;
00557           }
00558     if (numLonepairs) numDegFreedom -= 3 * numLonepairs;
00559           int numRigidBonds = molecule->numRigidBonds;
00560           int numFixedRigidBonds = molecule->numFixedRigidBonds;
00561     // numLonepairs is subtracted here because all lonepairs have a rigid bond
00562     // to oxygen, but all of the LP degrees of freedom are dealt with above
00563     numDegFreedom -= ( numRigidBonds - numFixedRigidBonds - numLonepairs);
00564           iout << iINFO << numDegFreedom << " DEGREES OF FREEDOM\n";
00565         }
00566 #endif
00567 
00568         iout << iINFO << molecule->numHydrogenGroups << " HYDROGEN GROUPS\n";
00569         if (simParameters->fixedAtomsOn)
00570         {
00571            iout << iINFO << molecule->numFixedGroups <<
00572                         " HYDROGEN GROUPS WITH ALL ATOMS FIXED\n";
00573         }
00574 
00575         {
00576           BigReal totalMass = 0;
00577           BigReal totalCharge = 0;
00578           int i;
00579           for ( i = 0; i < molecule->numAtoms; ++i ) {
00580             totalMass += molecule->atommass(i);
00581             totalCharge += molecule->atomcharge(i);
00582           }
00583           iout << iINFO << "TOTAL MASS = " << totalMass << " amu\n"; 
00584           iout << iINFO << "TOTAL CHARGE = " << totalCharge << " e\n"; 
00585 
00586           BigReal volume = lattice.volume();
00587           if ( volume ) {
00588             iout << iINFO << "MASS DENSITY = "
00589               << ((totalMass/volume) / 0.6022) << " g/cm^3\n";
00590             iout << iINFO << "ATOM DENSITY = "
00591               << (molecule->numAtoms/volume) << " atoms/A^3\n";
00592           }
00593         }
00594 
00595         iout << iINFO << "*****************************\n";
00596         iout << endi;
00597         fflush(stdout);
00598 
00599   DebugM(4, "::configFileInit() - printing Molecule Information\n");
00600 
00601   molecule->print_atoms(parameters);
00602   molecule->print_bonds(parameters);
00603   molecule->print_exclusions();
00604   fflush(stdout);
00605 
00606   DebugM(4, "::configFileInit() - done printing Molecule Information\n");
00607   DebugM(1, "::configFileInit() - done\n");
00608 
00609   return(0);
00610 }

void NamdState::runController void   ) 
 

Definition at line 78 of file NamdState.C.

References Controller::run().

Referenced by Node::run().

00079 {
00080   controller->run();
00081 }

int NamdState::status  ) 
 

Definition at line 43 of file NamdState.C.

References DebugM.

00044 {
00045     int ret=0;
00046     if (configList != NULL) {
00047       DebugM(1, "Config List exists\n");
00048     } else ret++;
00049 
00050     if (simParameters != NULL) {
00051       DebugM(1, "SimParameters exists\n");
00052     }
00053     else ret++;
00054 
00055     if (parameters != NULL) {
00056       DebugM(1,"Parameters exists\n");
00057     }
00058     else ret++;
00059 
00060     if (molecule != NULL) {
00061       DebugM(1, "Molecule exists\n");
00062     }
00063     else ret++;
00064 
00065     if (pdb != NULL) {
00066       DebugM(1,"PDB exists \n");
00067     }
00068     else ret++;
00069     
00070     return(ret);
00071 }

void NamdState::useController Controller controllerPtr  ) 
 

Definition at line 73 of file NamdState.C.

00074 {
00075   controller=controllerPtr;
00076 }


Friends And Related Function Documentation

friend class Controller [friend]
 

Definition at line 25 of file NamdState.h.

friend class Namd [friend]
 

Definition at line 23 of file NamdState.h.

friend class Node [friend]
 

Definition at line 24 of file NamdState.h.

friend class ScriptTcl [friend]
 

Definition at line 39 of file NamdState.h.


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 05:00:01 2009 for NAMD by  doxygen 1.3.9.1