#include <Molecule.h>
|
||||||||||||
|
Definition at line 389 of file Molecule.C. References initialize(), and simParams. 00390 {
00391 initialize(simParams,param);
00392 }
|
|
||||||||||||||||||||
|
Definition at line 402 of file Molecule.C. References initialize(), SimParameters::LCPOOn, simParams, and SimParameters::useCompressedPsf. 00403 {
00404 initialize(simParams,param);
00405
00406 #ifdef MEM_OPT_VERSION
00407 if(simParams->useCompressedPsf)
00408 read_mol_signatures(filename, param, cfgList);
00409 #else
00410 read_psf_file(filename, param);
00411 //LCPO
00412 if (simParams->LCPOOn)
00413 assignLCPOTypes( 0 );
00414 #endif
00415 }
|
|
||||||||||||||||||||||||
|
Definition at line 424 of file Molecule.C. References initialize(), SimParameters::LCPOOn, NAMD_die(), numAngles, numAtoms, numBonds, numCrossterms, numDihedrals, numImpropers, numRealBonds, setBFactorData(), setOccupancyData(), and simParams. 00425 {
00426 #ifdef MEM_OPT_VERSION
00427 NAMD_die("Sorry, plugin IO is not supported in the memory optimized version.");
00428 #else
00429 initialize(simParams, param);
00430 numAtoms = natoms;
00431 int optflags = MOLFILE_BADOPTIONS;
00432 molfile_atom_t *atomarray = (molfile_atom_t *) malloc(natoms*sizeof(molfile_atom_t));
00433 memset(atomarray, 0, natoms*sizeof(molfile_atom_t));
00434
00435 //1a. read basic atoms information
00436 int rc = pIOHdl->read_structure(pIOFileHdl, &optflags, atomarray);
00437 if (rc != MOLFILE_SUCCESS && rc != MOLFILE_NOSTRUCTUREDATA) {
00438 free(atomarray);
00439 NAMD_die("ERROR: plugin failed reading structure data");
00440 }
00441 if(optflags == MOLFILE_BADOPTIONS) {
00442 free(atomarray);
00443 NAMD_die("ERROR: plugin didn't initialize optional data flags");
00444 }
00445 if(optflags & MOLFILE_OCCUPANCY) {
00446 setOccupancyData(atomarray);
00447 }
00448 if(optflags & MOLFILE_BFACTOR) {
00449 setBFactorData(atomarray);
00450 }
00451 //1b. load basic atoms information to the molecule object
00452 plgLoadAtomBasics(atomarray);
00453 free(atomarray);
00454
00455 //2a. read bonds
00456 //indices are one-based in read_bonds
00457 int *from, *to;
00458 float *bondorder;
00459 int *bondtype, nbondtypes;
00460 char **bondtypename;
00461 if(pIOHdl->read_bonds!=NULL) {
00462 if(pIOHdl->read_bonds(pIOFileHdl, &numBonds, &from, &to, &bondorder,
00463 &bondtype, &nbondtypes, &bondtypename)){
00464 NAMD_die("ERROR: failed reading bond information.");
00465 }
00466 }
00467 //2b. load bonds information to the molecule object
00468 if(numBonds!=0) {
00469 plgLoadBonds(from,to);
00470 }
00471
00472 //3a. read other bonded structures
00473 int *plgAngles, *plgDihedrals, *plgImpropers, *plgCterms;
00474 int ctermcols, ctermrows;
00475 int *angletypes, numangletypes, *dihedraltypes, numdihedraltypes;
00476 int *impropertypes, numimpropertypes;
00477 char **angletypenames, **dihedraltypenames, **impropertypenames;
00478
00479 plgAngles=plgDihedrals=plgImpropers=plgCterms=NULL;
00480 if(pIOHdl->read_angles!=NULL) {
00481 if(pIOHdl->read_angles(pIOFileHdl,
00482 &numAngles, &plgAngles,
00483 &angletypes, &numangletypes, &angletypenames,
00484 &numDihedrals, &plgDihedrals,
00485 &dihedraltypes, &numdihedraltypes, &dihedraltypenames,
00486 &numImpropers, &plgImpropers,
00487 &impropertypes, &numimpropertypes, &impropertypenames,
00488 &numCrossterms, &plgCterms, &ctermcols, &ctermrows)) {
00489 NAMD_die("ERROR: failed reading angle information.");
00490 }
00491 }
00492 //3b. load other bonded structures to the molecule object
00493 if(numAngles!=0) plgLoadAngles(plgAngles);
00494 if(numDihedrals!=0) plgLoadDihedrals(plgDihedrals);
00495 if(numImpropers!=0) plgLoadImpropers(plgImpropers);
00496 if(numCrossterms!=0) plgLoadCrossterms(plgCterms);
00497
00498 numRealBonds = numBonds;
00499 build_atom_status();
00500 //LCPO
00501 if (simParams->LCPOOn)
00502 assignLCPOTypes( 2 );
00503 #endif
00504 }
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
Definition at line 518 of file Molecule.C. 00519 {
00520 /* Check to see if each array was ever allocated. If it was */
00521 /* then free it */
00522 if (atoms != NULL)
00523 delete [] atoms;
00524
00525 if (atomNames != NULL)
00526 {
00527 // subarrarys allocated from arena - automatically deleted
00528 delete [] atomNames;
00529 }
00530 delete nameArena;
00531
00532 if (resLookup != NULL)
00533 delete resLookup;
00534
00535 // DRUDE: free arrays read from PSF
00536 if (drudeConsts != NULL) delete [] drudeConsts;
00537 if (lphosts != NULL) delete [] lphosts;
00538 if (anisos != NULL) delete [] anisos;
00539 if (tholes != NULL) delete [] tholes;
00540 if (lphostIndexes != NULL) delete [] lphostIndexes;
00541 // DRUDE
00542
00543 //LCPO
00544 if (lcpoParamType != NULL) delete [] lcpoParamType;
00545
00546 #ifdef MEM_OPT_VERSION
00547 if(eachAtomSig) delete [] eachAtomSig;
00548 if(atomSigPool) delete [] atomSigPool;
00549 #else
00550 if (bonds != NULL)
00551 delete [] bonds;
00552
00553 if (angles != NULL)
00554 delete [] angles;
00555
00556 if (dihedrals != NULL)
00557 delete [] dihedrals;
00558
00559 if (impropers != NULL)
00560 delete [] impropers;
00561
00562 if (crossterms != NULL)
00563 delete [] crossterms;
00564
00565 if (exclusions != NULL)
00566 delete [] exclusions;
00567 #endif
00568
00569 if (donors != NULL)
00570 delete [] donors;
00571
00572 if (acceptors != NULL)
00573 delete [] acceptors;
00574
00575 #ifdef MEM_OPT_VERSION
00576 if(exclSigPool) delete [] exclSigPool;
00577 if(exclChkSigPool) delete [] exclChkSigPool;
00578 if(eachAtomExclSig) delete [] eachAtomExclSig;
00579 if(fixedAtomsSet) delete fixedAtomsSet;
00580 if(constrainedAtomsSet) delete constrainedAtomsSet;
00581 #else
00582 if (bondsByAtom != NULL)
00583 delete [] bondsByAtom;
00584
00585 if (anglesByAtom != NULL)
00586 delete [] anglesByAtom;
00587
00588 if (dihedralsByAtom != NULL)
00589 delete [] dihedralsByAtom;
00590
00591 if (impropersByAtom != NULL)
00592 delete [] impropersByAtom;
00593
00594 if (crosstermsByAtom != NULL)
00595 delete [] crosstermsByAtom;
00596
00597 if (exclusionsByAtom != NULL)
00598 delete [] exclusionsByAtom;
00599
00600 if (fullExclusionsByAtom != NULL)
00601 delete [] fullExclusionsByAtom;
00602
00603 if (modExclusionsByAtom != NULL)
00604 delete [] modExclusionsByAtom;
00605
00606 if (all_exclusions != NULL)
00607 delete [] all_exclusions;
00608
00609 // DRUDE
00610 if (tholesByAtom != NULL)
00611 delete [] tholesByAtom;
00612 if (anisosByAtom != NULL)
00613 delete [] anisosByAtom;
00614 // DRUDE
00615 #endif
00616
00617 //LCPO
00618 if (lcpoParamType != NULL)
00619 delete [] lcpoParamType;
00620
00621 if (fixedAtomFlags != NULL)
00622 delete [] fixedAtomFlags;
00623
00624 if (stirIndexes != NULL)
00625 delete [] stirIndexes;
00626
00627
00628 #ifdef MEM_OPT_VERSION
00629 if(clusterSigs != NULL){
00630 delete [] clusterSigs;
00631 }
00632 #else
00633 if (cluster != NULL)
00634 delete [] cluster;
00635 #endif
00636 if (clusterSize != NULL)
00637 delete [] clusterSize;
00638
00639 if (exPressureAtomFlags != NULL)
00640 delete [] exPressureAtomFlags;
00641
00642 if (rigidBondLengths != NULL)
00643 delete [] rigidBondLengths;
00644
00645 //fepb
00646 if (fepAtomFlags != NULL)
00647 delete [] fepAtomFlags;
00648 //fepe
00649
00650
00651 #ifndef MEM_OPT_VERSION
00652 delete arena;
00653 delete exclArena;
00654 #endif
00655 }
|
|
|
Definition at line 777 of file Molecule.h. References Real. Referenced by NamdState::configListInit(), WorkDistrib::createAtomLists(), and Sequencer::reloadCharges(). 00778 {
00779 #ifdef MEM_OPT_VERSION
00780 return atomChargePool[eachAtomCharge[anum]];
00781 #else
00782 return(atoms[anum].charge);
00783 #endif
00784 }
|
|
|
Definition at line 767 of file Molecule.h. References Real. Referenced by colvarmodule::atom::atom(), NamdState::configListInit(), WorkDistrib::createAtomLists(), GlobalMasterFreeEnergy::getMass(), GlobalMasterEasy::getMass(), GlobalMaster::processData(), ComputeGlobal::recvResults(), Tcl_centerOfMass(), and Tcl_radiusOfGyration(). 00768 {
00769 #ifdef MEM_OPT_VERSION
00770 return atomMassPool[eachAtomMass[anum]];
00771 #else
00772 return(atoms[anum].mass);
00773 #endif
00774 }
|
|
||||||||||||
|
Definition at line 1545 of file GoMolecule.C. References Angle, dihedral::atom1, angle::atom1, bond::atom1, dihedral::atom2, angle::atom2, bond::atom2, dihedral::atom3, angle::atom3, dihedral::atom4, Bond, Bool, DebugM, Dihedral, get_angle(), get_angles_for_atom(), get_bond(), get_bonds_for_atom(), get_dihedral(), and get_dihedrals_for_atom(). Referenced by build_go_arrays(), build_go_sigmas(), and build_go_sigmas2(). 01547 {
01548 int bondNum; // Bonds in bonded list
01549 int angleNum; // Angles in angle list
01550 int dihedralNum; // Dihedrals in dihedral list
01551 int *bonds;
01552 int *angles;
01553 int *dihedrals;
01554 Bond *bond; // Temporary bond structure
01555 Angle *angle; // Temporary angle structure
01556 Dihedral *dihedral; // Temporary dihedral structure
01557
01558 DebugM(2,"atoms_1to4(" << atom1 << "," << atom2 << ")" << std::endl);
01559
01560 bonds = get_bonds_for_atom(atom1);
01561 bondNum = *bonds;
01562 while(bondNum != -1) {
01563 bond = get_bond(bondNum);
01564 DebugM(2,"bond atom1:" << bond->atom1 << ", atom2:" << bond->atom2 << std::endl);
01565 if (atom2 == bond->atom1 || atom2 == bond->atom2) {
01566 return TRUE;
01567 }
01568 bondNum = *(++bonds);
01569 }
01570
01571 bonds = get_bonds_for_atom(atom2);
01572 bondNum = *bonds;
01573 while(bondNum != -1) {
01574 bond = get_bond(bondNum);
01575 DebugM(2,"bond atom1:" << bond->atom1 << ", atom2:" << bond->atom2 << std::endl);
01576 if (atom1 == bond->atom1 || atom1 == bond->atom2) {
01577 return TRUE;
01578 }
01579 bondNum = *(++bonds);
01580 }
01581
01582 angles = get_angles_for_atom(atom1);
01583 angleNum = *angles;
01584 while(angleNum != -1) {
01585 angle = get_angle(angleNum);
01586 DebugM(2,"angle atom1:" << angle->atom1 << ", atom2:" << angle->atom2 << ", atom3:" << angle->atom3 << std::endl);
01587 if (atom2 == angle->atom1 || atom2 == angle->atom2 || atom2 == angle->atom3) {
01588 return TRUE;
01589 }
01590 angleNum = *(++angles);
01591 }
01592
01593 angles = get_angles_for_atom(atom2);
01594 angleNum = *angles;
01595 while(angleNum != -1) {
01596 angle = get_angle(angleNum);
01597 DebugM(2,"angle atom1:" << angle->atom1 << ", atom2:" << angle->atom2 << ", atom3:" << angle->atom3 << std::endl);
01598 if (atom1 == angle->atom1 || atom1 == angle->atom2 || atom1 == angle->atom3) {
01599 return TRUE;
01600 }
01601 angleNum = *(++angles);
01602 }
01603
01604 dihedrals = get_dihedrals_for_atom(atom1);
01605 dihedralNum = *dihedrals;
01606 while(dihedralNum != -1) {
01607 dihedral = get_dihedral(dihedralNum);
01608 DebugM(2,"dihedral atom1:" << dihedral->atom1 << ", atom2:" << dihedral->atom2 << ", atom3:" << dihedral->atom3 << ", atom4:" << dihedral->atom4 << std::endl);
01609 if (atom2 == dihedral->atom1 || atom2 == dihedral->atom2 \
01610 || atom2 == dihedral->atom3 || atom2 == dihedral->atom4) {
01611 return TRUE;
01612 }
01613 dihedralNum = *(++dihedrals);
01614 }
01615
01616 dihedrals = get_dihedrals_for_atom(atom2);
01617 dihedralNum = *dihedrals;
01618 while(dihedralNum != -1) {
01619 dihedral = get_dihedral(dihedralNum);
01620 DebugM(2,"dihedral atom1:" << dihedral->atom1 << ", atom2:" << dihedral->atom2 << ", atom3:" << dihedral->atom3 << ", atom4:" << dihedral->atom4 << std::endl);
01621 if (atom1 == dihedral->atom1 || atom1 == dihedral->atom2 \
01622 || atom1 == dihedral->atom3 || atom1 == dihedral->atom4) {
01623 return TRUE;
01624 }
01625 dihedralNum = *(++dihedrals);
01626 }
01627
01628 return FALSE;
01629 }
|
|
|
Definition at line 787 of file Molecule.h. References Index, and AtomCstInfo::vdw_type. Referenced by WorkDistrib::createAtomLists(), and dumpbench(). 00788 {
00789 return(atoms[anum].vdw_type);
00790 }
|
|
|
Referenced by NamdState::configListInit(). |
|
||||||||||||||||||||||||||||||||||||
|
Referenced by NamdState::configListInit(). |
|
||||||||||||||||||||||||
|
Referenced by NamdState::configListInit(). |
|
||||||||||||||||||||
|
Referenced by NamdState::configListInit(). |
|
||||||||||||
|
Referenced by NamdState::configListInit(). |
|
||||||||||||||||||||||||
|
Referenced by NamdState::configListInit(). |
|
||||||||||||||||||||
|
Referenced by NamdState::configListInit(). |
|
||||||||||||
|
goSigmas = new Real[numGoAtoms*numGoAtoms]; goWithinCutoff = new bool[numGoAtoms*numGoAtoms]; for (i=0; i<numGoAtoms; i++) { for (j=0; j<numGoAtoms; j++) { goSigmas[i*numGoAtoms + j] = 0.0; goWithinCutoff[i*numGoAtoms + j] = false; } } Definition at line 950 of file GoMolecule.C. References PDB::atom(), atomChainTypes, atoms_1to4(), BigReal, StringList::data, DebugM, energyNative, energyNonnative, get_go_cutoff(), go_restricted(), goCoordinates, goPDB, goResids, goSigmaIndices, iINFO(), int32, iout, j, NAMD_die(), StringList::next, PDB::num_atoms(), numGoAtoms, Real, PDBAtom::residueseq(), PDBAtom::xcoor(), PDBAtom::ycoor(), and PDBAtom::zcoor(). Referenced by NamdState::configListInit(). 00952 {
00953 DebugM(3,"->build_go_arrays" << std::endl);
00954 //PDB *goPDB; // Pointer to PDB object to use
00955 int bcol = 4; // Column that data is in
00956 int32 chainType = 0; // b value from PDB file
00957 int i; // Loop counter
00958 int j; // Loop counter
00959 BigReal atomAtomDist; // Distance between two atoms -- JLai put back
00960 int resid1; // Residue ID for first atom
00961 int resid2; // Residue ID for second atom
00962 int residDiff; // Difference between resid1 and resid2
00963 int goIndex; // Index into the goCoordinates array
00964 int goIndx; // Index into the goCoordinates array
00965 char filename[129]; // Filename
00966
00967 //JLai
00968 BigReal nativeEnergy, *native;
00969 BigReal nonnativeEnergy, *nonnative;
00970 nativeEnergy = 0;
00971 nonnativeEnergy = 0;
00972 native = &nativeEnergy;
00973 nonnative = &nonnativeEnergy;
00974
00975 long nativeContacts = 0;
00976 long nonnativeContacts = 0;
00977
00978 // Get the PDB object that contains the Go coordinates. If
00979 // the user gave another file name, use it. Otherwise, just use
00980 // the PDB file that has the initial coordinates.
00981 if (goCoordFile == NULL)
00982 {
00983 //goPDB = initial_pdb;
00984 NAMD_die("Error: goCoordFile is NULL - build_go_arrays");
00985 }
00986 else
00987 {
00988 if (goCoordFile->next != NULL)
00989 {
00990 NAMD_die("Multiple definitions of Go atoms PDB file in configuration file");
00991 }
00992
00993 if ( (cwd == NULL) || (goCoordFile->data[0] == '/') )
00994 {
00995 strcpy(filename, goCoordFile->data);
00996 }
00997 else
00998 {
00999 strcpy(filename, cwd);
01000 strcat(filename, goCoordFile->data);
01001 }
01002
01003 goPDB = new PDB(filename);
01004 if ( goPDB == NULL )
01005 {
01006 NAMD_die("goPDB memory allocation failed in Molecule::build_go_arrays");
01007 }
01008
01009 if (goPDB->num_atoms() != numAtoms)
01010 {
01011 NAMD_die("Number of atoms in fixed atoms PDB doesn't match coordinate PDB");
01012 }
01013 }
01014
01015 // Allocate the array to hold Go atom indices into the sigma array
01016 goSigmaIndices = new int32[numAtoms];
01017
01018 if (goSigmaIndices == NULL) {
01019 NAMD_die("goSigmaIndices memory allocation failed in Molecule::build_go_arrays");
01020 }
01021
01022 numGoAtoms = 0;
01023
01024 // Loop through all the atoms and get the Go chain types
01025 for (i=0; i<numAtoms; i++) {
01026 chainType = (int32)(goPDB->atom(i))->occupancy();
01027 if ( chainType != 0 ) {
01028 DebugM(3,"build_go_arrays - atom:" << i << std::endl);
01029 goSigmaIndices[i] = numGoAtoms;
01030 numGoAtoms++;
01031 }
01032 else {
01033 goSigmaIndices[i] = -1;
01034 }
01035 }
01036
01037 // Allocate the array to hold the sigma values for each Go atom pair
01049 // Allocate the array to hold the chain types
01050 atomChainTypes = new int32[numGoAtoms];
01051
01052 if (atomChainTypes == NULL) {
01053 NAMD_die("atomChainTypes memory allocation failed in Molecule::build_go_arrays");
01054 }
01055
01056 // Allocate the array to hold (x,y,z) coordinates for all of the Go atoms
01057 goCoordinates = new Real[numGoAtoms*3];
01058
01059 if (goCoordinates == NULL) {
01060 NAMD_die("goCoordinates memory allocation failed in Molecule::build_go_arrays");
01061 }
01062
01063 goResids = new int[numGoAtoms];
01064
01065 // Allocate the array to hold PDB residu IDs for all of the Go atoms
01066 if (goResids == NULL) {
01067 NAMD_die("goResids memory allocation failed in Molecule::build_go_arrays");
01068 }
01069
01070 for (i=0; i<numAtoms; i++) {
01071 goIndex = goSigmaIndices[i];
01072 if (goIndex != -1) {
01073 // Assign the chainType value!
01074 // Get the chainType from the occupancy field
01075 atomChainTypes[goIndex] = (int32)(goPDB->atom(i))->occupancy();
01076 goCoordinates[goIndex*3] = goPDB->atom(i)->xcoor();
01077 goCoordinates[goIndex*3 + 1] = goPDB->atom(i)->ycoor();
01078 goCoordinates[goIndex*3 + 2] = goPDB->atom(i)->zcoor();
01079 goResids[goIndex] = goPDB->atom(i)->residueseq();
01080 }
01081 }
01082 // JLai
01083 energyNative = 0;
01084 energyNonnative = 0;
01085 //printf("INIT ENERGY: (N) %f (NN) %f\n", energyNative, energyNonnative);
01086 for (i=0; i<numAtoms-1; i++) {
01087 goIndex = goSigmaIndices[i];
01088 if (goIndex != -1) {
01089 for (j=i+1; j<numAtoms;j++) {
01090 goIndx = goSigmaIndices[j];
01091 if (goIndx != -1) {
01092 resid1 = (goPDB->atom(i))->residueseq();
01093 resid2 = (goPDB->atom(j))->residueseq();
01094 residDiff = resid2 - resid1;
01095 if (residDiff < 0) residDiff = -residDiff;
01096 if (atomChainTypes[goIndex] && atomChainTypes[goIndx] &&
01097 !(this->go_restricted(atomChainTypes[goIndex],atomChainTypes[goIndx],residDiff)) &&
01098 !atoms_1to4(i,j)) {
01099 atomAtomDist = sqrt(pow((goPDB->atom(i))->xcoor() - (goPDB->atom(j))->xcoor(), 2.0) +
01100 pow((goPDB->atom(i))->ycoor() - (goPDB->atom(j))->ycoor(), 2.0) +
01101 pow((goPDB->atom(i))->zcoor() - (goPDB->atom(j))->zcoor(), 2.0));
01102 if (atomAtomDist <= this->get_go_cutoff(atomChainTypes[goIndex],atomChainTypes[goIndx]) ) {
01103 nativeContacts++;
01104 } else {
01105 nonnativeContacts++;
01106 }
01107 }
01108 }
01109 }
01110 }
01111 }
01112 iout << iINFO << "Number of UNIQUE native contacts: " << nativeContacts << "\n" << endi;
01113 iout << iINFO << "Number of UNIQUE nonnative contacts: " << nonnativeContacts << "\n" << endi;
01114
01115 // If we had to create a PDB object, delete it now
01116 if (goCoordFile != NULL) {
01117 delete goPDB;
01118 }
01119
01120 return;
01121 }
|
|
|
Definition at line 79 of file GoMolecule.C. References StringList::data, iINFO(), iout, NAMD_die(), StringList::next, and read_go_file(). Referenced by NamdState::configListInit(). 00079 {
00080 iout << iINFO << "Building Go Parameters" << "\n" << endi;
00081 #ifdef MEM_OPT_VERSION
00082 NAMD_die("Go forces are not supported in memory-optimized builds.");
00083 #else
00084 build_lists_by_atom();
00085 #endif
00086 int iterator = 0;
00087 do
00088 {
00089 iout << iINFO << "Reading Go File: " << iterator << "\n" << endi;
00090 read_go_file(g->data);
00091 g = g->next;
00092 iterator++;
00093 } while ( g != NULL && iterator < 100);
00094 }
|
|
||||||||||||
|
Definition at line 577 of file GoMolecule.C. References PDB::atom(), atomChainTypes, atoms_1to4(), BigReal, StringList::data, DebugM, get_go_cutoff(), get_go_exp_a(), get_go_exp_b(), go_restricted(), goSigmaIndices, goSigmas, goWithinCutoff, iINFO(), int32, iout, j, NAMD_die(), StringList::next, PDB::num_atoms(), numGoAtoms, and Real. Referenced by NamdState::configListInit(). 00579 {
00580 DebugM(3,"->build_go_sigmas" << std::endl);
00581 PDB *goPDB; // Pointer to PDB object to use
00582 int bcol = 4; // Column that data is in
00583 int32 chainType = 0; // b value from PDB file
00584 int i; // Loop counter
00585 int j; // Loop counter
00586 int resid1; // Residue ID for first atom
00587 int resid2; // Residue ID for second atom
00588 int residDiff; // Difference between resid1 and resid2
00589 Real sigma; // Sigma calculated for a Go atom pair
00590 Real atomAtomDist; // Distance between two atoms
00591 Real exp_a; // First exponent in L-J like formula
00592 Real exp_b; // Second exponent in L-J like formula
00593 char filename[129]; // Filename
00594
00595 //JLai
00596 BigReal nativeEnergy, *native;
00597 BigReal nonnativeEnergy, *nonnative;
00598 nativeEnergy = 0;
00599 nonnativeEnergy = 0;
00600 native = &nativeEnergy;
00601 nonnative = &nonnativeEnergy;
00602
00603 long nativeContacts = 0;
00604 long nonnativeContacts = 0;
00605
00606 // Get the PDB object that contains the Go coordinates. If
00607 // the user gave another file name, use it. Otherwise, just use
00608 // the PDB file that has the initial coordinates.
00609 if (goCoordFile == NULL)
00610 {
00611 //goPDB = initial_pdb;
00612 NAMD_die("Error: goCoordFile is NULL - build_go_sigmas");
00613 }
00614 else
00615 {
00616 if (goCoordFile->next != NULL)
00617 {
00618 NAMD_die("Multiple definitions of Go atoms PDB file in configuration file");
00619 }
00620
00621 if ( (cwd == NULL) || (goCoordFile->data[0] == '/') )
00622 {
00623 strcpy(filename, goCoordFile->data);
00624 }
00625 else
00626 {
00627 strcpy(filename, cwd);
00628 strcat(filename, goCoordFile->data);
00629 }
00630
00631 goPDB = new PDB(filename);
00632 if ( goPDB == NULL )
00633 {
00634 NAMD_die("Memory allocation failed in Molecule::build_go_sigmas");
00635 }
00636
00637 if (goPDB->num_atoms() != numAtoms)
00638 {
00639 NAMD_die("Number of atoms in fixed atoms PDB doesn't match coordinate PDB");
00640 }
00641 }
00642 // Allocate the array to hold the chain types
00643 atomChainTypes = new int32[numAtoms];
00644 // Allocate the array to hold Go atom indices into the sigma array
00645 goSigmaIndices = new int32[numAtoms];
00646
00647 if (atomChainTypes == NULL) {
00648 NAMD_die("memory allocation failed in Molecule::build_go_sigmas");
00649 }
00650
00651 numGoAtoms = 0;
00652
00653 // Loop through all the atoms and get the Go chain types
00654 for (i=0; i<numAtoms; i++) {
00655 // Get the chainType from the occupancy field
00656 chainType = (int32)(goPDB->atom(i))->occupancy();
00657 // Assign the chainType value
00658 if ( chainType != 0 ) {
00659 //DebugM(3,"build_go_sigmas - atom:" << i << ", chainType:" << chainType << std::endl);
00660 atomChainTypes[i] = chainType;
00661 goSigmaIndices[i] = numGoAtoms;
00662 numGoAtoms++;
00663 }
00664 else {
00665 atomChainTypes[i] = 0;
00666 goSigmaIndices[i] = -1;
00667 }
00668 //printf("CT: %d %d %d %d\n",i,numGoAtoms,atomChainTypes[i],goSigmaIndices[i]);
00669 }
00670
00671 // Allocate the array to hold the sigma values for each Go atom pair
00672 goSigmas = new Real[numGoAtoms*numGoAtoms];
00673 goWithinCutoff = new bool[numGoAtoms*numGoAtoms];
00674 for (i=0; i<numGoAtoms; i++) {
00675 for (j=0; j<numGoAtoms; j++) {
00676 goSigmas[i*numGoAtoms + j] = -1.0;
00677 goWithinCutoff[i*numGoAtoms + j] = false;
00678 }
00679 }
00680 // Loop through all atom pairs and calculate sigmas
00681 DebugM(3," numAtoms=" << numAtoms << std::endl);
00682 for (i=0; i<numAtoms; i++) {
00683 //DebugM(3," i=" << i << std::endl);
00684 resid1 = (goPDB->atom(i))->residueseq();
00685 //DebugM(3," resid1=" << resid1 << std::endl);
00686 //if ( goSigmaIndices[i] != -1) {
00687 // goSigmas[goSigmaIndices[i]*numGoAtoms + goSigmaIndices[i]] = 0.0;
00688 //}
00689 for (j=i+1; j<numAtoms; j++) {
00690 //DebugM(3," j=" << j << std::endl);
00691 resid2 = (goPDB->atom(j))->residueseq();
00692 //printf("GSIi %d %d %d\n",i,numAtoms,goSigmaIndices[i]);
00693 //printf("SAN CHECK: %d\n",goSigmaIndices[37]);
00694 //printf("GSIj %d %d %d\n",j,numAtoms,goSigmaIndices[j]);
00695 //printf("ATOMS_1to4 %d\n",!atoms_1to4(i,j));
00696 //DebugM(3," resid2=" << resid2 << std::endl);
00697 // if goSigmaIndices aren't defined, don't set anything in goSigmas
00698 if ( goSigmaIndices[i] != -1 && goSigmaIndices[j] != -1 && !atoms_1to4(i,j) ) {
00699 //printf("TAKING DIFFERENCE\n");
00700 residDiff = resid2 - resid1;
00701 //printf("RESIDDIFF %d\n",residDiff);
00702 if (residDiff < 0) residDiff = -residDiff;
00703 //printf("RESIDDIFF2 %d\n",residDiff);
00704 // if this is a Go atom pair that is not restricted
00705 // calculate sigma
00706 // sigmas are initially set to -1.0 if the atom pair fails go_restricted
00707 //printf("CHECKING LOOPING\n");
00708 if ( atomChainTypes[i] && atomChainTypes[j] &&
00709 !(this->go_restricted(atomChainTypes[i],atomChainTypes[j],residDiff)) ) {
00710 atomAtomDist = sqrt(pow((goPDB->atom(i))->xcoor() - (goPDB->atom(j))->xcoor(), 2.0) +
00711 pow((goPDB->atom(i))->ycoor() - (goPDB->atom(j))->ycoor(), 2.0) +
00712 pow((goPDB->atom(i))->zcoor() - (goPDB->atom(j))->zcoor(), 2.0));
00713 if ( atomAtomDist <= this->get_go_cutoff(atomChainTypes[i],atomChainTypes[j]) ) {
00714 exp_a = this->get_go_exp_a(atomChainTypes[i],atomChainTypes[j]);
00715 exp_b = this->get_go_exp_b(atomChainTypes[i],atomChainTypes[j]);
00716 sigma = pow(static_cast<double>(exp_b/exp_a),(1.0/(exp_a-exp_b))) * atomAtomDist;
00717 goSigmas[goSigmaIndices[i]*numGoAtoms + goSigmaIndices[j]] = sigma;
00718 goSigmas[goSigmaIndices[j]*numGoAtoms + goSigmaIndices[i]] = sigma;
00719 goWithinCutoff[goSigmaIndices[i]*numGoAtoms + goSigmaIndices[j]] = true;
00720 goWithinCutoff[goSigmaIndices[j]*numGoAtoms + goSigmaIndices[i]] = true;
00721 nativeContacts++;
00722 } else {
00723 goSigmas[goSigmaIndices[i]*numGoAtoms + goSigmaIndices[j]] = 0.0;
00724 goSigmas[goSigmaIndices[j]*numGoAtoms + goSigmaIndices[i]] = 0.0;
00725 nonnativeContacts++;
00726 }
00727 } else {
00728 goSigmas[goSigmaIndices[i]*numGoAtoms + goSigmaIndices[j]] = -1.0;
00729 goSigmas[goSigmaIndices[j]*numGoAtoms + goSigmaIndices[i]] = -1.0;
00730 }
00731 }
00732 }
00733 }
00734
00735 iout << iINFO << "Number of UNIQUE native contacts: " << nativeContacts << "\n" << endi;
00736 iout << iINFO << "Number of UNIQUE nonnative contacts: " << nonnativeContacts << "\n" << endi;
00737
00738 // If we had to create a PDB object, delete it now
00739 if (goCoordFile != NULL) {
00740 delete goPDB;
00741 }
00742
00743 return;
00744 }
|
|
||||||||||||
|
Definition at line 747 of file GoMolecule.C. References go_pair::A, ResizeArray< Elem >::add(), PDB::atom(), atomChainTypes, atoms_1to4(), go_pair::B, ResizeArray< Elem >::begin(), StringList::data, DebugM, ResizeArray< Elem >::end(), get_go_cutoff(), get_go_exp_a(), get_go_exp_b(), go_restricted(), go_pair::goIndxA, go_pair::goIndxB, goIndxLJA, goIndxLJB, goNumLJPair, GoPair, goResidIndices, goSigmaIndices, goSigmaPairA, goSigmaPairB, iINFO(), int32, iout, j, NAMD_die(), StringList::next, PDB::num_atoms(), numGoAtoms, numLJPair, pointerToGoBeg, pointerToGoEnd, and Real. Referenced by NamdState::configListInit(). 00749 {
00750 DebugM(3,"->build_go_sigmas2" << std::endl);
00751 PDB *goPDB; // Pointer to PDB object to use
00752 int bcol = 4; // Column that data is in
00753 int32 chainType = 0; // b value from PDB file
00754 int32 residType = 0; // resid value from PDB file
00755 int i; // Loop counter
00756 int j; // Loop counter
00757 int resid1; // Residue ID for first atom
00758 int resid2; // Residue ID for second atom
00759 int residDiff; // Difference between resid1 and resid2
00760 Real sigma; // Sigma calculated for a Go atom pair
00761 Real atomAtomDist; // Distance between two atoms
00762 Real exp_a; // First exponent in L-J like formula
00763 Real exp_b; // Second exponent in L-J like formula
00764 char filename[129]; // Filename
00765
00766 //JLai
00767 int numLJPair = 0;
00768 long nativeContacts = 0;
00769 long nonnativeContacts = 0;
00770
00771 // Get the PDB object that contains the Go coordinates. If
00772 // the user gave another file name, use it. Otherwise, just use
00773 // the PDB file that has the initial coordinates.
00774 if (goCoordFile == NULL)
00775 {
00776 //goPDB = initial_pdb;
00777 NAMD_die("Error: goCoordFile is NULL - build_go_sigmas2");
00778 }
00779 else
00780 {
00781 if (goCoordFile->next != NULL)
00782 {
00783 NAMD_die("Multiple definitions of Go atoms PDB file in configuration file");
00784 }
00785
00786 if ( (cwd == NULL) || (goCoordFile->data[0] == '/') )
00787 {
00788 strcpy(filename, goCoordFile->data);
00789 }
00790 else
00791 {
00792 strcpy(filename, cwd);
00793 strcat(filename, goCoordFile->data);
00794 }
00795
00796 goPDB = new PDB(filename);
00797 if ( goPDB == NULL )
00798 {
00799 NAMD_die("Memory allocation failed in Molecule::build_go_sigmas2");
00800 }
00801
00802 if (goPDB->num_atoms() != numAtoms)
00803 {
00804 NAMD_die("Number of atoms in fixed atoms PDB doesn't match coordinate PDB");
00805 }
00806 }
00807 // Allocate the array to hold the chain types
00808 atomChainTypes = new int32[numAtoms];
00809 // Allocate the array to hold Go atom indices into the sigma array
00810 goSigmaIndices = new int32[numAtoms];
00811 // Allocate the array to hold resid
00812 goResidIndices = new int32[numAtoms];
00813
00814 if (atomChainTypes == NULL) {
00815 NAMD_die("memory allocation failed in Molecule::build_go_sigmas2");
00816 }
00817
00818 numGoAtoms = 0;
00819
00820 // Loop through all the atoms and get the Go chain types
00821 for (i=0; i<numAtoms; i++) {
00822 // Get the chainType from the occupancy field
00823 chainType = (int32)(goPDB->atom(i))->occupancy();
00824 // Get the resid from the resid field
00825 residType = (int32)(goPDB->atom(i))->residueseq();
00826 // Assign the chainType value
00827 if ( chainType != 0 ) {
00828 //DebugM(3,"build_go_sigmas2 - atom:" << i << ", chainType:" << chainType << std::endl);
00829 atomChainTypes[i] = chainType;
00830 goSigmaIndices[i] = numGoAtoms;
00831 goResidIndices[i] = residType;
00832 numGoAtoms++;
00833 }
00834 else {
00835 atomChainTypes[i] = 0;
00836 goSigmaIndices[i] = -1;
00837 goResidIndices[i] = -1;
00838 }
00839 }
00840
00841 //Define:
00842 ResizeArray<GoPair> tmpGoPair;
00843
00844 // Loop through all atom pairs and calculate sigmas
00845 // Store sigmas into sorted array
00846 DebugM(3," numAtoms=" << numAtoms << std::endl);
00847 for (i=0; i<numAtoms; i++) {
00848 resid1 = (goPDB->atom(i))->residueseq();
00849 for (j=i+1; j<numAtoms; j++) {
00850 resid2 = (goPDB->atom(j))->residueseq();
00851 if ( goSigmaIndices[i] != -1 && goSigmaIndices[j] != -1 && !atoms_1to4(i,j) ) {
00852 residDiff = resid2 - resid1;
00853 if (residDiff < 0) residDiff = -residDiff;
00854 if ( atomChainTypes[i] && atomChainTypes[j] &&
00855 !(this->go_restricted(atomChainTypes[i],atomChainTypes[j],residDiff)) ) {
00856 atomAtomDist = sqrt(pow((goPDB->atom(i))->xcoor() - (goPDB->atom(j))->xcoor(), 2.0) +
00857 pow((goPDB->atom(i))->ycoor() - (goPDB->atom(j))->ycoor(), 2.0) +
00858 pow((goPDB->atom(i))->zcoor() - (goPDB->atom(j))->zcoor(), 2.0));
00859 if ( atomAtomDist <= this->get_go_cutoff(atomChainTypes[i],atomChainTypes[j]) ) {
00860 exp_a = this->get_go_exp_a(atomChainTypes[i],atomChainTypes[j]);
00861 exp_b = this->get_go_exp_b(atomChainTypes[i],atomChainTypes[j]);
00862 sigma = pow(static_cast<double>(exp_b/exp_a),(1.0/(exp_a-exp_b))) * atomAtomDist;
00863 double tmpA = pow(sigma,exp_a);
00864 double tmpB = pow(sigma,exp_b);
00865 GoPair gp;
00866 GoPair gp2;
00867 gp.goIndxA = i;
00868 gp.goIndxB = j;
00869 gp.A = tmpA;
00870 gp.B = tmpB;
00871 tmpGoPair.add(gp);
00872 gp2.goIndxA = j;
00873 gp2.goIndxB = i;
00874 gp2.A = tmpA;
00875 gp2.B = tmpB;
00876 tmpGoPair.add(gp2);
00877 nativeContacts++;
00878 } else {
00879 nonnativeContacts++;
00880 }
00881 }
00882 }
00883 }
00884 }
00885
00886 iout << iINFO << "Number of UNIQUE native contacts: " << nativeContacts << "\n" << endi;
00887 iout << iINFO << "Number of UNIQUE nonnative contacts: " << nonnativeContacts << "\n" << endi;
00888
00889 // Copies the resizeArray into a block of continuous memory
00890 std::sort(tmpGoPair.begin(),tmpGoPair.end(),goPairCompare);
00891 goNumLJPair = 2*nativeContacts;
00892 goIndxLJA = new int[goNumLJPair];
00893 goIndxLJB = new int[goNumLJPair];
00894 goSigmaPairA = new double[goNumLJPair];
00895 goSigmaPairB = new double[goNumLJPair];
00896 for(i=0; i< goNumLJPair; i++) {
00897 goIndxLJA[i] = tmpGoPair[i].goIndxA;
00898 goIndxLJB[i] = tmpGoPair[i].goIndxB;
00899 goSigmaPairA[i] = tmpGoPair[i].A;
00900 goSigmaPairB[i] = tmpGoPair[i].B;
00901 }
00902
00903 pointerToGoBeg = new int[numAtoms];
00904 pointerToGoEnd = new int[numAtoms];
00905 int oldIndex = -1;
00906 for(i=0; i<numAtoms; i++) {
00907 pointerToGoBeg[i] = -1;
00908 pointerToGoEnd[i] = -2;
00909 }
00910 for(i=0; i < goNumLJPair; i++) {
00911 if(pointerToGoBeg[goIndxLJA[i]] == -1) {
00912 pointerToGoBeg[goIndxLJA[i]] = i;
00913 oldIndex = goIndxLJA[i];
00914 }
00915 pointerToGoEnd[oldIndex] = i;
00916 }
00917
00918 // If we had to create a PDB object, delete it now
00919 if (goCoordFile != NULL) {
00920 delete goPDB;
00921 }
00922
00923 return;
00924 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 5723 of file Molecule.C. References PDB::atom(), DebugM, endi(), MGridforceParamsList::get_first(), GridforceGrid::get_total_grids(), MGridforceParams::gridforceCol, MGridforceParams::gridforceFile, MGridforceParams::gridforceQcol, MGridforceParams::gridforceVfile, int32, iout, iWARN(), SimParameters::mgridforcelist, NAMD_die(), GridforceGrid::new_grid(), MGridforceParams::next, PDB::num_atoms(), numGridforceGrids, numGridforces, and Real. Referenced by NamdState::configListInit(). 05729 {
05730 PDB *kPDB;
05731 register int i; // Loop counters
05732 register int j;
05733 register int k;
05734
05735 DebugM(3, "Entered build_gridforce_params multi...\n");
05736 // DebugM(3, "\tgridfrcfile = " << gridfrcfile->data << endi);
05737 // DebugM(3, "\tgridfrccol = " << gridfrccol->data << endi);
05738
05739 MGridforceParams* mgridParams = simParams->mgridforcelist.get_first();
05740 numGridforceGrids = 0;
05741 while (mgridParams != NULL) {
05742 numGridforceGrids++;
05743 mgridParams = mgridParams->next;
05744 }
05745
05746 DebugM(3, "numGridforceGrids = " << numGridforceGrids << "\n");
05747 gridfrcIndexes = new int32*[numGridforceGrids];
05748 gridfrcParams = new GridforceParams*[numGridforceGrids];
05749 gridfrcGrid = new GridforceGrid*[numGridforceGrids];
05750 numGridforces = new int[numGridforceGrids];
05751
05752 int grandTotalGrids = 0; // including all subgrids
05753
05754 mgridParams = simParams->mgridforcelist.get_first();
05755 for (int gridnum = 0; gridnum < numGridforceGrids; gridnum++) {
05756 int current_index=0; // Index into values used
05757 int kcol = 5; // Column to look for force constant in
05758 int qcol = 0; // Column for charge (default 0: use electric charge)
05759 Real kval = 0; // Force constant value retreived
05760 char filename[129]; // PDB filename
05761 char potfilename[129]; // Potential file name
05762
05763 if (mgridParams == NULL) {
05764 NAMD_die("Problem with mgridParams!");
05765 }
05766
05767 // Now load values from mgridforcelist object
05768 if (mgridParams->gridforceFile == NULL)
05769 {
05770 kPDB = initial_pdb;
05771 }
05772 else
05773 {
05774 DebugM(4, "mgridParams->gridforceFile = " << mgridParams->gridforceFile << "\n" << endi);
05775
05776 if ( (cwd == NULL) || (mgridParams->gridforceFile[0] == '/') )
05777 {
05778 strcpy(filename, mgridParams->gridforceFile);
05779 }
05780 else
05781 {
05782 strcpy(filename, cwd);
05783 strcat(filename, mgridParams->gridforceFile);
05784 }
05785
05786 kPDB = new PDB(filename);
05787 if ( kPDB == NULL )
05788 {
05789 NAMD_die("Memory allocation failed in Molecule::build_gridforce_params");
05790 }
05791
05792 if (kPDB->num_atoms() != numAtoms)
05793 {
05794 NAMD_die("Number of atoms in grid force PDB doesn't match coordinate PDB");
05795 }
05796 }
05797
05798 // Get the column that the force constant is going to be in. It
05799 // can be in any of the 5 floating point fields in the PDB, according
05800 // to what the user wants. The allowable fields are X, Y, Z, O, or
05801 // B which correspond to the 1st, 2nd, ... 5th floating point fields.
05802 // The default is the 5th field, which is beta (temperature factor)
05803 if (mgridParams->gridforceCol == NULL)
05804 {
05805 kcol = 5;
05806 }
05807 else
05808 {
05809 if (strcasecmp(mgridParams->gridforceCol, "X") == 0)
05810 {
05811 kcol=1;
05812 }
05813 else if (strcasecmp(mgridParams->gridforceCol, "Y") == 0)
05814 {
05815 kcol=2;
05816 }
05817 else if (strcasecmp(mgridParams->gridforceCol, "Z") == 0)
05818 {
05819 kcol=3;
05820 }
05821 else if (strcasecmp(mgridParams->gridforceCol, "O") == 0)
05822 {
05823 kcol=4;
05824 }
05825 else if (strcasecmp(mgridParams->gridforceCol, "B") == 0)
05826 {
05827 kcol=5;
05828 }
05829 else
05830 {
05831 NAMD_die("gridforcecol must have value of X, Y, Z, O, or B");
05832 }
05833 }
05834
05835 // Get the column that the charge is going to be in.
05836 if (mgridParams->gridforceQcol == NULL)
05837 {
05838 qcol = 0; // Default: don't read charge from file, use electric charge
05839 }
05840 else
05841 {
05842 if (strcasecmp(mgridParams->gridforceQcol, "X") == 0)
05843 {
05844 qcol=1;
05845 }
05846 else if (strcasecmp(mgridParams->gridforceQcol, "Y") == 0)
05847 {
05848 qcol=2;
05849 }
05850 else if (strcasecmp(mgridParams->gridforceQcol, "Z") == 0)
05851 {
05852 qcol=3;
05853 }
05854 else if (strcasecmp(mgridParams->gridforceQcol, "O") == 0)
05855 {
05856 qcol=4;
05857 }
05858 else if (strcasecmp(mgridParams->gridforceQcol, "B") == 0)
05859 {
05860 qcol=5;
05861 }
05862 else
05863 {
05864 NAMD_die("gridforcechargecol must have value of X, Y, Z, O, or B");
05865 }
05866 }
05867
05868 if (kcol == qcol) {
05869 NAMD_die("gridforcecol and gridforcechargecol cannot have same value");
05870 }
05871
05872
05873 // Allocate an array that will store an index into the constraint
05874 // parameters for each atom. If the atom is not constrained, its
05875 // value will be set to -1 in this array.
05876 gridfrcIndexes[gridnum] = new int32[numAtoms];
05877
05878 if (gridfrcIndexes[gridnum] == NULL)
05879 {
05880 NAMD_die("memory allocation failed in Molecule::build_gridforce_params()");
05881 }
05882
05883 // Loop through all the atoms and find out which ones are constrained
05884 for (i=0; i<numAtoms; i++)
05885 {
05886 // Get the k value based on where we were told to find it
05887 switch (kcol)
05888 {
05889 case 1:
05890 kval = (kPDB->atom(i))->xcoor();
05891 break;
05892 case 2:
05893 kval = (kPDB->atom(i))->ycoor();
05894 break;
05895 case 3:
05896 kval = (kPDB->atom(i))->zcoor();
05897 break;
05898 case 4:
05899 kval = (kPDB->atom(i))->occupancy();
05900 break;
05901 case 5:
05902 kval = (kPDB->atom(i))->temperaturefactor();
05903 break;
05904 }
05905
05906 if (kval > 0.0)
05907 {
05908 // This atom is constrained
05909 gridfrcIndexes[gridnum][i] = current_index;
05910 current_index++;
05911 }
05912 else
05913 {
05914 // This atom is not constrained
05915 gridfrcIndexes[gridnum][i] = -1;
05916 }
05917 }
05918
05919 if (current_index == 0)
05920 {
05921 // Constraints were turned on, but there weren't really any constrained
05922 iout << iWARN << "NO GRIDFORCE ATOMS WERE FOUND, BUT GRIDFORCE IS ON . . .\n" << endi;
05923 }
05924 else
05925 {
05926 // Allocate an array to hold the constraint parameters
05927 gridfrcParams[gridnum] = new GridforceParams[current_index];
05928 if (gridfrcParams[gridnum] == NULL)
05929 {
05930 NAMD_die("memory allocation failed in Molecule::build_gridforce_params");
05931 }
05932 }
05933
05934 numGridforces[gridnum] = current_index;
05935
05936 // Loop through all the atoms and assign the parameters for those
05937 // that are constrained
05938 for (i=0; i<numAtoms; i++)
05939 {
05940 if (gridfrcIndexes[gridnum][i] != -1)
05941 {
05942 // This atom has grid force, so get the k value again
05943 switch (kcol)
05944 {
05945 case 1:
05946 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].k = (kPDB->atom(i))->xcoor();
05947 break;
05948 case 2:
05949 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].k = (kPDB->atom(i))->ycoor();
05950 break;
05951 case 3:
05952 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].k = (kPDB->atom(i))->zcoor();
05953 break;
05954 case 4:
05955 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].k = (kPDB->atom(i))->occupancy();
05956 break;
05957 case 5:
05958 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].k = (kPDB->atom(i))->temperaturefactor();
05959 break;
05960 }
05961
05962 // Also get charge column
05963 switch (qcol)
05964 {
05965 case 0:
05966 #ifdef MEM_OPT_VERSION
05967 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = atomChargePool[eachAtomCharge[i]];
05968 #else
05969 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = atoms[i].charge;
05970 #endif
05971 break;
05972 case 1:
05973 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = (kPDB->atom(i))->xcoor();
05974 break;
05975 case 2:
05976 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = (kPDB->atom(i))->ycoor();
05977 break;
05978 case 3:
05979 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = (kPDB->atom(i))->zcoor();
05980 break;
05981 case 4:
05982 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = (kPDB->atom(i))->occupancy();
05983 break;
05984 case 5:
05985 gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = (kPDB->atom(i))->temperaturefactor();
05986 break;
05987 }
05988 }
05989 }
05990
05991 // If we had to create new PDB objects, delete them now
05992 if (mgridParams->gridforceFile != NULL)
05993 {
05994 delete kPDB;
05995 }
05996
05997 // Now we fill in our grid information
05998
05999 // Open potential file
06000 if ( (cwd == NULL) || (mgridParams->gridforceVfile[0] == '/') )
06001 {
06002 strcpy(potfilename, mgridParams->gridforceVfile);
06003 }
06004 else
06005 {
06006 strcpy(potfilename, cwd);
06007 strcat(potfilename, mgridParams->gridforceVfile);
06008 }
06009
06010 // iout << iINFO << "Allocating grid " << gridnum
06011 // << "\n" << endi;
06012
06013 DebugM(3, "allocating GridforceGrid(" << gridnum << ")\n");
06014 gridfrcGrid[gridnum] = GridforceGrid::new_grid(gridnum, potfilename, simParams, mgridParams);
06015
06016 grandTotalGrids += gridfrcGrid[gridnum]->get_total_grids();
06017 DebugM(4, "grandTotalGrids = " << grandTotalGrids << "\n" << endi);
06018
06019 // Finally, get next mgridParams pointer
06020 mgridParams = mgridParams->next;
06021 }
06022 }
|
|
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
Referenced by NamdState::configListInit(). |
|
||||||||||||||||||||||||
|
Referenced by NamdState::configListInit(). |
|
||||||||||||||||||||||||||||||||||||
|
Referenced by NamdState::configListInit(). |
|
||||||||||||||||||||
|
Referenced by NamdState::configListInit(). |
|
||||||||||||
|
|
|
|
Referenced by NamdState::configListInit(). |
|
|
Definition at line 763 of file Molecule.h. Referenced by NamdState::configListInit(). 00763 { delete [] bfactor; bfactor=NULL; }
|
|
|
Definition at line 759 of file Molecule.h. Referenced by NamdState::configListInit(). 00759 { delete [] occupancy; occupancy=NULL; }
|
|
|
Definition at line 834 of file Molecule.h. References Bond. 00834 {return (&(acceptors[dnum]));}
|
|
|
Definition at line 797 of file Molecule.h. References Angle. Referenced by atoms_1to4(), and dumpbench(). 00797 {return (&(angles[anum]));}
|
|
|
Definition at line 876 of file Molecule.h. References int32. Referenced by atoms_1to4(), and dumpbench(). 00877 { return anglesByAtom[anum]; }
|
|
||||||||||||||||
|
Definition at line 173 of file Molecule.C. References ResidueLookupElem::lookup(), and NAMD_die(). Referenced by GlobalMasterFreeEnergy::getAtomID(), and GlobalMasterEasy::getAtomID(). 00174 {
00175
00176 if (atomNames == NULL || resLookup == NULL)
00177 {
00178 NAMD_die("Tried to find atom from name on node other than node 0");
00179 }
00180 int i = 0;
00181 int end = 0;
00182 if ( resLookup->lookup(segid,resid,&i,&end) ) return -1;
00183 if ( index >= 0 && index < ( end - i ) ) return ( index + i );
00184 return -1;
00185 }
|
|
||||||||||||||||
|
Definition at line 136 of file Molecule.C. References atomNamePool, Index, ResidueLookupElem::lookup(), and NAMD_die(). Referenced by colvarmodule::atom::atom(), GlobalMasterFreeEnergy::getAtomID(), and GlobalMasterEasy::getAtomID(). 00137 {
00138
00139 if (atomNames == NULL || resLookup == NULL)
00140 {
00141 NAMD_die("Tried to find atom from name on node other than node 0");
00142 }
00143
00144 int i = 0;
00145 int end = 0;
00146 if ( resLookup->lookup(segid,resid,&i,&end) ) return -1;
00147 for ( ; i < end; ++i ) {
00148 #ifdef MEM_OPT_VERSION
00149 Index idx = atomNames[i].atomnameIdx;
00150 if(!strcasecmp(aname, atomNamePool[idx])) return i;
00151 #else
00152 if ( ! strcasecmp(aname,atomNames[i].atomname) ) return i;
00153 #endif
00154 }
00155 return -1;
00156 }
|
|
|
Definition at line 845 of file Molecule.h. References AtomNameIdx::atomtypeIdx, atomTypePool, and NAMD_die(). 00846 {
00847 if (atomNames == NULL)
00848 {
00849 NAMD_die("Tried to find atom type on node other than node 0");
00850 }
00851
00852 #ifdef MEM_OPT_VERSION
00853 return atomTypePool[atomNames[anum].atomtypeIdx];
00854 #else
00855 return(atomNames[anum].atomtype);
00856 #endif
00857 }
|
|
|
Definition at line 794 of file Molecule.h. References Bond. Referenced by atoms_1to4(), and dumpbench(). 00794 {return (&(bonds[bnum]));}
|
|
|
Definition at line 874 of file Molecule.h. References int32. Referenced by atoms_1to4(), and dumpbench(). 00875 { return bondsByAtom[anum]; }
|
|
|
Definition at line 752 of file Molecule.h. Referenced by wrap_coor_int(). 00752 { return cluster[anum]; }
|
|
|
Definition at line 753 of file Molecule.h. Referenced by wrap_coor_int(). 00753 { return clusterSize[anum]; }
|
|
||||||||||||||||
|
Definition at line 991 of file Molecule.h. Referenced by ComputeRestraints::doForce(). 00992 {
00993 k = consParams[consIndexes[atomnum]].k;
00994 refPos = consParams[consIndexes[atomnum]].refPos;
00995 }
|
|
||||||||||||||||||||
|
Definition at line 1065 of file Molecule.h. Referenced by ComputeConsTorque::doForce(). 01067 {
01068 v = consTorqueParams[consTorqueIndexes[atomnum]].v;
01069 a = consTorqueParams[consTorqueIndexes[atomnum]].a;
01070 p = consTorqueParams[consTorqueIndexes[atomnum]].p;
01071 }
|
|
|
Definition at line 806 of file Molecule.h. References Crossterm. 00806 {return (&(crossterms[inum]));}
|
|
|
Definition at line 882 of file Molecule.h. References int32. 00883 { return crosstermsByAtom[anum]; }
|
|
|
Definition at line 803 of file Molecule.h. References Dihedral. Referenced by atoms_1to4(), and dumpbench(). 00803 {return (&(dihedrals[dnum]));}
|
|
|
Definition at line 878 of file Molecule.h. References int32. Referenced by atoms_1to4(), and dumpbench(). 00879 { return dihedralsByAtom[anum]; }
|
|
|
Definition at line 831 of file Molecule.h. References Bond. 00831 {return (&(donors[dnum]));}
|
|
|
Definition at line 902 of file Molecule.h. Referenced by dumpbench(). 00902 {
00903 return &all_exclusions[anum];
00904 }
|
|
|
Definition at line 841 of file Molecule.h. 00841 {return (&(exclusions[ex]));}
|
|
|
Definition at line 884 of file Molecule.h. References int32. 00885 { return exclusionsByAtom[anum]; }
|
|
|
Definition at line 1074 of file Molecule.h. Referenced by WorkDistrib::createAtomLists(), and ComputeHomeTuples< TholeElem, Thole, TholeValue >::loadTuples(). 01075 {
01076 return(fepAtomFlags[anum]);
01077 }
|
|
|
Definition at line 886 of file Molecule.h. References int32. Referenced by ComputeNonbondedCUDA::build_exclusions(), and ComputeNonbondedCUDA::finishWork(). 00887 { return fullExclusionsByAtom[anum]; }
|
|
||||||||||||
|
Definition at line 1275 of file Molecule.h. References go_val::cutoff, MAX_GO_CHAINS, and Real. Referenced by build_go_arrays(), build_go_sigmas(), build_go_sigmas2(), and get_go_force2(). 01275 { return go_array[MAX_GO_CHAINS*chain1 + chain2].cutoff; };
|
|
||||||||||||
|
Definition at line 1284 of file Molecule.h. References go_val::epsilon, MAX_GO_CHAINS, and Real. Referenced by get_go_force2(). 01284 { return go_array[MAX_GO_CHAINS*chain1 + chain2].epsilon; };
|
|
||||||||||||
|
Definition at line 1278 of file Molecule.h. References go_val::epsilonRep, MAX_GO_CHAINS, and Real. Referenced by get_go_force2(). 01278 { return go_array[MAX_GO_CHAINS*chain1 + chain2].epsilonRep; };
|
|
||||||||||||
|
Definition at line 1287 of file Molecule.h. References go_val::exp_a, and MAX_GO_CHAINS. Referenced by build_go_sigmas(), build_go_sigmas2(), and get_go_force2(). 01287 { return go_array[MAX_GO_CHAINS*chain1 + chain2].exp_a; };
|
|
||||||||||||
|
Definition at line 1290 of file Molecule.h. References go_val::exp_b, and MAX_GO_CHAINS. Referenced by build_go_sigmas(), build_go_sigmas2(), and get_go_force2(). 01290 { return go_array[MAX_GO_CHAINS*chain1 + chain2].exp_b; };
|
|
||||||||||||
|
Definition at line 1293 of file Molecule.h. References go_val::exp_rep, and MAX_GO_CHAINS. Referenced by get_go_force2(). 01293 { return go_array[MAX_GO_CHAINS*chain1 + chain2].exp_rep; };
|
|
||||||||||||||||||||||||
|
Definition at line 1268 of file GoMolecule.C. References atomChainTypes, BigReal, goForce, goNonnative, goSigmaIndices, goSigmas, goWithinCutoff, int32, numGoAtoms, and Real. 01273 {
01274 BigReal goForce = 0.0;
01275 Real pow1;
01276 Real pow2;
01277 // determine which Go chain pair we are working with
01278 //DebugM(3,"get_go_force - (" << atom1 << "," << atom2 << ")" << std::endl);
01279 int32 chain1 = atomChainTypes[atom1];
01280 int32 chain2 = atomChainTypes[atom2];
01281
01282 //DebugM(3," chain1:" << chain1 << ", chain2:" << chain2 << std::endl);
01283 if (chain1 == 0 || chain2 == 0) return 0.0;
01284
01285 // retrieve Go cutoff for this chain pair
01286 //TMP// JLai -- I'm going to replace this with a constant accessor. This is just a temporary thing
01287 Real goCutoff = const_cast<Molecule*>(this)->get_go_cutoff(chain1,chain2);
01288 //DebugM(3," goCutoff:" << goCutoff << std::endl);
01289 if (goCutoff == 0) return 0.0;
01290 // if repulsive then calculate repulsive
01291 // sigmas are initially set to -1.0 if the atom pair fails go_restricted
01292 if (goSigmas[goSigmaIndices[atom1]*numGoAtoms + goSigmaIndices[atom2]] != -1.0) {
01293 if (!goWithinCutoff[goSigmaIndices[atom1]*numGoAtoms + goSigmaIndices[atom2]]) {
01294 Real epsilonRep = const_cast<Molecule*>(this)->get_go_epsilonRep(chain1,chain2);
01295 Real sigmaRep = const_cast<Molecule*>(this)->get_go_sigmaRep(chain1,chain2);
01296 int exp_rep = const_cast<Molecule*>(this)->get_go_exp_rep(chain1,chain2);
01297 pow1 = pow(sigmaRep/r,exp_rep);
01298 goForce = 4*((exp_rep/(r*r)) * epsilonRep * pow1);
01299 *goNative = 0.0;
01300 *goNonnative = (4 * epsilonRep * pow1 );
01301 //DebugM(3,"get_go_force - (" << atom1 << "," << atom2 << ") chain1:" << chain1 << ", chain2:" << chain2 << ", epsilonRep:" << epsilonRep << ", sigmaRep:" << sigmaRep << ", r:" << r << ", goForce:" << goForce << std::endl);
01302 }
01303 // if attractive then calculate attractive
01304 else {
01305 int goSigmaIndex1 = goSigmaIndices[atom1];
01306 int goSigmaIndex2 = goSigmaIndices[atom2];
01307 if (goSigmaIndex1 != -1 && goSigmaIndex2 != -1) {
01308 Real epsilon = const_cast<Molecule*>(this)->get_go_epsilon(chain1,chain2);
01309 int exp_a = const_cast<Molecule*>(this)->get_go_exp_a(chain1,chain2);
01310 int exp_b = const_cast<Molecule*>(this)->get_go_exp_b(chain1,chain2);
01311 Real sigma_ij = goSigmas[goSigmaIndices[atom1]*numGoAtoms + goSigmaIndices[atom2]];
01312 // Positive gradient of potential, not negative gradient of potential
01313 pow1 = pow(sigma_ij/r,exp_a);
01314 pow2 = pow(sigma_ij/r,exp_b);
01315 goForce = ((4/(r*r)) * epsilon * (exp_a * pow1 - exp_b * pow2));
01316 //DebugM(3,"get_go_force - (" << atom1 << "," << atom2 << ") chain1:" << chain1 << ", chain2:" << chain2 << ", sigma_ij:" << sigma_ij << ", r:" << r << ", goForce:" << goForce << std::endl);
01317 *goNative = (4 * epsilon * ( pow1 - pow2 ) );
01318 *goNonnative = 0.0;
01319 }
01320 }
01321 }
01322 //DebugM(3,"goForce:" << goForce << std::endl);
01323 return goForce;
01324 }
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 1464 of file GoMolecule.C. References atomChainTypes, BigReal, get_go_cutoff(), get_go_epsilon(), get_go_epsilonRep(), get_go_exp_a(), get_go_exp_b(), get_go_exp_rep(), get_go_sigmaRep(), go_restricted(), goIndxLJB, goNonnative, goResidIndices, goSigmaPairA, goSigmaPairB, int32, pointerToGoBeg, pointerToGoEnd, and Real. 01471 {
01472
01473 // Check to see if restricted. If so, escape function early
01474 int32 chain1 = atomChainTypes[atom1];
01475 int32 chain2 = atomChainTypes[atom2];
01476
01477 if(chain1 == 0 || chain2 == 0) return 0.0;
01478 Molecule *mol = const_cast<Molecule*>(this);
01479 Real goCutoff = mol->get_go_cutoff(chain1,chain2);
01480 if(goCutoff == 0) return 0.0;
01481
01482 int resid1 = goResidIndices[atom1];
01483 int resid2 = goResidIndices[atom2];
01484 int residDiff = abs(resid1 - resid2);
01485 if((mol->go_restricted(chain1,chain2,residDiff))) {
01486 return 0.0;
01487 }
01488
01489 int LJIndex = -1;
01490 int LJbegin = pointerToGoBeg[atom1];
01491 int LJend = pointerToGoEnd[atom1];
01492 for(int i = LJbegin; i <= LJend; i++) {
01493 if(goIndxLJB[i] == atom2) {
01494 LJIndex = i;
01495 }
01496 }
01497
01498 BigReal r2 = x*x + y*y + z*z;
01499 BigReal r = sqrt(r2);
01500
01501 if (LJIndex == -1) {
01502 int exp_rep = const_cast<Molecule*>(this)->get_go_exp_rep(chain1,chain2);
01503 BigReal epsilonRep = const_cast<Molecule*>(this)->get_go_epsilonRep(chain1, chain2);
01504 BigReal sigmaRep = const_cast<Molecule*>(this)->get_go_sigmaRep(chain1, chain2);
01505 double sigmaRepPow = pow(sigmaRep,exp_rep);
01506 BigReal LJ = (4*epsilonRep*exp_rep*sigmaRepPow*pow(r,-(exp_rep+1)));
01507 *goNative = 0;
01508 *goNonnative = (4*epsilonRep*sigmaRepPow*pow(r,-exp_rep));
01509 //*goNonnative = (4*epsilonRep * pow(sigmaRep/r,exp_rep));
01510 return (LJ/r);
01511 } else {
01512 // Code to calculate distances because the pair was found in one of the lists
01513 int exp_a = const_cast<Molecule*>(this)->get_go_exp_a(chain1,chain2);
01514 int exp_b = const_cast<Molecule*>(this)->get_go_exp_b(chain1,chain2);
01515 // We want the force, so we have to take the n+1 derivative
01516 BigReal powA = pow(r,-(exp_a + 1));
01517 BigReal powB = pow(r,-(exp_b + 1));
01518 BigReal powaa = pow(r,-exp_a);
01519 BigReal powbb = pow(r,-exp_b);
01520 BigReal epsilon = const_cast<Molecule*>(this)->get_go_epsilon(chain1,chain2);
01521 BigReal LJ = 4 * epsilon * (exp_a*goSigmaPairA[LJIndex]*powA - exp_b*goSigmaPairB[LJIndex]*powB);
01522 *goNative = 4 * epsilon * (goSigmaPairA[LJIndex]*powaa - goSigmaPairB[LJIndex]*powbb);
01523 *goNonnative = 0;
01524 return (LJ/r);
01525 }
01526 return 0;
01527 }
|
|
||||||||||||||||||||||||
|
Definition at line 1342 of file GoMolecule.C. References atomChainTypes, BigReal, DebugM, goCoordinates, goForce, goNonnative, goResids, goSigmaIndices, int32, and Real. 01347 {
01348 int resid1;
01349 int resid2;
01350 int residDiff;
01351 Real xcoorDiff;
01352 Real ycoorDiff;
01353 Real zcoorDiff;
01354 Real atomAtomDist;
01355 Real exp_a;
01356 Real exp_b;
01357 Real sigma_ij;
01358 Real epsilon;
01359 Real epsilonRep;
01360 Real sigmaRep;
01361 Real expRep;
01362 Real pow1;
01363 Real pow2;
01364
01365 BigReal goForce = 0.0;
01366 *goNative = 0;
01367 *goNonnative = 0;
01368
01369 // determine which Go chain pair we are working with
01370 DebugM(3,"get_go_force - (" << atom1 << "," << atom2 << ")" << std::endl);
01371 int goIndex1 = goSigmaIndices[atom1];
01372 int goIndex2 = goSigmaIndices[atom2];
01373
01374 int32 chain1 = atomChainTypes[goIndex1];
01375 int32 chain2 = atomChainTypes[goIndex2];
01376
01377 DebugM(3," chain1:" << chain1 << ", chain2:" << chain2 << std::endl);
01378 if (chain1 == 0 || chain2 == 0) return 0.0;
01379
01380 // retrieve Go cutoff for this chain pair
01381 Real goCutoff = const_cast<Molecule*>(this)->get_go_cutoff(chain1,chain2);
01382 DebugM(3," goCutoff:" << goCutoff << std::endl);
01383 if (goCutoff == 0) return 0.0;
01384
01385 // sigmas are initially set to -1.0 if the atom pair fails go_restricted
01386 // no goSigmas array anymore
01387 //Real sigma_ij = goSigmas[goSigmaIndices[atom1]*numGoAtoms + goSigmaIndices[atom2]];
01388
01389 // XXX - used to be a condition for the following if
01390 //if the atoms are within 4 of each other
01391 //if ( !atoms_1to4(atom1,atom2) ) {
01392
01393 // if goSigmaIndices aren't defined, don't calculate forces
01394 if ( goIndex1 != -1 && goIndex2 != -1 ) {
01395 resid1 = goResids[goIndex1];
01396 resid2 = goResids[goIndex2];
01397 residDiff = resid2 - resid1;
01398 if (residDiff < 0) residDiff = -residDiff;
01399 // if this is a Go atom pair that is not restricted
01400 if ( !(const_cast<Molecule*>(this)->go_restricted(chain1,chain2,residDiff)) ) {
01401 xcoorDiff = goCoordinates[goIndex1*3] - goCoordinates[goIndex2*3];
01402 ycoorDiff = goCoordinates[goIndex1*3 + 1] - goCoordinates[goIndex2*3 + 1];
01403 zcoorDiff = goCoordinates[goIndex1*3 + 2] - goCoordinates[goIndex2*3 + 2];
01404 atomAtomDist = sqrt(xcoorDiff*xcoorDiff + ycoorDiff*ycoorDiff + zcoorDiff*zcoorDiff);
01405
01406 // if attractive then calculate attractive
01407 if ( atomAtomDist <= const_cast<Molecule*>(this)->get_go_cutoff(chain1,chain2) ) {
01408 exp_a = const_cast<Molecule*>(this)->get_go_exp_a(chain1,chain2);
01409 exp_b = const_cast<Molecule*>(this)->get_go_exp_b(chain1,chain2);
01410 sigma_ij = pow(static_cast<double>(exp_b/exp_a),(1.0/(exp_a-exp_b))) * atomAtomDist;
01411
01412 // [JLai] print out atoms involved in native contacts
01413 // printf("ATOM1: %d C1: %d ATOM2: %d C2: %d\n", atom1,chain1,atom2,chain2);
01414
01415 epsilon = const_cast<Molecule*>(this)->get_go_epsilon(chain1,chain2);
01416 pow1 = pow(sigma_ij/r,static_cast<double>(exp_a));
01417 pow2 = pow(sigma_ij/r,static_cast<double>(exp_b));
01418 //goForce = ((4/r) * epsilon * (exp_a * pow(sigma_ij/r,exp_a) - exp_b * pow(sigma_ij/r,exp_b)));
01419 goForce = ((4/(r*r)) * epsilon * (exp_a * pow1 - exp_b * pow2));
01420 DebugM(3,"get_go_force - (" << atom1 << "," << atom2 << ") chain1:" << chain1 << ", chain2:" << chain2 << ", exp_a:" << exp_a << ", exp_b:" << exp_b << ", sigma_ij:" << sigma_ij << ", r:" << r << ", goForce:" << goForce << std::endl);
01421 //goEnergy = (4 * epsilon * ( pow(sigma_ij/r,exp_a) - pow(sigma_ij/r,exp_b) ) ); // JLai I changed some of the expressions
01422 *goNative = (4 * epsilon * ( pow1 - pow2 ) );
01423 *goNonnative = 0;
01424 }
01425
01426 // if repulsive then calculate repulsive
01427 else {
01428 epsilonRep = const_cast<Molecule*>(this)->get_go_epsilonRep(chain1,chain2);
01429 sigmaRep = const_cast<Molecule*>(this)->get_go_sigmaRep(chain1,chain2);
01430 expRep = const_cast<Molecule*>(this)->get_go_exp_rep(chain1,chain2);
01431 pow1 = pow(sigmaRep/r,(BigReal)expRep);
01432 //goForce = ((12.0/r) * epsilonRep * pow(sigmaRep/r,12.0));
01433 goForce = (4*(expRep/(r*r)) * epsilonRep * pow1);
01434 DebugM(3,"get_go_force - (" << atom1 << "," << atom2 << ") chain1:" << chain1 << ", chain2:" << chain2 << ", epsilonRep:" << epsilonRep << ", sigmaRep:" << sigmaRep << ", r:" << r << ", goForce:" << goForce << std::endl);
01435 //goEnergy = (4 * epsilonRep * pow(sigmaRep/r,12.0)); // JLai I changed some of the expressions
01436 *goNonnative = (4 * epsilonRep * pow1);
01437 *goNative = 0;
01438 }
01439 }
01440 }
01441
01442 //DebugM(3,"goForce:" << goForce << std::endl);
01443 return goForce;
01444 }
|
|
||||||||||||
|
Definition at line 1281 of file Molecule.h. References MAX_GO_CHAINS, Real, and go_val::sigmaRep. Referenced by get_go_force2(). 01281 { return go_array[MAX_GO_CHAINS*chain1 + chain2].sigmaRep; };
|
|
|
Definition at line 1005 of file Molecule.h. Referenced by ComputeGridForce::doForce(), and Node::reloadGridforceGrid(). 01006 {
01007 GridforceGrid *result = NULL;
01008 if (gridnum >= 0 && gridnum < numGridforceGrids) {
01009 result = gridfrcGrid[gridnum];
01010 }
01011 return result;
01012 }
|
|
||||||||||||||||||||
|
Definition at line 999 of file Molecule.h. Referenced by ComputeGridForce::do_calc(). 01000 {
01001 k = gridfrcParams[gridnum][gridfrcIndexes[gridnum][atomnum]].k;
01002 q = gridfrcParams[gridnum][gridfrcIndexes[gridnum][atomnum]].q;
01003 }
|
|
||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 1181 of file GoMolecule.C. References A, BigReal, gA, giSigma1, giSigma2, gMu1, gMu2, gRepulsive, indxGaussB, indxLJB, pairC12, pairC6, pointerToGaussBeg, pointerToGaussEnd, pointerToLJBeg, and pointerToLJEnd. 01188 {
01189 //Initialize return energies to zero
01190 *pairLJEnergy = 0.0;
01191 *pairGaussEnergy = 0.0;
01192
01193 // Linear search for LJ data
01194 int LJIndex = -1;
01195 int LJbegin = pointerToLJBeg[atom1];
01196 int LJend = pointerToLJEnd[atom1];
01197 for(int i = LJbegin; i <= LJend; i++) {
01198 if(indxLJB[i] == atom2) {
01199 LJIndex = i;
01200 break;
01201 }
01202 }
01203
01204 // Linear search for Gaussian data
01205 int GaussIndex = -1;
01206 int Gaussbegin = pointerToGaussBeg[atom1];
01207 int Gaussend = pointerToGaussEnd[atom1];
01208 for(int i = Gaussbegin; i <= Gaussend; i++) {
01209 if(indxGaussB[i] == atom2) {
01210 GaussIndex = i;
01211 break;
01212 }
01213 }
01214
01215 if( LJIndex == -1 && GaussIndex == -1) {
01216 return 0;
01217 } else {
01218 // Code to calculate distances because the pair was found in one of the lists
01219 BigReal r2 = x*x + y*y + z*z;
01220 BigReal r = sqrt(r2);
01221 BigReal ri = 1/r;
01222 BigReal ri6 = (ri*ri*ri*ri*ri*ri);
01223 BigReal ri12 = ri6*ri6;
01224 BigReal ri13 = ri12*ri;
01225 BigReal LJ = 0;
01226 BigReal Gauss = 0;
01227 // Code to calculate LJ
01228 if (LJIndex != -1) {
01229 BigReal ri7 = ri6*ri;
01230 LJ = (12*(pairC12[LJIndex]*ri13) - 6*(pairC6[LJIndex]*ri7));
01231 *pairLJEnergy = (pairC12[LJIndex]*ri12 - pairC6[LJIndex]*ri6);
01232 //std::cout << pairC12[LJIndex] << " " << pairC6[LJIndex] << " " << ri13 << " " << ri7 << " " << LJ << " " << r << "\n";
01233 }
01234 // Code to calculate Gaussian
01235 if (GaussIndex != -1) {
01236 BigReal gr = 12*gRepulsive[GaussIndex]*ri13;
01237 BigReal r1prime = r - gMu1[GaussIndex];
01238 BigReal tmp1 = r1prime * r1prime;
01239 BigReal r2prime = r - gMu2[GaussIndex];
01240 BigReal tmp2 = r2prime * r2prime;
01241 BigReal tmp_gauss1 = 0;
01242 BigReal one_gauss1 = 1;
01243 BigReal tmp_gauss2 = 0;
01244 BigReal one_gauss2 = 1;
01245 if (giSigma1[GaussIndex] != 0) {
01246 tmp_gauss1 = exp(-tmp1*giSigma1[GaussIndex]);
01247 one_gauss1 = 1 - tmp_gauss1;
01248 }
01249 if (giSigma2[GaussIndex] != 0) {
01250 tmp_gauss2 = exp(-tmp2*giSigma2[GaussIndex]);
01251 one_gauss2 = 1 - tmp_gauss2;
01252 }
01253 BigReal A = gA[GaussIndex];
01254 Gauss = gr*one_gauss1*one_gauss2 - 2*A*tmp_gauss1*one_gauss2*r1prime*giSigma1[GaussIndex] \
01255 - 2*tmp_gauss1*one_gauss2*r1prime*giSigma1[GaussIndex]*gRepulsive[GaussIndex]*ri12 - 2*A*tmp_gauss2*one_gauss1*r2prime*giSigma2[GaussIndex] \
01256 - 2*tmp_gauss2*one_gauss1*r2prime*giSigma2[GaussIndex]*gRepulsive[GaussIndex]*ri12;
01257 *pairGaussEnergy = A*(-1+(one_gauss1)*(one_gauss2)*(1+gRepulsive[GaussIndex]*ri12/A));
01258 }
01259 //std::cout << "Net force: " << (LJ + Gauss) << " with ri " << (LJ + Gauss)*ri << "\n";
01260 return (LJ + Gauss)*ri;
01261 }
01262 return 0;
01263 }
|
|
|
|
|
|
Definition at line 800 of file Molecule.h. References Improper. Referenced by dumpbench(). 00800 {return (&(impropers[inum]));}
|
|
|
Definition at line 880 of file Molecule.h. References int32. Referenced by dumpbench(). 00881 { return impropersByAtom[anum]; }
|
|
|
Definition at line 810 of file Molecule.h. References Lphost. 00810 {
00811 // don't call unless simParams->drudeOn == TRUE
00812 // otherwise lphostIndexes array doesn't exist!
00813 int index = lphostIndexes[atomid];
00814 return (index != -1 ? &(lphosts[index]) : NULL);
00815 }
|
|
|
Definition at line 888 of file Molecule.h. References int32. 00889 { return modExclusionsByAtom[anum]; }
|
|
|
|
|
||||||||||||
|
Definition at line 1050 of file Molecule.h. Referenced by Sequencer::addMovDragToPosition(). 01051 {
01052 v = movDragParams[movDragIndexes[atomnum]].v;
01053 }
|
|
||||||||||||
|
Definition at line 159 of file Molecule.C. References ResidueLookupElem::lookup(), and NAMD_die(). Referenced by GlobalMasterFreeEnergy::getNumAtoms(), and GlobalMasterEasy::getNumAtoms(). 00160 {
00161
00162 if (atomNames == NULL || resLookup == NULL)
00163 {
00164 NAMD_die("Tried to find atom from name on node other than node 0");
00165 }
00166 int i = 0;
00167 int end = 0;
00168 if ( resLookup->lookup(segid,resid,&i,&end) ) return 0;
00169 return ( end - i );
00170 }
|
|
||||||||||||||||||||
|
Definition at line 1056 of file Molecule.h. Referenced by Sequencer::addRotDragToPosition(). 01058 {
01059 v = rotDragParams[rotDragIndexes[atomnum]].v;
01060 a = rotDragParams[rotDragIndexes[atomnum]].a;
01061 p = rotDragParams[rotDragIndexes[atomnum]].p;
01062 }
|
|
||||||||||||
|
Definition at line 1031 of file Molecule.h. 01032 {
01033 refPos = stirParams[stirIndexes[atomnum]].refPos;
01034 }
|
|
|
Definition at line 1043 of file Molecule.h. References Real. Referenced by ComputeStir::doForce(). 01044 {
01045 return stirParams[stirIndexes[atomnum]].startTheta;
01046 }
|
|
|
Definition at line 837 of file Molecule.h. References Bond. 00837 {return acceptors;}
|
|
|
Definition at line 820 of file Molecule.h. References Angle. Referenced by buildAngleData(). 00820 {return angles;}
|
|
|
Definition at line 819 of file Molecule.h. References Bond. Referenced by buildBondData(). 00819 {return bonds;}
|
|
|
Definition at line 823 of file Molecule.h. References Crossterm. Referenced by buildCrosstermData(). 00823 {return crossterms;}
|
|
|
Definition at line 822 of file Molecule.h. References Dihedral. Referenced by buildDihedralData(). 00822 {return dihedrals;}
|
|
|
Definition at line 836 of file Molecule.h. References Bond. 00836 {return donors;}
|
|
|
Definition at line 821 of file Molecule.h. References Improper. Referenced by buildImproperData(). 00821 {return impropers;}
|
|
|
Definition at line 827 of file Molecule.h. References Lphost. 00827 { return lphosts; }
|
|
|
Definition at line 437 of file Molecule.h. References drude_constants::alpha, and BigReal. 00437 {
00438 return drudeConsts[i].alpha;
00439 }
|
|
|
Definition at line 446 of file Molecule.h. References AtomNameInfo. Referenced by buildAtomData(). 00446 { return atomNames; }
|
|
|
Definition at line 445 of file Molecule.h. References Atom. Referenced by buildAtomData(), WorkDistrib::createAtomLists(), and outputCompressedFile(). 00445 { return atoms; }
|
|
|
Definition at line 449 of file Molecule.h. References AtomSegResInfo. Referenced by buildAtomData(). 00449 { return atomSegResids; }
|
|
|
Definition at line 761 of file Molecule.h. Referenced by NamdState::configListInit(), and outputCompressedFile(). 00761 { return (const float *)bfactor; }
|
|
|
Definition at line 433 of file Molecule.h. Referenced by HomePatch::setLcpoType(). 00433 {
00434 return lcpoParamType;
00435 }
|
|
|
Definition at line 757 of file Molecule.h. Referenced by NamdState::configListInit(), and outputCompressedFile(). 00757 { return (const float *)occupancy; }
|
|
||||||||||||||||
|
Definition at line 525 of file GoMolecule.C. References Bool, go_array, MAX_GO_CHAINS, and go_val::restrictions. Referenced by build_go_arrays(), build_go_sigmas(), build_go_sigmas2(), and get_go_force2(). 00526 {
00527 int i; // Loop counter
00528 for(i=0; i<MAX_RESTRICTIONS; i++) {
00529 if (go_array[(MAX_GO_CHAINS*chain1) + chain2].restrictions[i] == rDiff) {
00530 return TRUE;
00531 } else if (go_array[(MAX_GO_CHAINS*chain1) + chain2].restrictions[i] == -1) {
00532 return FALSE;
00533 }
00534 }
00535 return FALSE;
00536 }
|
|
|
Definition at line 54 of file GoMolecule.C. References atomChainTypes, energyNative, energyNonnative, goCoordinates, goPDB, goResids, goSigmaIndices, goSigmas, goWithinCutoff, and numGoAtoms. 00054 {
00055 numGoAtoms=0;
00056 energyNative=0;
00057 energyNonnative=0;
00058 atomChainTypes=NULL;
00059 goSigmaIndices=NULL;
00060 goSigmas=NULL;
00061 goWithinCutoff=NULL;
00062 goCoordinates=NULL;
00063 goResids=NULL;
00064 goPDB=NULL;
00065 }
|
|
|
Referenced by Molecule(). |
|
|
Definition at line 975 of file Molecule.h. References Bool. 00976 {
00977 if (numConsTorque)
00978 {
00979 // Check the index to see if it is constrained
00980 return(consTorqueIndexes[atomnum] != -1);
00981 }
00982 else
00983 {
00984 // No constraints at all, so just return FALSE
00985 return(FALSE);
00986 }
00987 }
|
|
|
Definition at line 926 of file Molecule.h. References Bool. Referenced by ComputeRestraints::doForce(). 00927 {
00928 if (numConstraints)
00929 {
00930 // Check the index to see if it is constrained
00931 return(consIndexes[atomnum] != -1);
00932 }
00933 else
00934 {
00935 // No constraints at all, so just return FALSE
00936 return(FALSE);
00937 }
00938 }
|
|
|
Definition at line 1121 of file Molecule.h. References Bool. Referenced by Sequencer::langevinPiston(). 01122 {
01123 return (numExPressureAtoms && exPressureAtomFlags[atomnum]);
01124 }
|
|
|
Definition at line 1081 of file Molecule.h. References Bool. Referenced by WorkDistrib::createAtomLists(). 01082 {
01083 return (numFixedAtoms && fixedAtomFlags[atomnum]);
01084 }
|
|
||||||||||||
|
Definition at line 910 of file Molecule.h. References Bool. Referenced by ComputeGridForce::do_calc(). 00911 {
00912 if (numGridforceGrids)
00913 {
00914 return(gridfrcIndexes[gridnum][atomnum] != -1);
00915 }
00916 else
00917 {
00918 return(FALSE);
00919 }
00920 }
|
|
|
Definition at line 943 of file Molecule.h. References Bool. Referenced by Sequencer::addMovDragToPosition(). 00944 {
00945 if (numMovDrag)
00946 {
00947 // Check the index to see if it is constrained
00948 return(movDragIndexes[atomnum] != -1);
00949 }
00950 else
00951 {
00952 // No constraints at all, so just return FALSE
00953 return(FALSE);
00954 }
00955 }
|
|
|
Definition at line 959 of file Molecule.h. References Bool. Referenced by Sequencer::addRotDragToPosition(). 00960 {
00961 if (numRotDrag)
00962 {
00963 // Check the index to see if it is constrained
00964 return(rotDragIndexes[atomnum] != -1);
00965 }
00966 else
00967 {
00968 // No constraints at all, so just return FALSE
00969 return(FALSE);
00970 }
00971 }
|
|
|
Definition at line 1102 of file Molecule.h. References Bool. Referenced by ComputeStir::doForce(). 01103 {
01104 if (numStirredAtoms)
01105 {
01106 // Check the index to see if it is constrained
01107 return(stirIndexes[atomnum] != -1);
01108 }
01109 else
01110 {
01111 // No constraints at all, so just return FALSE
01112 return(FALSE);
01113 }
01114 }
|
|
|
|
|
|
Definition at line 1117 of file Molecule.h. References Bool. 01118 {
01119 return (numFixedAtoms && (fixedAtomFlags[atomnum] == -1));
01120 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Referenced by outputCompressedFile(), and wrap_coor_int(). |
|
|
Definition at line 1025 of file Molecule.h. References Real. Referenced by WorkDistrib::createAtomLists(). 01026 {
01027 return(langevinParams ? langevinParams[atomnum] : 0.);
01028 }
|
|
|
Definition at line 478 of file Molecule.h. References SimParameters::comMove, SimParameters::fixedAtomsOn, SimParameters::langevinOn, SimParameters::pairInteractionOn, simParams, and SimParameters::watmodel. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), NamdState::configListInit(), and Controller::receivePressure(). 00478 {
00479 // local variables prefixed by s_
00480 int s_NumDegFreedom = 3 * numAtoms;
00481 int s_NumFixedAtoms = num_fixed_atoms();
00482 if (s_NumFixedAtoms) s_NumDegFreedom -= 3 * s_NumFixedAtoms;
00483 if (numLonepairs) s_NumDegFreedom -= 3 * numLonepairs;
00484 if ( ! (s_NumFixedAtoms || numConstraints
00485 || simParams->comMove || simParams->langevinOn) ) {
00486 s_NumDegFreedom -= 3;
00487 }
00488 if ( ! isInitialReport && simParams->pairInteractionOn) {
00489 //
00490 // DJH: a kludge? We want to initially report system degrees of freedom
00491 //
00492 // this doesn't attempt to deal with fixed atoms or constraints
00493 s_NumDegFreedom = 3 * numFepInitial;
00494 }
00495 int s_NumFixedRigidBonds =
00496 (simParams->fixedAtomsOn ? numFixedRigidBonds : 0);
00497 if (simParams->watmodel == WAT_TIP4) {
00498 // numLonepairs is subtracted here because all lonepairs have a rigid bond
00499 // to oxygen, but all of the LP degrees of freedom are dealt with above
00500 s_NumDegFreedom -= (numRigidBonds - s_NumFixedRigidBonds - numLonepairs);
00501 }
00502 else {
00503 // Non-polarized systems don't have LPs.
00504 // For Drude model, bonds that attach LPs are not counted as rigid;
00505 // LPs have already been subtracted from degrees of freedom.
00506 s_NumDegFreedom -= (numRigidBonds - s_NumFixedRigidBonds);
00507 }
00508 return s_NumDegFreedom;
00509 }
|
|
|
Definition at line 452 of file Molecule.h. References SimParameters::fixedAtomsOn, and simParams. Referenced by Controller::receivePressure(). 00452 {
00453 // local variables prefixed by s_
00454 int s_NumFixedAtoms = (simParams->fixedAtomsOn ? numFixedAtoms : 0);
00455 return s_NumFixedAtoms; // value is "turned on" SimParameters
00456 }
|
|
|
Definition at line 458 of file Molecule.h. Referenced by Controller::receivePressure(). 00458 {
00459 // local variables prefixed by s_
00460 int s_NumFixedAtoms = num_fixed_atoms();
00461 int s_NumFixedGroups = (s_NumFixedAtoms ? numFixedGroups : 0);
00462 return s_NumFixedGroups; // value is "turned on" SimParameters
00463 }
|
|
|
Definition at line 465 of file Molecule.h. References SimParameters::comMove, SimParameters::langevinOn, and simParams. Referenced by Controller::receivePressure(). 00465 {
00466 // local variables prefixed by s_
00467 int s_NumGroupDegFreedom = 3 * numHydrogenGroups;
00468 int s_NumFixedAtoms = num_fixed_atoms();
00469 int s_NumFixedGroups = num_fixed_groups();
00470 if (s_NumFixedGroups) s_NumGroupDegFreedom -= 3 * s_NumFixedGroups;
00471 if ( ! (s_NumFixedAtoms || numConstraints
00472 || simParams->comMove || simParams->langevinOn) ) {
00473 s_NumGroupDegFreedom -= 3;
00474 }
00475 return s_NumGroupDegFreedom;
00476 }
|
|
|
Definition at line 4855 of file Molecule.C. References DebugM, endi(), Parameters::get_vdw_params(), and Real. Referenced by NamdState::configListInit(). 04856 {
04857 #ifdef MEM_OPT_VERSION
04858 DebugM(2, "WARNING: this function is not availabe in memory optimized version!\n" << endi);
04859 #else
04860 register int i;
04861 Real sigma;
04862 Real epsilon;
04863 Real sigma14;
04864 Real epsilon14;
04865
04866 DebugM(2,"ATOM LIST\n" \
04867 << "******************************************\n" \
04868 << "NUM NAME TYPE RES MASS CHARGE CHARGE FEP-CHARGE" \
04869 << "SIGMA EPSILON SIGMA14 EPSILON14\n" \
04870 << endi);
04871
04872 for (i=0; i<numAtoms; i++)
04873 {
04874 params->get_vdw_params(&sigma, &epsilon, &sigma14, &epsilon14,
04875 atoms[i].vdw_type);
04876
04877 DebugM(2,i+1 << " " << atomNames[i].atomname \
04878 << " " << atomNames[i].atomtype << " " \
04879 << atomNames[i].resname << " " << atoms[i].mass \
04880 << " " << atoms[i].charge << " " << sigma \
04881 << " " << epsilon << " " << sigma14 \
04882 << " " << epsilon14 << "\n" \
04883 << endi);
04884 }
04885 #endif
04886 }
|
|
|
Definition at line 4898 of file Molecule.C. References DebugM, endi(), Parameters::get_bond_params(), and Real. Referenced by NamdState::configListInit(). 04899 {
04900 #ifdef MEM_OPT_VERSION
04901 DebugM(2, "WARNING: this function is not availabe in memory optimized version!\n" << endi);
04902 #else
04903 register int i;
04904 Real k;
04905 Real x0;
04906
04907 DebugM(2,"BOND LIST\n" << "********************************\n" \
04908 << "ATOM1 ATOM2 TYPE1 TYPE2 k x0" \
04909 << endi);
04910
04911 for (i=0; i<numBonds; i++)
04912 {
04913 params->get_bond_params(&k, &x0, bonds[i].bond_type);
04914
04915 DebugM(2,bonds[i].atom1+1 << " " \
04916 << bonds[i].atom2+1 << " " \
04917 << atomNames[bonds[i].atom1].atomtype << " " \
04918 << atomNames[bonds[i].atom2].atomtype << " " << k \
04919 << " " << x0 << endi);
04920 }
04921
04922 #endif
04923 }
|
|
|
Definition at line 4935 of file Molecule.C. References DebugM, and endi(). Referenced by NamdState::configListInit(). 04936 {
04937 #ifdef MEM_OPT_VERSION
04938 DebugM(2, "WARNING: this function is not availabe in memory optimized version!\n" << endi);
04939 #else
04940 register int i;
04941
04942 DebugM(2,"EXPLICIT EXCLUSION LIST\n" \
04943 << "********************************\n" \
04944 << "ATOM1 ATOM2 " \
04945 << endi);
04946
04947 for (i=0; i<numExclusions; i++)
04948 {
04949 DebugM(2,exclusions[i].atom1+1 << " " \
04950 << exclusions[i].atom2+1 << endi);
04951 }
04952 #endif
04953 }
|
|
|
Definition at line 548 of file GoMolecule.C. References DebugM, go_array, j, and NumGoChains. 00549 {
00550 int i;
00551 int j;
00552 int index;
00553
00554 DebugM(3,NumGoChains << " Go PARAMETERS 3\n" \
00555 << "*****************************************" << std::endl);
00556
00557 for (i=0; i<NumGoChains; i++) {
00558 for (j=0; j<NumGoChains; j++) {
00559 index = (i * MAX_GO_CHAINS) + j;
00560 // Real epsilon; // Epsilon
00561 // Real exp_a; // First exponent for attractive L-J term
00562 // Real exp_b; // Second exponent for attractive L-J term
00563 // Real sigmaRep; // Sigma for repulsive term
00564 // Real epsilonRep; // Epsilon for replusive term
00565 DebugM(3,"Go index=(" << i << "," << j << ") epsilon=" << go_array[index].epsilon \
00566 << " exp_a=" << go_array[index].exp_a << " exp_b=" << go_array[index].exp_b \
00567 << " exp_rep=" << go_array[index].exp_rep << " sigmaRep=" \
00568 << go_array[index].sigmaRep << " epsilonRep=" << go_array[index].epsilonRep \
00569 << " cutoff=" << go_array[index].cutoff << std::endl);
00570 }
00571 }
00572
00573 }
|
|
|
Definition at line 1134 of file GoMolecule.C. References DebugM, goSigmaIndices, goSigmas, j, numGoAtoms, and Real. 01135 {
01136 int i; // Counter
01137 int j; // Counter
01138 Real sigma;
01139
01140 DebugM(3,"GO SIGMA ARRAY\n" \
01141 << "***************************" << std::endl);
01142 DebugM(3, "numGoAtoms: " << numGoAtoms << std::endl);
01143
01144 if (goSigmaIndices == NULL) {
01145 DebugM(3, "GO SIGMAS HAVE NOT BEEN BUILT" << std::endl);
01146 return;
01147 }
01148
01149 for (i=0; i<numAtoms; i++) {
01150 for (j=0; j<numAtoms; j++) {
01151 if ( goSigmaIndices[i] != -1 && goSigmaIndices[j] != -1 ) {
01152 //DebugM(3, "i: " << i << ", j: " << j << std::endl);
01153 sigma = goSigmas[goSigmaIndices[i]*numGoAtoms + goSigmaIndices[j]];
01154 if (sigma > 0.0) {
01155 DebugM(3, "(" << i << "," << j << ") - +" << sigma << " ");
01156 }
01157 else {
01158 DebugM(3, "(" << i << "," << j << ") - " << sigma << " ");
01159 }
01160 } else {
01161 //DebugM(3, "0 ");
01162 }
01163 }
01164 if ( goSigmaIndices[i] != -1 ) {
01165 DebugM(3, "-----------" << std::endl);
01166 }
01167 }
01168 return;
01169 }
|
|
||||||||||||
|
Definition at line 1037 of file Molecule.h. 01038 {
01039 stirParams[stirIndexes[atomnum]].startTheta = theta;
01040 }
|
|
|
Definition at line 113 of file GoMolecule.C. References Bool, go_val::cutoff, DebugM, go_val::epsilon, go_val::epsilonRep, go_val::exp_a, go_val::exp_b, go_val::exp_rep, go_array, go_indices, GoValue, iout, iWARN(), j, MAX_GO_CHAINS, NAMD_blank_string(), NAMD_die(), NAMD_find_first_word(), NAMD_read_line(), NumGoChains, Real, go_val::restrictions, and go_val::sigmaRep. Referenced by build_go_params(). 00115 {
00116
00117 int i; // Counter
00118 int j; // Counter
00119 int par_type=0; // What type of parameter are we currently
00120 // dealing with? (vide infra)
00121 // JLai -- uncommented
00122 int skipline; // skip this line?
00123 int skipall = 0; // skip rest of file;
00124 char buffer[512]; // Buffer to store each line of the file
00125 char first_word[512]; // First word of the current line
00126 int read_count = 0; // Count of input parameters on a given line
00127 int chain1 = 0; // First chain type for pair interaction
00128 int chain2 = 0; // Second chain type for pair interaction
00129 int int1; // First parameter int
00130 int int2; // Second parameter int
00131 Real r1; // Parameter Real
00132 char in2[512]; // Second parameter word
00133 GoValue *goValue1 = NULL; // current GoValue for loading parameters
00134 GoValue *goValue2 = NULL; // other current GoValue for loading parameters
00135 Bool sameGoChain = FALSE; // whether the current GoValue is within a chain or between chains
00136 int restrictionCount = 0; // number of Go restrictions set for a given chain pair
00137 FILE *pfile; // File descriptor for the parameter file
00138
00139 /* Check to make sure that we haven't previously been told */
00140 /* that all the files were read */
00141 /*if (AllFilesRead)
00142 {
00143 NAMD_die("Tried to read another parameter file after being told that all files were read!");
00144 }*/
00145
00146 /* Initialize go_indices */
00147 for (i=0; i<MAX_GO_CHAINS+1; i++) {
00148 go_indices[i] = -1;
00149 }
00150
00151 /* Initialize go_array */
00152 for (i=0; i<MAX_GO_CHAINS*MAX_GO_CHAINS; i++) {
00153 go_array[i].epsilon = 1.25;
00154 go_array[i].exp_a = 12;
00155 go_array[i].exp_b = 6;
00156 go_array[i].exp_rep = 12;
00157 go_array[i].sigmaRep = 2.25;
00158 go_array[i].epsilonRep = 0.03;
00159 go_array[i].cutoff = 4.0;
00160 for (j=0; j<MAX_RESTRICTIONS; j++) {
00161 go_array[i].restrictions[j] = -1;
00162 }
00163 }
00164
00165 /* Try and open the file */
00166 if ( (pfile = fopen(fname, "r")) == NULL)
00167 {
00168 char err_msg[256];
00169
00170 sprintf(err_msg, "UNABLE TO OPEN GO PARAMETER FILE %s\n", fname);
00171 NAMD_die(err_msg);
00172 }
00173
00174 /* Keep reading in lines until we hit the EOF */
00175 while (NAMD_read_line(pfile, buffer) != -1)
00176 {
00177 /* Get the first word of the line */
00178 NAMD_find_first_word(buffer, first_word);
00179 skipline=0;
00180
00181 /* First, screen out things that we ignore. */
00182 /* blank lines, lines that start with '!' or '*', lines that */
00183 /* start with "END". */
00184 if (!NAMD_blank_string(buffer) &&
00185 (strncmp(first_word, "!", 1) != 0) &&
00186 (strncmp(first_word, "*", 1) != 0) &&
00187 (strncasecmp(first_word, "END", 3) != 0))
00188 {
00189 if ( skipall ) {
00190 iout << iWARN << "SKIPPING PART OF GO PARAMETER FILE AFTER RETURN STATEMENT\n" << endi;
00191 break;
00192 }
00193 /* Now, determine the apropriate parameter type. */
00194 if (strncasecmp(first_word, "chaintypes", 10)==0)
00195 {
00196 read_count=sscanf(buffer, "%s %d %d\n", first_word, &int1, &int2);
00197 if (read_count != 3) {
00198 char err_msg[512];
00199 sprintf(err_msg, "UNKNOWN PARAMETER IN GO PARAMETER FILE %s\nLINE=*%s*\nread_count=%d, int1=%d, int2=%d", fname, buffer, read_count, int1, int2);
00200 NAMD_die(err_msg);
00201 }
00202 chain1 = int1;
00203 chain2 = int2;
00204 if (chain1 < 1 || chain1 > MAX_GO_CHAINS ||
00205 chain2 < 1 || chain2 > MAX_GO_CHAINS) {
00206 char err_msg[512];
00207 sprintf(err_msg, "GO PARAMETER FILE: CHAIN INDEX MUST BE [1-%d] %s\nLINE=*%s*\nread_count=%d, int1=%d, int2=%d", MAX_GO_CHAINS, fname, buffer, read_count, int1, int2);
00208 NAMD_die(err_msg);
00209 }
00210 if (go_indices[chain1] == -1) {
00211 go_indices[chain1] = NumGoChains;
00212 NumGoChains++;
00213 }
00214 if (go_indices[chain2] == -1) {
00215 go_indices[chain2] = NumGoChains;
00216 NumGoChains++;
00217 }
00218 if (chain1 == chain2) {
00219 sameGoChain = TRUE;
00220 } else {
00221 sameGoChain = FALSE;
00222 }
00223 //goValue = &go_array[(chain1 * MAX_GO_CHAINS) + chain2];
00224 goValue1 = &go_array[(chain1*MAX_GO_CHAINS) + chain2];
00225 goValue2 = &go_array[(chain2*MAX_GO_CHAINS) + chain1];
00226 #if CODE_REDUNDANT
00227 goValue1 = &go_array[(go_indices[chain1]*MAX_GO_CHAINS) + go_indices[chain2]];
00228 goValue2 = &go_array[(go_indices[chain2]*MAX_GO_CHAINS) + go_indices[chain1]];
00229 #endif
00230 restrictionCount = 0; // restrictionCount applies to each chain pair separately
00231 }
00232 else if (strncasecmp(first_word, "epsilonRep", 10)==0)
00233 {
00234 read_count=sscanf(buffer, "%s %f\n", first_word, &r1);
00235 if (read_count != 2) {}
00236 goValue1->epsilonRep = r1;
00237 if (!sameGoChain) {
00238 goValue2->epsilonRep = r1;
00239 }
00240 }
00241 else if (strncasecmp(first_word, "epsilon", 7)==0)
00242 {
00243 // Read in epsilon
00244 read_count=sscanf(buffer, "%s %f\n", first_word, &r1);
00245 if (read_count != 2) {}
00246 goValue1->epsilon = r1;
00247 if (!sameGoChain) {
00248 goValue2->epsilon = r1;
00249 }
00250 }
00251 else if (strncasecmp(first_word, "exp_a", 5)==0)
00252 {
00253 read_count=sscanf(buffer, "%s %d\n", first_word, &int1);
00254 if (read_count != 2) {}
00255 goValue1->exp_a = int1;
00256 if (!sameGoChain) {
00257 goValue2->exp_a = int1;
00258 }
00259 }
00260 else if (strncasecmp(first_word, "exp_b", 5)==0)
00261 {
00262 read_count=sscanf(buffer, "%s %d\n", first_word, &int1);
00263 if (read_count != 2) {}
00264 goValue1->exp_b = int1;
00265 if (!sameGoChain) {
00266 goValue2->exp_b = int1;
00267 }
00268 }
00269 else if (strncasecmp(first_word, "exp_rep", 5)==0)
00270 {
00271 read_count=sscanf(buffer, "%s %d\n", first_word, &int1);
00272 if (read_count != 2) {}
00273 goValue1->exp_rep = int1;
00274 if (!sameGoChain) {
00275 goValue2->exp_rep = int1;
00276 }
00277 }
00278 else if (strncasecmp(first_word, "exp_Rep", 5)==0)
00279 {
00280 read_count=sscanf(buffer, "%s %d\n", first_word, &int1);
00281 if (read_count != 2) {}
00282 goValue1->exp_rep = int1;
00283 if (!sameGoChain) {
00284 goValue2->exp_rep = int1;
00285 }
00286 }
00287 else if (strncasecmp(first_word, "sigmaRep", 8)==0)
00288 {
00289 read_count=sscanf(buffer, "%s %f\n", first_word, &r1);
00290 if (read_count != 2) {}
00291 goValue1->sigmaRep = r1;
00292 if (!sameGoChain) {
00293 goValue2->sigmaRep = r1;
00294 }
00295 }
00296 else if (strncasecmp(first_word, "cutoff", 6)==0)
00297 {
00298 read_count=sscanf(buffer, "%s %f\n", first_word, &r1);
00299 if (read_count != 2) {}
00300 goValue1->cutoff = r1;
00301 if (!sameGoChain) {
00302 goValue2->cutoff = r1;
00303 }
00304 }
00305 else if (strncasecmp(first_word, "restriction", 10)==0)
00306 {
00307 read_count=sscanf(buffer, "%s %d\n", first_word, &int1);
00308 if (read_count != 2) {}
00309 if (int1 < 0) {
00310 DebugM(3, "ERROR: residue restriction value must be nonnegative. int1=" << int1 << "\n");
00311 }
00312 if (!sameGoChain) {
00313 //goValue2->restrictions[restrictionCount] = int1;
00314 DebugM(3, "ERROR: residue restrictions should not be defined between two separate chains. chain1=" << chain1 << ", chain2=" << chain2 << "\n");
00315 }
00316 else {
00317 goValue1->restrictions[restrictionCount] = int1;
00318 }
00319 restrictionCount++;
00320 }
00321 else if (strncasecmp(first_word, "return", 4)==0)
00322 {
00323 skipall=8;
00324 skipline=1;
00325 }
00326 else // if (par_type == 0)
00327 {
00328 /* This is an unknown paramter. */
00329 /* This is BAD */
00330 char err_msg[512];
00331
00332 sprintf(err_msg, "UNKNOWN PARAMETER IN GO PARAMETER FILE %s\nLINE=*%s*",fname, buffer);
00333 NAMD_die(err_msg);
00334 }
00335 }
00336 else
00337 {
00338 skipline=1;
00339 }
00340 }
00341
00342 /* Close the file */
00343 fclose(pfile);
00344
00345 return;
00346 }
|
|
|
|
|
|
Definition at line 1752 of file GoMolecule.C. References atomChainTypes, go_val::cutoff, go_val::epsilon, go_val::epsilonRep, go_val::exp_a, go_val::exp_b, go_val::exp_rep, MIStream::get(), go_array, go_indices, goCoordinates, SimParameters::goForcesOn, goIndxLJA, goIndxLJB, SimParameters::goMethod, goNumLJPair, goResidIndices, goResids, goSigmaIndices, goSigmaPairA, goSigmaPairB, goSigmas, goWithinCutoff, int32, j, MAX_GO_CHAINS, MAX_RESTRICTIONS, NAMD_die(), numAtoms, numGoAtoms, NumGoChains, pointerToGoBeg, pointerToGoEnd, Real, go_val::restrictions, and go_val::sigmaRep. 01752 {
01753 // Ported by JLai -- Original by JE
01754 // JE - receive Go info
01755 Real *a1, *a2, *a3, *a4;
01756 int *i1, *i2, *i3, *i4;
01757 int maxGoChainsSqr = MAX_GO_CHAINS*MAX_GO_CHAINS; // JE JLai Go code
01758 msg->get(NumGoChains);
01759
01760 if (NumGoChains) {
01761 //go_indices = new int[MAX_GO_CHAINS+1];
01762 //go_array = new GoValue[MAX_GO_CHAINS*MAX_GO_CHAINS];
01763
01764 // int go_indices[MAX_GO_CHAINS+1]; // Indices from chainIDs to go_array
01765 // GoValue go_array[MAX_GO_CHAINS*MAX_GO_CHAINS]; // Array of Go params
01766 msg->get(MAX_GO_CHAINS+1,go_indices);
01767
01768 a1 = new Real[maxGoChainsSqr];
01769 a2 = new Real[maxGoChainsSqr];
01770 a3 = new Real[maxGoChainsSqr];
01771 a4 = new Real[maxGoChainsSqr];
01772 i1 = new int[maxGoChainsSqr];
01773 i2 = new int[maxGoChainsSqr];
01774 i3 = new int[maxGoChainsSqr];
01775 i4 = new int[maxGoChainsSqr*MAX_RESTRICTIONS];
01776
01777 if ( (a1 == NULL) || (a2 == NULL) || (a3 == NULL) || (a4 == NULL) ||
01778 (i1 == NULL) || (i2 == NULL) || (i3 == NULL) || (i4 == NULL) )
01779 {
01780 NAMD_die("memory allocation failed in Molecule::send_Molecule");
01781 }
01782
01783 msg->get(maxGoChainsSqr, a1);
01784 msg->get(maxGoChainsSqr, a2);
01785 msg->get(maxGoChainsSqr, a3);
01786 msg->get(maxGoChainsSqr, a4);
01787 msg->get(maxGoChainsSqr, i1);
01788 msg->get(maxGoChainsSqr, i2);
01789 msg->get(maxGoChainsSqr, i3);
01790 msg->get(maxGoChainsSqr*MAX_RESTRICTIONS, i4);
01791
01792 for (int i=0; i<maxGoChainsSqr; i++) {
01793 go_array[i].epsilon = a1[i];
01794 go_array[i].sigmaRep = a2[i];
01795 go_array[i].epsilonRep = a3[i];
01796 go_array[i].cutoff = a4[i];
01797 go_array[i].exp_a = i1[i];
01798 go_array[i].exp_b = i2[i];
01799 go_array[i].exp_rep = i3[i];
01800 for (int j=0; j<MAX_RESTRICTIONS; j++) {
01801 go_array[i].restrictions[j] = i4[i*MAX_RESTRICTIONS + j];
01802 }
01803 }
01804
01805 delete [] a1;
01806 delete [] a2;
01807 delete [] a3;
01808 delete [] a4;
01809 delete [] i1;
01810 delete [] i2;
01811 delete [] i3;
01812 delete [] i4;
01813
01814 //msg->get(MAX_GO_CHAINS*MAX_GO_CHAINS, (char*)go_array);
01815
01816 /*DebugM(3,"NumGoChains:" << NumGoChains << std::endl);
01817 for (int ii=0; ii<MAX_GO_CHAINS; ii++) {
01818 for (int jj=0; jj<MAX_GO_CHAINS; jj++) {
01819 DebugM(3,"go_array[" << ii << "][" << jj << "]:" << go_array[ii][jj] << std::endl);
01820 }
01821 }
01822 for (int ii=0; ii<MAX_GO_CHAINS+1; ii++) {
01823 DebugM(3,"go_indices[" << ii << "]:" << go_indices[ii] << std::endl);
01824 }*/
01825 }
01826
01827 if (simParams->goForcesOn) {
01828 switch(simParams->goMethod) {
01829 case 1:
01830 msg->get(numGoAtoms);
01831 //printf("Deleting goSigmaIndiciesA\n");
01832 delete [] goSigmaIndices;
01833 goSigmaIndices = new int32[numAtoms];
01834 //printf("Deleting atomChainTypesA\n");
01835 delete [] atomChainTypes;
01836 atomChainTypes = new int32[numGoAtoms];
01837 //printf("Deleting goSigmasA\n");
01838 delete [] goSigmas;
01839 goSigmas = new Real[numGoAtoms*numGoAtoms];
01840 //printf("Deleting goWithinCutoffA\n");
01841 delete [] goWithinCutoff;
01842 goWithinCutoff = new bool[numGoAtoms*numGoAtoms];
01843 msg->get(numAtoms, goSigmaIndices);
01844 msg->get(numGoAtoms, atomChainTypes);
01845 msg->get(numGoAtoms*numGoAtoms, goSigmas);
01846 msg->get(numGoAtoms*numGoAtoms*sizeof(bool), (char*)goWithinCutoff);
01847 break;
01848 case 2: //GSR
01849 msg->get(numGoAtoms);
01850 delete [] pointerToGoBeg;
01851 pointerToGoBeg = new int[numAtoms];
01852 msg->get(numAtoms,pointerToGoBeg);
01853 delete [] pointerToGoEnd;
01854 pointerToGoEnd = new int[numAtoms];
01855 msg->get(numAtoms,pointerToGoEnd);
01856 delete [] goSigmaIndices;
01857 goSigmaIndices = new int32[numAtoms];
01858 msg->get(numAtoms,goSigmaIndices);
01859 delete [] goResidIndices;
01860 goResidIndices = new int32[numAtoms];
01861 msg->get(numAtoms,goResidIndices);
01862 delete [] atomChainTypes;
01863 atomChainTypes = new int32[numGoAtoms];
01864 msg->get(numGoAtoms,atomChainTypes);
01865 msg->get(goNumLJPair);
01866 delete [] goIndxLJA;
01867 goIndxLJA = new int[goNumLJPair];
01868 msg->get(goNumLJPair,goIndxLJA);
01869 delete [] goIndxLJB;
01870 goIndxLJB = new int[goNumLJPair];
01871 msg->get(goNumLJPair,goIndxLJB);
01872 delete [] goSigmaPairA;
01873 goSigmaPairA = new double[goNumLJPair];
01874 msg->get(goNumLJPair,goSigmaPairA);
01875 delete [] goSigmaPairB;
01876 goSigmaPairB = new double[goNumLJPair];
01877 msg->get(goNumLJPair,goSigmaPairB);
01878 break;
01879 case 3:
01880 msg->get(numGoAtoms);
01881 //printf("Deleting goSigmaIndiciesB\n");
01882 delete [] goSigmaIndices;
01883 goSigmaIndices = new int32[numAtoms];
01884 //printf("Deleting atomChainTypesB\n");
01885 delete [] atomChainTypes;
01886 atomChainTypes = new int32[numGoAtoms];
01887 //delete [] goSigmas;
01888 //goSigmas = new Real[numGoAtoms*numGoAtoms];
01889 //delete [] goWithinCutoff;
01890 //goWithinCutoff = new bool[numGoAtoms*numGoAtoms];
01891 //printf("Deleting goCoordinatesB\n");
01892 delete [] goCoordinates;
01893 goCoordinates = new Real[numGoAtoms*3];
01894 //printf("Deleting goResidsB\n");
01895 delete [] goResids;
01896 goResids = new int[numGoAtoms];
01897 msg->get(numAtoms, goSigmaIndices);
01898 msg->get(numGoAtoms, atomChainTypes);
01899 //msg->get(numGoAtoms*numGoAtoms, goSigmas);
01900 //msg->get(numGoAtoms*numGoAtoms*sizeof(bool), (char*)goWithinCutoff);
01901 msg->get(numGoAtoms*3, goCoordinates);
01902 msg->get(numGoAtoms, goResids);
01903 break;
01904 }
01905 }
01906
01907 delete msg;
01908
01909 }
|
|
|
Definition at line 5276 of file Molecule.C. References SimParameters::alchFepOn, SimParameters::alchThermIntOn, Angle, Aniso, Atom, atomNamePool, atomSigPool, Bond, consForce, consForceIndexes, SimParameters::consForceOn, consTorqueIndexes, SimParameters::consTorqueOn, consTorqueParams, SimParameters::constraintsOn, Crossterm, DebugM, Dihedral, DrudeConst, SimParameters::excludeFromPressure, SimParameters::fixedAtomsOn, gA, MIStream::get(), GridforceGrid::get_total_grids(), ObjectArena< Type >::getNewArray(), giSigma1, giSigma2, gMu1, gMu2, SimParameters::goGroPair, gRepulsive, Improper, indxGaussA, indxGaussB, indxLJA, indxLJB, int32, is_drude_psf, is_lonepairs_psf, isBFactorValid, isOccupancyValid, SimParameters::langevinOn, SimParameters::LCPOOn, SimParameters::lesOn, Lphost, maxHydrogenGroupSize, maxMigrationGroupSize, SimParameters::mgridforceOn, SimParameters::movDragOn, numAcceptors, numAngles, numAnisos, numBonds, numCalcAngles, numCalcBonds, numCalcCrossterms, numCalcDihedrals, numCalcExclusions, numCalcImpropers, numConsForce, numConsTorque, numConstraints, numCrossterms, numDihedrals, numDonors, numExclusions, numExPressureAtoms, numFepFinal, numFepInitial, numFixedAtoms, numFixedRigidBonds, numGaussPair, numGridforceGrids, numGridforces, numHydrogenGroups, numImpropers, numLJPair, numLphosts, numMigrationGroups, numMovDrag, numRealBonds, numRotDrag, numStirredAtoms, numTotalExclusions, pairC12, pairC6, SimParameters::pairInteractionOn, pointerToGaussBeg, pointerToGaussEnd, pointerToLJBeg, pointerToLJEnd, Real, SimParameters::rotDragOn, SimParameters::stirOn, SimParameters::tCoupleOn, and GridforceGrid::unpack_grid(). 05276 {
05277 // Get the atom information
05278 msg->get(numAtoms);
05279
05280 #ifdef MEM_OPT_VERSION
05281 //in the memory optimized version, only the atom signatures are recved
05282 //from the master Node. --Chao Mei
05283
05284 msg->get(massPoolSize);
05285 if(atomMassPool) delete [] atomMassPool;
05286 atomMassPool = new Real[massPoolSize];
05287 msg->get(massPoolSize, atomMassPool);
05288
05289 msg->get(chargePoolSize);
05290 if(atomChargePool) delete [] atomChargePool;
05291 atomChargePool = new Real[chargePoolSize];
05292 msg->get(chargePoolSize, atomChargePool);
05293
05294 //get atoms' signatures
05295 msg->get(atomSigPoolSize);
05296 if(atomSigPool) delete [] atomSigPool;
05297 atomSigPool = new AtomSignature[atomSigPoolSize];
05298 for(int i=0; i<atomSigPoolSize; i++)
05299 atomSigPool[i].unpack(msg);
05300
05301 //get exclusions' signatures
05302 msg->get(exclSigPoolSize);
05303 if(exclSigPool) delete [] exclSigPool;
05304 exclSigPool = new ExclusionSignature[exclSigPoolSize];
05305 for(int i=0; i<exclSigPoolSize; i++)
05306 exclSigPool[i].unpack(msg);
05307
05308 msg->get(numHydrogenGroups);
05309 msg->get(maxHydrogenGroupSize);
05310 msg->get(numMigrationGroups);
05311 msg->get(maxMigrationGroupSize);
05312 msg->get(isOccupancyValid);
05313 msg->get(isBFactorValid);
05314
05315 //get names for atoms
05316 msg->get(atomNamePoolSize);
05317 atomNamePool = new char *[atomNamePoolSize];
05318 for(int i=0; i<atomNamePoolSize;i++) {
05319 int len;
05320 msg->get(len);
05321 atomNamePool[i] = nameArena->getNewArray(len+1);
05322 msg->get(len, atomNamePool[i]);
05323 }
05324
05325 if(simParams->fixedAtomsOn){
05326 int numFixedAtomsSet;
05327 msg->get(numFixedAtoms);
05328 msg->get(numFixedAtomsSet);
05329 fixedAtomsSet = new AtomSetList(numFixedAtomsSet);
05330 msg->get(numFixedAtomsSet*sizeof(AtomSet), (char *)(fixedAtomsSet->begin()));
05331 }
05332
05333 if(simParams->constraintsOn){
05334 int numConstrainedAtomsSet;
05335 msg->get(numConstraints);
05336 msg->get(numConstrainedAtomsSet);
05337 constrainedAtomsSet = new AtomSetList(numConstrainedAtomsSet);
05338 msg->get(numConstrainedAtomsSet*sizeof(AtomSet), (char *)(constrainedAtomsSet->begin()));
05339 }
05340
05341 // Now free the message
05342 delete msg;
05343
05344 build_excl_check_signatures();
05345
05346 //set num{Calc}Tuples(Bonds,...,Impropers) to 0
05347 numBonds = numCalcBonds = 0;
05348 numAngles = numCalcAngles = 0;
05349 numDihedrals = numCalcDihedrals = 0;
05350 numImpropers = numCalcImpropers = 0;
05351 numCrossterms = numCalcCrossterms = 0;
05352 numTotalExclusions = numCalcExclusions = 0;
05353 #else
05354 delete [] atoms;
05355 atoms= new Atom[numAtoms];
05356 msg->get(numAtoms*sizeof(Atom), (char*)atoms);
05357
05358 // Get the bond information
05359 msg->get(numRealBonds);
05360 msg->get(numBonds);
05361 if (numBonds)
05362 {
05363 delete [] bonds;
05364 bonds=new Bond[numBonds];
05365 msg->get(numBonds*sizeof(Bond), (char*)bonds);
05366 }
05367
05368 // Get the angle information
05369 msg->get(numAngles);
05370 if (numAngles)
05371 {
05372 delete [] angles;
05373 angles=new Angle[numAngles];
05374 msg->get(numAngles*sizeof(Angle), (char*)angles);
05375 }
05376
05377 // Get the dihedral information
05378 msg->get(numDihedrals);
05379 if (numDihedrals)
05380 {
05381 delete [] dihedrals;
05382 dihedrals=new Dihedral[numDihedrals];
05383 msg->get(numDihedrals*sizeof(Dihedral), (char*)dihedrals);
05384 }
05385
05386 // Get the improper information
05387 msg->get(numImpropers);
05388 if (numImpropers)
05389 {
05390 delete [] impropers;
05391 impropers=new Improper[numImpropers];
05392 msg->get(numImpropers*sizeof(Improper), (char*)impropers);
05393 }
05394
05395 // Get the crossterm information
05396 msg->get(numCrossterms);
05397 if (numCrossterms)
05398 {
05399 delete [] crossterms;
05400 crossterms=new Crossterm[numCrossterms];
05401 msg->get(numCrossterms*sizeof(Crossterm), (char*)crossterms);
05402 }
05403
05404 // Get the hydrogen bond donors
05405 msg->get(numDonors);
05406 if (numDonors)
05407 {
05408 delete [] donors;
05409 donors=new Bond[numDonors];
05410 msg->get(numDonors*sizeof(Bond), (char*)donors);
05411 }
05412
05413 // Get the hydrogen bond acceptors
05414 msg->get(numAcceptors);
05415 if (numAcceptors)
05416 {
05417 delete [] acceptors;
05418 acceptors=new Bond[numAcceptors];
05419 msg->get(numAcceptors*sizeof(Bond), (char*)acceptors);
05420 }
05421
05422 // Get the exclusion information
05423 msg->get(numExclusions);
05424 if (numExclusions)
05425 {
05426 delete [] exclusions;
05427 exclusions=new Exclusion[numExclusions];
05428 msg->get(numExclusions*sizeof(Exclusion), (char*)exclusions);
05429 }
05430
05431 // Get the constraint information, if they are active
05432 if (simParams->constraintsOn)
05433 {
05434 msg->get(numConstraints);
05435
05436 delete [] consIndexes;
05437 consIndexes = new int32[numAtoms];
05438
05439 msg->get(numAtoms, consIndexes);
05440
05441 if (numConstraints)
05442 {
05443 delete [] consParams;
05444 consParams = new ConstraintParams[numConstraints];
05445
05446 msg->get(numConstraints*sizeof(ConstraintParams), (char*)consParams);
05447 }
05448 }
05449
05450 /* BEGIN gf */
05451 if (simParams->mgridforceOn)
05452 {
05453 DebugM(3, "Receiving gridforce info\n");
05454
05455 msg->get(numGridforceGrids);
05456
05457 DebugM(3, "numGridforceGrids = " << numGridforceGrids << "\n");
05458
05459 delete [] numGridforces;
05460 numGridforces = new int[numGridforceGrids];
05461
05462 delete [] gridfrcIndexes; // Should I be deleting elements of these first?
05463 delete [] gridfrcParams;
05464 delete [] gridfrcGrid;
05465 gridfrcIndexes = new int32*[numGridforceGrids];
05466 gridfrcParams = new GridforceParams*[numGridforceGrids];
05467 gridfrcGrid = new GridforceGrid*[numGridforceGrids];
05468
05469 int grandTotalGrids = 0;
05470 for (int gridnum = 0; gridnum < numGridforceGrids; gridnum++) {
05471 msg->get(numGridforces[gridnum]);
05472
05473 gridfrcIndexes[gridnum] = new int32[numAtoms];
05474 msg->get(numAtoms, gridfrcIndexes[gridnum]);
05475
05476 if (numGridforces[gridnum])
05477 {
05478 gridfrcParams[gridnum] = new GridforceParams[numGridforces[gridnum]];
05479 msg->get(numGridforces[gridnum]*sizeof(GridforceParams), (char*)gridfrcParams[gridnum]);
05480 }
05481
05482 gridfrcGrid[gridnum] = GridforceGrid::unpack_grid(gridnum, msg);
05483
05484 grandTotalGrids += gridfrcGrid[gridnum]->get_total_grids();
05485 }
05486 }
05487 /* END gf */
05488
05489 // Get the stirring information, if stirring is active
05490 if (simParams->stirOn)
05491 {
05492 msg->get(numStirredAtoms);
05493
05494 delete [] stirIndexes;
05495 stirIndexes = new int32[numAtoms];
05496
05497 msg->get(numAtoms, stirIndexes);
05498
05499 if (numStirredAtoms)
05500 {
05501 delete [] stirParams;
05502 stirParams = new StirParams[numStirredAtoms];
05503
05504 msg->get(numStirredAtoms*sizeof(StirParams), (char*)stirParams);
05505 }
05506 }
05507
05508 // Get the moving drag information, if it is active
05509 if (simParams->movDragOn) {
05510 msg->get(numMovDrag);
05511 delete [] movDragIndexes;
05512 movDragIndexes = new int32[numAtoms];
05513 msg->get(numAtoms, movDragIndexes);
05514 if (numMovDrag)
05515 {
05516 delete [] movDragParams;
05517 movDragParams = new MovDragParams[numMovDrag];
05518 msg->get(numMovDrag*sizeof(MovDragParams), (char*)movDragParams);
05519 }
05520 }
05521
05522 // Get the rotating drag information, if it is active
05523 if (simParams->rotDragOn) {
05524 msg->get(numRotDrag);
05525 delete [] rotDragIndexes;
05526 rotDragIndexes = new int32[numAtoms];
05527 msg->get(numAtoms, rotDragIndexes);
05528 if (numRotDrag)
05529 {
05530 delete [] rotDragParams;
05531 rotDragParams = new RotDragParams[numRotDrag];
05532 msg->get(numRotDrag*sizeof(RotDragParams), (char*)rotDragParams);
05533 }
05534 }
05535
05536 // Get the "constant" torque information, if it is active
05537 if (simParams->consTorqueOn) {
05538 msg->get(numConsTorque);
05539 delete [] consTorqueIndexes;
05540 consTorqueIndexes = new int32[numAtoms];
05541 msg->get(numAtoms, consTorqueIndexes);
05542 if (numConsTorque)
05543 {
05544 delete [] consTorqueParams;
05545 consTorqueParams = new ConsTorqueParams[numConsTorque];
05546 msg->get(numConsTorque*sizeof(ConsTorqueParams), (char*)consTorqueParams);
05547 }
05548 }
05549
05550 // Get the constant force information, if it's active
05551 if (simParams->consForceOn)
05552 { msg->get(numConsForce);
05553 delete [] consForceIndexes;
05554 consForceIndexes = new int32[numAtoms];
05555 msg->get(numAtoms, consForceIndexes);
05556 if (numConsForce)
05557 { delete [] consForce;
05558 consForce = new Vector[numConsForce];
05559 msg->get(numConsForce*sizeof(Vector), (char*)consForce);
05560 }
05561 }
05562
05563 // Get the langevin parameters, if they are active
05564 if (simParams->langevinOn || simParams->tCoupleOn)
05565 {
05566 delete [] langevinParams;
05567 langevinParams = new Real[numAtoms];
05568
05569 msg->get(numAtoms, langevinParams);
05570 }
05571
05572 // Get the fixed atoms, if they are active
05573 if (simParams->fixedAtomsOn)
05574 {
05575 delete [] fixedAtomFlags;
05576 fixedAtomFlags = new int32[numAtoms];
05577
05578 msg->get(numFixedAtoms);
05579 msg->get(numAtoms, fixedAtomFlags);
05580 msg->get(numFixedRigidBonds);
05581 }
05582
05583 if (simParams->excludeFromPressure) {
05584 exPressureAtomFlags = new int32[numAtoms];
05585 msg->get(numExPressureAtoms);
05586 msg->get(numAtoms, exPressureAtomFlags);
05587 }
05588
05589 //fepb
05590 //receive fep atom info
05591 if (simParams->alchFepOn || simParams->lesOn || simParams->alchThermIntOn || simParams->pairInteractionOn) {
05592 delete [] fepAtomFlags;
05593 fepAtomFlags = new unsigned char[numAtoms];
05594
05595 msg->get(numFepInitial);
05596 msg->get(numFepFinal);
05597 msg->get(numAtoms*sizeof(unsigned char), (char*)fepAtomFlags);
05598 }
05599 //fepe
05600
05601 #ifdef OPENATOM_VERSION
05602 // This needs to be refactored into its own version
05603 if (simParams->openatomOn) {
05604 delete [] fepAtomFlags;
05605 fepAtomFlags = new unsigned char[numAtoms];
05606
05607 msg->get(numFepInitial);
05608 msg->get(numAtoms*sizeof(unsigned char), (char*)fepAtomFlags);
05609 #endif //OPENATOM_VERSION
05610
05611 // DRUDE: receive data read from PSF
05612 msg->get(is_lonepairs_psf);
05613 if (is_lonepairs_psf) {
05614 msg->get(numLphosts);
05615 delete[] lphosts;
05616 lphosts = new Lphost[numLphosts];
05617 msg->get(numLphosts*sizeof(Lphost), (char*)lphosts);
05618 }
05619 msg->get(is_drude_psf);
05620 if (is_drude_psf) {
05621 delete[] drudeConsts;
05622 drudeConsts = new DrudeConst[numAtoms];
05623 msg->get(numAtoms*sizeof(DrudeConst), (char*)drudeConsts);
05624 msg->get(numAnisos);
05625 delete[] anisos;
05626 anisos = new Aniso[numAnisos];
05627 msg->get(numAnisos*sizeof(Aniso), (char*)anisos);
05628 }
05629 // DRUDE
05630
05631 //LCPO
05632 if (simParams->LCPOOn) {
05633 delete [] lcpoParamType;
05634 lcpoParamType = new int[numAtoms];
05635 msg->get(numAtoms, (int*)lcpoParamType);
05636 }
05637
05638 if (simParams->goGroPair) {
05639 msg->get(numLJPair);
05640 delete [] indxLJA;
05641 indxLJA = new int[numLJPair];
05642 msg->get(numLJPair,indxLJA);
05643 delete [] indxLJB;
05644 indxLJB = new int[numLJPair];
05645 msg->get(numLJPair,indxLJB);
05646 delete [] pairC6;
05647 pairC6 = new Real[numLJPair];
05648 msg->get(numLJPair,pairC6);
05649 delete [] pairC12;
05650 pairC12 = new Real[numLJPair];
05651 msg->get(numLJPair,pairC12);
05652 delete [] pointerToLJBeg;
05653 pointerToLJBeg = new int[numAtoms];
05654 msg->get((numAtoms),pointerToLJBeg);
05655 delete [] pointerToLJEnd;
05656 pointerToLJEnd = new int[numAtoms];
05657 msg->get((numAtoms),pointerToLJEnd);
05658 //
05659 msg->get(numGaussPair);
05660 delete [] indxGaussA;
05661 indxGaussA = new int[numGaussPair];
05662 msg->get(numGaussPair,indxGaussA);
05663 delete [] indxGaussB;
05664 indxGaussB = new int[numGaussPair];
05665 msg->get(numGaussPair,indxGaussB);
05666 delete [] gA;
05667 gA = new Real[numGaussPair];
05668 msg->get(numGaussPair,gA);
05669 delete [] gMu1;
05670 gMu1 = new Real[numGaussPair];
05671 msg->get(numGaussPair,gMu1);
05672 delete [] giSigma1;
05673 giSigma1 = new Real[numGaussPair];
05674 msg->get(numGaussPair,giSigma1);
05675 delete [] gMu2;
05676 gMu2 = new Real[numGaussPair];
05677 msg->get(numGaussPair,gMu2);
05678 delete [] giSigma2;
05679 giSigma2 = new Real[numGaussPair];
05680 msg->get(numGaussPair,giSigma2);
05681 delete [] gRepulsive;
05682 gRepulsive = new Real[numGaussPair];
05683 msg->get(numGaussPair,gRepulsive);
05684 delete [] pointerToGaussBeg;
05685 pointerToGaussBeg = new int[numAtoms];
05686 msg->get((numAtoms),pointerToGaussBeg);
05687 delete [] pointerToGaussEnd;
05688 pointerToGaussEnd = new int[numAtoms];
05689 msg->get((numAtoms),pointerToGaussEnd);
05690 //
05691 }
05692
05693 // Now free the message
05694 delete msg;
05695
05696 // analyze the data and find the status of each atom
05697 build_atom_status();
05698 build_lists_by_atom();
05699 #endif
05700 }
|
|
||||||||||||
|
Referenced by Node::reloadCharges(). |
|
|
Definition at line 1127 of file Molecule.h. References Real. Referenced by WorkDistrib::createAtomLists(), and outputCompressedFile(). 01128 {
01129 return(rigidBondLengths[atomnum]);
01130 }
|
|
|
Definition at line 1643 of file GoMolecule.C. References atomChainTypes, go_val::cutoff, MOStream::end(), go_val::epsilon, go_val::epsilonRep, go_val::exp_a, go_val::exp_b, go_val::exp_rep, go_array, go_indices, goCoordinates, SimParameters::goForcesOn, goIndxLJA, goIndxLJB, SimParameters::goMethod, goNumLJPair, goResidIndices, goResids, goSigmaIndices, goSigmaPairA, goSigmaPairB, goSigmas, goWithinCutoff, j, MAX_GO_CHAINS, MAX_RESTRICTIONS, NAMD_die(), numAtoms, numGoAtoms, NumGoChains, pointerToGoBeg, pointerToGoEnd, MOStream::put(), Real, go_val::restrictions, and go_val::sigmaRep. 01643 {
01644 Real *a1, *a2, *a3, *a4;
01645 int *i1, *i2, *i3, *i4;
01646 int maxGoChainsSqr = MAX_GO_CHAINS*MAX_GO_CHAINS; // JE JLai Go code
01647 msg->put(NumGoChains);
01648
01649 if (NumGoChains) {
01650 // int go_indices[MAX_GO_CHAINS+1]; // Indices from chainIDs to go_array
01651 // GoValue go_array[MAX_GO_CHAINS*MAX_GO_CHAINS]; // Array of Go params
01652 msg->put(MAX_GO_CHAINS+1,go_indices);
01653
01654 a1 = new Real[maxGoChainsSqr];
01655 a2 = new Real[maxGoChainsSqr];
01656 a3 = new Real[maxGoChainsSqr];
01657 a4 = new Real[maxGoChainsSqr];
01658 i1 = new int[maxGoChainsSqr];
01659 i2 = new int[maxGoChainsSqr];
01660 i3 = new int[maxGoChainsSqr];
01661 i4 = new int[maxGoChainsSqr*MAX_RESTRICTIONS];
01662
01663 if ( (a1 == NULL) || (a2 == NULL) || (a3 == NULL) || (a4 == NULL) ||
01664 (i1 == NULL) || (i2 == NULL) || (i3 == NULL) || (i4 == NULL) )
01665 {
01666 NAMD_die("memory allocation failed in Molecules::send_Molecules");
01667 }
01668
01669 for (int i=0; i<maxGoChainsSqr; i++) {
01670 a1[i] = go_array[i].epsilon;
01671 a2[i] = go_array[i].sigmaRep;
01672 a3[i] = go_array[i].epsilonRep;
01673 a4[i] = go_array[i].cutoff;
01674 i1[i] = go_array[i].exp_a;
01675 i2[i] = go_array[i].exp_b;
01676 i3[i] = go_array[i].exp_rep;
01677 for (int j=0; j<MAX_RESTRICTIONS; j++) {
01678 i4[i*MAX_RESTRICTIONS + j] = go_array[i].restrictions[j];
01679 }
01680 }
01681
01682 msg->put(maxGoChainsSqr, a1);
01683 msg->put(maxGoChainsSqr, a2);
01684 msg->put(maxGoChainsSqr, a3);
01685 msg->put(maxGoChainsSqr, a4);
01686 msg->put(maxGoChainsSqr, i1);
01687 msg->put(maxGoChainsSqr, i2);
01688 msg->put(maxGoChainsSqr, i3);
01689 msg->put(maxGoChainsSqr*MAX_RESTRICTIONS, i4);
01690
01691 delete [] a1;
01692 delete [] a2;
01693 delete [] a3;
01694 delete [] a4;
01695 delete [] i1;
01696 delete [] i2;
01697 delete [] i3;
01698 delete [] i4;
01699 }
01700
01701 //Ported JLai
01702 if (simParams->goForcesOn) {
01703 switch(simParams->goMethod) {
01704 case 1:
01705 msg->put(numGoAtoms);
01706 msg->put(numAtoms, goSigmaIndices);
01707 msg->put(numGoAtoms, atomChainTypes);
01708 msg->put(numGoAtoms*numGoAtoms, goSigmas);
01709 msg->put(numGoAtoms*numGoAtoms*sizeof(bool), (char*)goWithinCutoff);
01710 // printf("Molecule.C sending atomChainTypes %d %d \n", numGoAtoms, atomChainTypes);
01711 break;
01712 case 2: //GSS
01713 msg->put(numGoAtoms);
01714 msg->put(numAtoms,pointerToGoBeg);
01715 msg->put(numAtoms,pointerToGoEnd);
01716 msg->put(numAtoms,goSigmaIndices);
01717 msg->put(numAtoms,goResidIndices);
01718 msg->put(numGoAtoms,atomChainTypes);
01719 msg->put(goNumLJPair);
01720 msg->put(goNumLJPair,goIndxLJA);
01721 msg->put(goNumLJPair,goIndxLJB);
01722 msg->put(goNumLJPair,goSigmaPairA);
01723 msg->put(goNumLJPair,goSigmaPairB);
01724 break;
01725 case 3:
01726 msg->put(numGoAtoms);
01727 msg->put(numAtoms, goSigmaIndices);
01728 msg->put(numGoAtoms, atomChainTypes);
01729 //msg->put(numGoAtoms*numGoAtoms, goSigmas);
01730 //msg->put(numGoAtoms*numGoAtoms*sizeof(bool), (char*)goWithinCutoff);
01731 msg->put(numGoAtoms*3, goCoordinates);
01732 msg->put(numGoAtoms, goResids);
01733 break;
01734 }
01735 }
01736
01737 msg->end();
01738 delete msg;
01739 }
|
|
|
Definition at line 4966 of file Molecule.C. References SimParameters::alchFepOn, SimParameters::alchThermIntOn, Angle, Aniso, Atom, atomNamePool, atomSigPool, Bond, consForce, consForceIndexes, SimParameters::consForceOn, consTorqueIndexes, SimParameters::consTorqueOn, consTorqueParams, SimParameters::constraintsOn, Crossterm, DebugM, Dihedral, DrudeConst, MOStream::end(), endi(), SimParameters::excludeFromPressure, SimParameters::fixedAtomsOn, gA, giSigma1, giSigma2, gMu1, gMu2, SimParameters::goGroPair, gRepulsive, Improper, indxGaussA, indxGaussB, indxLJA, indxLJB, is_drude_psf, is_lonepairs_psf, isBFactorValid, isOccupancyValid, SimParameters::langevinOn, SimParameters::LCPOOn, SimParameters::lesOn, Lphost, maxHydrogenGroupSize, maxMigrationGroupSize, SimParameters::mgridforceOn, SimParameters::movDragOn, numAcceptors, numAngles, numAnisos, numBonds, numCalcAngles, numCalcBonds, numCalcCrossterms, numCalcDihedrals, numCalcExclusions, numCalcImpropers, numConsForce, numConsTorque, numConstraints, numCrossterms, numDihedrals, numDonors, numExclusions, numExPressureAtoms, numFepFinal, numFepInitial, numFixedAtoms, numFixedRigidBonds, numGaussPair, numGridforceGrids, numGridforces, numHydrogenGroups, numImpropers, numLJPair, numLphosts, numMigrationGroups, numMovDrag, numRealBonds, numRotDrag, numStirredAtoms, numTotalExclusions, GridforceGrid::pack_grid(), pairC12, pairC6, SimParameters::pairInteractionOn, pointerToGaussBeg, pointerToGaussEnd, pointerToLJBeg, pointerToLJEnd, MOStream::put(), SimParameters::rotDragOn, SimParameters::stirOn, and SimParameters::tCoupleOn. 04966 {
04967 #ifdef MEM_OPT_VERSION
04968 //in the memory optimized version, only the atom signatures are broadcast
04969 //to other Nodes. --Chao Mei
04970
04971 msg->put(numAtoms);
04972
04973 msg->put(massPoolSize);
04974 msg->put(massPoolSize, atomMassPool);
04975
04976 msg->put(chargePoolSize);
04977 msg->put(chargePoolSize, atomChargePool);
04978
04979 //put atoms' signatures
04980 msg->put(atomSigPoolSize);
04981 for(int i=0; i<atomSigPoolSize; i++)
04982 atomSigPool[i].pack(msg);
04983
04984 //put atom's exclusion signatures
04985 msg->put(exclSigPoolSize);
04986 for(int i=0; i<exclSigPoolSize; i++)
04987 exclSigPool[i].pack(msg);
04988
04989 msg->put(numHydrogenGroups);
04990 msg->put(maxHydrogenGroupSize);
04991 msg->put(numMigrationGroups);
04992 msg->put(maxMigrationGroupSize);
04993 msg->put(isOccupancyValid);
04994 msg->put(isBFactorValid);
04995
04996 //put names for atoms
04997 msg->put(atomNamePoolSize);
04998 for(int i=0; i<atomNamePoolSize;i++) {
04999 int len = strlen(atomNamePool[i]);
05000 msg->put(len);
05001 msg->put(len*sizeof(char), atomNamePool[i]);
05002 }
05003
05004 if(simParams->fixedAtomsOn){
05005 int numFixedAtomsSet = fixedAtomsSet->size();
05006 msg->put(numFixedAtoms);
05007 msg->put(numFixedAtomsSet);
05008 msg->put(numFixedAtomsSet*sizeof(AtomSet), (char *)(fixedAtomsSet->begin()));
05009 }
05010
05011 if (simParams->constraintsOn) {
05012 int numConstrainedAtomsSet = constrainedAtomsSet->size();
05013 msg->put(numConstraints);
05014 msg->put(numConstrainedAtomsSet);
05015 msg->put(numConstrainedAtomsSet*sizeof(AtomSet), (char *)(constrainedAtomsSet->begin()));
05016 }
05017
05018 // Broadcast the message to the other nodes
05019 msg->end();
05020 delete msg;
05021
05022 build_excl_check_signatures();
05023
05024 //set num{Calc}Tuples(Bonds,...,Impropers) to 0
05025 numBonds = numCalcBonds = 0;
05026 numAngles = numCalcAngles = 0;
05027 numDihedrals = numCalcDihedrals = 0;
05028 numImpropers = numCalcImpropers = 0;
05029 numCrossterms = numCalcCrossterms = 0;
05030 numTotalExclusions = numCalcExclusions = 0;
05031
05032 #else
05033 msg->put(numAtoms);
05034 msg->put(numAtoms*sizeof(Atom), (char*)atoms);
05035
05036 // Send the bond information
05037 msg->put(numRealBonds);
05038 msg->put(numBonds);
05039
05040 if (numBonds)
05041 {
05042 msg->put(numBonds*sizeof(Bond), (char*)bonds);
05043 }
05044
05045 // Send the angle information
05046 msg->put(numAngles);
05047 if (numAngles)
05048 {
05049 msg->put(numAngles*sizeof(Angle), (char*)angles);
05050 }
05051
05052 // Send the dihedral information
05053 msg->put(numDihedrals);
05054 if (numDihedrals)
05055 {
05056 msg->put(numDihedrals*sizeof(Dihedral), (char*)dihedrals);
05057 }
05058
05059 // Send the improper information
05060 msg->put(numImpropers);
05061 if (numImpropers)
05062 {
05063 msg->put(numImpropers*sizeof(Improper), (char*)impropers);
05064 }
05065
05066 // Send the crossterm information
05067 msg->put(numCrossterms);
05068 if (numCrossterms)
05069 {
05070 msg->put(numCrossterms*sizeof(Crossterm), (char*)crossterms);
05071 }
05072
05073 // send the hydrogen bond donor information
05074 msg->put(numDonors);
05075 if(numDonors)
05076 {
05077 msg->put(numDonors*sizeof(Bond), (char*)donors);
05078 }
05079
05080 // send the hydrogen bond acceptor information
05081 msg->put(numAcceptors);
05082 if(numAcceptors)
05083 {
05084 msg->put(numAcceptors*sizeof(Bond), (char*)acceptors);
05085 }
05086
05087 // Send the exclusion information
05088 msg->put(numExclusions);
05089 if (numExclusions)
05090 {
05091 msg->put(numExclusions*sizeof(Exclusion), (char*)exclusions);
05092 }
05093 // Send the constraint information, if used
05094 if (simParams->constraintsOn)
05095 {
05096 msg->put(numConstraints);
05097
05098 msg->put(numAtoms, consIndexes);
05099
05100 if (numConstraints)
05101 {
05102 msg->put(numConstraints*sizeof(ConstraintParams), (char*)consParams);
05103 }
05104 }
05105
05106 /* BEGIN gf */
05107 // Send the gridforce information, if used
05108 if (simParams->mgridforceOn)
05109 {
05110 DebugM(3, "Sending gridforce info\n" << endi);
05111 msg->put(numGridforceGrids);
05112
05113 for (int gridnum = 0; gridnum < numGridforceGrids; gridnum++) {
05114 msg->put(numGridforces[gridnum]);
05115 msg->put(numAtoms, gridfrcIndexes[gridnum]);
05116 if (numGridforces[gridnum])
05117 {
05118 msg->put(numGridforces[gridnum]*sizeof(GridforceParams), (char*)gridfrcParams[gridnum]);
05119 }
05120 GridforceGrid::pack_grid(gridfrcGrid[gridnum], msg);
05121 }
05122 }
05123 /* END gf */
05124
05125 // Send the stirring information, if used
05126 if (simParams->stirOn)
05127 {
05128 //CkPrintf ("DEBUG: putting numStirredAtoms..\n");
05129 msg->put(numStirredAtoms);
05130 //CkPrintf ("DEBUG: putting numAtoms,stirIndexes.. numAtoms=%d\n",numStirredAtoms);
05131 msg->put(numAtoms, stirIndexes);
05132 //CkPrintf ("DEBUG: if numStirredAtoms..\n");
05133 if (numStirredAtoms)
05134 {
05135 //CkPrintf ("DEBUG: big put, with (char*)stirParams\n");
05136 msg->put(numStirredAtoms*sizeof(StirParams), (char*)stirParams);
05137 }
05138 }
05139
05140
05141 // Send the moving drag information, if used
05142 if (simParams->movDragOn) {
05143 msg->put(numMovDrag);
05144 msg->put(numAtoms, movDragIndexes);
05145 if (numMovDrag)
05146 {
05147 msg->put(numMovDrag*sizeof(MovDragParams), (char*)movDragParams);
05148 }
05149 }
05150
05151 // Send the rotating drag information, if used
05152 if (simParams->rotDragOn) {
05153 msg->put(numRotDrag);
05154 msg->put(numAtoms, rotDragIndexes);
05155 if (numRotDrag)
05156 {
05157 msg->put(numRotDrag*sizeof(RotDragParams), (char*)rotDragParams);
05158 }
05159 }
05160
05161 // Send the "constant" torque information, if used
05162 if (simParams->consTorqueOn) {
05163 msg->put(numConsTorque);
05164 msg->put(numAtoms, consTorqueIndexes);
05165 if (numConsTorque)
05166 {
05167 msg->put(numConsTorque*sizeof(ConsTorqueParams), (char*)consTorqueParams);
05168 }
05169 }
05170
05171 // Send the constant force information, if used
05172 if (simParams->consForceOn)
05173 { msg->put(numConsForce);
05174 msg->put(numAtoms, consForceIndexes);
05175 if (numConsForce)
05176 msg->put(numConsForce*sizeof(Vector), (char*)consForce);
05177 }
05178
05179 // Send the langevin parameters, if active
05180 if (simParams->langevinOn || simParams->tCoupleOn)
05181 {
05182 msg->put(numAtoms, langevinParams);
05183 }
05184
05185 // Send fixed atoms, if active
05186 if (simParams->fixedAtomsOn)
05187 {
05188 msg->put(numFixedAtoms);
05189 msg->put(numAtoms, fixedAtomFlags);
05190 msg->put(numFixedRigidBonds);
05191 }
05192
05193 if (simParams->excludeFromPressure) {
05194 msg->put(numExPressureAtoms);
05195 msg->put(numAtoms, exPressureAtomFlags);
05196 }
05197
05198 //fepb
05199 // send fep atom info
05200 if (simParams->alchFepOn || simParams->alchThermIntOn || simParams->lesOn || simParams->pairInteractionOn) {
05201 msg->put(numFepInitial);
05202 msg->put(numFepFinal);
05203 msg->put(numAtoms*sizeof(char), (char*)fepAtomFlags);
05204 }
05205 //fepe
05206
05207 #ifdef OPENATOM_VERSION
05208 // needs to be refactored into its own openatom version
05209 if (simParams->openatomOn ) {
05210 msg->put(numFepInitial);
05211 msg->put(numAtoms*sizeof(char), (char*)fepAtomFlags);
05212 }
05213 #endif //OPENATOM_VERSION
05214
05215 // DRUDE: send data read from PSF
05216 msg->put(is_lonepairs_psf);
05217 if (is_lonepairs_psf) {
05218 msg->put(numLphosts);
05219 msg->put(numLphosts*sizeof(Lphost), (char*)lphosts);
05220 }
05221 msg->put(is_drude_psf);
05222 if (is_drude_psf) {
05223 msg->put(numAtoms*sizeof(DrudeConst), (char*)drudeConsts);
05224 msg->put(numAnisos);
05225 msg->put(numAnisos*sizeof(Aniso), (char*)anisos);
05226 }
05227 // DRUDE
05228
05229 //LCPO
05230 if (simParams->LCPOOn) {
05231 msg->put(numAtoms, (int*)lcpoParamType);
05232 }
05233
05234 //Send GromacsPairStuff -- JLai
05235 if (simParams->goGroPair) {
05236 msg->put(numLJPair);
05237 msg->put(numLJPair,indxLJA);
05238 msg->put(numLJPair,indxLJB);
05239 msg->put(numLJPair,pairC6);
05240 msg->put(numLJPair,pairC12);
05241 msg->put((numAtoms),pointerToLJBeg);
05242 msg->put((numAtoms),pointerToLJEnd);
05243 msg->put(numGaussPair);
05244 msg->put(numGaussPair,indxGaussA);
05245 msg->put(numGaussPair,indxGaussB);
05246 msg->put(numGaussPair,gA);
05247 msg->put(numGaussPair,gMu1);
05248 msg->put(numGaussPair,giSigma1);
05249 msg->put(numGaussPair,gMu2);
05250 msg->put(numGaussPair,giSigma2);
05251 msg->put(numGaussPair,gRepulsive);
05252 msg->put((numAtoms),pointerToGaussBeg);
05253 msg->put((numAtoms),pointerToGaussEnd);
05254 }
05255
05256 // Broadcast the message to the other nodes
05257 msg->end();
05258 delete msg;
05259
05260 // Now build arrays of indexes into these arrays by atom
05261 build_lists_by_atom();
05262 #endif
05263 }
|
|
||||||||||||
|
Definition at line 1014 of file Molecule.h. Referenced by Node::reloadGridforceGrid(). 01015 {
01016 if (grid && gridnum >= 0 && gridnum < numGridforceGrids) {
01017 gridfrcGrid[gridnum] = grid;
01018 return 0;
01019 } else {
01020 return -1;
01021 }
01022 }
|
|
|
Definition at line 2841 of file Molecule.C. Referenced by Molecule(). 02841 {
02842 bfactor = new float[numAtoms];
02843 for(int i=0; i<numAtoms; i++) {
02844 bfactor[i] = atomarray[i].bfactor;
02845 }
02846 }
|
|
|
Definition at line 2834 of file Molecule.C. Referenced by Molecule(). 02834 {
02835 occupancy = new float[numAtoms];
02836 for(int i=0; i<numAtoms; i++) {
02837 occupancy[i] = atomarray[i].occupancy;
02838 }
02839 }
|
|
|
Definition at line 196 of file Molecule.h. |
|
|
Definition at line 200 of file Molecule.h. |
|
|
Definition at line 195 of file Molecule.h. |
|
|
Definition at line 201 of file Molecule.h. |
|
|
Definition at line 197 of file Molecule.h. |
|
|
Definition at line 194 of file Molecule.h. |
|
|
Definition at line 198 of file Molecule.h. |
|
|
Definition at line 199 of file Molecule.h. |
|
|
Definition at line 202 of file Molecule.h. |
|
|
Definition at line 518 of file Molecule.h. Referenced by NamdState::configListInit(). |
|
|
Definition at line 519 of file Molecule.h. Referenced by NamdState::configListInit(). |
|
|
Definition at line 520 of file Molecule.h. Referenced by NamdState::configListInit(). |
|
|
Definition at line 590 of file Molecule.h. Referenced by build_go_arrays(), build_go_sigmas(), build_go_sigmas2(), get_go_force(), get_go_force2(), get_go_force_new(), goInit(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 561 of file Molecule.h. Referenced by ComputeConsForce::doForce(), receive_Molecule(), ComputeMgr::recvComputeConsForceMsg(), and send_Molecule(). |
|
|
Definition at line 560 of file Molecule.h. Referenced by ComputeConsForce::doForce(), receive_Molecule(), ComputeMgr::recvComputeConsForceMsg(), and send_Molecule(). |
|
|
Definition at line 563 of file Molecule.h. Referenced by ComputeConsTorque::doForce(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 564 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 629 of file Molecule.h. Referenced by build_go_arrays(), and goInit(). |
|
|
Definition at line 630 of file Molecule.h. Referenced by build_go_arrays(), and goInit(). |
|
|
Definition at line 621 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 623 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 625 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 622 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 624 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 1258 of file Molecule.h. Referenced by go_restricted(), print_go_params(), read_go_file(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 1259 of file Molecule.h. Referenced by read_go_file(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 595 of file Molecule.h. Referenced by build_go_arrays(), get_go_force_new(), goInit(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 600 of file Molecule.h. Referenced by build_go_sigmas2(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 601 of file Molecule.h. Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 599 of file Molecule.h. Referenced by build_go_sigmas2(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 597 of file Molecule.h. Referenced by build_go_arrays(), and goInit(). |
|
|
Definition at line 592 of file Molecule.h. Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 596 of file Molecule.h. Referenced by build_go_arrays(), get_go_force_new(), goInit(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 591 of file Molecule.h. Referenced by build_go_arrays(), build_go_sigmas(), build_go_sigmas2(), get_go_force(), get_go_force_new(), goInit(), print_go_sigmas(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 602 of file Molecule.h. Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 603 of file Molecule.h. Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 593 of file Molecule.h. Referenced by build_go_sigmas(), get_go_force(), goInit(), print_go_sigmas(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 594 of file Molecule.h. Referenced by build_go_sigmas(), get_go_force(), goInit(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 626 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 586 of file Molecule.h. Referenced by WorkDistrib::createAtomLists(), and outputCompressedFile(). |
|
|
Definition at line 619 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 620 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 611 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 612 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 421 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 422 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 1139 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 1139 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 548 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), NamdState::configListInit(), outputCompressedFile(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 550 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), NamdState::configListInit(), outputCompressedFile(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 524 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 515 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), ParallelIOMgr::bcastMolInfo(), buildAngleData(), NamdState::configListInit(), dumpbench(), Molecule(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 532 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
|
Definition at line 514 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), ParallelIOMgr::bcastMolInfo(), buildBondData(), NamdState::configListInit(), dumpbench(), Molecule(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 570 of file Molecule.h. Referenced by ParallelIOMgr::bcastMolInfo(), Controller::compareChecksums(), dumpbench(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 578 of file Molecule.h. Referenced by Controller::compareChecksums(). |
|
|
Definition at line 569 of file Molecule.h. Referenced by ParallelIOMgr::bcastMolInfo(), Controller::compareChecksums(), dumpbench(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 573 of file Molecule.h. Referenced by ParallelIOMgr::bcastMolInfo(), Controller::compareChecksums(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 571 of file Molecule.h. Referenced by ParallelIOMgr::bcastMolInfo(), Controller::compareChecksums(), dumpbench(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 574 of file Molecule.h. Referenced by ParallelIOMgr::bcastMolInfo(), Controller::compareChecksums(), dumpbench(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 572 of file Molecule.h. Referenced by ParallelIOMgr::bcastMolInfo(), Controller::compareChecksums(), dumpbench(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 577 of file Molecule.h. Referenced by Controller::compareChecksums(). |
|
|
Definition at line 559 of file Molecule.h. Referenced by NamdState::configListInit(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 543 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 536 of file Molecule.h. Referenced by NamdState::configListInit(), receive_Molecule(), Controller::receivePressure(), and send_Molecule(). |
|
|
Definition at line 522 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), ParallelIOMgr::bcastMolInfo(), buildCrosstermData(), NamdState::configListInit(), Molecule(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 516 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), ParallelIOMgr::bcastMolInfo(), buildDihedralData(), NamdState::configListInit(), dumpbench(), Molecule(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 523 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 530 of file Molecule.h. Referenced by NamdState::configListInit(), and Controller::receivePressure(). |
|
|
Definition at line 525 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), NamdState::configListInit(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 546 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 556 of file Molecule.h. Referenced by NamdState::configListInit(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 555 of file Molecule.h. Referenced by NamdState::configListInit(), receive_Molecule(), Controller::receivePressure(), and send_Molecule(). |
|
|
Definition at line 544 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), NamdState::configListInit(), ParallelIOMgr::integrateMigratedAtoms(), receive_Molecule(), Controller::receivePressure(), send_Molecule(), and ParallelIOMgr::updateMolInfo(). |
|
|
Definition at line 551 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), NamdState::configListInit(), Controller::receivePressure(), and ParallelIOMgr::recvHydroBasedCounter(). |
|
|
Definition at line 553 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), NamdState::configListInit(), receive_Molecule(), Controller::receivePressure(), ParallelIOMgr::recvHydroBasedCounter(), and send_Molecule(). |
|
|
Definition at line 618 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 589 of file Molecule.h. Referenced by build_go_arrays(), build_go_sigmas(), build_go_sigmas2(), get_go_force(), goInit(), print_go_sigmas(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 1260 of file Molecule.h. Referenced by print_go_params(), read_go_file(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 538 of file Molecule.h. Referenced by build_gridforce_params(), NamdState::configListInit(), ComputeGridForce::doForce(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 539 of file Molecule.h. Referenced by build_gridforce_params(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 547 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), NamdState::configListInit(), outputCompressedFile(), receive_Molecule(), Controller::receivePressure(), and send_Molecule(). |
|
|
Definition at line 521 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), ParallelIOMgr::bcastMolInfo(), buildImproperData(), NamdState::configListInit(), dumpbench(), Molecule(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 608 of file Molecule.h. Referenced by build_go_sigmas2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 529 of file Molecule.h. Referenced by NamdState::configListInit(), and Controller::receivePressure(). |
|
|
Definition at line 533 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 549 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), NamdState::configListInit(), outputCompressedFile(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 541 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 582 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), and NamdState::configListInit(). |
|
|
Definition at line 584 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), and NamdState::configListInit(). |
|
|
Definition at line 607 of file Molecule.h. |
|
|
Definition at line 513 of file Molecule.h. Referenced by buildBondData(), Molecule(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 552 of file Molecule.h. Referenced by ParallelIOMgr::bcastHydroBasedCounter(), ParallelIOMgr::bcastMolInfo(), NamdState::configListInit(), ParallelIOMgr::integrateMigratedAtoms(), Controller::receivePressure(), and ParallelIOMgr::recvMolInfo(). |
|
|
Definition at line 542 of file Molecule.h. Referenced by receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 545 of file Molecule.h. Referenced by NamdState::configListInit(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 531 of file Molecule.h. |
|
|
Definition at line 526 of file Molecule.h. Referenced by ParallelIOMgr::bcastMolInfo(), receive_Molecule(), ParallelIOMgr::recvMolInfo(), and send_Molecule(). |
|
|
Definition at line 614 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 613 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 616 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 617 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 604 of file Molecule.h. Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 605 of file Molecule.h. Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule(). |
|
|
Definition at line 609 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 610 of file Molecule.h. Referenced by get_gro_force2(), receive_Molecule(), and send_Molecule(). |
|
|
Definition at line 427 of file Molecule.h. |
|
|
Definition at line 426 of file Molecule.h. |
|
|
Definition at line 517 of file Molecule.h. Referenced by NamdState::configListInit(). |
|
|
Definition at line 430 of file Molecule.h. Referenced by Controller::printEnergies(). |
|
|
Definition at line 431 of file Molecule.h. Referenced by Controller::receivePressure(). |
1.3.9.1