NAMD
Classes | Public Member Functions | Public Attributes | Friends | List of all members
Molecule Class Reference

#include <Molecule.h>

Public Member Functions

void compute_LJcorrection ()
 
BigReal getEnergyTailCorr (const BigReal, const int)
 
BigReal getVirialTailCorr (const BigReal)
 
int const * getLcpoParamType ()
 
BigReal GetAtomAlpha (int i) const
 
AtomgetAtoms () const
 
AtomNameInfogetAtomNames () const
 
AtomSegResInfogetAtomSegResInfo () const
 
int num_fixed_atoms () const
 
int num_fixed_groups () const
 
int64_t num_group_deg_freedom () const
 
int64_t num_deg_freedom (int isInitialReport=0) const
 
void set_qm_replaceAll (Bool newReplaceAll)
 
const Realget_qmAtomGroup () const
 
Real get_qmAtomGroup (int indx) const
 
Realget_qmAtmChrg ()
 
const int * get_qmAtmIndx ()
 
int get_numQMAtoms ()
 
const char *const * get_qmElements ()
 
int get_qmNumGrps () const
 
const int * get_qmGrpSizes ()
 
Realget_qmGrpID ()
 
Realget_qmGrpChrg ()
 
Realget_qmGrpMult ()
 
int get_qmNumBonds ()
 
const BigRealget_qmDummyBondVal ()
 
const int * get_qmGrpNumBonds ()
 
const int *const * get_qmMMBond ()
 
const int *const * get_qmGrpBonds ()
 
const int *const * get_qmMMBondedIndx ()
 
const char *const * get_qmDummyElement ()
 
const int *const * get_qmMMChargeTarget ()
 
const int * get_qmMMNumTargs ()
 
int * get_qmLSSSize ()
 
int * get_qmLSSIdxs ()
 
Massget_qmLSSMass ()
 
int get_qmLSSFreq ()
 
int get_qmLSSResSize ()
 
int * get_qmLSSRefIDs ()
 
int * get_qmLSSRefSize ()
 
Massget_qmLSSRefMass ()
 
std::map< int, int > & get_qmMMSolv ()
 
Bool get_qmReplaceAll ()
 
Bool get_noPC ()
 
int get_qmMeNumBonds ()
 
int * get_qmMeMMindx ()
 
Realget_qmMeQMGrp ()
 
int get_qmPCFreq ()
 
int get_qmTotCustPCs ()
 
int * get_qmCustPCSizes ()
 
int * get_qmCustomPCIdxs ()
 
Bool get_qmcSMD ()
 
int get_cSMDnumInst ()
 
int const * get_cSMDindxLen ()
 
int const *const * get_cSMDindex ()
 
int const *const * get_cSMDpairs ()
 
const Realget_cSMDKs ()
 
const Realget_cSMDVels ()
 
const Realget_cSMDcoffs ()
 
void prepare_qm (const char *pdbFileName, Parameters *params, ConfigList *cfgList)
 
void delete_qm_bonded ()
 
 Molecule (SimParameters *, Parameters *param)
 
 Molecule (SimParameters *, Parameters *param, char *filename, ConfigList *cfgList=NULL)
 
 Molecule (SimParameters *simParams, Parameters *param, molfile_plugin_t *pIOHdl, void *pIOFileHdl, int natoms)
 
 Molecule (SimParameters *, Parameters *, Ambertoppar *)
 
void read_parm (Ambertoppar *)
 
 Molecule (SimParameters *, Parameters *, AmberParm7Reader::Ambertoppar *)
 
void read_parm (AmberParm7Reader::Ambertoppar *)
 
 Molecule (SimParameters *, Parameters *, const GromacsTopFile *)
 
 ~Molecule ()
 
void send_Molecule (MOStream *)
 
void receive_Molecule (MIStream *)
 
void build_constraint_params (StringList *, StringList *, StringList *, PDB *, char *)
 
void build_gridforce_params (StringList *, StringList *, StringList *, StringList *, PDB *, char *)
 
void build_movdrag_params (StringList *, StringList *, StringList *, PDB *, char *)
 
void build_rotdrag_params (StringList *, StringList *, StringList *, StringList *, StringList *, StringList *, PDB *, char *)
 
void build_constorque_params (StringList *, StringList *, StringList *, StringList *, StringList *, StringList *, PDB *, char *)
 
void build_constant_forces (char *)
 
void build_langevin_params (BigReal coupling, BigReal drudeCoupling, Bool doHydrogen)
 
void build_langevin_params (StringList *, StringList *, PDB *, char *)
 
void build_fixed_atoms (StringList *, StringList *, PDB *, char *)
 
void build_stirred_atoms (StringList *, StringList *, PDB *, char *)
 
void build_extra_bonds (Parameters *parameters, StringList *file)
 
void build_fep_flags (StringList *, StringList *, PDB *, char *, const char *)
 
void delete_alch_bonded (void)
 
void build_alch_unpert_bond_lists (char *)
 
void read_alch_unpert_bonds (FILE *)
 
void read_alch_unpert_angles (FILE *)
 
void read_alch_unpert_dihedrals (FILE *)
 
void build_ss_flags (const StringList *ssfile, const StringList *sscol, PDB *initial_pdb, const char *cwd)
 
void build_exPressure_atoms (StringList *, StringList *, PDB *, char *)
 
void print_go_sigmas ()
 
void build_go_sigmas (StringList *, char *)
 
void build_go_sigmas2 (StringList *, char *)
 
void build_go_arrays (StringList *, char *)
 
BigReal get_gro_force (BigReal, BigReal, BigReal, int, int) const
 
BigReal get_gro_force2 (BigReal, BigReal, BigReal, int, int, BigReal *, BigReal *) const
 
BigReal get_go_force (BigReal, int, int, BigReal *, BigReal *) const
 
BigReal get_go_force_new (BigReal, int, int, BigReal *, BigReal *) const
 
BigReal get_go_force2 (BigReal, BigReal, BigReal, int, int, BigReal *, BigReal *) const
 
Bool atoms_1to4 (unsigned int, unsigned int)
 
void reloadCharges (float charge[], int n)
 
Bool is_lp (int)
 
Bool is_drude (int)
 
Bool is_hydrogen (int)
 
Bool is_oxygen (int)
 
Bool is_hydrogenGroupParent (int)
 
Bool is_water (int)
 
int get_groupSize (int)
 
int get_mother_atom (int)
 
int get_cluster (int anum) const
 
int get_clusterSize (int anum) const
 
const float * getOccupancyData ()
 
void setOccupancyData (molfile_atom_t *atomarray)
 
void freeOccupancyData ()
 
const float * getBFactorData ()
 
void setBFactorData (molfile_atom_t *atomarray)
 
void freeBFactorData ()
 
Real atommass (int anum) const
 
Real atomcharge (int anum) const
 
Index atomvdwtype (int anum) const
 
Bondget_bond (int bnum) const
 
Angleget_angle (int anum) const
 
Improperget_improper (int inum) const
 
Dihedralget_dihedral (int dnum) const
 
Crosstermget_crossterm (int inum) const
 
Lphostget_lphost (int atomid) const
 
BondgetAllBonds () const
 
AnglegetAllAngles () const
 
ImpropergetAllImpropers () const
 
DihedralgetAllDihedrals () const
 
CrosstermgetAllCrossterms () const
 
LphostgetAllLphosts () const
 
Bondget_donor (int dnum) const
 
Bondget_acceptor (int dnum) const
 
BondgetAllDonors () const
 
BondgetAllAcceptors () const
 
Exclusionget_exclusion (int ex) const
 
const char * get_atomtype (int anum) const
 
int get_atom_from_name (const char *segid, int resid, const char *aname) const
 
int get_residue_size (const char *segid, int resid) const
 
int get_atom_from_index_in_residue (const char *segid, int resid, int index) const
 
int32get_bonds_for_atom (int anum)
 
int32get_angles_for_atom (int anum)
 
int32get_dihedrals_for_atom (int anum)
 
int32get_impropers_for_atom (int anum)
 
int32get_crossterms_for_atom (int anum)
 
int32get_exclusions_for_atom (int anum)
 
const int32get_full_exclusions_for_atom (int anum) const
 
const int32get_mod_exclusions_for_atom (int anum) const
 
int checkexcl (int atom1, int atom2) const
 
const ExclusionCheckget_excl_check_for_atom (int anum) const
 
Bool is_atom_gridforced (int atomnum, int gridnum) const
 
Bool is_atom_constrained (int atomnum) const
 
Bool is_atom_movdragged (int atomnum) const
 
Bool is_atom_rotdragged (int atomnum) const
 
Bool is_atom_constorqued (int atomnum) const
 
void get_cons_params (Real &k, Vector &refPos, int atomnum) const
 
void get_gridfrc_params (Real &k, Charge &q, int atomnum, int gridnum) const
 
GridforceGridget_gridfrc_grid (int gridnum) const
 
int set_gridfrc_grid (int gridnum, GridforceGrid *grid)
 
Real langevin_param (int atomnum) const
 
void get_stir_refPos (Vector &refPos, int atomnum) const
 
void put_stir_startTheta (Real theta, int atomnum) const
 
Real get_stir_startTheta (int atomnum) const
 
void get_movdrag_params (Vector &v, int atomnum) const
 
void get_rotdrag_params (BigReal &v, Vector &a, Vector &p, int atomnum) const
 
void get_constorque_params (BigReal &v, Vector &a, Vector &p, int atomnum) const
 
unsigned char get_fep_type (int anum) const
 
unsigned char get_ss_type (int anum) const
 
int get_fep_bonded_type (const int *atomID, unsigned int order) const
 
Bool is_atom_fixed (int atomnum) const
 
Bool is_atom_stirred (int atomnum) const
 
Bool is_group_fixed (int atomnum) const
 
Bool is_atom_exPressure (int atomnum) const
 
Real rigid_bond_length (int atomnum) const
 
void print_atoms (Parameters *)
 
void print_bonds (Parameters *)
 
void print_exclusions ()
 
void goInit ()
 
void build_gro_pair ()
 
void build_go_params (StringList *)
 
void read_go_file (char *)
 
Real get_go_cutoff (int chain1, int chain2)
 
Real get_go_epsilonRep (int chain1, int chain2)
 
Real get_go_sigmaRep (int chain1, int chain2)
 
Real get_go_epsilon (int chain1, int chain2)
 
int get_go_exp_a (int chain1, int chain2)
 
int get_go_exp_b (int chain1, int chain2)
 
int get_go_exp_rep (int chain1, int chain2)
 
Bool go_restricted (int, int, int)
 
void print_go_params ()
 
void initialize ()
 
void send_GoMolecule (MOStream *)
 
void receive_GoMolecule (MIStream *)
 

Public Attributes

int ss_num_vdw_params
 
int * ss_vdw_type
 
int * ss_index
 
int is_drude_psf
 
int is_lonepairs_psf
 
Real r_om
 
Real r_ohc
 
BigReal tail_corr_ener
 
BigReal tail_corr_virial
 
BigReal tail_corr_dUdl_1
 
BigReal tail_corr_dUdl_2
 
BigReal tail_corr_virial_1
 
BigReal tail_corr_virial_2
 
int numAtoms
 
int numRealBonds
 
int numBonds
 
int numAngles
 
int numDihedrals
 
int suspiciousAlchBonds
 
int alchDroppedAngles
 
int alchDroppedDihedrals
 
int alchDroppedImpropers
 
int numImpropers
 
int numCrossterms
 
int numDonors
 
int numAcceptors
 
int numExclusions
 
int64 numTotalExclusions
 
int num_alch_unpert_Bonds
 
int num_alch_unpert_Angles
 
int num_alch_unpert_Dihedrals
 
Bondalch_unpert_bonds
 
Anglealch_unpert_angles
 
Dihedralalch_unpert_dihedrals
 
int numLonepairs
 Number of lone pairs. More...
 
int numDrudeAtoms
 Number of Drude particles. More...
 
int numTholes
 Number of Thole terms. More...
 
int numAnisos
 Number of anisotropic terms. More...
 
int numLphosts
 Number of lone pair host records in PSF. More...
 
int numZeroMassAtoms
 Number of atoms with zero mass. More...
 
int numConstraints
 
int numGridforceGrids
 
int * numGridforces
 
int numMovDrag
 
int numRotDrag
 
int numConsTorque
 
int numFixedAtoms
 
int numStirredAtoms
 
int numExPressureAtoms
 
int numHydrogenGroups
 
int maxHydrogenGroupSize
 
int numMigrationGroups
 
int maxMigrationGroupSize
 
int numFixedGroups
 
int numRigidBonds
 
int numFixedRigidBonds
 
int numFepInitial
 
int numFepFinal
 
int numConsForce
 
int32consForceIndexes
 
VectorconsForce
 
int32consTorqueIndexes
 
ConsTorqueParams * consTorqueParams
 
int numCalcBonds
 
int numCalcAngles
 
int numCalcDihedrals
 
int numCalcImpropers
 
int numCalcCrossterms
 
int64 numCalcExclusions
 
int64 numCalcFullExclusions
 
int numCalcTholes
 
int numCalcAnisos
 
int numMultipleDihedrals
 
int numMultipleImpropers
 
HydrogenGroup hydrogenGroup
 
int numGoAtoms
 
int32atomChainTypes
 
int32goSigmaIndices
 
int32goResidIndices
 
RealgoSigmas
 
bool * goWithinCutoff
 
RealgoCoordinates
 
int * goResids
 
PDBgoPDB
 
int goNumLJPair
 
int * goIndxLJA
 
int * goIndxLJB
 
double * goSigmaPairA
 
double * goSigmaPairB
 
int * pointerToGoBeg
 
int * pointerToGoEnd
 
int numPair
 
int numLJPair
 
int numCalcLJPair
 
int * pointerToLJBeg
 
int * pointerToLJEnd
 
int * indxLJA
 
int * indxLJB
 
RealpairC6
 
RealpairC12
 
int * gromacsPair_type
 
int * pointerToGaussBeg
 
int * pointerToGaussEnd
 
int numGaussPair
 
int * indxGaussA
 
int * indxGaussB
 
RealgA
 
RealgMu1
 
RealgiSigma1
 
RealgMu2
 
RealgiSigma2
 
RealgRepulsive
 
BigReal energyNative
 
BigReal energyNonnative
 
int isOccupancyValid
 
int isBFactorValid
 
GoValue go_array [MAX_GO_CHAINS *MAX_GO_CHAINS]
 
int go_indices [MAX_GO_CHAINS+1]
 
int NumGoChains
 

Friends

class ExclElem
 
class BondElem
 
class AngleElem
 
class DihedralElem
 
class ImproperElem
 
class TholeElem
 
class AnisoElem
 
class CrosstermElem
 
class GromacsPairElem
 
class WorkDistrib
 

Detailed Description

Definition at line 151 of file Molecule.h.

Constructor & Destructor Documentation

Molecule::Molecule ( SimParameters simParams,
Parameters param 
)

Definition at line 429 of file Molecule.C.

430 {
431  initialize(simParams,param);
432 }
void initialize()
Molecule::Molecule ( SimParameters simParams,
Parameters param,
char *  filename,
ConfigList cfgList = NULL 
)

Definition at line 442 of file Molecule.C.

References SimParameters::LCPOOn, and SimParameters::useCompressedPsf.

443 {
444  initialize(simParams,param);
445 
446 #ifdef MEM_OPT_VERSION
447  if(simParams->useCompressedPsf)
448  read_mol_signatures(filename, param, cfgList);
449 #else
450  read_psf_file(filename, param);
451  //LCPO
452  if (simParams->LCPOOn)
453  assignLCPOTypes( 0 );
454 #endif
455  }
void initialize()
Molecule::Molecule ( SimParameters simParams,
Parameters param,
molfile_plugin_t *  pIOHdl,
void pIOFileHdl,
int  natoms 
)

Definition at line 464 of file Molecule.C.

References SimParameters::LCPOOn, and NAMD_die().

465 {
466 #ifdef MEM_OPT_VERSION
467  NAMD_die("Sorry, plugin IO is not supported in the memory optimized version.");
468 #else
469  initialize(simParams, param);
470  numAtoms = natoms;
471  int optflags = MOLFILE_BADOPTIONS;
472  molfile_atom_t *atomarray = (molfile_atom_t *) malloc(natoms*sizeof(molfile_atom_t));
473  memset(atomarray, 0, natoms*sizeof(molfile_atom_t));
474 
475  //1a. read basic atoms information
476  int rc = pIOHdl->read_structure(pIOFileHdl, &optflags, atomarray);
477  if (rc != MOLFILE_SUCCESS && rc != MOLFILE_NOSTRUCTUREDATA) {
478  free(atomarray);
479  NAMD_die("ERROR: plugin failed reading structure data");
480  }
481  if(optflags == MOLFILE_BADOPTIONS) {
482  free(atomarray);
483  NAMD_die("ERROR: plugin didn't initialize optional data flags");
484  }
485  if(optflags & MOLFILE_OCCUPANCY) {
486  setOccupancyData(atomarray);
487  }
488  if(optflags & MOLFILE_BFACTOR) {
489  setBFactorData(atomarray);
490  }
491  //1b. load basic atoms information to the molecule object
492  plgLoadAtomBasics(atomarray);
493  free(atomarray);
494 
495  //2a. read bonds
496  //indices are one-based in read_bonds
497  int *from, *to;
498  float *bondorder;
499  int *bondtype, nbondtypes;
500  char **bondtypename;
501  if(pIOHdl->read_bonds!=NULL) {
502  if(pIOHdl->read_bonds(pIOFileHdl, &numBonds, &from, &to, &bondorder,
503  &bondtype, &nbondtypes, &bondtypename)){
504  NAMD_die("ERROR: failed reading bond information.");
505  }
506  }
507  //2b. load bonds information to the molecule object
508  if(numBonds!=0) {
509  plgLoadBonds(from,to);
510  }
511 
512  //3a. read other bonded structures
513  int *plgAngles, *plgDihedrals, *plgImpropers, *plgCterms;
514  int ctermcols, ctermrows;
515  int *angletypes, numangletypes, *dihedraltypes, numdihedraltypes;
516  int *impropertypes, numimpropertypes;
517  char **angletypenames, **dihedraltypenames, **impropertypenames;
518 
519  plgAngles=plgDihedrals=plgImpropers=plgCterms=NULL;
520  if(pIOHdl->read_angles!=NULL) {
521  if(pIOHdl->read_angles(pIOFileHdl,
522  &numAngles, &plgAngles,
523  &angletypes, &numangletypes, &angletypenames,
524  &numDihedrals, &plgDihedrals,
525  &dihedraltypes, &numdihedraltypes, &dihedraltypenames,
526  &numImpropers, &plgImpropers,
527  &impropertypes, &numimpropertypes, &impropertypenames,
528  &numCrossterms, &plgCterms, &ctermcols, &ctermrows)) {
529  NAMD_die("ERROR: failed reading angle information.");
530  }
531  }
532  //3b. load other bonded structures to the molecule object
533  if(numAngles!=0) plgLoadAngles(plgAngles);
534  if(numDihedrals!=0) plgLoadDihedrals(plgDihedrals);
535  if(numImpropers!=0) plgLoadImpropers(plgImpropers);
536  if(numCrossterms!=0) plgLoadCrossterms(plgCterms);
537 
539  build_atom_status();
540  //LCPO
541  if (simParams->LCPOOn)
542  assignLCPOTypes( 2 );
543 #endif
544 }
int numBonds
Definition: Molecule.h:560
void setOccupancyData(molfile_atom_t *atomarray)
Definition: Molecule.C:3236
void setBFactorData(molfile_atom_t *atomarray)
Definition: Molecule.C:3243
int numRealBonds
Definition: Molecule.h:559
int numAngles
Definition: Molecule.h:561
int numAtoms
Definition: Molecule.h:557
int numCrossterms
Definition: Molecule.h:568
void NAMD_die(const char *err_msg)
Definition: common.C:85
int numDihedrals
Definition: Molecule.h:562
int numImpropers
Definition: Molecule.h:567
void initialize()
Molecule::Molecule ( SimParameters ,
Parameters ,
Ambertoppar  
)
Molecule::Molecule ( SimParameters ,
Parameters ,
AmberParm7Reader::Ambertoppar  
)
Molecule::Molecule ( SimParameters ,
Parameters ,
const GromacsTopFile  
)
Molecule::~Molecule ( )

Definition at line 558 of file Molecule.C.

References atoms, atomSigPool, exclusions, and exclusionsByAtom.

559 {
560  /* Check to see if each array was ever allocated. If it was */
561  /* then free it */
562  if (atoms != NULL)
563  delete [] atoms;
564 
565  if (atomNames != NULL)
566  {
567  // subarrarys allocated from arena - automatically deleted
568  delete [] atomNames;
569  }
570  delete nameArena;
571 
572  if (resLookup != NULL)
573  delete resLookup;
574 
575  // DRUDE: free arrays read from PSF
576  if (drudeConsts != NULL) delete [] drudeConsts;
577  if (lphosts != NULL) delete [] lphosts;
578  if (anisos != NULL) delete [] anisos;
579  if (tholes != NULL) delete [] tholes;
580  if (lphostIndexes != NULL) delete [] lphostIndexes;
581  // DRUDE
582 
583  //LCPO
584  if (lcpoParamType != NULL) delete [] lcpoParamType;
585 
586  #ifdef MEM_OPT_VERSION
587  if(eachAtomSig) delete [] eachAtomSig;
588  if(atomSigPool) delete [] atomSigPool;
589  #else
590  if (bonds != NULL)
591  delete [] bonds;
592 
593  if (angles != NULL)
594  delete [] angles;
595 
596  if (dihedrals != NULL)
597  delete [] dihedrals;
598 
599  if (impropers != NULL)
600  delete [] impropers;
601 
602  if (crossterms != NULL)
603  delete [] crossterms;
604 
605  if (exclusions != NULL)
606  delete [] exclusions;
607  #endif
608 
609  if (donors != NULL)
610  delete [] donors;
611 
612  if (acceptors != NULL)
613  delete [] acceptors;
614 
615  #ifdef MEM_OPT_VERSION
616  if(exclSigPool) delete [] exclSigPool;
617  if(exclChkSigPool) delete [] exclChkSigPool;
618  if(eachAtomExclSig) delete [] eachAtomExclSig;
619  if(fixedAtomsSet) delete fixedAtomsSet;
620  if(constrainedAtomsSet) delete constrainedAtomsSet;
621  #else
622  if (bondsByAtom != NULL)
623  delete [] bondsByAtom;
624 
625  if (anglesByAtom != NULL)
626  delete [] anglesByAtom;
627 
628  if (dihedralsByAtom != NULL)
629  delete [] dihedralsByAtom;
630 
631  if (impropersByAtom != NULL)
632  delete [] impropersByAtom;
633 
634  if (crosstermsByAtom != NULL)
635  delete [] crosstermsByAtom;
636 
637  if (exclusionsByAtom != NULL)
638  delete [] exclusionsByAtom;
639 
640  if (fullExclusionsByAtom != NULL)
641  delete [] fullExclusionsByAtom;
642 
643  if (modExclusionsByAtom != NULL)
644  delete [] modExclusionsByAtom;
645 
646  if (all_exclusions != NULL)
647  delete [] all_exclusions;
648 
649  // JLai
650  if (gromacsPairByAtom != NULL)
651  delete [] gromacsPairByAtom;
652  // End of JLai
653 
654  // DRUDE
655  if (tholesByAtom != NULL)
656  delete [] tholesByAtom;
657  if (anisosByAtom != NULL)
658  delete [] anisosByAtom;
659  // DRUDE
660  #endif
661 
662  //LCPO
663  if (lcpoParamType != NULL)
664  delete [] lcpoParamType;
665 
666  if (fixedAtomFlags != NULL)
667  delete [] fixedAtomFlags;
668 
669  if (stirIndexes != NULL)
670  delete [] stirIndexes;
671 
672 
673  #ifdef MEM_OPT_VERSION
674  if(clusterSigs != NULL){
675  delete [] clusterSigs;
676  }
677  #else
678  if (cluster != NULL)
679  delete [] cluster;
680  #endif
681  if (clusterSize != NULL)
682  delete [] clusterSize;
683 
684  if (exPressureAtomFlags != NULL)
685  delete [] exPressureAtomFlags;
686 
687  if (rigidBondLengths != NULL)
688  delete [] rigidBondLengths;
689 
690 //fepb
691  if (fepAtomFlags != NULL)
692  delete [] fepAtomFlags;
693  if (alch_unpert_bonds != NULL)
694  delete [] alch_unpert_bonds;
695  if (alch_unpert_angles != NULL)
696  delete [] alch_unpert_angles;
697  if (alch_unpert_dihedrals != NULL)
698  delete [] alch_unpert_dihedrals;
699 //fepe
700 
701 //soluteScaling
702  if (ssAtomFlags != NULL)
703  delete [] ssAtomFlags;
704  if (ss_vdw_type != NULL)
705  delete [] ss_vdw_type;
706  if (ss_index != NULL)
707  delete [] ss_index;
708 //soluteScaling
709 
710  if (qmAtomGroup != NULL)
711  delete [] qmAtomGroup;
712 
713  if (qmAtmIndx != NULL)
714  delete [] qmAtmIndx;
715 
716  if (qmAtmChrg != NULL)
717  delete [] qmAtmChrg;
718 
719 
720  if (qmGrpNumBonds != NULL)
721  delete [] qmGrpNumBonds;
722 
723  if (qmGrpSizes != NULL)
724  delete [] qmGrpSizes;
725 
726  if (qmDummyBondVal != NULL)
727  delete [] qmDummyBondVal;
728 
729  if (qmMMNumTargs != NULL)
730  delete [] qmMMNumTargs;
731 
732  if (qmGrpID != NULL)
733  delete [] qmGrpID;
734 
735  if (qmGrpChrg != NULL)
736  delete [] qmGrpChrg;
737 
738  if (qmGrpMult != NULL)
739  delete [] qmGrpMult;
740 
741  if (qmMeMMindx != NULL)
742  delete [] qmMeMMindx;
743 
744  if (qmMeQMGrp != NULL)
745  delete [] qmMeQMGrp;
746 
747  if (qmLSSSize != NULL)
748  delete [] qmLSSSize;
749 
750  if (qmLSSIdxs != NULL)
751  delete [] qmLSSIdxs;
752 
753  if (qmLSSMass != NULL)
754  delete [] qmLSSMass;
755 
756  if (qmLSSRefSize != NULL)
757  delete [] qmLSSRefSize;
758 
759  if (qmLSSRefIDs != NULL)
760  delete [] qmLSSRefIDs;
761 
762  if (qmLSSRefMass != NULL)
763  delete [] qmLSSRefMass;
764 
765  if (qmMMBond != NULL) {
766  for(int grpIndx = 0 ; grpIndx < qmNumBonds; grpIndx++) {
767  if (qmMMBond[grpIndx] != NULL)
768  delete [] qmMMBond[grpIndx];
769  }
770  delete [] qmMMBond;
771  }
772 
773  if (qmGrpBonds != NULL) {
774  for(int grpIndx = 0 ; grpIndx < qmNumGrps; grpIndx++) {
775  if (qmGrpBonds[grpIndx] != NULL)
776  delete [] qmGrpBonds[grpIndx];
777  }
778  delete [] qmGrpBonds;
779  }
780 
781  if (qmMMBondedIndx != NULL) {
782  for(int grpIndx = 0 ; grpIndx < qmNumGrps; grpIndx++) {
783  if (qmMMBondedIndx[grpIndx] != NULL)
784  delete [] qmMMBondedIndx[grpIndx];
785  }
786  delete [] qmMMBondedIndx;
787  }
788 
789  if (qmMMChargeTarget != NULL) {
790  for(int grpIndx = 0 ; grpIndx < qmNumBonds; grpIndx++) {
791  if (qmMMChargeTarget[grpIndx] != NULL)
792  delete [] qmMMChargeTarget[grpIndx];
793  }
794  delete [] qmMMChargeTarget;
795  }
796 
797  if (qmElementArray != NULL){
798  for(int atmInd = 0 ; atmInd < numAtoms; atmInd++) {
799  if (qmElementArray[atmInd] != NULL)
800  delete [] qmElementArray[atmInd];
801  }
802  delete [] qmElementArray;
803  }
804 
805  if (qmDummyElement != NULL){
806  for(int atmInd = 0 ; atmInd < numAtoms; atmInd++) {
807  if (qmDummyElement[atmInd] != NULL)
808  delete [] qmDummyElement[atmInd];
809  }
810  delete [] qmDummyElement;
811  }
812 
813  if (qmCustPCSizes != NULL){
814  delete [] qmCustPCSizes;
815  }
816 
817  if (qmCustomPCIdxs != NULL){
818  delete [] qmCustomPCIdxs;
819  }
820 
821  if (cSMDindex != NULL) {
822  for(int grpIndx = 0 ; grpIndx < qmNumGrps; grpIndx++) {
823  if (cSMDindex[grpIndx] != NULL)
824  delete [] cSMDindex[grpIndx];
825  }
826  delete [] cSMDindex;
827  }
828 
829  if (cSMDpairs != NULL) {
830  for(int instIndx = 0 ; instIndx < cSMDnumInst; instIndx++) {
831  if (cSMDpairs[instIndx] != NULL)
832  delete [] cSMDpairs[instIndx];
833  }
834  delete [] cSMDpairs;
835  }
836 
837  if (cSMDindxLen != NULL)
838  delete [] cSMDindxLen;
839  if (cSMDKs != NULL)
840  delete [] cSMDKs;
841  if (cSMDVels != NULL)
842  delete [] cSMDVels;
843  if (cSMDcoffs != NULL)
844  delete [] cSMDcoffs;
845 
846  #ifndef MEM_OPT_VERSION
847  delete arena;
848  delete exclArena;
849  #endif
850 }
Angle * alch_unpert_angles
Definition: Molecule.h:577
Dihedral * alch_unpert_dihedrals
Definition: Molecule.h:578
Bond * alch_unpert_bonds
Definition: Molecule.h:576
int numAtoms
Definition: Molecule.h:557
int * ss_index
Definition: Molecule.h:459
int * ss_vdw_type
Definition: Molecule.h:458
HashPool< AtomSigInfo > atomSigPool
Definition: CompressPsf.C:313

Member Function Documentation

Real Molecule::atomcharge ( int  anum) const
inline

Definition at line 1052 of file Molecule.h.

References atoms, and charge.

Referenced by WorkDistrib::createAtomLists(), NamdState::loadStructure(), Sequencer::reloadCharges(), Sequencer::rescaleSoluteCharges(), colvarproxy_namd::update_atom_properties(), and colvarproxy_namd::update_group_properties().

1053  {
1054  #ifdef MEM_OPT_VERSION
1055  return atomChargePool[eachAtomCharge[anum]];
1056  #else
1057  return(atoms[anum].charge);
1058  #endif
1059  }
k< npairi;++k){TABENERGY(const int numtypes=simParams->tableNumTypes;const float table_spacing=simParams->tableSpacing;const int npertype=(int)(namdnearbyint(simParams->tableMaxDist/simParams->tableSpacing)+1);) int table_i=(r2iilist[2 *k] >> 14)+r2_delta_expc;const int j=pairlisti[k];#define p_j BigReal diffa=r2list[k]-r2_table[table_i];#define table_four_i TABENERGY(register const int tabtype=-1-(lj_pars->A< 0?lj_pars->A:0);) BigReal kqq=kq_i *p_j-> charge
Real Molecule::atommass ( int  anum) const
inline

Definition at line 1042 of file Molecule.h.

References atoms.

Referenced by WorkDistrib::createAtomLists(), GlobalMasterEasy::getMass(), GlobalMasterFreeEnergy::getMass(), NamdState::loadStructure(), Tcl_centerOfMass(), Tcl_radiusOfGyration(), colvarproxy_namd::update_atom_properties(), and colvarproxy_namd::update_group_properties().

1043  {
1044  #ifdef MEM_OPT_VERSION
1045  return atomMassPool[eachAtomMass[anum]];
1046  #else
1047  return(atoms[anum].mass);
1048  #endif
1049  }
Bool Molecule::atoms_1to4 ( unsigned int  atom1,
unsigned int  atom2 
)

Definition at line 1537 of file GoMolecule.C.

References bond::atom1, angle::atom1, dihedral::atom1, bond::atom2, angle::atom2, dihedral::atom2, angle::atom3, dihedral::atom3, dihedral::atom4, DebugM, FALSE, get_angle(), get_angles_for_atom(), get_bond(), get_bonds_for_atom(), get_dihedral(), get_dihedrals_for_atom(), and TRUE.

Referenced by build_go_arrays(), build_go_sigmas(), and build_go_sigmas2().

1539 {
1540  int bondNum; // Bonds in bonded list
1541  int angleNum; // Angles in angle list
1542  int dihedralNum; // Dihedrals in dihedral list
1543  int *bonds;
1544  int *angles;
1545  int *dihedrals;
1546  Bond *bond; // Temporary bond structure
1547  Angle *angle; // Temporary angle structure
1548  Dihedral *dihedral; // Temporary dihedral structure
1549 
1550  DebugM(2,"atoms_1to4(" << atom1 << "," << atom2 << ")" << std::endl);
1551 
1552  bonds = get_bonds_for_atom(atom1);
1553  bondNum = *bonds;
1554  while(bondNum != -1) {
1555  bond = get_bond(bondNum);
1556  DebugM(2,"bond atom1:" << bond->atom1 << ", atom2:" << bond->atom2 << std::endl);
1557  if (atom2 == bond->atom1 || atom2 == bond->atom2) {
1558  return TRUE;
1559  }
1560  bondNum = *(++bonds);
1561  }
1562 
1563  bonds = get_bonds_for_atom(atom2);
1564  bondNum = *bonds;
1565  while(bondNum != -1) {
1566  bond = get_bond(bondNum);
1567  DebugM(2,"bond atom1:" << bond->atom1 << ", atom2:" << bond->atom2 << std::endl);
1568  if (atom1 == bond->atom1 || atom1 == bond->atom2) {
1569  return TRUE;
1570  }
1571  bondNum = *(++bonds);
1572  }
1573 
1574  angles = get_angles_for_atom(atom1);
1575  angleNum = *angles;
1576  while(angleNum != -1) {
1577  angle = get_angle(angleNum);
1578  DebugM(2,"angle atom1:" << angle->atom1 << ", atom2:" << angle->atom2 << ", atom3:" << angle->atom3 << std::endl);
1579  if (atom2 == angle->atom1 || atom2 == angle->atom2 || atom2 == angle->atom3) {
1580  return TRUE;
1581  }
1582  angleNum = *(++angles);
1583  }
1584 
1585  angles = get_angles_for_atom(atom2);
1586  angleNum = *angles;
1587  while(angleNum != -1) {
1588  angle = get_angle(angleNum);
1589  DebugM(2,"angle atom1:" << angle->atom1 << ", atom2:" << angle->atom2 << ", atom3:" << angle->atom3 << std::endl);
1590  if (atom1 == angle->atom1 || atom1 == angle->atom2 || atom1 == angle->atom3) {
1591  return TRUE;
1592  }
1593  angleNum = *(++angles);
1594  }
1595 
1596  dihedrals = get_dihedrals_for_atom(atom1);
1597  dihedralNum = *dihedrals;
1598  while(dihedralNum != -1) {
1599  dihedral = get_dihedral(dihedralNum);
1600  DebugM(2,"dihedral atom1:" << dihedral->atom1 << ", atom2:" << dihedral->atom2 << ", atom3:" << dihedral->atom3 << ", atom4:" << dihedral->atom4 << std::endl);
1601  if (atom2 == dihedral->atom1 || atom2 == dihedral->atom2 \
1602  || atom2 == dihedral->atom3 || atom2 == dihedral->atom4) {
1603  return TRUE;
1604  }
1605  dihedralNum = *(++dihedrals);
1606  }
1607 
1608  dihedrals = get_dihedrals_for_atom(atom2);
1609  dihedralNum = *dihedrals;
1610  while(dihedralNum != -1) {
1611  dihedral = get_dihedral(dihedralNum);
1612  DebugM(2,"dihedral atom1:" << dihedral->atom1 << ", atom2:" << dihedral->atom2 << ", atom3:" << dihedral->atom3 << ", atom4:" << dihedral->atom4 << std::endl);
1613  if (atom1 == dihedral->atom1 || atom1 == dihedral->atom2 \
1614  || atom1 == dihedral->atom3 || atom1 == dihedral->atom4) {
1615  return TRUE;
1616  }
1617  dihedralNum = *(++dihedrals);
1618  }
1619 
1620  return FALSE;
1621 }
int32 * get_dihedrals_for_atom(int anum)
Definition: Molecule.h:1153
int32 atom3
Definition: structures.h:65
#define DebugM(x, y)
Definition: Debug.h:59
#define FALSE
Definition: common.h:118
int32 * get_angles_for_atom(int anum)
Definition: Molecule.h:1151
int32 atom4
Definition: structures.h:66
int32 atom1
Definition: structures.h:48
Dihedral * get_dihedral(int dnum) const
Definition: Molecule.h:1078
int32 atom2
Definition: structures.h:56
int32 atom1
Definition: structures.h:55
int32 * get_bonds_for_atom(int anum)
Definition: Molecule.h:1149
int32 atom3
Definition: structures.h:57
Bond * get_bond(int bnum) const
Definition: Molecule.h:1069
int32 atom2
Definition: structures.h:64
Angle * get_angle(int anum) const
Definition: Molecule.h:1072
#define TRUE
Definition: common.h:119
int32 atom1
Definition: structures.h:63
int32 atom2
Definition: structures.h:49
Index Molecule::atomvdwtype ( int  anum) const
inline

Definition at line 1062 of file Molecule.h.

References atoms.

Referenced by WorkDistrib::createAtomLists(), and dumpbench().

1063  {
1064  return(atoms[anum].vdw_type);
1065  }
void Molecule::build_alch_unpert_bond_lists ( char *  )
void Molecule::build_constant_forces ( char *  )
void Molecule::build_constorque_params ( StringList ,
StringList ,
StringList ,
StringList ,
StringList ,
StringList ,
PDB ,
char *   
)
void Molecule::build_constraint_params ( StringList ,
StringList ,
StringList ,
PDB ,
char *   
)
void Molecule::build_exPressure_atoms ( StringList ,
StringList ,
PDB ,
char *   
)
void Molecule::build_extra_bonds ( Parameters parameters,
StringList file 
)
void Molecule::build_fep_flags ( StringList ,
StringList ,
PDB ,
char *  ,
const char *   
)
void Molecule::build_fixed_atoms ( StringList ,
StringList ,
PDB ,
char *   
)
void Molecule::build_go_arrays ( StringList goCoordFile,
char *  cwd 
)

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(), StringList::data, DebugM, endi(), energyNative, energyNonnative, get_go_cutoff(), go_restricted(), goCoordinates, goPDB, goResids, goSigmaIndices, iINFO(), iout, NAMD_die(), NAMD_FILENAME_BUFFER_SIZE, StringList::next, PDB::num_atoms(), numAtoms, numGoAtoms, PDBAtom::residueseq(), PDBAtom::xcoor(), PDBAtom::ycoor(), and PDBAtom::zcoor().

Referenced by NamdState::loadStructure().

952 {
953  DebugM(3,"->build_go_arrays" << std::endl);
954  //PDB *goPDB; // Pointer to PDB object to use
955  int bcol = 4; // Column that data is in
956  int32 chainType = 0; // b value from PDB file
957  int i; // Loop counter
958  int j; // Loop counter
959  BigReal atomAtomDist; // Distance between two atoms -- JLai put back
960  int resid1; // Residue ID for first atom
961  int resid2; // Residue ID for second atom
962  int residDiff; // Difference between resid1 and resid2
963  int goIndex; // Index into the goCoordinates array
964  int goIndx; // Index into the goCoordinates array
965  char filename[NAMD_FILENAME_BUFFER_SIZE]; // Filename
966 
967  //JLai
968  BigReal nativeEnergy, *native;
969  BigReal nonnativeEnergy, *nonnative;
970  nativeEnergy = 0;
971  nonnativeEnergy = 0;
972  native = &nativeEnergy;
973  nonnative = &nonnativeEnergy;
974 
975  long nativeContacts = 0;
976  long nonnativeContacts = 0;
977 
978  // Get the PDB object that contains the Go coordinates. If
979  // the user gave another file name, use it. Otherwise, just use
980  // the PDB file that has the initial coordinates.
981  if (goCoordFile == NULL)
982  {
983  //goPDB = initial_pdb;
984  NAMD_die("Error: goCoordFile is NULL - build_go_arrays");
985  }
986  else
987  {
988  if (goCoordFile->next != NULL)
989  {
990  NAMD_die("Multiple definitions of Go atoms PDB file in configuration file");
991  }
992 
993  if ( (cwd == NULL) || (goCoordFile->data[0] == '/') )
994  {
995  strcpy(filename, goCoordFile->data);
996  }
997  else
998  {
999  strcpy(filename, cwd);
1000  strcat(filename, goCoordFile->data);
1001  }
1002 
1003  goPDB = new PDB(filename);
1004  if ( goPDB == NULL )
1005  {
1006  NAMD_die("goPDB memory allocation failed in Molecule::build_go_arrays");
1007  }
1008 
1009  if (goPDB->num_atoms() != numAtoms)
1010  {
1011  NAMD_die("Number of atoms in fixed atoms PDB doesn't match coordinate PDB");
1012  }
1013  }
1014 
1015  // Allocate the array to hold Go atom indices into the sigma array
1016  goSigmaIndices = new int32[numAtoms];
1017 
1018  if (goSigmaIndices == NULL) {
1019  NAMD_die("goSigmaIndices memory allocation failed in Molecule::build_go_arrays");
1020  }
1021 
1022  numGoAtoms = 0;
1023 
1024  // Loop through all the atoms and get the Go chain types
1025  for (i=0; i<numAtoms; i++) {
1026  chainType = (int32)(goPDB->atom(i))->occupancy();
1027  if ( chainType != 0 ) {
1028  DebugM(3,"build_go_arrays - atom:" << i << std::endl);
1030  numGoAtoms++;
1031  }
1032  else {
1033  goSigmaIndices[i] = -1;
1034  }
1035  }
1036 
1037  // Allocate the array to hold the sigma values for each Go atom pair
1049  // Allocate the array to hold the chain types
1051 
1052  if (atomChainTypes == NULL) {
1053  NAMD_die("atomChainTypes memory allocation failed in Molecule::build_go_arrays");
1054  }
1055 
1056  // Allocate the array to hold (x,y,z) coordinates for all of the Go atoms
1057  goCoordinates = new Real[numGoAtoms*3];
1058 
1059  if (goCoordinates == NULL) {
1060  NAMD_die("goCoordinates memory allocation failed in Molecule::build_go_arrays");
1061  }
1062 
1063  goResids = new int[numGoAtoms];
1064 
1065  // Allocate the array to hold PDB residu IDs for all of the Go atoms
1066  if (goResids == NULL) {
1067  NAMD_die("goResids memory allocation failed in Molecule::build_go_arrays");
1068  }
1069 
1070  for (i=0; i<numAtoms; i++) {
1071  goIndex = goSigmaIndices[i];
1072  if (goIndex != -1) {
1073  // Assign the chainType value!
1074  // Get the chainType from the occupancy field
1075  atomChainTypes[goIndex] = (int32)(goPDB->atom(i))->occupancy();
1076  goCoordinates[goIndex*3] = goPDB->atom(i)->xcoor();
1077  goCoordinates[goIndex*3 + 1] = goPDB->atom(i)->ycoor();
1078  goCoordinates[goIndex*3 + 2] = goPDB->atom(i)->zcoor();
1079  goResids[goIndex] = goPDB->atom(i)->residueseq();
1080  }
1081  }
1082  // JLai
1083  energyNative = 0;
1084  energyNonnative = 0;
1085  //printf("INIT ENERGY: (N) %f (NN) %f\n", energyNative, energyNonnative);
1086  for (i=0; i<numAtoms-1; i++) {
1087  goIndex = goSigmaIndices[i];
1088  if (goIndex != -1) {
1089  for (j=i+1; j<numAtoms;j++) {
1090  goIndx = goSigmaIndices[j];
1091  if (goIndx != -1) {
1092  resid1 = (goPDB->atom(i))->residueseq();
1093  resid2 = (goPDB->atom(j))->residueseq();
1094  residDiff = resid2 - resid1;
1095  if (residDiff < 0) residDiff = -residDiff;
1096  if (atomChainTypes[goIndex] && atomChainTypes[goIndx] &&
1097  !(this->go_restricted(atomChainTypes[goIndex],atomChainTypes[goIndx],residDiff)) &&
1098  !atoms_1to4(i,j)) {
1099  atomAtomDist = sqrt(pow((goPDB->atom(i))->xcoor() - (goPDB->atom(j))->xcoor(), 2.0) +
1100  pow((goPDB->atom(i))->ycoor() - (goPDB->atom(j))->ycoor(), 2.0) +
1101  pow((goPDB->atom(i))->zcoor() - (goPDB->atom(j))->zcoor(), 2.0));
1102  if (atomAtomDist <= this->get_go_cutoff(atomChainTypes[goIndex],atomChainTypes[goIndx]) ) {
1103  nativeContacts++;
1104  } else {
1105  nonnativeContacts++;
1106  }
1107  }
1108  }
1109  }
1110  }
1111  }
1112  iout << iINFO << "Number of UNIQUE native contacts: " << nativeContacts << "\n" << endi;
1113  iout << iINFO << "Number of UNIQUE nonnative contacts: " << nonnativeContacts << "\n" << endi;
1114 
1115  // If we had to create a PDB object, delete it now
1116  if (goCoordFile != NULL) {
1117  delete goPDB;
1118  }
1119 
1120  return;
1121 }
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:81
Real get_go_cutoff(int chain1, int chain2)
Definition: Molecule.h:1605
Definition: PDB.h:36
PDB * goPDB
Definition: Molecule.h:651
short int32
Definition: dumpdcd.c:24
Real * goCoordinates
Definition: Molecule.h:649
float Real
Definition: common.h:109
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
BigReal zcoor(void)
Definition: PDBData.C:433
#define iout
Definition: InfoStream.h:51
#define NAMD_FILENAME_BUFFER_SIZE
Definition: common.h:38
int num_atoms(void)
Definition: PDB.C:323
int32 * atomChainTypes
Definition: Molecule.h:644
PDBAtom * atom(int place)
Definition: PDB.C:394
BigReal ycoor(void)
Definition: PDBData.C:429
int residueseq(void)
Definition: PDBData.C:411
int * goResids
Definition: Molecule.h:650
BigReal energyNonnative
Definition: Molecule.h:686
Bool go_restricted(int, int, int)
Definition: GoMolecule.C:525
int numAtoms
Definition: Molecule.h:557
void NAMD_die(const char *err_msg)
Definition: common.C:85
BigReal xcoor(void)
Definition: PDBData.C:425
StringList * next
Definition: ConfigList.h:49
char * data
Definition: ConfigList.h:48
BigReal energyNative
Definition: Molecule.h:685
Bool atoms_1to4(unsigned int, unsigned int)
Definition: GoMolecule.C:1537
int32 * goSigmaIndices
Definition: Molecule.h:645
int numGoAtoms
Definition: Molecule.h:643
double BigReal
Definition: common.h:114
void Molecule::build_go_params ( StringList g)

Definition at line 79 of file GoMolecule.C.

References StringList::data, endi(), iINFO(), iout, NAMD_die(), StringList::next, and read_go_file().

Referenced by NamdState::loadStructure().

79  {
80  iout << iINFO << "Building Go Parameters" << "\n" << endi;
81 #ifdef MEM_OPT_VERSION
82  NAMD_die("Go forces are not supported in memory-optimized builds.");
83 #else
84  build_lists_by_atom();
85 #endif
86  int iterator = 0;
87  do
88  {
89  iout << iINFO << "Reading Go File: " << iterator << "\n" << endi;
90  read_go_file(g->data);
91  g = g->next;
92  iterator++;
93  } while ( g != NULL && iterator < 100);
94 }
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:81
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
#define iout
Definition: InfoStream.h:51
void read_go_file(char *)
Definition: GoMolecule.C:113
void NAMD_die(const char *err_msg)
Definition: common.C:85
StringList * next
Definition: ConfigList.h:49
char * data
Definition: ConfigList.h:48
void Molecule::build_go_sigmas ( StringList goCoordFile,
char *  cwd 
)

Definition at line 577 of file GoMolecule.C.

References PDB::atom(), atomChainTypes, atoms_1to4(), StringList::data, DebugM, endi(), get_go_cutoff(), get_go_exp_a(), get_go_exp_b(), go_restricted(), goPDB, goSigmaIndices, goSigmas, goWithinCutoff, iINFO(), iout, NAMD_die(), NAMD_FILENAME_BUFFER_SIZE, StringList::next, PDB::num_atoms(), numAtoms, and numGoAtoms.

Referenced by NamdState::loadStructure().

579 {
580  DebugM(3,"->build_go_sigmas" << std::endl);
581  PDB *goPDB; // Pointer to PDB object to use
582  int bcol = 4; // Column that data is in
583  int32 chainType = 0; // b value from PDB file
584  int i; // Loop counter
585  int j; // Loop counter
586  int resid1; // Residue ID for first atom
587  int resid2; // Residue ID for second atom
588  int residDiff; // Difference between resid1 and resid2
589  Real sigma; // Sigma calculated for a Go atom pair
590  Real atomAtomDist; // Distance between two atoms
591  Real exp_a; // First exponent in L-J like formula
592  Real exp_b; // Second exponent in L-J like formula
593  char filename[NAMD_FILENAME_BUFFER_SIZE]; // Filename
594 
595  //JLai
596  BigReal nativeEnergy, *native;
597  BigReal nonnativeEnergy, *nonnative;
598  nativeEnergy = 0;
599  nonnativeEnergy = 0;
600  native = &nativeEnergy;
601  nonnative = &nonnativeEnergy;
602 
603  long nativeContacts = 0;
604  long nonnativeContacts = 0;
605 
606  // Get the PDB object that contains the Go coordinates. If
607  // the user gave another file name, use it. Otherwise, just use
608  // the PDB file that has the initial coordinates.
609  if (goCoordFile == NULL)
610  {
611  //goPDB = initial_pdb;
612  NAMD_die("Error: goCoordFile is NULL - build_go_sigmas");
613  }
614  else
615  {
616  if (goCoordFile->next != NULL)
617  {
618  NAMD_die("Multiple definitions of Go atoms PDB file in configuration file");
619  }
620 
621  if ( (cwd == NULL) || (goCoordFile->data[0] == '/') )
622  {
623  strcpy(filename, goCoordFile->data);
624  }
625  else
626  {
627  strcpy(filename, cwd);
628  strcat(filename, goCoordFile->data);
629  }
630 
631  goPDB = new PDB(filename);
632  if ( goPDB == NULL )
633  {
634  NAMD_die("Memory allocation failed in Molecule::build_go_sigmas");
635  }
636 
637  if (goPDB->num_atoms() != numAtoms)
638  {
639  NAMD_die("Number of atoms in fixed atoms PDB doesn't match coordinate PDB");
640  }
641  }
642  // Allocate the array to hold the chain types
644  // Allocate the array to hold Go atom indices into the sigma array
646 
647  if (atomChainTypes == NULL) {
648  NAMD_die("memory allocation failed in Molecule::build_go_sigmas");
649  }
650 
651  numGoAtoms = 0;
652 
653  // Loop through all the atoms and get the Go chain types
654  for (i=0; i<numAtoms; i++) {
655  // Get the chainType from the occupancy field
656  chainType = (int32)(goPDB->atom(i))->occupancy();
657  // Assign the chainType value
658  if ( chainType != 0 ) {
659  //DebugM(3,"build_go_sigmas - atom:" << i << ", chainType:" << chainType << std::endl);
660  atomChainTypes[i] = chainType;
662  numGoAtoms++;
663  }
664  else {
665  atomChainTypes[i] = 0;
666  goSigmaIndices[i] = -1;
667  }
668  //printf("CT: %d %d %d %d\n",i,numGoAtoms,atomChainTypes[i],goSigmaIndices[i]);
669  }
670 
671  // Allocate the array to hold the sigma values for each Go atom pair
674  for (i=0; i<numGoAtoms; i++) {
675  for (j=0; j<numGoAtoms; j++) {
676  goSigmas[i*numGoAtoms + j] = -1.0;
677  goWithinCutoff[i*numGoAtoms + j] = false;
678  }
679  }
680  // Loop through all atom pairs and calculate sigmas
681  DebugM(3," numAtoms=" << numAtoms << std::endl);
682  for (i=0; i<numAtoms; i++) {
683  //DebugM(3," i=" << i << std::endl);
684  resid1 = (goPDB->atom(i))->residueseq();
685  //DebugM(3," resid1=" << resid1 << std::endl);
686  //if ( goSigmaIndices[i] != -1) {
687  // goSigmas[goSigmaIndices[i]*numGoAtoms + goSigmaIndices[i]] = 0.0;
688  //}
689  for (j=i+1; j<numAtoms; j++) {
690  //DebugM(3," j=" << j << std::endl);
691  resid2 = (goPDB->atom(j))->residueseq();
692  //printf("GSIi %d %d %d\n",i,numAtoms,goSigmaIndices[i]);
693  //printf("SAN CHECK: %d\n",goSigmaIndices[37]);
694  //printf("GSIj %d %d %d\n",j,numAtoms,goSigmaIndices[j]);
695  //printf("ATOMS_1to4 %d\n",!atoms_1to4(i,j));
696  //DebugM(3," resid2=" << resid2 << std::endl);
697  // if goSigmaIndices aren't defined, don't set anything in goSigmas
698  if ( goSigmaIndices[i] != -1 && goSigmaIndices[j] != -1 && !atoms_1to4(i,j) ) {
699  //printf("TAKING DIFFERENCE\n");
700  residDiff = resid2 - resid1;
701  //printf("RESIDDIFF %d\n",residDiff);
702  if (residDiff < 0) residDiff = -residDiff;
703  //printf("RESIDDIFF2 %d\n",residDiff);
704  // if this is a Go atom pair that is not restricted
705  // calculate sigma
706  // sigmas are initially set to -1.0 if the atom pair fails go_restricted
707  //printf("CHECKING LOOPING\n");
708  if ( atomChainTypes[i] && atomChainTypes[j] &&
709  !(this->go_restricted(atomChainTypes[i],atomChainTypes[j],residDiff)) ) {
710  atomAtomDist = sqrt(pow((goPDB->atom(i))->xcoor() - (goPDB->atom(j))->xcoor(), 2.0) +
711  pow((goPDB->atom(i))->ycoor() - (goPDB->atom(j))->ycoor(), 2.0) +
712  pow((goPDB->atom(i))->zcoor() - (goPDB->atom(j))->zcoor(), 2.0));
713  if ( atomAtomDist <= this->get_go_cutoff(atomChainTypes[i],atomChainTypes[j]) ) {
714  exp_a = this->get_go_exp_a(atomChainTypes[i],atomChainTypes[j]);
715  exp_b = this->get_go_exp_b(atomChainTypes[i],atomChainTypes[j]);
716  sigma = pow(static_cast<double>(exp_b/exp_a),(1.0/(exp_a-exp_b))) * atomAtomDist;
717  goSigmas[goSigmaIndices[i]*numGoAtoms + goSigmaIndices[j]] = sigma;
718  goSigmas[goSigmaIndices[j]*numGoAtoms + goSigmaIndices[i]] = sigma;
719  goWithinCutoff[goSigmaIndices[i]*numGoAtoms + goSigmaIndices[j]] = true;
720  goWithinCutoff[goSigmaIndices[j]*numGoAtoms + goSigmaIndices[i]] = true;
721  nativeContacts++;
722  } else {
723  goSigmas[goSigmaIndices[i]*numGoAtoms + goSigmaIndices[j]] = 0.0;
724  goSigmas[goSigmaIndices[j]*numGoAtoms + goSigmaIndices[i]] = 0.0;
725  nonnativeContacts++;
726  }
727  } else {
728  goSigmas[goSigmaIndices[i]*numGoAtoms + goSigmaIndices[j]] = -1.0;
729  goSigmas[goSigmaIndices[j]*numGoAtoms + goSigmaIndices[i]] = -1.0;
730  }
731  }
732  }
733  }
734 
735  iout << iINFO << "Number of UNIQUE native contacts: " << nativeContacts << "\n" << endi;
736  iout << iINFO << "Number of UNIQUE nonnative contacts: " << nonnativeContacts << "\n" << endi;
737 
738  // If we had to create a PDB object, delete it now
739  if (goCoordFile != NULL) {
740  delete goPDB;
741  }
742 
743  return;
744 }
int get_go_exp_a(int chain1, int chain2)
Definition: Molecule.h:1617
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:81
Real get_go_cutoff(int chain1, int chain2)
Definition: Molecule.h:1605
Definition: PDB.h:36
PDB * goPDB
Definition: Molecule.h:651
short int32
Definition: dumpdcd.c:24
float Real
Definition: common.h:109
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
bool * goWithinCutoff
Definition: Molecule.h:648
#define iout
Definition: InfoStream.h:51
#define NAMD_FILENAME_BUFFER_SIZE
Definition: common.h:38
int num_atoms(void)
Definition: PDB.C:323
int32 * atomChainTypes
Definition: Molecule.h:644
PDBAtom * atom(int place)
Definition: PDB.C:394
Real * goSigmas
Definition: Molecule.h:647
Bool go_restricted(int, int, int)
Definition: GoMolecule.C:525
int numAtoms
Definition: Molecule.h:557
void NAMD_die(const char *err_msg)
Definition: common.C:85
int get_go_exp_b(int chain1, int chain2)
Definition: Molecule.h:1620
StringList * next
Definition: ConfigList.h:49
char * data
Definition: ConfigList.h:48
Bool atoms_1to4(unsigned int, unsigned int)
Definition: GoMolecule.C:1537
int32 * goSigmaIndices
Definition: Molecule.h:645
int numGoAtoms
Definition: Molecule.h:643
double BigReal
Definition: common.h:114
void Molecule::build_go_sigmas2 ( StringList goCoordFile,
char *  cwd 
)

Definition at line 747 of file GoMolecule.C.

References go_pair::A, ResizeArray< T >::add(), PDB::atom(), atomChainTypes, atoms_1to4(), go_pair::B, ResizeArray< T >::begin(), StringList::data, DebugM, ResizeArray< T >::end(), endi(), get_go_cutoff(), get_go_exp_a(), get_go_exp_b(), go_restricted(), go_pair::goIndxA, go_pair::goIndxB, goIndxLJA, goIndxLJB, goNumLJPair, goPDB, goResidIndices, goSigmaIndices, goSigmaPairA, goSigmaPairB, iINFO(), iout, NAMD_die(), NAMD_FILENAME_BUFFER_SIZE, StringList::next, PDB::num_atoms(), numAtoms, numGoAtoms, numLJPair, pointerToGoBeg, pointerToGoEnd, and sort.

Referenced by NamdState::loadStructure().

749 {
750  DebugM(3,"->build_go_sigmas2" << std::endl);
751  PDB *goPDB; // Pointer to PDB object to use
752  int bcol = 4; // Column that data is in
753  int32 chainType = 0; // b value from PDB file
754  int32 residType = 0; // resid value from PDB file
755  int i; // Loop counter
756  int j; // Loop counter
757  int resid1; // Residue ID for first atom
758  int resid2; // Residue ID for second atom
759  int residDiff; // Difference between resid1 and resid2
760  Real sigma; // Sigma calculated for a Go atom pair
761  Real atomAtomDist; // Distance between two atoms
762  Real exp_a; // First exponent in L-J like formula
763  Real exp_b; // Second exponent in L-J like formula
764  char filename[NAMD_FILENAME_BUFFER_SIZE]; // Filename
765 
766  //JLai
767  int numLJPair = 0;
768  long nativeContacts = 0;
769  long nonnativeContacts = 0;
770 
771  // Get the PDB object that contains the Go coordinates. If
772  // the user gave another file name, use it. Otherwise, just use
773  // the PDB file that has the initial coordinates.
774  if (goCoordFile == NULL)
775  {
776  //goPDB = initial_pdb;
777  NAMD_die("Error: goCoordFile is NULL - build_go_sigmas2");
778  }
779  else
780  {
781  if (goCoordFile->next != NULL)
782  {
783  NAMD_die("Multiple definitions of Go atoms PDB file in configuration file");
784  }
785 
786  if ( (cwd == NULL) || (goCoordFile->data[0] == '/') )
787  {
788  strcpy(filename, goCoordFile->data);
789  }
790  else
791  {
792  strcpy(filename, cwd);
793  strcat(filename, goCoordFile->data);
794  }
795 
796  goPDB = new PDB(filename);
797  if ( goPDB == NULL )
798  {
799  NAMD_die("Memory allocation failed in Molecule::build_go_sigmas2");
800  }
801 
802  if (goPDB->num_atoms() != numAtoms)
803  {
804  NAMD_die("Number of atoms in fixed atoms PDB doesn't match coordinate PDB");
805  }
806  }
807  // Allocate the array to hold the chain types
809  // Allocate the array to hold Go atom indices into the sigma array
811  // Allocate the array to hold resid
813 
814  if (atomChainTypes == NULL) {
815  NAMD_die("memory allocation failed in Molecule::build_go_sigmas2");
816  }
817 
818  numGoAtoms = 0;
819 
820  // Loop through all the atoms and get the Go chain types
821  for (i=0; i<numAtoms; i++) {
822  // Get the chainType from the occupancy field
823  chainType = (int32)(goPDB->atom(i))->occupancy();
824  // Get the resid from the resid field
825  residType = (int32)(goPDB->atom(i))->residueseq();
826  // Assign the chainType value
827  if ( chainType != 0 ) {
828  //DebugM(3,"build_go_sigmas2 - atom:" << i << ", chainType:" << chainType << std::endl);
829  atomChainTypes[i] = chainType;
831  goResidIndices[i] = residType;
832  numGoAtoms++;
833  }
834  else {
835  atomChainTypes[i] = 0;
836  goSigmaIndices[i] = -1;
837  goResidIndices[i] = -1;
838  }
839  }
840 
841  //Define:
842  ResizeArray<GoPair> tmpGoPair;
843 
844  // Loop through all atom pairs and calculate sigmas
845  // Store sigmas into sorted array
846  DebugM(3," numAtoms=" << numAtoms << std::endl);
847  for (i=0; i<numAtoms; i++) {
848  resid1 = (goPDB->atom(i))->residueseq();
849  for (j=i+1; j<numAtoms; j++) {
850  resid2 = (goPDB->atom(j))->residueseq();
851  if ( goSigmaIndices[i] != -1 && goSigmaIndices[j] != -1 && !atoms_1to4(i,j) ) {
852  residDiff = resid2 - resid1;
853  if (residDiff < 0) residDiff = -residDiff;
854  if ( atomChainTypes[i] && atomChainTypes[j] &&
855  !(this->go_restricted(atomChainTypes[i],atomChainTypes[j],residDiff)) ) {
856  atomAtomDist = sqrt(pow((goPDB->atom(i))->xcoor() - (goPDB->atom(j))->xcoor(), 2.0) +
857  pow((goPDB->atom(i))->ycoor() - (goPDB->atom(j))->ycoor(), 2.0) +
858  pow((goPDB->atom(i))->zcoor() - (goPDB->atom(j))->zcoor(), 2.0));
859  if ( atomAtomDist <= this->get_go_cutoff(atomChainTypes[i],atomChainTypes[j]) ) {
860  exp_a = this->get_go_exp_a(atomChainTypes[i],atomChainTypes[j]);
861  exp_b = this->get_go_exp_b(atomChainTypes[i],atomChainTypes[j]);
862  sigma = pow(static_cast<double>(exp_b/exp_a),(1.0/(exp_a-exp_b))) * atomAtomDist;
863  double tmpA = pow(sigma,exp_a);
864  double tmpB = pow(sigma,exp_b);
865  GoPair gp;
866  GoPair gp2;
867  gp.goIndxA = i;
868  gp.goIndxB = j;
869  gp.A = tmpA;
870  gp.B = tmpB;
871  tmpGoPair.add(gp);
872  gp2.goIndxA = j;
873  gp2.goIndxB = i;
874  gp2.A = tmpA;
875  gp2.B = tmpB;
876  tmpGoPair.add(gp2);
877  nativeContacts++;
878  } else {
879  nonnativeContacts++;
880  }
881  }
882  }
883  }
884  }
885 
886  iout << iINFO << "Number of UNIQUE native contacts: " << nativeContacts << "\n" << endi;
887  iout << iINFO << "Number of UNIQUE nonnative contacts: " << nonnativeContacts << "\n" << endi;
888 
889  // Copies the resizeArray into a block of continuous memory
890  std::sort(tmpGoPair.begin(),tmpGoPair.end(),goPairCompare);
891  goNumLJPair = 2*nativeContacts;
892  goIndxLJA = new int[goNumLJPair];
893  goIndxLJB = new int[goNumLJPair];
894  goSigmaPairA = new double[goNumLJPair];
895  goSigmaPairB = new double[goNumLJPair];
896  for(i=0; i< goNumLJPair; i++) {
897  goIndxLJA[i] = tmpGoPair[i].goIndxA;
898  goIndxLJB[i] = tmpGoPair[i].goIndxB;
899  goSigmaPairA[i] = tmpGoPair[i].A;
900  goSigmaPairB[i] = tmpGoPair[i].B;
901  }
902 
903  pointerToGoBeg = new int[numAtoms];
904  pointerToGoEnd = new int[numAtoms];
905  int oldIndex = -1;
906  for(i=0; i<numAtoms; i++) {
907  pointerToGoBeg[i] = -1;
908  pointerToGoEnd[i] = -2;
909  }
910  for(i=0; i < goNumLJPair; i++) {
911  if(pointerToGoBeg[goIndxLJA[i]] == -1) {
912  pointerToGoBeg[goIndxLJA[i]] = i;
913  oldIndex = goIndxLJA[i];
914  }
915  pointerToGoEnd[oldIndex] = i;
916  }
917 
918  // If we had to create a PDB object, delete it now
919  if (goCoordFile != NULL) {
920  delete goPDB;
921  }
922 
923  return;
924 }
int get_go_exp_a(int chain1, int chain2)
Definition: Molecule.h:1617
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:81
Real get_go_cutoff(int chain1, int chain2)
Definition: Molecule.h:1605
Definition: PDB.h:36
double A
Definition: Molecule.h:121
int * pointerToGoBeg
Definition: Molecule.h:658
PDB * goPDB
Definition: Molecule.h:651
short int32
Definition: dumpdcd.c:24
int goIndxB
Definition: Molecule.h:120
float Real
Definition: common.h:109
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
double * goSigmaPairA
Definition: Molecule.h:656
#define iout
Definition: InfoStream.h:51
#define NAMD_FILENAME_BUFFER_SIZE
Definition: common.h:38
int num_atoms(void)
Definition: PDB.C:323
int32 * atomChainTypes
Definition: Molecule.h:644
double B
Definition: Molecule.h:122
int goIndxA
Definition: Molecule.h:119
int * pointerToGoEnd
Definition: Molecule.h:659
int * goIndxLJA
Definition: Molecule.h:654
PDBAtom * atom(int place)
Definition: PDB.C:394
int goNumLJPair
Definition: Molecule.h:653
iterator end(void)
Definition: ResizeArray.h:37
int32 * goResidIndices
Definition: Molecule.h:646
Bool go_restricted(int, int, int)
Definition: GoMolecule.C:525
int numAtoms
Definition: Molecule.h:557
void NAMD_die(const char *err_msg)
Definition: common.C:85
double * goSigmaPairB
Definition: Molecule.h:657
int add(const Elem &elem)
Definition: ResizeArray.h:97
BlockRadixSort::TempStorage sort
int get_go_exp_b(int chain1, int chain2)
Definition: Molecule.h:1620
StringList * next
Definition: ConfigList.h:49
char * data
Definition: ConfigList.h:48
Bool atoms_1to4(unsigned int, unsigned int)
Definition: GoMolecule.C:1537
int32 * goSigmaIndices
Definition: Molecule.h:645
int * goIndxLJB
Definition: Molecule.h:655
int numGoAtoms
Definition: Molecule.h:643
int numLJPair
Definition: Molecule.h:662
iterator begin(void)
Definition: ResizeArray.h:36
void Molecule::build_gridforce_params ( StringList gridfrcfile,
StringList gridfrccol,
StringList gridfrcchrgcol,
StringList potfile,
PDB initial_pdb,
char *  cwd 
)

Definition at line 6373 of file Molecule.C.

References PDB::atom(), DebugM, endi(), MGridforceParamsList::get_first(), MGridforceParams::gridforceCol, MGridforceParams::gridforceFile, MGridforceParams::gridforceQcol, MGridforceParams::gridforceVfile, iout, iWARN(), SimParameters::mgridforcelist, NAMD_die(), NAMD_FILENAME_BUFFER_SIZE, GridforceGrid::new_grid(), MGridforceParams::next, and PDB::num_atoms().

Referenced by NamdState::loadStructure().

6379 {
6380  PDB *kPDB;
6381  register int i; // Loop counters
6382  register int j;
6383  register int k;
6384 
6385  DebugM(3, "Entered build_gridforce_params multi...\n");
6386 // DebugM(3, "\tgridfrcfile = " << gridfrcfile->data << endi);
6387 // DebugM(3, "\tgridfrccol = " << gridfrccol->data << endi);
6388 
6389  MGridforceParams* mgridParams = simParams->mgridforcelist.get_first();
6390  numGridforceGrids = 0;
6391  while (mgridParams != NULL) {
6393  mgridParams = mgridParams->next;
6394  }
6395 
6396  DebugM(3, "numGridforceGrids = " << numGridforceGrids << "\n");
6397  gridfrcIndexes = new int32*[numGridforceGrids];
6398  gridfrcParams = new GridforceParams*[numGridforceGrids];
6399  gridfrcGrid = new GridforceGrid*[numGridforceGrids];
6400  numGridforces = new int[numGridforceGrids];
6401 
6402  int grandTotalGrids = 0; // including all subgrids
6403 
6404  mgridParams = simParams->mgridforcelist.get_first();
6405  for (int gridnum = 0; gridnum < numGridforceGrids; gridnum++) {
6406  int current_index=0; // Index into values used
6407  int kcol = 5; // Column to look for force constant in
6408  int qcol = 0; // Column for charge (default 0: use electric charge)
6409  Real kval = 0; // Force constant value retreived
6410  char filename[NAMD_FILENAME_BUFFER_SIZE]; // PDB filename
6411  char potfilename[NAMD_FILENAME_BUFFER_SIZE]; // Potential file name
6412 
6413  if (mgridParams == NULL) {
6414  NAMD_die("Problem with mgridParams!");
6415  }
6416 
6417  // Now load values from mgridforcelist object
6418  if (mgridParams->gridforceFile == NULL)
6419  {
6420  if ( ! initial_pdb ) NAMD_die("Initial PDB file unavailable, gridforceFile required.");
6421  kPDB = initial_pdb;
6422  }
6423  else
6424  {
6425  DebugM(4, "mgridParams->gridforceFile = " << mgridParams->gridforceFile << "\n" << endi);
6426 
6427  if ( (cwd == NULL) || (mgridParams->gridforceFile[0] == '/') )
6428  {
6429  strcpy(filename, mgridParams->gridforceFile);
6430  }
6431  else
6432  {
6433  strcpy(filename, cwd);
6434  strcat(filename, mgridParams->gridforceFile);
6435  }
6436 
6437  kPDB = new PDB(filename);
6438  if ( kPDB == NULL )
6439  {
6440  NAMD_die("Memory allocation failed in Molecule::build_gridforce_params");
6441  }
6442 
6443  if (kPDB->num_atoms() != numAtoms)
6444  {
6445  NAMD_die("Number of atoms in grid force PDB doesn't match coordinate PDB");
6446  }
6447  }
6448 
6449  // Get the column that the force constant is going to be in. It
6450  // can be in any of the 5 floating point fields in the PDB, according
6451  // to what the user wants. The allowable fields are X, Y, Z, O, or
6452  // B which correspond to the 1st, 2nd, ... 5th floating point fields.
6453  // The default is the 5th field, which is beta (temperature factor)
6454  if (mgridParams->gridforceCol == NULL)
6455  {
6456  kcol = 5;
6457  }
6458  else
6459  {
6460  if (strcasecmp(mgridParams->gridforceCol, "X") == 0)
6461  {
6462  kcol=1;
6463  }
6464  else if (strcasecmp(mgridParams->gridforceCol, "Y") == 0)
6465  {
6466  kcol=2;
6467  }
6468  else if (strcasecmp(mgridParams->gridforceCol, "Z") == 0)
6469  {
6470  kcol=3;
6471  }
6472  else if (strcasecmp(mgridParams->gridforceCol, "O") == 0)
6473  {
6474  kcol=4;
6475  }
6476  else if (strcasecmp(mgridParams->gridforceCol, "B") == 0)
6477  {
6478  kcol=5;
6479  }
6480  else
6481  {
6482  NAMD_die("gridforcecol must have value of X, Y, Z, O, or B");
6483  }
6484  }
6485 
6486  // Get the column that the charge is going to be in.
6487  if (mgridParams->gridforceQcol == NULL)
6488  {
6489  qcol = 0; // Default: don't read charge from file, use electric charge
6490  }
6491  else
6492  {
6493  if (strcasecmp(mgridParams->gridforceQcol, "X") == 0)
6494  {
6495  qcol=1;
6496  }
6497  else if (strcasecmp(mgridParams->gridforceQcol, "Y") == 0)
6498  {
6499  qcol=2;
6500  }
6501  else if (strcasecmp(mgridParams->gridforceQcol, "Z") == 0)
6502  {
6503  qcol=3;
6504  }
6505  else if (strcasecmp(mgridParams->gridforceQcol, "O") == 0)
6506  {
6507  qcol=4;
6508  }
6509  else if (strcasecmp(mgridParams->gridforceQcol, "B") == 0)
6510  {
6511  qcol=5;
6512  }
6513  else
6514  {
6515  NAMD_die("gridforcechargecol must have value of X, Y, Z, O, or B");
6516  }
6517  }
6518 
6519  if (kcol == qcol) {
6520  NAMD_die("gridforcecol and gridforcechargecol cannot have same value");
6521  }
6522 
6523 
6524  // Allocate an array that will store an index into the constraint
6525  // parameters for each atom. If the atom is not constrained, its
6526  // value will be set to -1 in this array.
6527  gridfrcIndexes[gridnum] = new int32[numAtoms];
6528 
6529  if (gridfrcIndexes[gridnum] == NULL)
6530  {
6531  NAMD_die("memory allocation failed in Molecule::build_gridforce_params()");
6532  }
6533 
6534  // Loop through all the atoms and find out which ones are constrained
6535  for (i=0; i<numAtoms; i++)
6536  {
6537  // Get the k value based on where we were told to find it
6538  switch (kcol)
6539  {
6540  case 1:
6541  kval = (kPDB->atom(i))->xcoor();
6542  break;
6543  case 2:
6544  kval = (kPDB->atom(i))->ycoor();
6545  break;
6546  case 3:
6547  kval = (kPDB->atom(i))->zcoor();
6548  break;
6549  case 4:
6550  kval = (kPDB->atom(i))->occupancy();
6551  break;
6552  case 5:
6553  kval = (kPDB->atom(i))->temperaturefactor();
6554  break;
6555  }
6556 
6557  if (kval > 0.0)
6558  {
6559  // This atom is constrained
6560  gridfrcIndexes[gridnum][i] = current_index;
6561  current_index++;
6562  }
6563  else
6564  {
6565  // This atom is not constrained
6566  gridfrcIndexes[gridnum][i] = -1;
6567  }
6568  }
6569 
6570  if (current_index == 0)
6571  {
6572  // Constraints were turned on, but there weren't really any constrained
6573  iout << iWARN << "NO GRIDFORCE ATOMS WERE FOUND, BUT GRIDFORCE IS ON . . .\n" << endi;
6574  }
6575  else
6576  {
6577  // Allocate an array to hold the constraint parameters
6578  gridfrcParams[gridnum] = new GridforceParams[current_index];
6579  if (gridfrcParams[gridnum] == NULL)
6580  {
6581  NAMD_die("memory allocation failed in Molecule::build_gridforce_params");
6582  }
6583  }
6584 
6585  numGridforces[gridnum] = current_index;
6586 
6587  // Loop through all the atoms and assign the parameters for those
6588  // that are constrained
6589  for (i=0; i<numAtoms; i++)
6590  {
6591  if (gridfrcIndexes[gridnum][i] != -1)
6592  {
6593  // This atom has grid force, so get the k value again
6594  switch (kcol)
6595  {
6596  case 1:
6597  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].k = (kPDB->atom(i))->xcoor();
6598  break;
6599  case 2:
6600  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].k = (kPDB->atom(i))->ycoor();
6601  break;
6602  case 3:
6603  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].k = (kPDB->atom(i))->zcoor();
6604  break;
6605  case 4:
6606  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].k = (kPDB->atom(i))->occupancy();
6607  break;
6608  case 5:
6609  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].k = (kPDB->atom(i))->temperaturefactor();
6610  break;
6611  }
6612 
6613  // Also get charge column
6614  switch (qcol)
6615  {
6616  case 0:
6617 #ifdef MEM_OPT_VERSION
6618  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = atomChargePool[eachAtomCharge[i]];
6619 #else
6620  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = atoms[i].charge;
6621 #endif
6622  break;
6623  case 1:
6624  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = (kPDB->atom(i))->xcoor();
6625  break;
6626  case 2:
6627  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = (kPDB->atom(i))->ycoor();
6628  break;
6629  case 3:
6630  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = (kPDB->atom(i))->zcoor();
6631  break;
6632  case 4:
6633  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = (kPDB->atom(i))->occupancy();
6634  break;
6635  case 5:
6636  gridfrcParams[gridnum][gridfrcIndexes[gridnum][i]].q = (kPDB->atom(i))->temperaturefactor();
6637  break;
6638  }
6639  }
6640  }
6641 
6642  // If we had to create new PDB objects, delete them now
6643  if (mgridParams->gridforceFile != NULL)
6644  {
6645  delete kPDB;
6646  }
6647 
6648  // Now we fill in our grid information
6649 
6650  // Open potential file
6651  if ( (cwd == NULL) || (mgridParams->gridforceVfile[0] == '/') )
6652  {
6653  strcpy(potfilename, mgridParams->gridforceVfile);
6654  }
6655  else
6656  {
6657  strcpy(potfilename, cwd);
6658  strcat(potfilename, mgridParams->gridforceVfile);
6659  }
6660 
6661 // iout << iINFO << "Allocating grid " << gridnum
6662 // << "\n" << endi;
6663 
6664  DebugM(3, "allocating GridforceGrid(" << gridnum << ")\n");
6665  gridfrcGrid[gridnum] = GridforceGrid::new_grid(gridnum, potfilename, simParams, mgridParams);
6666 
6667  grandTotalGrids += gridfrcGrid[gridnum]->get_total_grids();
6668  DebugM(4, "grandTotalGrids = " << grandTotalGrids << "\n" << endi);
6669 
6670  // Finally, get next mgridParams pointer
6671  mgridParams = mgridParams->next;
6672  }
6673 }
Definition: PDB.h:36
short int32
Definition: dumpdcd.c:24
static GridforceGrid * new_grid(int gridnum, char *potfilename, SimParameters *simParams, MGridforceParams *mgridParams)
Definition: GridForceGrid.C:34
float Real
Definition: common.h:109
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
int numGridforceGrids
Definition: Molecule.h:591
std::ostream & iWARN(std::ostream &s)
Definition: InfoStream.C:82
#define iout
Definition: InfoStream.h:51
#define NAMD_FILENAME_BUFFER_SIZE
Definition: common.h:38
int num_atoms(void)
Definition: PDB.C:323
MGridforceParams * get_first()
PDBAtom * atom(int place)
Definition: PDB.C:394
int numAtoms
Definition: Molecule.h:557
void NAMD_die(const char *err_msg)
Definition: common.C:85
MGridforceParamsList mgridforcelist
MGridforceParams * next
int * numGridforces
Definition: Molecule.h:592
virtual int get_total_grids(void) const =0
void Molecule::build_gro_pair ( )
void Molecule::build_langevin_params ( BigReal  coupling,
BigReal  drudeCoupling,
Bool  doHydrogen 
)
void Molecule::build_langevin_params ( StringList ,
StringList ,
PDB ,
char *   
)
void Molecule::build_movdrag_params ( StringList ,
StringList ,
StringList ,
PDB ,
char *   
)
void Molecule::build_rotdrag_params ( StringList ,
StringList ,
StringList ,
StringList ,
StringList ,
StringList ,
PDB ,
char *   
)
void Molecule::build_ss_flags ( const StringList ssfile,
const StringList sscol,
PDB initial_pdb,
const char *  cwd 
)

Build the flags needed for solute scaling.

A PDB file is read, indicating which atoms are to be scaled, and an array is maintained marking which are to be included. Each marked atom then has its corresponding van der Waals type number reassigned to enable extending the LJTable with scaled interaction values.

Parameters
ssfileconfig "soluteScalingFile = my.pdb" for PDB filename
sscolconfig "soluteScalingCol = O" for column of PDB ATOM records
initial_pdbthe initial PDB file
cwdcurrent working directory

Referenced by NamdState::loadStructure().

void Molecule::build_stirred_atoms ( StringList ,
StringList ,
PDB ,
char *   
)
int Molecule::checkexcl ( int  atom1,
int  atom2 
) const
void Molecule::compute_LJcorrection ( )
void Molecule::delete_alch_bonded ( void  )
void Molecule::delete_qm_bonded ( void  )

Definition at line 1547 of file MoleculeQM.C.

References bond::atom1, angle::atom1, dihedral::atom1, improper::atom1, crossterm::atom1, DebugM, endi(), SimParameters::extraBondsOn, iERROR(), iINFO(), iout, NAMD_die(), numAngles, numBonds, numCrossterms, numDihedrals, numImpropers, and numRealBonds.

1547  {
1548 
1549 #ifdef MEM_OPT_VERSION
1550  NAMD_die("QMMM interface is not supported in memory optimized builds.");
1551 #else
1552 
1553  DebugM(3,"Cleaning QM bonds, angles, dihedrals, impropers and crossterms.\n")
1554 
1555  // Bonds
1556  Bond *nonQMBonds;
1557  nonQMBonds = new Bond[numBonds] ;
1558  int nonQMBondCount = 0;
1559  qmDroppedBonds = 0;
1560  for (int i = 0; i < numBonds; i++) {
1561 
1562  int part1 = qmAtomGroup[bonds[i].atom1];
1563  int part2 = qmAtomGroup[bonds[i].atom2];
1564  if (part1 > 0 && part2 > 0 ) {
1565 
1566  // If the user defined extra bonds, we check if the QM-QM bond is an "extra"
1567  // bond, and do not delete it.
1568  if (simParams->extraBondsOn) {
1569 // std::cout << "Checking Bond: " << bonds[i].atom1 << "," << bonds[i].atom2 << std::endl ;
1570 
1571  for (int ebi=0; ebi < qmExtraBonds.size() ; ebi++) {
1572 
1573  if( (qmExtraBonds[ebi].atom1 == bonds[i].atom1 ||
1574  qmExtraBonds[ebi].atom1 == bonds[i].atom2) &&
1575  (qmExtraBonds[ebi].atom2 == bonds[i].atom1 ||
1576  qmExtraBonds[ebi].atom2 == bonds[i].atom2) ) {
1577 // std::cout << "This is an extra bond! We will keep it." << std::endl;
1578  nonQMBonds[nonQMBondCount++] = bonds[i];
1579  break;
1580  }
1581  }
1582  }
1583 
1584  qmDroppedBonds++;
1585  } else {
1586  // Just a simple sanity check.
1587  // If there are no QM bonds defined by the user but we find a
1588  // bond between a QM and an MM atom, error out.
1589  if ((part1 > 0 || part2 > 0) && qmNumBonds == 0) {
1590  iout << iERROR << " Atoms " << bonds[i].atom1
1591  << " and " << bonds[i].atom2 << " form a QM-MM bond!\n" << endi ;
1592  NAMD_die("No QM-MM bonds were defined by the user, but one was found.");
1593  }
1594  nonQMBonds[nonQMBondCount++] = bonds[i];
1595  }
1596  }
1597  numBonds = nonQMBondCount;
1598  delete [] bonds;
1599  bonds = new Bond[numBonds];
1600  for (int i = 0; i < nonQMBondCount; i++) {
1601  bonds[i]=nonQMBonds[i];
1602  }
1603  delete [] nonQMBonds;
1605 
1606  // Angles
1607  Angle *nonQMAngles;
1608  nonQMAngles = new Angle[numAngles];
1609  int nonQMAngleCount = 0;
1610  qmDroppedAngles = 0;
1611  for (int i = 0; i < numAngles; i++) {
1612  int part1 = qmAtomGroup[angles[i].atom1];
1613  int part2 = qmAtomGroup[angles[i].atom2];
1614  int part3 = qmAtomGroup[angles[i].atom3];
1615  if (part1 > 0 && part2 > 0 && part3 > 0) {
1616  //CkPrintf("-----ANGLE ATOMS %i %i %i partitions %i %i %i\n",angles[i].atom1, angles[i].atom2, angles[i].atom3, part1, part2, part3);
1617  qmDroppedAngles++;
1618  }
1619  else {
1620  nonQMAngles[nonQMAngleCount++] = angles[i];
1621  }
1622  }
1623  numAngles = nonQMAngleCount;
1624  delete [] angles;
1625  angles = new Angle[numAngles];
1626  for (int i = 0; i < nonQMAngleCount; i++) {
1627  angles[i]=nonQMAngles[i];
1628  }
1629  delete [] nonQMAngles;
1630 
1631 
1632  // Dihedrals
1633  Dihedral *nonQMDihedrals;
1634  nonQMDihedrals = new Dihedral[numDihedrals];
1635  int nonQMDihedralCount = 0;
1636  qmDroppedDihedrals = 0;
1637  for (int i = 0; i < numDihedrals; i++) {
1638  int part1 = qmAtomGroup[dihedrals[i].atom1];
1639  int part2 = qmAtomGroup[dihedrals[i].atom2];
1640  int part3 = qmAtomGroup[dihedrals[i].atom3];
1641  int part4 = qmAtomGroup[dihedrals[i].atom4];
1642  if (part1 > 0 && part2 > 0 && part3 > 0 && part4 > 0) {
1643  //CkPrintf("-----i %i DIHEDRAL ATOMS %i %i %i %i partitions %i %i %i %i\n",i,dihedrals[i].atom1, dihedrals[i].atom2, dihedrals[i].atom3, dihedrals[i].atom4, part1, part2, part3,part4);
1644  qmDroppedDihedrals++;
1645  }
1646  else {
1647  nonQMDihedrals[nonQMDihedralCount++] = dihedrals[i];
1648  }
1649  }
1650  numDihedrals = nonQMDihedralCount;
1651  delete [] dihedrals;
1652  dihedrals = new Dihedral[numDihedrals];
1653  for (int i = 0; i < numDihedrals; i++) {
1654  dihedrals[i]=nonQMDihedrals[i];
1655  }
1656  delete [] nonQMDihedrals;
1657 
1658  // Impropers
1659  Improper *nonQMImpropers;
1660  nonQMImpropers = new Improper[numImpropers];
1661  int nonQMImproperCount = 0;
1662  qmDroppedImpropers = 0;
1663  for (int i = 0; i < numImpropers; i++) {
1664  int part1 = qmAtomGroup[impropers[i].atom1];
1665  int part2 = qmAtomGroup[impropers[i].atom2];
1666  int part3 = qmAtomGroup[impropers[i].atom3];
1667  int part4 = qmAtomGroup[impropers[i].atom4];
1668  if (part1 > 0 && part2 > 0 && part3 > 0 && part4 > 0) {
1669  //CkPrintf("-----i %i IMPROPER ATOMS %i %i %i %i partitions %i %i %i %i\n",i,impropers[i].atom1, impropers[i].atom2, impropers[i].atom3, impropers[i].atom4, part1, part2, part3,part4);
1670  qmDroppedImpropers++;
1671  }
1672  else {
1673  nonQMImpropers[nonQMImproperCount++] = impropers[i];
1674  }
1675  }
1676  numImpropers = nonQMImproperCount;
1677  delete [] impropers;
1678  impropers = new Improper[numImpropers];
1679  for (int i = 0; i < numImpropers; i++) {
1680  impropers[i]=nonQMImpropers[i];
1681  }
1682  delete [] nonQMImpropers;
1683 
1684  // Crossterms
1685  Crossterm *nonQMCrossterms;
1686  nonQMCrossterms = new Crossterm[numCrossterms];
1687  int nonQMCrosstermCount = 0;
1688  qmDroppedCrossterms = 0 ;
1689  for (int i = 0; i < numCrossterms; i++) {
1690  int part1 = qmAtomGroup[crossterms[i].atom1];
1691  int part2 = qmAtomGroup[crossterms[i].atom2];
1692  int part3 = qmAtomGroup[crossterms[i].atom3];
1693  int part4 = qmAtomGroup[crossterms[i].atom4];
1694  int part5 = qmAtomGroup[crossterms[i].atom5];
1695  int part6 = qmAtomGroup[crossterms[i].atom6];
1696  int part7 = qmAtomGroup[crossterms[i].atom7];
1697  int part8 = qmAtomGroup[crossterms[i].atom8];
1698  if (part1 > 0 && part2 > 0 && part3 > 0 && part4 > 0 &&
1699  part5 > 0 && part6 > 0 && part7 > 0 && part8 > 0) {
1700  //CkPrintf("-----i %i IMPROPER ATOMS %i %i %i %i partitions %i %i %i %i\n",i,impropers[i].atom1, impropers[i].atom2, impropers[i].atom3, impropers[i].atom4, part1, part2, part3,part4);
1701  qmDroppedCrossterms++;
1702  }
1703  else {
1704  nonQMCrossterms[nonQMCrosstermCount++] = crossterms[i];
1705  }
1706  }
1707  numCrossterms = nonQMCrosstermCount;
1708  delete [] crossterms;
1709  crossterms = new Crossterm[numCrossterms] ;
1710  for (int i=0; i < numCrossterms; i++){
1711  crossterms[i] = nonQMCrossterms[i] ;
1712  }
1713  delete [] nonQMCrossterms ;
1714 
1715  if (!CkMyPe()) {
1716  iout << iINFO << "The QM region will remove " << qmDroppedBonds << " bonds, " <<
1717  qmDroppedAngles << " angles, " << qmDroppedDihedrals << " dihedrals, "
1718  << qmDroppedImpropers << " impropers and " << qmDroppedCrossterms
1719  << " crossterms.\n" << endi ;
1720  }
1721 
1722 #endif
1723 }
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:81
int numBonds
Definition: Molecule.h:560
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
int numRealBonds
Definition: Molecule.h:559
int32 atom1
Definition: structures.h:81
#define iout
Definition: InfoStream.h:51
int32 atom1
Definition: structures.h:48
int32 atom1
Definition: structures.h:55
int numAngles
Definition: Molecule.h:561
int numCrossterms
Definition: Molecule.h:568
void NAMD_die(const char *err_msg)
Definition: common.C:85
int numDihedrals
Definition: Molecule.h:562
int numImpropers
Definition: Molecule.h:567
int32 atom1
Definition: structures.h:72
std::ostream & iERROR(std::ostream &s)
Definition: InfoStream.C:83
int32 atom1
Definition: structures.h:63
for(int i=0;i< n1;++i)
void Molecule::freeBFactorData ( )
inline

Definition at line 1038 of file Molecule.h.

Referenced by NamdState::loadStructure().

1038 { delete [] bfactor; bfactor=NULL; }
void Molecule::freeOccupancyData ( )
inline

Definition at line 1034 of file Molecule.h.

Referenced by NamdState::loadStructure().

1034 { delete [] occupancy; occupancy=NULL; }
Bond* Molecule::get_acceptor ( int  dnum) const
inline

Definition at line 1109 of file Molecule.h.

1109 {return (&(acceptors[dnum]));}
Angle* Molecule::get_angle ( int  anum) const
inline

Definition at line 1072 of file Molecule.h.

Referenced by atoms_1to4(), and dumpbench().

1072 {return (&(angles[anum]));}
int32* Molecule::get_angles_for_atom ( int  anum)
inline

Definition at line 1151 of file Molecule.h.

Referenced by atoms_1to4(), and dumpbench().

1152  { return anglesByAtom[anum]; }
int Molecule::get_atom_from_index_in_residue ( const char *  segid,
int  resid,
int  index 
) const

Definition at line 158 of file Molecule.C.

References NAMD_die().

Referenced by GlobalMasterEasy::getAtomID(), and GlobalMasterFreeEnergy::getAtomID().

159  {
160 
161  if (atomNames == NULL || resLookup == NULL)
162  {
163  NAMD_die("Tried to find atom from name on node other than node 0");
164  }
165  int i = 0;
166  int end = 0;
167  if ( resLookup->lookup(segid,resid,&i,&end) ) return -1;
168  if ( index >= 0 && index < ( end - i ) ) return ( index + i );
169  return -1;
170 }
int lookup(const char *segid, int resid, int *begin, int *end) const
Definition: Molecule.C:76
void NAMD_die(const char *err_msg)
Definition: common.C:85
int Molecule::get_atom_from_name ( const char *  segid,
int  resid,
const char *  aname 
) const

Definition at line 121 of file Molecule.C.

References atomNamePool, and NAMD_die().

Referenced by colvarproxy_namd::check_atom_id(), GlobalMasterEasy::getAtomID(), and GlobalMasterFreeEnergy::getAtomID().

122  {
123 
124  if (atomNames == NULL || resLookup == NULL)
125  {
126  NAMD_die("Tried to find atom from name on node other than node 0");
127  }
128 
129  int i = 0;
130  int end = 0;
131  if ( resLookup->lookup(segid,resid,&i,&end) ) return -1;
132  for ( ; i < end; ++i ) {
133  #ifdef MEM_OPT_VERSION
134  Index idx = atomNames[i].atomnameIdx;
135  if(!strcasecmp(aname, atomNamePool[idx])) return i;
136  #else
137  if ( ! strcasecmp(aname,atomNames[i].atomname) ) return i;
138  #endif
139  }
140  return -1;
141 }
int Index
Definition: structures.h:26
int lookup(const char *segid, int resid, int *begin, int *end) const
Definition: Molecule.C:76
void NAMD_die(const char *err_msg)
Definition: common.C:85
HashPool< HashString > atomNamePool
Definition: CompressPsf.C:309
const char* Molecule::get_atomtype ( int  anum) const
inline

Definition at line 1120 of file Molecule.h.

References atomTypePool, and NAMD_die().

1121  {
1122  if (atomNames == NULL)
1123  {
1124  NAMD_die("Tried to find atom type on node other than node 0");
1125  }
1126 
1127  #ifdef MEM_OPT_VERSION
1128  return atomTypePool[atomNames[anum].atomtypeIdx];
1129  #else
1130  return(atomNames[anum].atomtype);
1131  #endif
1132  }
void NAMD_die(const char *err_msg)
Definition: common.C:85
HashPool< HashString > atomTypePool
Definition: CompressPsf.C:310
Bond* Molecule::get_bond ( int  bnum) const
inline

Definition at line 1069 of file Molecule.h.

Referenced by atoms_1to4(), and dumpbench().

1069 {return (&(bonds[bnum]));}
int32* Molecule::get_bonds_for_atom ( int  anum)
inline

Definition at line 1149 of file Molecule.h.

Referenced by atoms_1to4(), and dumpbench().

1150  { return bondsByAtom[anum]; }
int Molecule::get_cluster ( int  anum) const
inline

Definition at line 1027 of file Molecule.h.

Referenced by wrap_coor_int().

1027 { return cluster[anum]; }
int Molecule::get_clusterSize ( int  anum) const
inline

Definition at line 1028 of file Molecule.h.

Referenced by wrap_coor_int().

1028 { return clusterSize[anum]; }
void Molecule::get_cons_params ( Real k,
Vector refPos,
int  atomnum 
) const
inline

Definition at line 1266 of file Molecule.h.

Referenced by ComputeRestraints::doForce().

1267  {
1268  k = consParams[consIndexes[atomnum]].k;
1269  refPos = consParams[consIndexes[atomnum]].refPos;
1270  }
void Molecule::get_constorque_params ( BigReal v,
Vector a,
Vector p,
int  atomnum 
) const
inline

Definition at line 1340 of file Molecule.h.

References consTorqueIndexes, and consTorqueParams.

Referenced by ComputeConsTorque::doForce().

1342  {
1343  v = consTorqueParams[consTorqueIndexes[atomnum]].v;
1344  a = consTorqueParams[consTorqueIndexes[atomnum]].a;
1345  p = consTorqueParams[consTorqueIndexes[atomnum]].p;
1346  }
int32 * consTorqueIndexes
Definition: Molecule.h:616
ConsTorqueParams * consTorqueParams
Definition: Molecule.h:617
Crossterm* Molecule::get_crossterm ( int  inum) const
inline

Definition at line 1081 of file Molecule.h.

1081 {return (&(crossterms[inum]));}
int32* Molecule::get_crossterms_for_atom ( int  anum)
inline

Definition at line 1157 of file Molecule.h.

1158  { return crosstermsByAtom[anum]; }
const Real* Molecule::get_cSMDcoffs ( )
inline

Definition at line 875 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

875 {return cSMDcoffs;} ;
int const* const* Molecule::get_cSMDindex ( )
inline

Definition at line 871 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

871 {return cSMDindex;} ;
int const* Molecule::get_cSMDindxLen ( )
inline

Definition at line 870 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

870 { return cSMDindxLen;} ;
const Real* Molecule::get_cSMDKs ( )
inline

Definition at line 873 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

873 {return cSMDKs;} ;
int Molecule::get_cSMDnumInst ( )
inline

Definition at line 869 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

869 { return cSMDnumInst;} ;
int const* const* Molecule::get_cSMDpairs ( )
inline

Definition at line 872 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

872 {return cSMDpairs;} ;
const Real* Molecule::get_cSMDVels ( )
inline

Definition at line 874 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

874 {return cSMDVels;} ;
Dihedral* Molecule::get_dihedral ( int  dnum) const
inline

Definition at line 1078 of file Molecule.h.

Referenced by atoms_1to4(), and dumpbench().

1078 {return (&(dihedrals[dnum]));}
int32* Molecule::get_dihedrals_for_atom ( int  anum)
inline

Definition at line 1153 of file Molecule.h.

Referenced by atoms_1to4(), and dumpbench().

1154  { return dihedralsByAtom[anum]; }
Bond* Molecule::get_donor ( int  dnum) const
inline

Definition at line 1106 of file Molecule.h.

1106 {return (&(donors[dnum]));}
const ExclusionCheck* Molecule::get_excl_check_for_atom ( int  anum) const
inline

Definition at line 1177 of file Molecule.h.

Referenced by dumpbench().

1177  {
1178  return &all_exclusions[anum];
1179  }
Exclusion* Molecule::get_exclusion ( int  ex) const
inline

Definition at line 1116 of file Molecule.h.

References exclusions.

1116 {return (&(exclusions[ex]));}
int32* Molecule::get_exclusions_for_atom ( int  anum)
inline

Definition at line 1159 of file Molecule.h.

References exclusionsByAtom.

1160  { return exclusionsByAtom[anum]; }
int Molecule::get_fep_bonded_type ( const int *  atomID,
unsigned int  order 
) const
inline

Definition at line 1389 of file Molecule.h.

References NAMD_die(), order, and simParams.

Referenced by AngleElem::computeForce(), ImproperElem::computeForce(), DihedralElem::computeForce(), AnisoElem::computeForce(), and BondElem::computeForce().

1390  {
1391  int typeSum = 0;
1392  for ( int i=0; i < order; ++i ) {
1393  typeSum += (fepAtomFlags[atomID[i]] == 2 ? -1 : fepAtomFlags[atomID[i]]);
1394  }
1395  // Increase the cutoff if scaling purely alchemical bonds.
1396  // This really only applies when order = 2.
1397  if ( simParams->alchBondDecouple ) order++;
1398 
1399  // The majority of interactions are type 0, so catch those first.
1400  if ( typeSum == 0 || abs(typeSum) == order ) return 0;
1401  else if ( 0 < typeSum && typeSum < order ) return 1;
1402  else if ( -order < typeSum && typeSum < 0 ) return 2;
1403 
1404  // Alchemify should always keep this from bombing, but just in case...
1405  NAMD_die("Unexpected alchemical bonded interaction!");
1406  return 0;
1407  }
#define order
Definition: PmeRealSpace.C:235
void NAMD_die(const char *err_msg)
Definition: common.C:85
unsigned char Molecule::get_fep_type ( int  anum) const
inline

Definition at line 1349 of file Molecule.h.

Referenced by CrosstermElem::computeForce(), TholeElem::computeForce(), WorkDistrib::createAtomLists(), and ComputeHomeTuples< TholeElem, Thole, TholeValue >::loadTuples().

1350  {
1351  return(fepAtomFlags[anum]);
1352  }
const int32* Molecule::get_full_exclusions_for_atom ( int  anum) const
inline

Definition at line 1161 of file Molecule.h.

Referenced by ComputeNonbondedCUDA::build_exclusions().

1162  { return fullExclusionsByAtom[anum]; }
Real Molecule::get_go_cutoff ( int  chain1,
int  chain2 
)
inline

Definition at line 1605 of file Molecule.h.

References go_val::cutoff, go_array, and MAX_GO_CHAINS.

Referenced by build_go_arrays(), build_go_sigmas(), build_go_sigmas2(), get_go_force(), get_go_force2(), and get_go_force_new().

1605 { return go_array[MAX_GO_CHAINS*chain1 + chain2].cutoff; };
#define MAX_GO_CHAINS
Definition: Molecule.h:37
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
Real cutoff
Definition: Molecule.h:113
Real Molecule::get_go_epsilon ( int  chain1,
int  chain2 
)
inline

Definition at line 1614 of file Molecule.h.

References go_val::epsilon, go_array, and MAX_GO_CHAINS.

Referenced by get_go_force(), get_go_force2(), and get_go_force_new().

1614 { return go_array[MAX_GO_CHAINS*chain1 + chain2].epsilon; };
#define MAX_GO_CHAINS
Definition: Molecule.h:37
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
Real epsilon
Definition: Molecule.h:107
Real Molecule::get_go_epsilonRep ( int  chain1,
int  chain2 
)
inline

Definition at line 1608 of file Molecule.h.

References go_val::epsilonRep, go_array, and MAX_GO_CHAINS.

Referenced by get_go_force(), get_go_force2(), and get_go_force_new().

1608 { return go_array[MAX_GO_CHAINS*chain1 + chain2].epsilonRep; };
Real epsilonRep
Definition: Molecule.h:112
#define MAX_GO_CHAINS
Definition: Molecule.h:37
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
int Molecule::get_go_exp_a ( int  chain1,
int  chain2 
)
inline

Definition at line 1617 of file Molecule.h.

References go_val::exp_a, go_array, and MAX_GO_CHAINS.

Referenced by build_go_sigmas(), build_go_sigmas2(), get_go_force(), get_go_force2(), and get_go_force_new().

1617 { return go_array[MAX_GO_CHAINS*chain1 + chain2].exp_a; };
#define MAX_GO_CHAINS
Definition: Molecule.h:37
int exp_a
Definition: Molecule.h:108
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
int Molecule::get_go_exp_b ( int  chain1,
int  chain2 
)
inline

Definition at line 1620 of file Molecule.h.

References go_val::exp_b, go_array, and MAX_GO_CHAINS.

Referenced by build_go_sigmas(), build_go_sigmas2(), get_go_force(), get_go_force2(), and get_go_force_new().

1620 { return go_array[MAX_GO_CHAINS*chain1 + chain2].exp_b; };
int exp_b
Definition: Molecule.h:109
#define MAX_GO_CHAINS
Definition: Molecule.h:37
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
int Molecule::get_go_exp_rep ( int  chain1,
int  chain2 
)
inline

Definition at line 1623 of file Molecule.h.

References go_val::exp_rep, go_array, and MAX_GO_CHAINS.

Referenced by get_go_force(), get_go_force2(), and get_go_force_new().

1623 { return go_array[MAX_GO_CHAINS*chain1 + chain2].exp_rep; };
#define MAX_GO_CHAINS
Definition: Molecule.h:37
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
int exp_rep
Definition: Molecule.h:110
BigReal Molecule::get_go_force ( BigReal  r,
int  atom1,
int  atom2,
BigReal goNative,
BigReal goNonnative 
) const

Definition at line 1260 of file GoMolecule.C.

References atomChainTypes, get_go_cutoff(), get_go_epsilon(), get_go_epsilonRep(), get_go_exp_a(), get_go_exp_b(), get_go_exp_rep(), get_go_sigmaRep(), goForce, goSigmaIndices, goSigmas, goWithinCutoff, and numGoAtoms.

1265 {
1266  BigReal goForce = 0.0;
1267  Real pow1;
1268  Real pow2;
1269  // determine which Go chain pair we are working with
1270  //DebugM(3,"get_go_force - (" << atom1 << "," << atom2 << ")" << std::endl);
1271  int32 chain1 = atomChainTypes[atom1];
1272  int32 chain2 = atomChainTypes[atom2];
1273 
1274  //DebugM(3," chain1:" << chain1 << ", chain2:" << chain2 << std::endl);
1275  if (chain1 == 0 || chain2 == 0) return 0.0;
1276 
1277  // retrieve Go cutoff for this chain pair
1278  //TMP// JLai -- I'm going to replace this with a constant accessor. This is just a temporary thing
1279  Real goCutoff = const_cast<Molecule*>(this)->get_go_cutoff(chain1,chain2);
1280  //DebugM(3," goCutoff:" << goCutoff << std::endl);
1281  if (goCutoff == 0) return 0.0;
1282  // if repulsive then calculate repulsive
1283  // sigmas are initially set to -1.0 if the atom pair fails go_restricted
1284  if (goSigmas[goSigmaIndices[atom1]*numGoAtoms + goSigmaIndices[atom2]] != -1.0) {
1285  if (!goWithinCutoff[goSigmaIndices[atom1]*numGoAtoms + goSigmaIndices[atom2]]) {
1286  Real epsilonRep = const_cast<Molecule*>(this)->get_go_epsilonRep(chain1,chain2);
1287  Real sigmaRep = const_cast<Molecule*>(this)->get_go_sigmaRep(chain1,chain2);
1288  int exp_rep = const_cast<Molecule*>(this)->get_go_exp_rep(chain1,chain2);
1289  pow1 = pow(sigmaRep/r,exp_rep);
1290  goForce = 4*((exp_rep/(r*r)) * epsilonRep * pow1);
1291  *goNative = 0.0;
1292  *goNonnative = (4 * epsilonRep * pow1 );
1293  //DebugM(3,"get_go_force - (" << atom1 << "," << atom2 << ") chain1:" << chain1 << ", chain2:" << chain2 << ", epsilonRep:" << epsilonRep << ", sigmaRep:" << sigmaRep << ", r:" << r << ", goForce:" << goForce << std::endl);
1294  }
1295  // if attractive then calculate attractive
1296  else {
1297  int goSigmaIndex1 = goSigmaIndices[atom1];
1298  int goSigmaIndex2 = goSigmaIndices[atom2];
1299  if (goSigmaIndex1 != -1 && goSigmaIndex2 != -1) {
1300  Real epsilon = const_cast<Molecule*>(this)->get_go_epsilon(chain1,chain2);
1301  int exp_a = const_cast<Molecule*>(this)->get_go_exp_a(chain1,chain2);
1302  int exp_b = const_cast<Molecule*>(this)->get_go_exp_b(chain1,chain2);
1303  Real sigma_ij = goSigmas[goSigmaIndices[atom1]*numGoAtoms + goSigmaIndices[atom2]];
1304  // Positive gradient of potential, not negative gradient of potential
1305  pow1 = pow(sigma_ij/r,exp_a);
1306  pow2 = pow(sigma_ij/r,exp_b);
1307  goForce = ((4/(r*r)) * epsilon * (exp_a * pow1 - exp_b * pow2));
1308  //DebugM(3,"get_go_force - (" << atom1 << "," << atom2 << ") chain1:" << chain1 << ", chain2:" << chain2 << ", sigma_ij:" << sigma_ij << ", r:" << r << ", goForce:" << goForce << std::endl);
1309  *goNative = (4 * epsilon * ( pow1 - pow2 ) );
1310  *goNonnative = 0.0;
1311  }
1312  }
1313  }
1314  //DebugM(3,"goForce:" << goForce << std::endl);
1315  return goForce;
1316 }
int get_go_exp_a(int chain1, int chain2)
Definition: Molecule.h:1617
Real get_go_cutoff(int chain1, int chain2)
Definition: Molecule.h:1605
short int32
Definition: dumpdcd.c:24
Real get_go_epsilonRep(int chain1, int chain2)
Definition: Molecule.h:1608
float Real
Definition: common.h:109
bool * goWithinCutoff
Definition: Molecule.h:648
Real get_go_epsilon(int chain1, int chain2)
Definition: Molecule.h:1614
int32 * atomChainTypes
Definition: Molecule.h:644
Real get_go_sigmaRep(int chain1, int chain2)
Definition: Molecule.h:1611
int get_go_exp_rep(int chain1, int chain2)
Definition: Molecule.h:1623
Real * goSigmas
Definition: Molecule.h:647
BigReal goNonnative
int get_go_exp_b(int chain1, int chain2)
Definition: Molecule.h:1620
BigReal goForce
int32 * goSigmaIndices
Definition: Molecule.h:645
int numGoAtoms
Definition: Molecule.h:643
double BigReal
Definition: common.h:114
BigReal Molecule::get_go_force2 ( BigReal  x,
BigReal  y,
BigReal  z,
int  atom1,
int  atom2,
BigReal goNative,
BigReal goNonnative 
) const

Definition at line 1456 of file GoMolecule.C.

References atomChainTypes, 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, goResidIndices, goSigmaPairA, goSigmaPairB, pointerToGoBeg, pointerToGoEnd, and z.

1463 {
1464 
1465  // Check to see if restricted. If so, escape function early
1466  int32 chain1 = atomChainTypes[atom1];
1467  int32 chain2 = atomChainTypes[atom2];
1468 
1469  if(chain1 == 0 || chain2 == 0) return 0.0;
1470  Molecule *mol = const_cast<Molecule*>(this);
1471  Real goCutoff = mol->get_go_cutoff(chain1,chain2);
1472  if(goCutoff == 0) return 0.0;
1473 
1474  int resid1 = goResidIndices[atom1];
1475  int resid2 = goResidIndices[atom2];
1476  int residDiff = abs(resid1 - resid2);
1477  if((mol->go_restricted(chain1,chain2,residDiff))) {
1478  return 0.0;
1479  }
1480 
1481  int LJIndex = -1;
1482  int LJbegin = pointerToGoBeg[atom1];
1483  int LJend = pointerToGoEnd[atom1];
1484  for(int i = LJbegin; i <= LJend; i++) {
1485  if(goIndxLJB[i] == atom2) {
1486  LJIndex = i;
1487  }
1488  }
1489 
1490  BigReal r2 = x*x + y*y + z*z;
1491  BigReal r = sqrt(r2);
1492 
1493  if (LJIndex == -1) {
1494  int exp_rep = const_cast<Molecule*>(this)->get_go_exp_rep(chain1,chain2);
1495  BigReal epsilonRep = const_cast<Molecule*>(this)->get_go_epsilonRep(chain1, chain2);
1496  BigReal sigmaRep = const_cast<Molecule*>(this)->get_go_sigmaRep(chain1, chain2);
1497  double sigmaRepPow = pow(sigmaRep,exp_rep);
1498  BigReal LJ = (4*epsilonRep*exp_rep*sigmaRepPow*pow(r,-(exp_rep+1)));
1499  *goNative = 0;
1500  *goNonnative = (4*epsilonRep*sigmaRepPow*pow(r,-exp_rep));
1501  //*goNonnative = (4*epsilonRep * pow(sigmaRep/r,exp_rep));
1502  return (LJ/r);
1503  } else {
1504  // Code to calculate distances because the pair was found in one of the lists
1505  int exp_a = const_cast<Molecule*>(this)->get_go_exp_a(chain1,chain2);
1506  int exp_b = const_cast<Molecule*>(this)->get_go_exp_b(chain1,chain2);
1507  // We want the force, so we have to take the n+1 derivative
1508  BigReal powA = pow(r,-(exp_a + 1));
1509  BigReal powB = pow(r,-(exp_b + 1));
1510  BigReal powaa = pow(r,-exp_a);
1511  BigReal powbb = pow(r,-exp_b);
1512  BigReal epsilon = const_cast<Molecule*>(this)->get_go_epsilon(chain1,chain2);
1513  BigReal LJ = 4 * epsilon * (exp_a*goSigmaPairA[LJIndex]*powA - exp_b*goSigmaPairB[LJIndex]*powB);
1514  *goNative = 4 * epsilon * (goSigmaPairA[LJIndex]*powaa - goSigmaPairB[LJIndex]*powbb);
1515  *goNonnative = 0;
1516  return (LJ/r);
1517  }
1518  return 0;
1519 }
int get_go_exp_a(int chain1, int chain2)
Definition: Molecule.h:1617
Real get_go_cutoff(int chain1, int chain2)
Definition: Molecule.h:1605
int * pointerToGoBeg
Definition: Molecule.h:658
short int32
Definition: dumpdcd.c:24
Real get_go_epsilonRep(int chain1, int chain2)
Definition: Molecule.h:1608
float Real
Definition: common.h:109
double * goSigmaPairA
Definition: Molecule.h:656
Real get_go_epsilon(int chain1, int chain2)
Definition: Molecule.h:1614
int32 * atomChainTypes
Definition: Molecule.h:644
int * pointerToGoEnd
Definition: Molecule.h:659
Real get_go_sigmaRep(int chain1, int chain2)
Definition: Molecule.h:1611
int get_go_exp_rep(int chain1, int chain2)
Definition: Molecule.h:1623
int32 * goResidIndices
Definition: Molecule.h:646
gridSize z
Bool go_restricted(int, int, int)
Definition: GoMolecule.C:525
BigReal goNonnative
double * goSigmaPairB
Definition: Molecule.h:657
int get_go_exp_b(int chain1, int chain2)
Definition: Molecule.h:1620
gridSize y
gridSize x
int * goIndxLJB
Definition: Molecule.h:655
double BigReal
Definition: common.h:114
BigReal Molecule::get_go_force_new ( BigReal  r,
int  atom1,
int  atom2,
BigReal goNative,
BigReal goNonnative 
) const

Definition at line 1334 of file GoMolecule.C.

References atomChainTypes, DebugM, 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(), goCoordinates, goForce, goResids, and goSigmaIndices.

1339 {
1340  int resid1;
1341  int resid2;
1342  int residDiff;
1343  Real xcoorDiff;
1344  Real ycoorDiff;
1345  Real zcoorDiff;
1346  Real atomAtomDist;
1347  Real exp_a;
1348  Real exp_b;
1349  Real sigma_ij;
1350  Real epsilon;
1351  Real epsilonRep;
1352  Real sigmaRep;
1353  Real expRep;
1354  Real pow1;
1355  Real pow2;
1356 
1357  BigReal goForce = 0.0;
1358  *goNative = 0;
1359  *goNonnative = 0;
1360 
1361  // determine which Go chain pair we are working with
1362  DebugM(3,"get_go_force - (" << atom1 << "," << atom2 << ")" << std::endl);
1363  int goIndex1 = goSigmaIndices[atom1];
1364  int goIndex2 = goSigmaIndices[atom2];
1365 
1366  int32 chain1 = atomChainTypes[goIndex1];
1367  int32 chain2 = atomChainTypes[goIndex2];
1368 
1369  DebugM(3," chain1:" << chain1 << ", chain2:" << chain2 << std::endl);
1370  if (chain1 == 0 || chain2 == 0) return 0.0;
1371 
1372  // retrieve Go cutoff for this chain pair
1373  Real goCutoff = const_cast<Molecule*>(this)->get_go_cutoff(chain1,chain2);
1374  DebugM(3," goCutoff:" << goCutoff << std::endl);
1375  if (goCutoff == 0) return 0.0;
1376 
1377  // sigmas are initially set to -1.0 if the atom pair fails go_restricted
1378  // no goSigmas array anymore
1379  //Real sigma_ij = goSigmas[goSigmaIndices[atom1]*numGoAtoms + goSigmaIndices[atom2]];
1380 
1381  // XXX - used to be a condition for the following if
1382  //if the atoms are within 4 of each other
1383  //if ( !atoms_1to4(atom1,atom2) ) {
1384 
1385  // if goSigmaIndices aren't defined, don't calculate forces
1386  if ( goIndex1 != -1 && goIndex2 != -1 ) {
1387  resid1 = goResids[goIndex1];
1388  resid2 = goResids[goIndex2];
1389  residDiff = resid2 - resid1;
1390  if (residDiff < 0) residDiff = -residDiff;
1391  // if this is a Go atom pair that is not restricted
1392  if ( !(const_cast<Molecule*>(this)->go_restricted(chain1,chain2,residDiff)) ) {
1393  xcoorDiff = goCoordinates[goIndex1*3] - goCoordinates[goIndex2*3];
1394  ycoorDiff = goCoordinates[goIndex1*3 + 1] - goCoordinates[goIndex2*3 + 1];
1395  zcoorDiff = goCoordinates[goIndex1*3 + 2] - goCoordinates[goIndex2*3 + 2];
1396  atomAtomDist = sqrt(xcoorDiff*xcoorDiff + ycoorDiff*ycoorDiff + zcoorDiff*zcoorDiff);
1397 
1398  // if attractive then calculate attractive
1399  if ( atomAtomDist <= const_cast<Molecule*>(this)->get_go_cutoff(chain1,chain2) ) {
1400  exp_a = const_cast<Molecule*>(this)->get_go_exp_a(chain1,chain2);
1401  exp_b = const_cast<Molecule*>(this)->get_go_exp_b(chain1,chain2);
1402  sigma_ij = pow(static_cast<double>(exp_b/exp_a),(1.0/(exp_a-exp_b))) * atomAtomDist;
1403 
1404  // [JLai] print out atoms involved in native contacts
1405  // printf("ATOM1: %d C1: %d ATOM2: %d C2: %d\n", atom1,chain1,atom2,chain2);
1406 
1407  epsilon = const_cast<Molecule*>(this)->get_go_epsilon(chain1,chain2);
1408  pow1 = pow(sigma_ij/r,static_cast<double>(exp_a));
1409  pow2 = pow(sigma_ij/r,static_cast<double>(exp_b));
1410  //goForce = ((4/r) * epsilon * (exp_a * pow(sigma_ij/r,exp_a) - exp_b * pow(sigma_ij/r,exp_b)));
1411  goForce = ((4/(r*r)) * epsilon * (exp_a * pow1 - exp_b * pow2));
1412  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);
1413  //goEnergy = (4 * epsilon * ( pow(sigma_ij/r,exp_a) - pow(sigma_ij/r,exp_b) ) ); // JLai I changed some of the expressions
1414  *goNative = (4 * epsilon * ( pow1 - pow2 ) );
1415  *goNonnative = 0;
1416  }
1417 
1418  // if repulsive then calculate repulsive
1419  else {
1420  epsilonRep = const_cast<Molecule*>(this)->get_go_epsilonRep(chain1,chain2);
1421  sigmaRep = const_cast<Molecule*>(this)->get_go_sigmaRep(chain1,chain2);
1422  expRep = const_cast<Molecule*>(this)->get_go_exp_rep(chain1,chain2);
1423  pow1 = pow(sigmaRep/r,(BigReal)expRep);
1424  //goForce = ((12.0/r) * epsilonRep * pow(sigmaRep/r,12.0));
1425  goForce = ((4/(r*r)) * expRep * epsilonRep * pow1);
1426  DebugM(3,"get_go_force - (" << atom1 << "," << atom2 << ") chain1:" << chain1 << ", chain2:" << chain2 << ", epsilonRep:" << epsilonRep << ", sigmaRep:" << sigmaRep << ", r:" << r << ", goForce:" << goForce << std::endl);
1427  //goEnergy = (4 * epsilonRep * pow(sigmaRep/r,12.0)); // JLai I changed some of the expressions
1428  *goNonnative = (4 * epsilonRep * pow1);
1429  *goNative = 0;
1430  }
1431  }
1432  }
1433 
1434  //DebugM(3,"goForce:" << goForce << std::endl);
1435  return goForce;
1436 }
int get_go_exp_a(int chain1, int chain2)
Definition: Molecule.h:1617
Real get_go_cutoff(int chain1, int chain2)
Definition: Molecule.h:1605
short int32
Definition: dumpdcd.c:24
Real * goCoordinates
Definition: Molecule.h:649
Real get_go_epsilonRep(int chain1, int chain2)
Definition: Molecule.h:1608
float Real
Definition: common.h:109
#define DebugM(x, y)
Definition: Debug.h:59
Real get_go_epsilon(int chain1, int chain2)
Definition: Molecule.h:1614
int32 * atomChainTypes
Definition: Molecule.h:644
Real get_go_sigmaRep(int chain1, int chain2)
Definition: Molecule.h:1611
int get_go_exp_rep(int chain1, int chain2)
Definition: Molecule.h:1623
int * goResids
Definition: Molecule.h:650
Bool go_restricted(int, int, int)
Definition: GoMolecule.C:525
BigReal goNonnative
int get_go_exp_b(int chain1, int chain2)
Definition: Molecule.h:1620
BigReal goForce
int32 * goSigmaIndices
Definition: Molecule.h:645
double BigReal
Definition: common.h:114
Real Molecule::get_go_sigmaRep ( int  chain1,
int  chain2 
)
inline

Definition at line 1611 of file Molecule.h.

References go_array, MAX_GO_CHAINS, and go_val::sigmaRep.

Referenced by get_go_force(), get_go_force2(), and get_go_force_new().

1611 { return go_array[MAX_GO_CHAINS*chain1 + chain2].sigmaRep; };
#define MAX_GO_CHAINS
Definition: Molecule.h:37
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
Real sigmaRep
Definition: Molecule.h:111
GridforceGrid* Molecule::get_gridfrc_grid ( int  gridnum) const
inline

Definition at line 1280 of file Molecule.h.

References numGridforceGrids.

Referenced by ComputeGridForce::doForce(), colvarproxy_namd::init_volmap(), Node::reloadGridforceGrid(), and Node::updateGridScale().

1281  {
1282  GridforceGrid *result = NULL;
1283  if (gridnum >= 0 && gridnum < numGridforceGrids) {
1284  result = gridfrcGrid[gridnum];
1285  }
1286  return result;
1287  }
int numGridforceGrids
Definition: Molecule.h:591
void Molecule::get_gridfrc_params ( Real k,
Charge q,
int  atomnum,
int  gridnum 
) const
inline

Definition at line 1274 of file Molecule.h.

Referenced by ComputeGridForce::do_calc().

1275  {
1276  k = gridfrcParams[gridnum][gridfrcIndexes[gridnum][atomnum]].k;
1277  q = gridfrcParams[gridnum][gridfrcIndexes[gridnum][atomnum]].q;
1278  }
BigReal Molecule::get_gro_force ( BigReal  ,
BigReal  ,
BigReal  ,
int  ,
int   
) const
BigReal Molecule::get_gro_force2 ( BigReal  x,
BigReal  y,
BigReal  z,
int  atom1,
int  atom2,
BigReal pairLJEnergy,
BigReal pairGaussEnergy 
) const

Definition at line 1173 of file GoMolecule.C.

References A, gA, giSigma1, giSigma2, gMu1, gMu2, gRepulsive, indxGaussB, indxLJB, pairC12, pairC6, pointerToGaussBeg, pointerToGaussEnd, pointerToLJBeg, pointerToLJEnd, and z.

1180 {
1181  //Initialize return energies to zero
1182  *pairLJEnergy = 0.0;
1183  *pairGaussEnergy = 0.0;
1184 
1185  // Linear search for LJ data
1186  int LJIndex = -1;
1187  int LJbegin = pointerToLJBeg[atom1];
1188  int LJend = pointerToLJEnd[atom1];
1189  for(int i = LJbegin; i <= LJend; i++) {
1190  if(indxLJB[i] == atom2) {
1191  LJIndex = i;
1192  break;
1193  }
1194  }
1195 
1196  // Linear search for Gaussian data
1197  int GaussIndex = -1;
1198  int Gaussbegin = pointerToGaussBeg[atom1];
1199  int Gaussend = pointerToGaussEnd[atom1];
1200  for(int i = Gaussbegin; i <= Gaussend; i++) {
1201  if(indxGaussB[i] == atom2) {
1202  GaussIndex = i;
1203  break;
1204  }
1205  }
1206 
1207  if( LJIndex == -1 && GaussIndex == -1) {
1208  return 0;
1209  } else {
1210  // Code to calculate distances because the pair was found in one of the lists
1211  BigReal r2 = x*x + y*y + z*z;
1212  BigReal r = sqrt(r2);
1213  BigReal ri = 1/r;
1214  BigReal ri6 = (ri*ri*ri*ri*ri*ri);
1215  BigReal ri12 = ri6*ri6;
1216  BigReal ri13 = ri12*ri;
1217  BigReal LJ = 0;
1218  BigReal Gauss = 0;
1219  // Code to calculate LJ
1220  if (LJIndex != -1) {
1221  BigReal ri7 = ri6*ri;
1222  LJ = (12*(pairC12[LJIndex]*ri13) - 6*(pairC6[LJIndex]*ri7));
1223  *pairLJEnergy = (pairC12[LJIndex]*ri12 - pairC6[LJIndex]*ri6);
1224  //std::cout << pairC12[LJIndex] << " " << pairC6[LJIndex] << " " << ri13 << " " << ri7 << " " << LJ << " " << r << "\n";
1225  }
1226  // Code to calculate Gaussian
1227  if (GaussIndex != -1) {
1228  BigReal gr = 12*gRepulsive[GaussIndex]*ri13;
1229  BigReal r1prime = r - gMu1[GaussIndex];
1230  BigReal tmp1 = r1prime * r1prime;
1231  BigReal r2prime = r - gMu2[GaussIndex];
1232  BigReal tmp2 = r2prime * r2prime;
1233  BigReal tmp_gauss1 = 0;
1234  BigReal one_gauss1 = 1;
1235  BigReal tmp_gauss2 = 0;
1236  BigReal one_gauss2 = 1;
1237  if (giSigma1[GaussIndex] != 0) {
1238  tmp_gauss1 = exp(-tmp1*giSigma1[GaussIndex]);
1239  one_gauss1 = 1 - tmp_gauss1;
1240  }
1241  if (giSigma2[GaussIndex] != 0) {
1242  tmp_gauss2 = exp(-tmp2*giSigma2[GaussIndex]);
1243  one_gauss2 = 1 - tmp_gauss2;
1244  }
1245  BigReal A = gA[GaussIndex];
1246  Gauss = gr*one_gauss1*one_gauss2 - 2*A*tmp_gauss1*one_gauss2*r1prime*giSigma1[GaussIndex] \
1247  - 2*tmp_gauss1*one_gauss2*r1prime*giSigma1[GaussIndex]*gRepulsive[GaussIndex]*ri12 - 2*A*tmp_gauss2*one_gauss1*r2prime*giSigma2[GaussIndex] \
1248  - 2*tmp_gauss2*one_gauss1*r2prime*giSigma2[GaussIndex]*gRepulsive[GaussIndex]*ri12;
1249  *pairGaussEnergy = A*(-1+(one_gauss1)*(one_gauss2)*(1+gRepulsive[GaussIndex]*ri12/A));
1250  }
1251  //std::cout << "Net force: " << (LJ + Gauss) << " with ri " << (LJ + Gauss)*ri << "\n";
1252  return (LJ + Gauss)*ri;
1253  }
1254  return 0;
1255 }
Real * gMu2
Definition: Molecule.h:680
Real * giSigma2
Definition: Molecule.h:681
const BigReal A
Real * pairC6
Definition: Molecule.h:668
int * pointerToLJEnd
Definition: Molecule.h:665
Real * gA
Definition: Molecule.h:677
int * indxLJB
Definition: Molecule.h:667
int * pointerToGaussBeg
Definition: Molecule.h:672
Real * gMu1
Definition: Molecule.h:678
int * pointerToLJBeg
Definition: Molecule.h:664
Real * gRepulsive
Definition: Molecule.h:682
int * indxGaussB
Definition: Molecule.h:676
gridSize z
int * pointerToGaussEnd
Definition: Molecule.h:673
Real * pairC12
Definition: Molecule.h:669
Real * giSigma1
Definition: Molecule.h:679
gridSize y
gridSize x
double BigReal
Definition: common.h:114
int Molecule::get_groupSize ( int  )
Improper* Molecule::get_improper ( int  inum) const
inline

Definition at line 1075 of file Molecule.h.

Referenced by dumpbench().

1075 {return (&(impropers[inum]));}
int32* Molecule::get_impropers_for_atom ( int  anum)
inline

Definition at line 1155 of file Molecule.h.

Referenced by dumpbench().

1156  { return impropersByAtom[anum]; }
Lphost* Molecule::get_lphost ( int  atomid) const
inline

Definition at line 1085 of file Molecule.h.

1085  {
1086  // don't call unless simParams->drudeOn == TRUE
1087  // otherwise lphostIndexes array doesn't exist!
1088  int index = lphostIndexes[atomid];
1089  return (index != -1 ? &(lphosts[index]) : NULL);
1090  }
const int32* Molecule::get_mod_exclusions_for_atom ( int  anum) const
inline

Definition at line 1163 of file Molecule.h.

1164  { return modExclusionsByAtom[anum]; }
int Molecule::get_mother_atom ( int  )
void Molecule::get_movdrag_params ( Vector v,
int  atomnum 
) const
inline

Definition at line 1325 of file Molecule.h.

Referenced by Sequencer::addMovDragToPosition().

1326  {
1327  v = movDragParams[movDragIndexes[atomnum]].v;
1328  }
Bool Molecule::get_noPC ( )
inline

Definition at line 857 of file Molecule.h.

Referenced by ComputeQM::initialize().

857 { return qmNoPC; } ;
int Molecule::get_numQMAtoms ( )
inline
Real* Molecule::get_qmAtmChrg ( )
inline
const int* Molecule::get_qmAtmIndx ( )
inline
const Real* Molecule::get_qmAtomGroup ( ) const
inline
Real Molecule::get_qmAtomGroup ( int  indx) const
inline

Definition at line 821 of file Molecule.h.

821 {return qmAtomGroup[indx]; } ;
Bool Molecule::get_qmcSMD ( )
inline

Definition at line 868 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

868 { return qmcSMD;} ;
int* Molecule::get_qmCustomPCIdxs ( )
inline

Definition at line 866 of file Molecule.h.

Referenced by ComputeQM::initialize().

866 { return qmCustomPCIdxs; } ;
int* Molecule::get_qmCustPCSizes ( )
inline

Definition at line 865 of file Molecule.h.

Referenced by ComputeQM::initialize().

865 { return qmCustPCSizes; } ;
const BigReal* Molecule::get_qmDummyBondVal ( )
inline

Definition at line 835 of file Molecule.h.

Referenced by ComputeQMMgr::recvPntChrg().

835 { return qmDummyBondVal; } ;
const char* const* Molecule::get_qmDummyElement ( )
inline

Definition at line 840 of file Molecule.h.

Referenced by ComputeQMMgr::recvPntChrg().

840 { return qmDummyElement; } ;
const char* const* Molecule::get_qmElements ( )
inline

Definition at line 827 of file Molecule.h.

Referenced by ComputeQMMgr::recvPntChrg().

827 {return qmElementArray;} ;
const int* const* Molecule::get_qmGrpBonds ( )
inline

Definition at line 838 of file Molecule.h.

Referenced by ComputeQMMgr::recvPntChrg().

838 { return qmGrpBonds; } ;
Real* Molecule::get_qmGrpChrg ( )
inline

Definition at line 831 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

831 {return qmGrpChrg; } ;
Real* Molecule::get_qmGrpID ( )
inline

Definition at line 830 of file Molecule.h.

Referenced by ComputeQM::initialize(), and ComputeQMMgr::recvPartQM().

830 { return qmGrpID; } ;
Real* Molecule::get_qmGrpMult ( )
inline

Definition at line 832 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

832 {return qmGrpMult; } ;
const int* Molecule::get_qmGrpNumBonds ( )
inline

Definition at line 836 of file Molecule.h.

Referenced by ComputeQMMgr::recvPntChrg().

836 { return qmGrpNumBonds; } ;
const int* Molecule::get_qmGrpSizes ( )
inline

Definition at line 829 of file Molecule.h.

Referenced by ComputeQMMgr::recvPntChrg().

829 {return qmGrpSizes; } ;
int Molecule::get_qmLSSFreq ( )
inline

Definition at line 848 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

848 { return qmLSSFreq; } ;
int* Molecule::get_qmLSSIdxs ( )
inline

Definition at line 846 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

846 { return qmLSSIdxs;} ;
Mass* Molecule::get_qmLSSMass ( )
inline

Definition at line 847 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

847 { return qmLSSMass; } ;
int* Molecule::get_qmLSSRefIDs ( )
inline

Definition at line 850 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

850 { return qmLSSRefIDs ; } ;
Mass* Molecule::get_qmLSSRefMass ( )
inline

Definition at line 852 of file Molecule.h.

852 {return qmLSSRefMass; } ;
int* Molecule::get_qmLSSRefSize ( )
inline

Definition at line 851 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

851 { return qmLSSRefSize ; } ;
int Molecule::get_qmLSSResSize ( )
inline

Definition at line 849 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

849 { return qmLSSResidueSize; } ;
int* Molecule::get_qmLSSSize ( )
inline

Definition at line 845 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

845 { return qmLSSSize;} ;
int* Molecule::get_qmMeMMindx ( )
inline

Definition at line 859 of file Molecule.h.

Referenced by ComputeQM::initialize().

859 { return qmMeMMindx; } ;
int Molecule::get_qmMeNumBonds ( )
inline

Definition at line 858 of file Molecule.h.

Referenced by ComputeQM::initialize(), and ComputeQMMgr::recvPartQM().

858 { return qmMeNumBonds; } ;
Real* Molecule::get_qmMeQMGrp ( )
inline

Definition at line 860 of file Molecule.h.

Referenced by ComputeQM::initialize().

860 { return qmMeQMGrp; } ;
const int* const* Molecule::get_qmMMBond ( )
inline

Definition at line 837 of file Molecule.h.

Referenced by ComputeQMMgr::recvPntChrg().

837 { return qmMMBond; } ;
const int* const* Molecule::get_qmMMBondedIndx ( )
inline

Definition at line 839 of file Molecule.h.

Referenced by ComputeQMMgr::recvPntChrg().

839 { return qmMMBondedIndx; } ;
const int* const* Molecule::get_qmMMChargeTarget ( )
inline

Definition at line 842 of file Molecule.h.

Referenced by ComputeQMMgr::recvPntChrg().

842 { return qmMMChargeTarget; } ;
const int* Molecule::get_qmMMNumTargs ( )
inline

Definition at line 843 of file Molecule.h.

Referenced by ComputeQMMgr::recvPntChrg().

843 { return qmMMNumTargs; } ;
std::map<int,int>& Molecule::get_qmMMSolv ( )
inline

Definition at line 853 of file Molecule.h.

853 { return qmClassicSolv;} ;
int Molecule::get_qmNumBonds ( )
inline

Definition at line 834 of file Molecule.h.

834 { return qmNumBonds; } ;
int Molecule::get_qmNumGrps ( ) const
inline

Definition at line 828 of file Molecule.h.

Referenced by ComputeQM::initialize(), ComputeQMMgr::recvPartQM(), and ComputeQM::saveResults().

828 {return qmNumGrps; } ;
int Molecule::get_qmPCFreq ( )
inline

Definition at line 862 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

862 { return qmPCFreq; } ;
Bool Molecule::get_qmReplaceAll ( )
inline

Definition at line 855 of file Molecule.h.

Referenced by ComputeQMMgr::recvPartQM().

855 {return qmReplaceAll; } ;
int Molecule::get_qmTotCustPCs ( )
inline

Definition at line 864 of file Molecule.h.

Referenced by ComputeQM::initialize().

864 { return qmTotCustPCs; } ;
int Molecule::get_residue_size ( const char *  segid,
int  resid 
) const

Definition at line 144 of file Molecule.C.

References NAMD_die().

Referenced by GlobalMasterEasy::getNumAtoms(), GlobalMasterFreeEnergy::getNumAtoms(), and prepare_qm().

145  {
146 
147  if (atomNames == NULL || resLookup == NULL)
148  {
149  NAMD_die("Tried to find atom from name on node other than node 0");
150  }
151  int i = 0;
152  int end = 0;
153  if ( resLookup->lookup(segid,resid,&i,&end) ) return 0;
154  return ( end - i );
155 }
int lookup(const char *segid, int resid, int *begin, int *end) const
Definition: Molecule.C:76
void NAMD_die(const char *err_msg)
Definition: common.C:85
void Molecule::get_rotdrag_params ( BigReal v,
Vector a,
Vector p,
int  atomnum 
) const
inline

Definition at line 1331 of file Molecule.h.

Referenced by Sequencer::addRotDragToPosition().

1333  {
1334  v = rotDragParams[rotDragIndexes[atomnum]].v;
1335  a = rotDragParams[rotDragIndexes[atomnum]].a;
1336  p = rotDragParams[rotDragIndexes[atomnum]].p;
1337  }
unsigned char Molecule::get_ss_type ( int  anum) const
inline

Definition at line 1355 of file Molecule.h.

Referenced by ComputeHomeTuples< TholeElem, Thole, TholeValue >::loadTuples(), and Sequencer::rescaleSoluteCharges().

1356  {
1357  return(ssAtomFlags[anum]);
1358  }
void Molecule::get_stir_refPos ( Vector refPos,
int  atomnum 
) const
inline

Definition at line 1306 of file Molecule.h.

1307  {
1308  refPos = stirParams[stirIndexes[atomnum]].refPos;
1309  }
Real Molecule::get_stir_startTheta ( int  atomnum) const
inline

Definition at line 1318 of file Molecule.h.

Referenced by ComputeStir::doForce().

1319  {
1320  return stirParams[stirIndexes[atomnum]].startTheta;
1321  }
Bond* Molecule::getAllAcceptors ( ) const
inline

Definition at line 1112 of file Molecule.h.

1112 {return acceptors;}
Angle* Molecule::getAllAngles ( ) const
inline

Definition at line 1095 of file Molecule.h.

Referenced by buildAngleData().

1095 {return angles;}
Bond* Molecule::getAllBonds ( ) const
inline

Definition at line 1094 of file Molecule.h.

Referenced by buildBondData().

1094 {return bonds;}
Crossterm* Molecule::getAllCrossterms ( ) const
inline

Definition at line 1098 of file Molecule.h.

Referenced by buildCrosstermData().

1098 {return crossterms;}
Dihedral* Molecule::getAllDihedrals ( ) const
inline

Definition at line 1097 of file Molecule.h.

Referenced by buildDihedralData().

1097 {return dihedrals;}
Bond* Molecule::getAllDonors ( ) const
inline

Definition at line 1111 of file Molecule.h.

1111 {return donors;}
Improper* Molecule::getAllImpropers ( ) const
inline

Definition at line 1096 of file Molecule.h.

Referenced by buildImproperData().

1096 {return impropers;}
Lphost* Molecule::getAllLphosts ( ) const
inline

Definition at line 1102 of file Molecule.h.

1102 { return lphosts; }
BigReal Molecule::GetAtomAlpha ( int  i) const
inline

Definition at line 483 of file Molecule.h.

References drude_constants::alpha.

483  {
484  return drudeConsts[i].alpha;
485  }
AtomNameInfo* Molecule::getAtomNames ( ) const
inline

Definition at line 492 of file Molecule.h.

Referenced by buildAtomData().

492 { return atomNames; }
Atom* Molecule::getAtoms ( ) const
inline

Definition at line 491 of file Molecule.h.

References atoms.

Referenced by buildAtomData(), WorkDistrib::createAtomLists(), and outputCompressedFile().

491 { return atoms; }
AtomSegResInfo* Molecule::getAtomSegResInfo ( ) const
inline

Definition at line 495 of file Molecule.h.

Referenced by buildAtomData().

495 { return atomSegResids; }
const float* Molecule::getBFactorData ( )
inline

Definition at line 1036 of file Molecule.h.

Referenced by NamdState::loadStructure(), and outputCompressedFile().

1036 { return (const float *)bfactor; }
BigReal Molecule::getEnergyTailCorr ( const BigReal  ,
const int   
)
int const* Molecule::getLcpoParamType ( )
inline

Definition at line 479 of file Molecule.h.

Referenced by HomePatch::setLcpoType().

479  {
480  return lcpoParamType;
481  }
const float* Molecule::getOccupancyData ( )
inline

Definition at line 1032 of file Molecule.h.

Referenced by NamdState::loadStructure(), and outputCompressedFile().

1032 { return (const float *)occupancy; }
BigReal Molecule::getVirialTailCorr ( const BigReal  )
Bool Molecule::go_restricted ( int  chain1,
int  chain2,
int  rDiff 
)

Definition at line 525 of file GoMolecule.C.

References FALSE, go_array, MAX_GO_CHAINS, MAX_RESTRICTIONS, and TRUE.

Referenced by build_go_arrays(), build_go_sigmas(), build_go_sigmas2(), get_go_force2(), and get_go_force_new().

526 {
527  int i; // Loop counter
528  for(i=0; i<MAX_RESTRICTIONS; i++) {
529  if (go_array[(MAX_GO_CHAINS*chain1) + chain2].restrictions[i] == rDiff) {
530  return TRUE;
531  } else if (go_array[(MAX_GO_CHAINS*chain1) + chain2].restrictions[i] == -1) {
532  return FALSE;
533  }
534  }
535  return FALSE;
536 }
#define MAX_RESTRICTIONS
Definition: Molecule.h:38
#define FALSE
Definition: common.h:118
#define MAX_GO_CHAINS
Definition: Molecule.h:37
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
#define TRUE
Definition: common.h:119
void Molecule::goInit ( )

Definition at line 54 of file GoMolecule.C.

References atomChainTypes, energyNative, energyNonnative, goCoordinates, goPDB, goResids, goSigmaIndices, goSigmas, goWithinCutoff, and numGoAtoms.

54  {
55  numGoAtoms=0;
56  energyNative=0;
58  atomChainTypes=NULL;
59  goSigmaIndices=NULL;
60  goSigmas=NULL;
61  goWithinCutoff=NULL;
62  goCoordinates=NULL;
63  goResids=NULL;
64  goPDB=NULL;
65 }
PDB * goPDB
Definition: Molecule.h:651
Real * goCoordinates
Definition: Molecule.h:649
bool * goWithinCutoff
Definition: Molecule.h:648
int32 * atomChainTypes
Definition: Molecule.h:644
int * goResids
Definition: Molecule.h:650
Real * goSigmas
Definition: Molecule.h:647
BigReal energyNonnative
Definition: Molecule.h:686
BigReal energyNative
Definition: Molecule.h:685
int32 * goSigmaIndices
Definition: Molecule.h:645
int numGoAtoms
Definition: Molecule.h:643
void Molecule::initialize ( )
Bool Molecule::is_atom_constorqued ( int  atomnum) const
inline

Definition at line 1250 of file Molecule.h.

References consTorqueIndexes, FALSE, and numConsTorque.

1251  {
1252  if (numConsTorque)
1253  {
1254  // Check the index to see if it is constrained
1255  return(consTorqueIndexes[atomnum] != -1);
1256  }
1257  else
1258  {
1259  // No constraints at all, so just return FALSE
1260  return(FALSE);
1261  }
1262  }
#define FALSE
Definition: common.h:118
int32 * consTorqueIndexes
Definition: Molecule.h:616
int numConsTorque
Definition: Molecule.h:596
Bool Molecule::is_atom_constrained ( int  atomnum) const
inline

Definition at line 1201 of file Molecule.h.

References FALSE, and numConstraints.

Referenced by ComputeRestraints::doForce().

1202  {
1203  if (numConstraints)
1204  {
1205  // Check the index to see if it is constrained
1206  return(consIndexes[atomnum] != -1);
1207  }
1208  else
1209  {
1210  // No constraints at all, so just return FALSE
1211  return(FALSE);
1212  }
1213  }
#define FALSE
Definition: common.h:118
int numConstraints
Definition: Molecule.h:589
Bool Molecule::is_atom_exPressure ( int  atomnum) const
inline

Definition at line 1451 of file Molecule.h.

References numExPressureAtoms.

Referenced by Sequencer::langevinPiston().

1452  {
1453  return (numExPressureAtoms && exPressureAtomFlags[atomnum]);
1454  }
int numExPressureAtoms
Definition: Molecule.h:599
Bool Molecule::is_atom_fixed ( int  atomnum) const
inline

Definition at line 1411 of file Molecule.h.

References numFixedAtoms.

Referenced by WorkDistrib::createAtomLists().

1412  {
1413  return (numFixedAtoms && fixedAtomFlags[atomnum]);
1414  }
int numFixedAtoms
Definition: Molecule.h:597
Bool Molecule::is_atom_gridforced ( int  atomnum,
int  gridnum 
) const
inline

Definition at line 1185 of file Molecule.h.

References FALSE, and numGridforceGrids.

Referenced by ComputeGridForce::do_calc().

1186  {
1187  if (numGridforceGrids)
1188  {
1189  return(gridfrcIndexes[gridnum][atomnum] != -1);
1190  }
1191  else
1192  {
1193  return(FALSE);
1194  }
1195  }
#define FALSE
Definition: common.h:118
int numGridforceGrids
Definition: Molecule.h:591
Bool Molecule::is_atom_movdragged ( int  atomnum) const
inline

Definition at line 1218 of file Molecule.h.

References FALSE, and numMovDrag.

Referenced by Sequencer::addMovDragToPosition().

1219  {
1220  if (numMovDrag)
1221  {
1222  // Check the index to see if it is constrained
1223  return(movDragIndexes[atomnum] != -1);
1224  }
1225  else
1226  {
1227  // No constraints at all, so just return FALSE
1228  return(FALSE);
1229  }
1230  }
#define FALSE
Definition: common.h:118
int numMovDrag
Definition: Molecule.h:594
Bool Molecule::is_atom_rotdragged ( int  atomnum) const
inline

Definition at line 1234 of file Molecule.h.

References FALSE, and numRotDrag.

Referenced by Sequencer::addRotDragToPosition().

1235  {
1236  if (numRotDrag)
1237  {
1238  // Check the index to see if it is constrained
1239  return(rotDragIndexes[atomnum] != -1);
1240  }
1241  else
1242  {
1243  // No constraints at all, so just return FALSE
1244  return(FALSE);
1245  }
1246  }
#define FALSE
Definition: common.h:118
int numRotDrag
Definition: Molecule.h:595
Bool Molecule::is_atom_stirred ( int  atomnum) const
inline

Definition at line 1432 of file Molecule.h.

References FALSE, and numStirredAtoms.

Referenced by ComputeStir::doForce().

1433  {
1434  if (numStirredAtoms)
1435  {
1436  // Check the index to see if it is constrained
1437  return(stirIndexes[atomnum] != -1);
1438  }
1439  else
1440  {
1441  // No constraints at all, so just return FALSE
1442  return(FALSE);
1443  }
1444  }
#define FALSE
Definition: common.h:118
int numStirredAtoms
Definition: Molecule.h:598
Bool Molecule::is_drude ( int  )
Bool Molecule::is_group_fixed ( int  atomnum) const
inline

Definition at line 1447 of file Molecule.h.

References numFixedAtoms.

1448  {
1449  return (numFixedAtoms && (fixedAtomFlags[atomnum] == -1));
1450  }
int numFixedAtoms
Definition: Molecule.h:597
Bool Molecule::is_hydrogen ( int  )
Bool Molecule::is_hydrogenGroupParent ( int  )
Bool Molecule::is_lp ( int  )
Bool Molecule::is_oxygen ( int  )
Bool Molecule::is_water ( int  )
Real Molecule::langevin_param ( int  atomnum) const
inline

Definition at line 1300 of file Molecule.h.

Referenced by WorkDistrib::createAtomLists().

1301  {
1302  return(langevinParams ? langevinParams[atomnum] : 0.);
1303  }
int64_t Molecule::num_deg_freedom ( int  isInitialReport = 0) const
inline

Definition at line 524 of file Molecule.h.

References num_fixed_atoms(), numAtoms, numConstraints, numFepInitial, numFixedRigidBonds, numLonepairs, numRigidBonds, simParams, and WAT_TIP4.

Referenced by Controller::Controller(), NamdState::loadStructure(), and Controller::receivePressure().

524  {
525  // local variables prefixed by s_
526  int64_t s_NumDegFreedom = 3 * (int64_t) numAtoms;
527  int64_t s_NumFixedAtoms = num_fixed_atoms();
528  if (s_NumFixedAtoms) s_NumDegFreedom -= 3 * s_NumFixedAtoms;
529  if (numLonepairs) s_NumDegFreedom -= 3 * numLonepairs;
530  if ( ! (s_NumFixedAtoms || numConstraints
531  || simParams->comMove || simParams->langevinOn) ) {
532  s_NumDegFreedom -= 3;
533  }
534  if ( ! isInitialReport && simParams->pairInteractionOn) {
535  //
536  // DJH: a kludge? We want to initially report system degrees of freedom
537  //
538  // this doesn't attempt to deal with fixed atoms or constraints
539  s_NumDegFreedom = 3 * numFepInitial;
540  }
541  int s_NumFixedRigidBonds =
542  (simParams->fixedAtomsOn ? numFixedRigidBonds : 0);
543  if (simParams->watmodel == WAT_TIP4) {
544  // numLonepairs is subtracted here because all lonepairs have a rigid bond
545  // to oxygen, but all of the LP degrees of freedom are dealt with above
546  s_NumDegFreedom -= (numRigidBonds - s_NumFixedRigidBonds - numLonepairs);
547  }
548  else {
549  // Non-polarized systems don't have LPs.
550  // For Drude model, bonds that attach LPs are not counted as rigid;
551  // LPs have already been subtracted from degrees of freedom.
552  s_NumDegFreedom -= (numRigidBonds - s_NumFixedRigidBonds);
553  }
554  return s_NumDegFreedom;
555  }
int num_fixed_atoms() const
Definition: Molecule.h:498
Bool pairInteractionOn
int numLonepairs
Number of lone pairs.
Definition: Molecule.h:581
int numFixedRigidBonds
Definition: Molecule.h:606
int numFepInitial
Definition: Molecule.h:608
int numAtoms
Definition: Molecule.h:557
int numConstraints
Definition: Molecule.h:589
#define WAT_TIP4
Definition: common.h:191
int numRigidBonds
Definition: Molecule.h:605
int Molecule::num_fixed_atoms ( ) const
inline

Definition at line 498 of file Molecule.h.

References numFixedAtoms, and simParams.

Referenced by num_deg_freedom(), num_fixed_groups(), num_group_deg_freedom(), and Controller::receivePressure().

498  {
499  // local variables prefixed by s_
500  int s_NumFixedAtoms = (simParams->fixedAtomsOn ? numFixedAtoms : 0);
501  return s_NumFixedAtoms; // value is "turned on" SimParameters
502  }
int numFixedAtoms
Definition: Molecule.h:597
int Molecule::num_fixed_groups ( ) const
inline

Definition at line 504 of file Molecule.h.

References num_fixed_atoms(), and numFixedGroups.

Referenced by num_group_deg_freedom(), and Controller::receivePressure().

504  {
505  // local variables prefixed by s_
506  int s_NumFixedAtoms = num_fixed_atoms();
507  int s_NumFixedGroups = (s_NumFixedAtoms ? numFixedGroups : 0);
508  return s_NumFixedGroups; // value is "turned on" SimParameters
509  }
int numFixedGroups
Definition: Molecule.h:604
int num_fixed_atoms() const
Definition: Molecule.h:498
int64_t Molecule::num_group_deg_freedom ( ) const
inline

Definition at line 511 of file Molecule.h.

References num_fixed_atoms(), num_fixed_groups(), numConstraints, numHydrogenGroups, and simParams.

Referenced by Controller::receivePressure().

511  {
512  // local variables prefixed by s_
513  int64_t s_NumGroupDegFreedom = 3 * (int64_t) numHydrogenGroups;
514  int64_t s_NumFixedAtoms = num_fixed_atoms();
515  int s_NumFixedGroups = num_fixed_groups();
516  if (s_NumFixedGroups) s_NumGroupDegFreedom -= 3 * s_NumFixedGroups;
517  if ( ! (s_NumFixedAtoms || numConstraints
518  || simParams->comMove || simParams->langevinOn) ) {
519  s_NumGroupDegFreedom -= 3;
520  }
521  return s_NumGroupDegFreedom;
522  }
int numHydrogenGroups
Definition: Molecule.h:600
int num_fixed_atoms() const
Definition: Molecule.h:498
int numConstraints
Definition: Molecule.h:589
int num_fixed_groups() const
Definition: Molecule.h:504
void Molecule::prepare_qm ( const char *  pdbFileName,
Parameters params,
ConfigList cfgList 
)

Prepares Live Solvent Selection

Data gathering from PDB to find QM atom and bond info

Multiplicity of each QM group

Charge of each QM group

Populate arrays that are used throughout the the calculations.

Overides Link Atom element with user selection.

Bond Schemes. Prepares for treatment of QM-MM bonds in ComputeQM.C

Live Solvent Selection

Custom Point Charge selection

Topology preparation

Definition at line 109 of file MoleculeQM.C.

References Parameters::assign_vdw_index(), qmSolvData::atmIDs, PDB::atom(), bond::atom1, bond::atom2, ResizeArray< T >::begin(), bond::bond_type, atom_constants::charge, charge, StringList::data, DebugM, PDBAtom::element(), ResizeArray< T >::end(), endi(), SimParameters::extraBondsOn, SortedArray< Type >::find(), ConfigList::find(), SimParameters::fixedAtomsOn, get_residue_size(), ObjectArena< Type >::getNewArray(), iERROR(), iINFO(), SortedArray< Type >::insert(), iout, iWARN(), ResidueLookupElem::lookup(), atom_constants::mass, NAMD_blank_string(), NAMD_die(), NAMD_read_line(), StringList::next, PDB::num_atoms(), numAtoms, numBonds, numRealBonds, PDBAtom::occupancy(), SimParameters::PMEOn, SimParameters::qmBondDist, SimParameters::qmBondOn, SimParameters::qmBondScheme, SimParameters::qmChrgFromPSF, SimParameters::qmColumn, SimParameters::qmCSMD, SimParameters::qmCustomPCSel, SimParameters::qmElecEmbed, SimParameters::qmFormat, QMFormatMOPAC, QMFormatORCA, SimParameters::qmLSSFreq, SimParameters::qmLSSMode, QMLSSMODECOM, QMLSSMODEDIST, SimParameters::qmLSSOn, SimParameters::qmLSSResname, SimParameters::qmMOPACAddConfigChrg, SimParameters::qmNoPC, SimParameters::qmPCSelFreq, QMSCHEMECS, QMSCHEMERCD, QMSCHEMEZ1, QMSCHEMEZ2, QMSCHEMEZ3, SimParameters::qmVDW, PDBAtom::residuename(), PDBAtom::residueseq(), PDBAtom::segmentname(), ResizeArray< T >::size(), split(), SimParameters::stepsPerCycle, and PDBAtom::temperaturefactor().

Referenced by NamdState::loadStructure().

110  {
111 #ifdef MEM_OPT_VERSION
112  NAMD_die("QMMM interface is not supported in memory optimized builds.");
113 #else
114 
115  PDB *pdbP; // Pointer to PDB object to use
116 
117  qmNumQMAtoms = 0;
118 
119  qmNumGrps = 0 ;
120 
121  iout << iINFO << "Using the following PDB file for QM parameters: " <<
122  pdbFileName << "\n" << endi;
123  if (pdbFileName)
124  pdbP = new PDB(pdbFileName);
125  else
126  iout << "pdbFile name not defined!\n\n" << endi ;
127 
128  if (pdbP->num_atoms() != numAtoms)
129  {
130  NAMD_die("Number of atoms in QM parameter PDB file doesn't match coordinate PDB");
131  }
132 
133  qmElementArray = new char*[numAtoms] ;
134 
135  qmAtomGroup = new Real[numAtoms] ;
136 
137  BigReal bondVal;
138  Real atmGrp;
139 
140  std::set<Real> atmGrpSet;
141 
142  std::vector<Real> grpChrgVec;
143 
144  // Value in the bond column fro QM-MM bonds.
145  std::vector<BigReal> qmBondValVec;
146  // Identifiers of different QM regions
147  std::vector<Real> qmGroupIDsVec;
148  // This maps the qm group ID with the serail index of this group in
149  // various arrays.
150  std::map<Real,int> qmGrpIDMap ;
151 
152  std::vector<int> qmAtmIndxVec, qmGrpSizeVec;
153 
154  // Used to parse user selection in different places.
155  std::vector<std::string> strVec;
156 
157  qmNoPC = simParams->qmNoPC;
158 
159  // We set to zero by default, So there is no need for extra processing.
160  qmPCFreq = 0;
161  if (simParams->qmPCSelFreq > 1)
162  qmPCFreq = simParams->qmPCSelFreq;
163 
164 
167 
168 
169  qmLSSTotalNumAtms = 0;
170  SortedArray< qmSolvData> lssGrpRes;
171  std::map<Real,std::vector<int> > lssGrpRefIDs;
172  refSelStrMap lssRefUsrSel;
173  int totalNumRefAtms = 0;
174  int lssClassicResIndx = 0 ;
175  int lssCurrClassResID = -1 ;
176  char lssCurrClassResSegID[5];
177  if (simParams->qmLSSOn) {
178  DebugM(4, "LSS is ON! Processing QM solvent.\n") ;
179 
180  if (resLookup == NULL)
181  NAMD_die("We need residue data to conduct LSS.");
182 
183  if (simParams->qmLSSMode == QMLSSMODECOM) {
184 
185  StringList *current = cfgList->find("QMLSSRef");
186  for ( ; current; current = current->next ) {
187 
188  strVec = split( std::string(current->data) , " ");
189 
190  if (strVec.size() != 3 ) {
191  iout << iERROR << "Format error in QM LSS size: "
192  << current->data
193  << "\n" << endi;
194  NAMD_die("Error processing QM information.");
195  }
196 
197  std::stringstream storConv ;
198 
199  storConv << strVec[0] ;
200  Real grpID ;
201  storConv >> grpID;
202  if (storConv.fail()) {
203  iout << iERROR << "Error parsing QMLSSRef selection: "
204  << current->data
205  << "\n" << endi;
206  NAMD_die("Error processing QM information.");
207  }
208 
209  std::string segName = strVec[1].substr(0,4);
210 
211  storConv.clear() ;
212  storConv << strVec[2];
213  int resID ;
214  storConv >> resID;
215  if (storConv.fail()) {
216  iout << iERROR << "Error parsing QMLSSRef selection: "
217  << current->data
218  << "\n" << endi;
219  NAMD_die("Error processing QM information.");
220  }
221 
222  auto it = lssRefUsrSel.find(grpID) ;
223  if (it == lssRefUsrSel.end())
224  lssRefUsrSel.insert(refSelStrPair(grpID,refSelStrVec()));
225 
226  lssRefUsrSel[grpID].push_back(refSelStr(segName, resID));
227  }
228 
229  for (auto it=lssRefUsrSel.begin(); it!=lssRefUsrSel.end(); it++) {
230  iout << iINFO << "LSS user selection for COM composition of group "
231  << it->first << ":\n" << endi ;
232  for (int i=0; i<it->second.size();i++) {
233  iout << iINFO << "Segment " << it->second[i].segid
234  << " ; residue " << it->second[i].resid << "\n" << endi ;
235  }
236  }
237  }
238  }
239 
240 
241 
244 
245 
246  for (int atmInd = 0 ; atmInd < numAtoms; atmInd++) {
247 
248  // If we are looking for QM-MM bonds, then we need to store extra info.
249  if (simParams->qmBondOn) {
250 
251  // We store both the qm group and the bond value
252  if ( strcmp(simParams->qmColumn,"beta") == 0 ){
253  atmGrp = pdbP->atom(atmInd)->temperaturefactor() ;
254 
255  bondVal = pdbP->atom(atmInd)->occupancy() ;
256  }
257  else {
258  atmGrp = pdbP->atom(atmInd)->occupancy() ;
259 
260  bondVal = pdbP->atom(atmInd)->temperaturefactor() ;
261  }
262 
263  qmBondValVec.push_back(bondVal);
264  }
265  else {
266 
267  if ( strcmp(simParams->qmColumn,"beta") == 0 ){
268  atmGrp = pdbP->atom(atmInd)->temperaturefactor() ;
269  }
270  else {
271  atmGrp = pdbP->atom(atmInd)->occupancy() ;
272  }
273  }
274 
275  // We store all atom QM Group IDs in an array for
276  // future transport to all PEs.
277  qmAtomGroup[atmInd] = atmGrp;
278 
279  // We store all atom's elements for quick access in the QM code.
280  // Elements are used to tell the QM code the atom type.
281  qmElementArray[atmInd] = new char[3];
282  strncpy(qmElementArray[atmInd],pdbP->atom(atmInd)->element(),3);
283 
284  // For QM atoms, we keep global atom indices and parse different QM Group
285  // IDs, keeping track of each groups size
286  if (atmGrp > 0){
287 
288  if (simParams->fixedAtomsOn) {
289  if ( fixedAtomFlags[atmInd] == 1 ) {
290  iout << iERROR << "QM atom cannot be fixed in space!\n"
291  << endi;
292  NAMD_die("Error processing QM information.");
293  }
294  }
295 
296  // Changes the VdW type of QM atoms.
297  // This is may be used to counter balance the overpolarization
298  // that QM atoms sufer.
299  if (simParams->qmVDW) {
300  // Creating a new type string
301  std::string qmType(qmElementArray[atmInd]) ;
302  // Erases empty spaces
303  qmType.erase(
304  std::remove_if(qmType.begin(), qmType.end(), isspace ),
305  qmType.end());
306  // pre-pends a "q" to the element name.
307  qmType = std::string("q") + qmType;
308 
309 // iout << "QM VdW type: " << atoms[atmInd].vdw_type
310 // << " atom type: " << atomNames[atmInd].atomtype
311 // << " new type "<< qmType << "\n" << endi;
312 
313  /* Look up the vdw constants for this atom */
314  // I am casting a non-const here because the function doesn't actually
315  // change the string value, but it doesn't ask for a const char* as
316  // an argument.
317  params->assign_vdw_index(const_cast<char*>( qmType.c_str()),
318  &(atoms[atmInd]));
319 
320 // iout << "----> new VdW type: " << atoms[atmInd].vdw_type << "\n" << endi;
321  }
322 
323  // Indexes all global indices of QM atoms.
324  qmAtmIndxVec.push_back(atmInd);
325 
326  auto retVal = atmGrpSet.insert(atmGrp);
327 
328  // If a new QM group is found, store the reverse reference in a map
329  // and increase the total count.
330  if (retVal.second) {
331  // This mak makes the reverse identification from the group ID
332  // to the sequential order in which each group was first found.
333  qmGrpIDMap.insert(std::pair<BigReal,int>(atmGrp, qmNumGrps));
334 
335  // This vector keeps track of the group ID for each group
336  qmGroupIDsVec.push_back(atmGrp);
337 
338  // This counter is used to keep track of the sequential order in
339  // which QM groups were first seen in the reference PDB file.
340  qmNumGrps++ ;
341 
342  // If this is a new QM group, initialize a new variable in the
343  // vector to keep track of the number of atoms in this group.
344  qmGrpSizeVec.push_back(1);
345 
346  // For each new QM group, a new entry in the total charge
347  // vector is created
348  grpChrgVec.push_back( atoms[atmInd].charge );
349  }
350  else {
351  // If the QM group has already been seen, increase the count
352  // of atoms in that group.
353  qmGrpSizeVec[ qmGrpIDMap[atmGrp] ]++ ;
354 
355  // If the QM group exists, adds current atom charge to total charge.
356  grpChrgVec[ qmGrpIDMap[atmGrp] ] += atoms[atmInd].charge;
357  }
358 
359  // In case we are using live solvent selection
360  if(simParams->qmLSSOn) {
361 
362  int resID = pdbP->atom(atmInd)->residueseq();
363  char segName[5];
364  strncpy(segName, pdbP->atom(atmInd)->segmentname(),5);
365 
366  int resSize = get_residue_size(segName,resID);
367 
368  int i =-1, end =-1;
369 
370  resLookup->lookup(segName,resID,&i, &end);
371 
372  if ( strncasecmp(pdbP->atom(atmInd)->residuename(),
373  simParams->qmLSSResname, 4) == 0) {
374 
375  // We try to insert every residue from every atom
376  qmSolvData *resP = lssGrpRes.find(qmSolvData(resID, i, resSize));
377 
378  if (resP != NULL) {
379  resP->atmIDs.push_back(atmInd) ;
380 // DebugM(3, "Existing residue " << resP->resID
381 // << " from segID " << resP->segName
382 // << " received atom "
383 // << atmInd << "\n" );
384  }
385  else {
386  lssGrpRes.insert(qmSolvData(resID, i, resSize, segName, atmGrp));
387 // DebugM(3, lssGrpRes.size() << ") Inserted new residue: "
388 // << resID << " from segID " << segName
389 // << " with atom "
390 // << i << "\n" ) ;
391  }
392  }
393  else {
394  // We store the QM atoms, per group, which are NOT part of
395  // solvent molecules.
396 
397  // Checks if we have a vector for this QM group.
398  auto itNewGrp = lssGrpRefIDs.find(atmGrp) ;
399  if (itNewGrp == lssGrpRefIDs.end()) {
400  lssGrpRefIDs.insert(std::pair<Real, std::vector<int> >(
401  atmGrp, std::vector<int>() ) );
402  }
403 
404  switch (simParams->qmLSSMode)
405  {
406 
407  case QMLSSMODECOM:
408  {
409  // If we are using COM selection, checks if the atom
410  // is part of the user selected residues
411  for(int i=0; i<lssRefUsrSel[atmGrp].size(); i++) {
412  if (lssRefUsrSel[atmGrp][i].resid == resID &&
413  strncmp(lssRefUsrSel[atmGrp][i].segid.c_str(),
414  segName,5) == 0 ) {
415 
416  lssGrpRefIDs[atmGrp].push_back(atmInd);
417  totalNumRefAtms++;
418  }
419  }
420 
421  } break;
422 
423  case QMLSSMODEDIST:
424  {
425 
426  lssGrpRefIDs[atmGrp].push_back(atmInd);
427  totalNumRefAtms++;
428 
429  } break;
430 
431  }
432  }
433 
434  }
435 
436  }
437  else if (atmGrp == 0) {
438 
439  if(simParams->qmLSSOn) {
440 
441  if ( strncasecmp(pdbP->atom(atmInd)->residuename(),
442  simParams->qmLSSResname, 4) == 0) {
443 
444  int resID = pdbP->atom(atmInd)->residueseq();
445  char segName[5];
446  strncpy(segName, pdbP->atom(atmInd)->segmentname(),5);
447 
448  if (lssCurrClassResID < 0) {
449  lssCurrClassResID = resID ;
450  strncpy(lssCurrClassResSegID, segName,5);
451  lssClassicResIndx = 0;
452  }
453  else if (lssCurrClassResID != resID ||
454  strcmp(lssCurrClassResSegID, segName) != 0 ) {
455  lssCurrClassResID = resID ;
456  strncpy(lssCurrClassResSegID, segName,5);
457  lssClassicResIndx++;
458  }
459 
460  qmClassicSolv.insert(std::pair<int,int>(atmInd,lssClassicResIndx));
461 
462  }
463  }
464  }
465  else if(atmGrp < 0) {
466  iout << iERROR << "QM group ID cannot be less than zero!\n" << endi;
467  NAMD_die("Error processing QM information.");
468  }
469  }
470 
471  // Sanity check
472  if (simParams->qmLSSOn) {
473  if (lssGrpRes.size() == 0)
474  NAMD_die("LSS was activated but there are no QM solvent molecules!\n");
475 
476  for (auto it=lssRefUsrSel.begin(); it!=lssRefUsrSel.end(); it++) {
477  auto itTarget = qmGrpIDMap.find(it->first);
478  if (itTarget == qmGrpIDMap.end()) {
479  iout << iERROR << "QM group ID for LSS could not be found in input!"
480  << " QM group ID: " << it->first << "\n" << endi;
481  NAMD_die("Error processing QM information.");
482  }
483  }
484 
485  DebugM(3,"We found " << lssClassicResIndx << " classical solvent molecules totalling "
486  << qmClassicSolv.size() << " atoms.\n" );
487 
488  }
489 
490  qmNumQMAtoms = qmAtmIndxVec.size();
491 
492  if (qmNumQMAtoms == 0)
493  NAMD_die("No QM atoms were found in this QM simulation!") ;
494 
495  iout << iINFO << "Number of QM atoms (excluding Dummy atoms): " <<
496  qmNumQMAtoms << "\n" << endi;
497 
498  qmAtmChrg = new Real[qmNumQMAtoms] ;
499  qmAtmIndx = new int[qmNumQMAtoms] ;
500  for (int i=0; i<qmNumQMAtoms; i++) {
501  // qmAtmChrg gets initialized with the PSF charges at the end of this
502  // function, but values may change as QM steps are taken.
503  qmAtmChrg[i] = 0;
504  qmAtmIndx[i] = qmAtmIndxVec[i] ;
505  }
506 
507  // This map relates the QM group index with a vector of pairs
508  // of bonded MM-QM atoms (with the bonded atoms ins this order:
509  // MM first, QM second).
510  std::map<int, std::vector<std::pair<int,int> > > qmGrpIDBonds ;
511  int bondCounter = 0;
512  if (simParams->qmBondOn) {
513 
514  // Checks all bonds for QM-MM pairs.
515  // Makes sanity checks against QM-QM pairs and MM-MM pairs that
516  // are flagged by the user to be bonds between QM and MM regions.
517  // QM-QM bonds will be removed in another function.
518  for (int bndIt = 0; bndIt < numBonds; bndIt++) {
519 
520  bond curr = bonds[bndIt] ;
521 
522  // In case either atom has a non-zero
523  if ( qmBondValVec[curr.atom1] != 0 &&
524  qmBondValVec[curr.atom2] != 0 ) {
525 
526  // Sanity checks (1 of 2)
527  if (qmAtomGroup[curr.atom1] != 0 &&
528  qmAtomGroup[curr.atom2] != 0) {
529  iout << iERROR << "Atoms " << curr.atom1 << " and " <<
530  curr.atom2 << " are assigned as QM atoms.\n" << endi;
531  NAMD_die("Error in QM-MM bond assignment.") ;
532  }
533 
534  // Sanity checks (2 of 2)
535  if (qmAtomGroup[curr.atom1] == 0 &&
536  qmAtomGroup[curr.atom2] == 0) {
537  iout << iERROR << "Atoms " << curr.atom1 << " and " <<
538  curr.atom2 << " are assigned as MM atoms.\n" << endi;
539  NAMD_die("Error in QM-MM bond assignment.") ;
540  }
541 
542  int currGrpID = 0;
543  std::pair<int,int> newPair(0,0);
544 
545  // We create a QM-MM pair with the MM atom first
546  if (qmAtomGroup[curr.atom1] != 0) {
547  newPair = std::pair<int,int>(curr.atom2, curr.atom1) ;
548  currGrpID = qmAtomGroup[curr.atom1];
549  } else {
550  newPair = std::pair<int,int>(curr.atom1, curr.atom2) ;
551  currGrpID = qmAtomGroup[curr.atom2];
552  }
553 
554  int grpIndx = qmGrpIDMap[currGrpID] ;
555 
556  // Stores bonds in vectors key-ed by the QM group ID of the QM atom.
557  auto retIter = qmGrpIDBonds.find(grpIndx) ;
558  // In case thi QM-MM bonds belong to a QM group we have not seen
559  // yet, stores a new vector in the map.
560  if (retIter == qmGrpIDBonds.end()) {
561  qmGrpIDBonds.insert(std::pair<BigReal,std::vector<std::pair<int,int> > >(
562  grpIndx, std::vector<std::pair<int,int> >() ) );
563  }
564 
565  qmGrpIDBonds[grpIndx].push_back( newPair );
566 
567  bondCounter++ ;
568  }
569 
570 
571  }
572 
573 // iout << "Finished processing QM-MM bonds.\n" << endi ;
574 
575  if (bondCounter == 0)
576  iout << iWARN << "We found " << bondCounter << " QM-MM bonds.\n" << endi ;
577  else
578  iout << iINFO << "We found " << bondCounter << " QM-MM bonds.\n" << endi ;
579 
580  }
581 
582  // Initializes several arrays used to setup the QM simulation.
583  qmNumBonds = bondCounter ;
584 
585  qmMMBond = new int*[qmNumBonds];
586 
587  qmDummyBondVal = new BigReal[qmNumBonds];
588 
589  qmMMChargeTarget = new int*[qmNumBonds] ;
590  qmMMNumTargs = new int[qmNumBonds] ;
591 
592  qmDummyElement = new char*[qmNumBonds] ;
593 
594 
595  qmNumGrps = atmGrpSet.size();
596 
597  qmGrpSizes = new int[qmNumGrps];
598 
599  qmGrpID = new Real[qmNumGrps];
600 
601  qmGrpChrg = new Real[qmNumGrps];
602 
603  qmGrpMult = new Real[qmNumGrps] ;
604 
605  qmGrpNumBonds = new int[qmNumGrps];
606 
607  qmGrpBonds = new int*[qmNumGrps];
608  qmMMBondedIndx = new int*[qmNumGrps];
609 
610 
613 
614 
615  // We first initialize the multiplicity vector with
616  // default values, then populate it with user defined values.
617  for (int grpIter = 0; grpIter < qmNumGrps; grpIter++) {
618  qmGrpMult[grpIter] = 0;
619  }
620 
621  int multCount = 0;
622  StringList *current = cfgList->find("QMMult");
623  for ( ; current; current = current->next ) {
624 
625  auto strVec = split( std::string(current->data) , " ");
626 
627  if (strVec.size() != 2 ) {
628  iout << iERROR << "Format error in QM Multiplicity string: "
629  << current->data
630  << "\n" << endi;
631  NAMD_die("Error processing QM information.");
632  }
633 
634  std::stringstream storConv ;
635 
636  storConv << strVec[0] ;
637  Real grpID ;
638  storConv >> grpID;
639  if (storConv.fail()) {
640  iout << iERROR << "Error parsing QMMult selection: "
641  << current->data
642  << "\n" << endi;
643  NAMD_die("Error processing QM information.");
644  }
645 
646  storConv.clear() ;
647  storConv << strVec[1];
648  Real multiplicity ;
649  storConv >> multiplicity;
650  if (storConv.fail()) {
651  iout << iERROR << "Error parsing QMMult selection: "
652  << current->data
653  << "\n" << endi;
654  NAMD_die("Error processing QM information.");
655  }
656 
657  auto it = qmGrpIDMap.find(grpID);
658 
659  if (it == qmGrpIDMap.end()) {
660  iout << iERROR << "Error parsing QMMult selection. Could not find QM group ID: "
661  << grpID
662  << "\n" << endi;
663  NAMD_die("Error processing QM information.");
664  }
665  else {
666  iout << iINFO << "Applying user defined multiplicity "
667  << multiplicity << " to QM group ID " << grpID << "\n" << endi;
668  qmGrpMult[it->second] = multiplicity;
669  }
670 
671  multCount++;
672  }
673 
674  if (multCount != qmNumGrps && simParams->qmFormat == QMFormatORCA) {
675  NAMD_die("ORCA neds multiplicity values for all QM regions.");
676  }
677 
678 
681 
682 
683  for (size_t grpIndx = 0; grpIndx < qmGrpSizeVec.size(); grpIndx++) {
684 
685  bool nonInteger = true;
686  if ((fabsf(roundf(grpChrgVec[grpIndx]) - grpChrgVec[grpIndx]) <= 0.001f) ) {
687  grpChrgVec[grpIndx] = roundf(grpChrgVec[grpIndx]) ;
688  nonInteger = false;
689  }
690 
691  iout << iINFO << grpIndx + 1 << ") Group ID: " << qmGroupIDsVec[grpIndx]
692  << " ; Group size: " << qmGrpSizeVec[grpIndx] << " atoms"
693  << " ; Total PSF charge: " << grpChrgVec[grpIndx] << "\n" << endi ;
694 
695  if (nonInteger && simParams->PMEOn)
696  NAMD_die("QM atoms do not add up to a whole charge, which is needed for PME.") ;
697  }
698 
699  int chrgCount = 0;
700  current = cfgList->find("QMCharge");
701  for ( ; current; current = current->next ) {
702 
703  auto strVec = split( std::string(current->data) , " ");
704 
705  if (strVec.size() != 2 ) {
706  iout << iERROR << "Format error in QM Charge string: "
707  << current->data
708  << "\n" << endi;
709  NAMD_die("Error processing QM information.");
710  }
711 
712  std::stringstream storConv ;
713 
714  storConv << strVec[0] ;
715  Real grpID ;
716  storConv >> grpID;
717  if (storConv.fail()) {
718  iout << iERROR << "Error parsing QMCharge selection: "
719  << current->data
720  << "\n" << endi;
721  NAMD_die("Error processing QM information.");
722  }
723 
724  storConv.clear() ;
725  storConv << strVec[1];
726  Real charge ;
727  storConv >> charge;
728  if (storConv.fail()) {
729  iout << iERROR << "Error parsing QMCharge selection: "
730  << current->data
731  << "\n" << endi;
732  NAMD_die("Error processing QM information.");
733  }
734 
735  auto it = qmGrpIDMap.find(grpID);
736 
737  if (it == qmGrpIDMap.end()) {
738  iout << iERROR << "Error parsing QMCharge selection. Could not find QM group ID: "
739  << grpID
740  << "\n" << endi;
741  NAMD_die("Error processing QM information.");
742  }
743  else {
744  iout << iINFO << "Found user defined charge "
745  << charge << " for QM group ID " << grpID << ". Will ignore PSF charge.\n" << endi;
746  grpChrgVec[it->second] = charge;
747  }
748 
749  chrgCount++;
750  }
751 
752  simParams->qmMOPACAddConfigChrg = false;
753  // Checks if QM group charges can be defined for MOPAC.
754  // Since charge can be defined in QMConfigLine, we need extra logic.
755  if (simParams->qmFormat == QMFormatMOPAC) {
756 
757  // Checks if group charge was supplied in config line for MOPAC.
758  std::string::size_type chrgLoc = std::string::npos ;
759 
760  // This will hold a sting with the first user supplied configuration line for MOPAC.
761  std::string configLine(cfgList->find("QMConfigLine")->data) ;
762  chrgLoc = configLine.find("CHARGE") ;
763 
764  if ( chrgLoc != std::string::npos ) {
765  iout << iINFO << "Found user defined charge in command line. This \
766 will be used for all QM regions and will take precedence over all other charge \
767 definitions.\n" << endi;
768  }
769  else if ( chrgLoc == std::string::npos && (simParams->qmChrgFromPSF || chrgCount == qmNumGrps) ) {
770  // If no charge was defined in the configuration line, gets from PSF and/or
771  // from user defined charges (through the QMCharge keyword).
772  simParams->qmMOPACAddConfigChrg = true;
773  }
774  else
775  {
776  // If we could nont find a charge definition in the config line AND
777  // no specific charge was selected for each QM region through QMCharge AND
778  // the QMChargeFromPSF was not turned ON, the we stop NAMD and scream at the user.
779 // if ( chrgLoc == std::string::npos && (chrgCount != qmNumGrps ) && !simParams->qmChrgFromPSF)
780  iout << iERROR << "Could not find charge for all QM groups. For MOPAC, \
781 charges can be defined through QMConfigLine, QMCharge or QMChargeFromPSF keywords.\n" << endi;
782  NAMD_die("Error processing QM information.");
783  }
784 
785  }
786 
787  if (simParams->qmFormat == QMFormatORCA ) {
788  if ((chrgCount != qmNumGrps ) && !simParams->qmChrgFromPSF) {
789  // If we are not supposed to get charges from the PSF, and not
790  // enough charges were set to cover all QM regions,
791  // we stop NAMD and scream at the user.
792  iout << iERROR << "Could not find charge for all QM groups. For ORCA, \
793 charges can be defined through QMCharge or QMChargeFromPSF keywords.\n" << endi;
794  NAMD_die("Error processing QM information.");
795  }
796  }
797 
798  // If mechanichal embedding was requested but we have QM-MM bonds, we need
799  // to send extra info to ComputeQM to preserve calculation speed.
800  if (qmNumBonds > 0 && qmNoPC) {
801  qmMeNumBonds = qmNumBonds;
802  qmMeMMindx = new int[qmMeNumBonds] ;
803  qmMeQMGrp = new Real[qmMeNumBonds] ;
804  }
805  else {
806  qmMeNumBonds = 0 ;
807  qmMeMMindx = NULL;
808  qmMeQMGrp = NULL;
809  }
810 
811 
814 
815 
816  bondCounter = 0;
817  for (int grpIter = 0; grpIter < qmNumGrps; grpIter++) {
818 
819  qmGrpID[grpIter] = qmGroupIDsVec[grpIter] ;
820 
821  qmGrpSizes[grpIter] = qmGrpSizeVec[grpIter] ;
822 
823  qmGrpChrg[grpIter] = grpChrgVec[grpIter];
824 
825 // iout << "Loaded " << qmGrpSizes[grpIter] << " atoms to this group.\n" << endi;
826 
827  int currNumbBonds = qmGrpIDBonds[grpIter].size() ;
828 
829  // Assigns the number of bonds that the current QM group has.
830  qmGrpNumBonds[grpIter] = currNumbBonds;
831 
832  if (currNumbBonds > 0) {
833 
834  qmGrpBonds[grpIter] = new int[currNumbBonds];
835  qmMMBondedIndx[grpIter] = new int[currNumbBonds];
836 
837  for (int bndIter = 0; bndIter<currNumbBonds; bndIter++) {
838 
839  // Adds the bonds to the overall sequential list.
840  qmMMBond[bondCounter] = new int[2] ;
841  qmMMBond[bondCounter][0] = qmGrpIDBonds[grpIter][bndIter].first ;
842  qmMMBond[bondCounter][1] = qmGrpIDBonds[grpIter][bndIter].second ;
843 
844  // For the current QM group, and the current bond, gets the bond index.
845  qmGrpBonds[grpIter][bndIter] = bondCounter;
846 
847  // For the current QM group, and the current bond, gets the MM atom.
848  qmMMBondedIndx[grpIter][bndIter] = qmGrpIDBonds[grpIter][bndIter].first ;
849 
850  // Assign the default value of dummy element
851  qmDummyElement[bondCounter] = new char[3];
852  strcpy(qmDummyElement[bondCounter],"H\0");
853 
854  // Determines the distance that will separate the new Dummy atom
855  // and the Qm atom to which it will be bound.
856  bondVal = 0;
857  if (simParams->qmBondDist) {
858  if (qmBondValVec[qmMMBond[bondCounter][0]] !=
859  qmBondValVec[qmMMBond[bondCounter][1]]
860  ) {
861  iout << iERROR << "qmBondDist is ON but the values in the bond column are different for atom "
862  << qmMMBond[bondCounter][0] << " and " << qmMMBond[bondCounter][1]
863  << ".\n" << endi ;
864  NAMD_die("Error in QM-MM bond processing.");
865  }
866 
867  bondVal = qmBondValVec[qmMMBond[bondCounter][0]] ;
868  }
869  else {
870 
871  if (strcmp(qmElementArray[qmMMBond[bondCounter][1]],"C") == 0 ) {
872  bondVal = 1.09 ;
873  }
874  else if (strcmp(qmElementArray[qmMMBond[bondCounter][1]],"O") == 0 ) {
875  bondVal = 0.98 ;
876  }
877  else if (strcmp(qmElementArray[qmMMBond[bondCounter][1]],"N") == 0 ) {
878  bondVal = 0.99 ;
879  }
880  else {
881  iout << iERROR << "qmBondDist is OFF but the QM atom has no default distance value. Atom "
882  << qmMMBond[bondCounter][1] << ", with element: "
883  << qmElementArray[qmMMBond[bondCounter][1]]
884  << ".\n" << endi ;
885  NAMD_die("Error in QM-MM bond processing.");
886  }
887 
888  }
889 
890  iout << iINFO << "MM-QM pair: " << qmMMBond[bondCounter][0] << ":"
891  << qmMMBond[bondCounter][1]
892  << " -> Value (distance or ratio): " << bondVal
893  << " (QM Group " << grpIter << " ID " << qmGrpID[grpIter] << ")"
894  << "\n" << endi ;
895 
896  qmDummyBondVal[bondCounter] = bondVal;
897 
898  // In case we are preparing for a mechanical embedding simulation
899  // with no point charges, populate the following vectors
900  if (qmMeNumBonds > 0) {
901  qmMeMMindx[bondCounter] = qmMMBond[bondCounter][0];
902  qmMeQMGrp[bondCounter] = qmGrpID[grpIter];
903  }
904 
905  bondCounter++ ;
906  }
907  }
908 
909  }
910 
911 
914 
915  current = NULL;
916  if (qmNumBonds > 0)
917  current = cfgList->find("QMLinkElement");
918 
919  int numParsedLinkElem = 0;
920  for ( ; current != NULL; current = current->next ) {
921 
922  DebugM(3,"Parsing link atom element: " << current->data << "\n" );
923 
924  strVec = split( std::string(current->data) , " ");
925 
926  // We need the two atoms that compose the QM-MM bonds and
927  // then the element.
928  if (strVec.size() != 3 && qmNumBonds > 1) {
929  iout << iERROR << "Format error in QM link atom element selection: "
930  << current->data
931  << "\n" << endi;
932  NAMD_die("Error processing QM information.");
933  }
934 
935  // If there is only one QM-MM bond, we can accept the element only.
936  if (strVec.size() != 1 && strVec.size() != 3 && qmNumBonds == 1) {
937  iout << iERROR << "Format error in QM link atom element selection: "
938  << current->data
939  << "\n" << endi;
940  NAMD_die("Error processing QM information.");
941  }
942 
943  std::stringstream storConv ;
944  int bondAtom1, bondAtom2;
945  std::string linkElement ;
946 
947  if (strVec.size() == 1) {
948  linkElement = strVec[0].substr(0,2);
949  }
950  else if (strVec.size() == 3) {
951 
952  storConv << strVec[0] ;
953  storConv >> bondAtom1;
954  if (storConv.fail()) {
955  iout << iERROR << "Error parsing link atom element selection: "
956  << current->data
957  << "\n" << endi;
958  NAMD_die("Error processing QM information.");
959  }
960 
961  storConv.clear() ;
962  storConv << strVec[1];
963  storConv >> bondAtom2;
964  if (storConv.fail()) {
965  iout << iERROR << "Error parsing link atom element selection: "
966  << current->data
967  << "\n" << endi;
968  NAMD_die("Error processing QM information.");
969  }
970 
971  linkElement = strVec[2].substr(0,2);
972  }
973 
974  numParsedLinkElem++;
975 
976  if (numParsedLinkElem>qmNumBonds) {
977  iout << iERROR << "More link atom elements were set than there"
978  " are QM-MM bonds.\n" << endi;
979  NAMD_die("Error processing QM information.");
980  }
981 
982  int bondIter;
983 
984  if (strVec.size() == 1) {
985  bondIter = 0;
986  }
987  else if (strVec.size() == 3) {
988 
989  Bool foundBond = false;
990 
991  for (bondIter=0; bondIter<qmNumBonds; bondIter++) {
992 
993  if ( (qmMMBond[bondIter][0] == bondAtom1 &&
994  qmMMBond[bondIter][1] == bondAtom2 ) ||
995  (qmMMBond[bondIter][0] == bondAtom2 &&
996  qmMMBond[bondIter][1] == bondAtom1 ) ) {
997 
998  foundBond = true;
999  break;
1000  }
1001  }
1002 
1003  if (! foundBond) {
1004  iout << iERROR << "Error parsing link atom element selection: "
1005  << current->data
1006  << "\n" << endi;
1007  iout << iERROR << "Atom pair was not found to be a QM-MM bond.\n"
1008  << endi;
1009  NAMD_die("Error processing QM information.");
1010  }
1011  }
1012 
1013  strcpy(qmDummyElement[bondIter],linkElement.c_str());
1014  qmDummyElement[bondIter][2] = '\0';
1015 
1016  iout << iINFO << "Applying user defined link atom element "
1017  << qmDummyElement[bondIter] << " to QM-MM bond "
1018  << bondIter << ": " << qmMMBond[bondIter][0]
1019  << " - " << qmMMBond[bondIter][1]
1020  << "\n" << endi;
1021  }
1022 
1023 
1024 
1027 
1028 
1029  int32 **bondsWithAtomLocal = NULL ;
1030  int32 *byAtomSizeLocal = NULL;
1031  ObjectArena <int32 >* tmpArenaLocal = NULL;
1032  if (qmNumBonds > 0) {
1033 
1034  bondsWithAtomLocal = new int32 *[numAtoms];
1035  byAtomSizeLocal = new int32[numAtoms];
1036  tmpArenaLocal = new ObjectArena<int32>;
1037 
1038  // Build the bond lists
1039  for (int i=0; i<numAtoms; i++)
1040  {
1041  byAtomSizeLocal[i] = 0;
1042  }
1043  for (int i=0; i<numRealBonds; i++)
1044  {
1045  byAtomSizeLocal[bonds[i].atom1]++;
1046  byAtomSizeLocal[bonds[i].atom2]++;
1047  }
1048  for (int i=0; i<numAtoms; i++)
1049  {
1050  bondsWithAtomLocal[i] = tmpArenaLocal->getNewArray(byAtomSizeLocal[i]+1);
1051  bondsWithAtomLocal[i][byAtomSizeLocal[i]] = -1;
1052  byAtomSizeLocal[i] = 0;
1053  }
1054  for (int i=0; i<numRealBonds; i++)
1055  {
1056  int a1 = bonds[i].atom1;
1057  int a2 = bonds[i].atom2;
1058  bondsWithAtomLocal[a1][byAtomSizeLocal[a1]++] = i;
1059  bondsWithAtomLocal[a2][byAtomSizeLocal[a2]++] = i;
1060  }
1061  }
1062 
1063  // In this loops we try to find other bonds in which the MM atoms from
1064  // QM-MM bonds may be involved. The other MM atoms (which we will call M2 and M3)
1065  // will be involved in charge manipulation. See ComputeQM.C for details.
1066  for (int qmBndIt = 0; qmBndIt < qmNumBonds; qmBndIt++) {
1067 
1068  // The charge targets are accumulated in a temporary vector and then
1069  // transfered to an array that will be transmited to the ComputeQMMgr object.
1070  std::vector<int> chrgTrgt ;
1071 
1072  int MM1 = qmMMBond[qmBndIt][0], MM2, MM2BondIndx, MM3, MM3BondIndx;
1073 
1074  switch (simParams->qmBondScheme) {
1075 
1076  case QMSCHEMERCD:
1077 
1078  case QMSCHEMECS:
1079  {
1080  // Selects ALL MM2 atoms.
1081  for (int i=0; i<byAtomSizeLocal[MM1]; i++) {
1082  MM2BondIndx = bondsWithAtomLocal[MM1][i] ;
1083 
1084  // Checks which of the atoms in the bond structure is the
1085  // MM2 atom.
1086  if (bonds[MM2BondIndx].atom1 == MM1)
1087  MM2 = bonds[MM2BondIndx].atom2;
1088  else
1089  MM2 = bonds[MM2BondIndx].atom1;
1090 
1091  // In case the bonded atom is a QM atom,
1092  // skips the index.
1093  if (qmAtomGroup[MM2] > 0)
1094  continue;
1095 
1096  chrgTrgt.push_back(MM2);
1097  }
1098 
1099  } break;
1100 
1101  case QMSCHEMEZ3:
1102  {
1103  // Selects all MM3 atoms
1104  for (int i=0; i<byAtomSizeLocal[MM1]; i++) {
1105  MM2BondIndx = bondsWithAtomLocal[MM1][i] ;
1106 
1107  // Checks which of the atoms in the bond structure is the
1108  // MM2 atom.
1109  if (bonds[MM2BondIndx].atom1 == MM1)
1110  MM2 = bonds[MM2BondIndx].atom2;
1111  else
1112  MM2 = bonds[MM2BondIndx].atom1;
1113 
1114  // In case the bonded atom is a QM atom,
1115  // skips the index.
1116  if (qmAtomGroup[MM2] > 0)
1117  continue;
1118 
1119  for (int i=0; i<byAtomSizeLocal[MM2]; i++) {
1120  MM3BondIndx = bondsWithAtomLocal[MM2][i] ;
1121 
1122  // Checks which of the atoms in the bond structure is the
1123  // MM3 atom.
1124  if (bonds[MM3BondIndx].atom1 == MM2)
1125  MM3 = bonds[MM3BondIndx].atom2;
1126  else
1127  MM3 = bonds[MM3BondIndx].atom1;
1128 
1129  // In case the bonded atom is a QM atom,
1130  // skips the index.
1131  // We also keep the search from going back to MM1.
1132  if (qmAtomGroup[MM3] > 0 || MM3 == MM1)
1133  continue;
1134 
1135  chrgTrgt.push_back(MM3);
1136  }
1137 
1138  }
1139 
1140  };
1141 
1142  case QMSCHEMEZ2:
1143  {
1144  // Selects all MM2 atoms
1145  for (int i=0; i<byAtomSizeLocal[MM1]; i++) {
1146  MM2BondIndx = bondsWithAtomLocal[MM1][i] ;
1147 
1148  // Checks which of the atoms in the bond structure is the
1149  // MM2 atom.
1150  if (bonds[MM2BondIndx].atom1 == MM1)
1151  MM2 = bonds[MM2BondIndx].atom2;
1152  else
1153  MM2 = bonds[MM2BondIndx].atom1;
1154 
1155  // In case the bonded atom is a QM atom,
1156  // skips the index.
1157  if (qmAtomGroup[MM2] > 0)
1158  continue;
1159 
1160  chrgTrgt.push_back(MM2);
1161  }
1162 
1163  };
1164 
1165  case QMSCHEMEZ1:
1166  {
1167  // Selects all MM1 atoms
1168  chrgTrgt.push_back(MM1);
1169  } break;
1170  }
1171 
1172 
1173  qmMMChargeTarget[qmBndIt] = new int[chrgTrgt.size()] ;
1174  qmMMNumTargs[qmBndIt] = chrgTrgt.size();
1175 
1176  DebugM(3, "MM-QM bond " << qmBndIt << "; MM atom "
1177  << qmMMBond[qmBndIt][0] << " conections: \n" );
1178 
1179  for (size_t i=0; i < chrgTrgt.size(); i++) {
1180  qmMMChargeTarget[qmBndIt][i] = chrgTrgt[i];
1181  DebugM(3,"MM Bonded to: " << chrgTrgt[i] << "\n" );
1182  }
1183 
1184  chrgTrgt.clear();
1185  }
1186 
1187  if (bondsWithAtomLocal != NULL)
1188  delete [] bondsWithAtomLocal; bondsWithAtomLocal = 0;
1189  if (byAtomSizeLocal != NULL)
1190  delete [] byAtomSizeLocal; byAtomSizeLocal = 0;
1191  if (tmpArenaLocal != NULL)
1192  delete tmpArenaLocal; tmpArenaLocal = 0;
1193 
1194 
1197 
1198 
1199  if(simParams->qmLSSOn) {
1200 
1201  std::map<Real,int> grpLSSSize ;
1202  std::map<Real,int>::iterator itGrpSize;
1203 
1204  qmLSSTotalNumAtms = 0;
1205  qmLSSResidueSize = 0;
1206 
1207  if (simParams->qmLSSFreq == 0)
1208  qmLSSFreq = simParams->stepsPerCycle ;
1209  else
1210  qmLSSFreq = simParams->qmLSSFreq;
1211 
1212  #ifdef DEBUG_QM
1213  int resSize = -1;
1214  #endif
1215 
1216  std::map<Real, int> grpNumLSSRes;
1217  std::map<Real, int>::iterator itGrpNumRes;
1218 
1219  for( auto it = lssGrpRes.begin(); it != lssGrpRes.end();it++ ) {
1220 
1221  if (it->atmIDs.size() != it->size) {
1222  iout << iERROR << "The number of atoms loaded for residue "
1223  << it->resID << " does not match the expected for this residue type.\n"
1224  << endi;
1225  NAMD_die("Error parsing data for LSS.");
1226  }
1227 
1228  qmLSSTotalNumAtms += it->size;
1229 
1230  #ifdef DEBUG_QM
1231  if (resSize < 0) resSize = it->size ;
1232  if (resSize > 0 and resSize != it->size) {
1233  iout << iERROR << "The number of atoms loaded for residue "
1234  << it->resID << " does not match previously loaded residues.\n"
1235  << endi;
1236  NAMD_die("Error parsing data for LSS.");
1237  }
1238 
1239 // DebugM(3,"Residue " << it->resID << ": " << it->segName
1240 // << " - from " << it->begAtmID << " with size "
1241 // << it->size << " (QM ID: " << it->qmGrpID
1242 // << ") has " << it->atmIDs.size() << " atoms: \n" ) ;
1243 // for (int i=0; i<it->atmIDs.size(); i++)
1244 // DebugM(3, it->atmIDs[i] << "\n" );
1245  #endif
1246 
1247  // Calculating total number of atoms per group
1248  itGrpSize = grpLSSSize.find(it->qmGrpID) ;
1249  if (itGrpSize != grpLSSSize.end())
1250  itGrpSize->second += it->size;
1251  else
1252  grpLSSSize.insert(std::pair<Real,int>(it->qmGrpID, it->size));
1253 
1254  // Calculating total number of solvent residues per group
1255  itGrpNumRes = grpNumLSSRes.find(it->qmGrpID) ;
1256  if (itGrpNumRes != grpNumLSSRes.end())
1257  itGrpNumRes->second += 1;
1258  else
1259  grpNumLSSRes.insert(std::pair<Real,int>(it->qmGrpID, 1));
1260  }
1261 
1262  qmLSSResidueSize = lssGrpRes.begin()->size ;
1263 
1264  qmLSSSize = new int[qmNumGrps];
1265 
1266  qmLSSIdxs = new int[qmLSSTotalNumAtms];
1267  int lssAtmIndx = 0;
1268 
1269  switch (simParams->qmLSSMode) {
1270 
1271  case QMLSSMODECOM:
1272  {
1273 
1274  qmLSSRefSize = new int[qmNumGrps];
1275 
1276  qmLSSMass = new Mass[qmLSSTotalNumAtms];
1277 
1278  qmLSSRefIDs = new int[totalNumRefAtms];
1279  qmLSSRefMass = new Mass[totalNumRefAtms];
1280  int lssRefIndx = 0;
1281 
1282  for (int grpIndx=0; grpIndx<qmNumGrps; grpIndx++) {
1283 
1284  itGrpSize = grpNumLSSRes.find(qmGrpID[grpIndx]) ;
1285 
1286  if (itGrpSize != grpNumLSSRes.end())
1287  qmLSSSize[grpIndx] = itGrpSize->second;
1288  else
1289  qmLSSSize[grpIndx] = 0;
1290 
1291  for( auto it = lssGrpRes.begin(); it != lssGrpRes.end();it++ ) {
1292 
1293  if (it->qmGrpID == qmGrpID[grpIndx]) {
1294  for (int i=0; i<it->atmIDs.size(); i++) {
1295  qmLSSIdxs[lssAtmIndx] = it->atmIDs[i];
1296  qmLSSMass[lssAtmIndx] = atoms[it->atmIDs[i]].mass;
1297  lssAtmIndx++;
1298  }
1299  }
1300  }
1301 
1302  DebugM(4, "QM group " << qmGrpID[grpIndx]
1303  << " has " << qmLSSSize[grpIndx] << " solvent molecules, "
1304  << "totalling " << grpLSSSize[qmGrpID[grpIndx]]
1305  << " atoms (check " << lssAtmIndx << ").\n" );
1306 
1307  qmLSSRefSize[grpIndx] = lssGrpRefIDs[qmGrpID[grpIndx]].size();
1308  for(int i=0; i < qmLSSRefSize[grpIndx]; i++) {
1309  qmLSSRefIDs[lssRefIndx] = lssGrpRefIDs[qmGrpID[grpIndx]][i];
1310  qmLSSRefMass[lssRefIndx] = atoms[qmLSSRefIDs[lssRefIndx]].mass;
1311  lssRefIndx++;
1312  }
1313 
1314  DebugM(4, "QM group " << qmGrpID[grpIndx]
1315  << " has " << qmLSSRefSize[grpIndx] << " non-solvent atoms for LSS.\n" );
1316  }
1317 
1318  } break ;
1319 
1320  case QMLSSMODEDIST:
1321  {
1322  for (int grpIndx=0; grpIndx<qmNumGrps; grpIndx++) {
1323 
1324  itGrpSize = grpNumLSSRes.find(qmGrpID[grpIndx]) ;
1325 
1326  if (itGrpSize != grpNumLSSRes.end())
1327  qmLSSSize[grpIndx] = itGrpSize->second;
1328  else
1329  qmLSSSize[grpIndx] = 0;
1330 
1331  for( auto it = lssGrpRes.begin(); it != lssGrpRes.end();it++ ) {
1332 
1333  if (it->qmGrpID == qmGrpID[grpIndx]) {
1334  for (int i=0; i<it->atmIDs.size(); i++) {
1335  qmLSSIdxs[lssAtmIndx] = it->atmIDs[i];
1336  lssAtmIndx++;
1337  }
1338  }
1339  }
1340 
1341  DebugM(4, "QM group " << qmGrpID[grpIndx]
1342  << " has " << qmLSSSize[grpIndx] << " solvent molecules, "
1343  << "totalling " << grpLSSSize[qmGrpID[grpIndx]]
1344  << " atoms (check " << lssAtmIndx << ").\n" );
1345  }
1346 
1347  } break ;
1348 
1349  }
1350  }
1351 
1352 
1355 
1356 
1357  PDB *customPCPDB;
1358 
1359  // In case we have a custom and fixed set of point charges for each QM group,
1360  // we process the files containing information.
1361  current = NULL;
1362  if (simParams->qmCustomPCSel) {
1363  current = cfgList->find("QMCustomPCFile");
1364  }
1365 
1366  std::map<Real,std::vector<int> > qmPCVecMap ;
1367 
1368  int numParsedPBDs = 0;
1369  for ( ; current != NULL; current = current->next ) {
1370 
1371  iout << iINFO << "Parsing QM Custom PC file " << current->data << "\n" << endi;
1372  customPCPDB = new PDB(current->data);
1373 
1374  if (customPCPDB->num_atoms() != numAtoms)
1375  NAMD_die("Number of atoms in QM Custom PC PDB file doesn't match coordinate PDB");
1376 
1377  std::vector< int > currPCSel ;
1378  Real currQMID = 0 ;
1379  int currGrpSize = 0 ;
1380 
1381  for (int atmInd = 0 ; atmInd < numAtoms; atmInd++) {
1382 
1383  BigReal beta = customPCPDB->atom(atmInd)->temperaturefactor() ;
1384  BigReal occ = customPCPDB->atom(atmInd)->occupancy() ;
1385 
1386  if ( beta != 0 && occ != 0)
1387  NAMD_die("An atom cannot be marked as QM and poitn charge simultaneously!");
1388 
1389  // If this is not a QM atom and
1390  if (occ != 0) {
1391  currPCSel.push_back(atmInd) ;
1392  }
1393 
1394  if (beta != 0) {
1395  if (pdbP->atom(atmInd)->temperaturefactor() != beta)
1396  NAMD_die("QM Group selection is different in reference PDB and Custom-PC PDB!");
1397 
1398  if (currQMID == 0) {
1399  // If this is the first QM atom we find, keep the QM Group ID.
1400  currQMID = beta;
1401  }
1402  else {
1403  // For all other atoms, check if it is the same group. It must be!!
1404  if (currQMID != beta)
1405  NAMD_die("Found two different QM group IDs in this file!");
1406  }
1407 
1408  currGrpSize++;
1409  }
1410 
1411  }
1412 
1413  if (currGrpSize != qmGrpSizeVec[ qmGrpIDMap[currQMID] ])
1414  NAMD_die("Reference PDB and Custom-PC PDB have different QM group sizes!") ;
1415 
1416  qmPCVecMap.insert(std::pair<Real,std::vector<int> >(
1417  currQMID, currPCSel ));
1418 
1419  numParsedPBDs++;
1420  delete customPCPDB;
1421  }
1422 
1423  delete pdbP;
1424 
1425  if (numParsedPBDs != qmNumGrps && simParams->qmCustomPCSel) {
1426  iout << iWARN << "The number of files provided for custom point "
1427  "charges is not equal to the number of QM groups!\n" << endi;
1428  }
1429 
1430  // Initializes an array with the number of Custom Point Charges per
1431  // QM group.
1432  qmCustPCSizes = new int[qmNumGrps];
1433  for (int i=0; i<qmNumGrps; i++)
1434  qmCustPCSizes[i] = 0;
1435 
1436  qmTotCustPCs = 0;
1437 
1438  // Stores the size of each Custom PC vector in the array.
1439  // We may not have PCs for all QM groups.
1440  for (auto it = qmPCVecMap.begin(); it != qmPCVecMap.end(); it++) {
1441  qmTotCustPCs += (*it).second.size();
1442  int qmIndx = qmGrpIDMap[(*it).first];
1443  qmCustPCSizes[qmIndx] = (*it).second.size();
1444  }
1445 
1446  qmCustomPCIdxs = new int[qmTotCustPCs];
1447 
1448  if (simParams->qmCustomPCSel) {
1449 
1450  int auxIter = 0;
1451  for (int grpIndx=0; grpIndx<qmNumGrps; grpIndx++) {
1452 
1453  Real currQMID = qmGrpID[grpIndx];
1454 
1455  iout << iINFO << "Loading " << qmPCVecMap[currQMID].size()
1456  << " custom point charges to QM Group " << grpIndx
1457  << " (ID: " << currQMID << ")\n" << endi;
1458 
1459  for (int pcIndx=0; pcIndx<qmPCVecMap[currQMID].size(); pcIndx++) {
1460  qmCustomPCIdxs[auxIter] = qmPCVecMap[currQMID][pcIndx] ;
1461  auxIter++;
1462  }
1463  }
1464  }
1465 
1466  // Conditional SMD option
1467  qmcSMD = simParams->qmCSMD;
1468  if (qmcSMD) {
1469  read_qm_csdm_file(qmGrpIDMap);
1470  }
1471 
1474 
1475  if (simParams->qmElecEmbed) {
1476  // Modifies Atom charges for Electrostatic Embedding.
1477  // QM atoms cannot have charges in the standard location, to keep
1478  // NAMD from calculating electrostatic interactions between QM and MM atoms.
1479  // We handle electrostatics ourselves in ComputeQM.C and in special
1480  // modifications for PME.
1481  for (int i=0; i<qmNumQMAtoms; i++) {
1482  qmAtmChrg[i] = atoms[qmAtmIndx[i]].charge;
1483  atoms[qmAtmIndx[i]].charge = 0;
1484  }
1485  }
1486 
1487 
1488  if ( simParams->extraBondsOn) {
1489  // Lifted from Molecule::build_extra_bonds
1490 
1491  StringList *file = cfgList->find("extraBondsFile");
1492 
1493  char err_msg[512];
1494  int a1,a2; float k, ref;
1495 
1496  for ( ; file; file = file->next ) { // loop over files
1497  FILE *f = fopen(file->data,"r");
1498 // if ( ! f ) {
1499 // sprintf(err_msg, "UNABLE TO OPEN EXTRA BONDS FILE %s", file->data);
1500 // NAMD_err(err_msg);
1501 // } else {
1502 // iout << iINFO << "READING EXTRA BONDS FILE " << file->data <<"\n"<<endi;
1503 // }
1504 
1505  while ( 1 ) {
1506  char buffer[512];
1507  int ret_code;
1508  do {
1509  ret_code = NAMD_read_line(f, buffer);
1510  } while ( (ret_code==0) && (NAMD_blank_string(buffer)) );
1511  if (ret_code!=0) break;
1512 
1513  char type[512];
1514  sscanf(buffer,"%s",type);
1515 
1516  int badline = 0;
1517  if ( ! strncasecmp(type,"bond",4) ) {
1518  if ( sscanf(buffer, "%s %d %d %f %f %s",
1519  type, &a1, &a2, &k, &ref, err_msg) != 5 ) badline = 1;
1520 
1521  // If an extra bond is defined between QM atoms, we make
1522  // note so that it wont be deleted when we delete bonded
1523  // interactions between QM atoms.
1524  if( qmAtomGroup[a1] > 0 && qmAtomGroup[a2]) {
1525  Bond tmp;
1526  tmp.bond_type = 0;
1527  tmp.atom1 = a1; tmp.atom2 = a2;
1528  qmExtraBonds.add(tmp);
1529  }
1530 
1531 
1532  }else if ( ! strncasecmp(type,"#",1) ) {
1533  continue; // comment
1534  }
1535 
1536  }
1537  fclose(f);
1538  }
1539  }
1540 
1541  return;
1542 
1543 #endif // MEM_OPT_VERSION
1544 }
char qmLSSResname[5]
int get_residue_size(const char *segid, int resid) const
Definition: Molecule.C:144
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:81
Type * getNewArray(int n)
Definition: ObjectArena.h:49
std::map< Real, refSelStrVec > refSelStrMap
Definition: MoleculeQM.C:106
#define QMLSSMODECOM
Definition: Molecule.h:127
Definition: PDB.h:36
int numBonds
Definition: Molecule.h:560
#define QMSCHEMEZ2
Definition: Molecule.h:140
int NAMD_read_line(FILE *fd, char *buf, int bufsize)
Definition: strlib.C:38
void assign_vdw_index(const char *, Atom *)
Definition: Parameters.C:3470
std::vector< int > atmIDs
Definition: MoleculeQM.C:50
short int32
Definition: dumpdcd.c:24
#define QMSCHEMERCD
Definition: Molecule.h:138
BigReal temperaturefactor(void)
Definition: PDBData.C:450
float Real
Definition: common.h:109
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
std::ostream & iWARN(std::ostream &s)
Definition: InfoStream.C:82
int numRealBonds
Definition: Molecule.h:559
#define QMFormatMOPAC
Definition: Molecule.h:130
#define iout
Definition: InfoStream.h:51
int num_atoms(void)
Definition: PDB.C:323
#define QMFormatORCA
Definition: Molecule.h:129
int insert(const Elem &elem)
#define QMSCHEMEZ3
Definition: Molecule.h:141
int32 atom1
Definition: structures.h:48
#define QMSCHEMEZ1
Definition: Molecule.h:139
#define QMSCHEMECS
Definition: Molecule.h:137
const char * residuename(void)
Definition: PDBData.C:399
PDBAtom * atom(int place)
Definition: PDB.C:394
int NAMD_blank_string(char *str)
Definition: strlib.C:222
iterator end(void)
Definition: ResizeArray.h:37
int Bool
Definition: common.h:133
int residueseq(void)
Definition: PDBData.C:411
std::pair< Real, refSelStrVec > refSelStrPair
Definition: MoleculeQM.C:107
int lookup(const char *segid, int resid, int *begin, int *end) const
Definition: Molecule.C:76
int numAtoms
Definition: Molecule.h:557
void NAMD_die(const char *err_msg)
Definition: common.C:85
std::vector< std::string > split(const std::string &text, std::string delimiter)
Definition: MoleculeQM.C:73
Bool qmMOPACAddConfigChrg
std::vector< refSelStr > refSelStrVec
Definition: MoleculeQM.C:105
StringList * next
Definition: ConfigList.h:49
char * data
Definition: ConfigList.h:48
StringList * find(const char *name) const
Definition: ConfigList.C:341
Elem * find(const Elem &elem)
float Mass
Definition: ComputeGBIS.inl:20
k< npairi;++k){TABENERGY(const int numtypes=simParams->tableNumTypes;const float table_spacing=simParams->tableSpacing;const int npertype=(int)(namdnearbyint(simParams->tableMaxDist/simParams->tableSpacing)+1);) int table_i=(r2iilist[2 *k] >> 14)+r2_delta_expc;const int j=pairlisti[k];#define p_j BigReal diffa=r2list[k]-r2_table[table_i];#define table_four_i TABENERGY(register const int tabtype=-1-(lj_pars->A< 0?lj_pars->A:0);) BigReal kqq=kq_i *p_j-> charge
BigReal occupancy(void)
Definition: PDBData.C:444
int size(void) const
Definition: ResizeArray.h:127
std::ostream & iERROR(std::ostream &s)
Definition: InfoStream.C:83
#define QMLSSMODEDIST
Definition: Molecule.h:126
Index bond_type
Definition: structures.h:50
const char * element(void)
Definition: PDBData.C:470
int32 atom2
Definition: structures.h:49
double BigReal
Definition: common.h:114
char qmColumn[16]
const char * segmentname(void)
Definition: PDBData.C:464
iterator begin(void)
Definition: ResizeArray.h:36
void Molecule::print_atoms ( Parameters params)

Definition at line 5337 of file Molecule.C.

References DebugM, endi(), and Parameters::get_vdw_params().

Referenced by NamdState::loadStructure().

5338 {
5339 #ifdef MEM_OPT_VERSION
5340  DebugM(2, "WARNING: this function is not availabe in memory optimized version!\n" << endi);
5341 #else
5342  register int i;
5343  Real sigma;
5344  Real epsilon;
5345  Real sigma14;
5346  Real epsilon14;
5347 
5348  DebugM(2,"ATOM LIST\n" \
5349  << "******************************************\n" \
5350  << "NUM NAME TYPE RES MASS CHARGE CHARGE FEP-CHARGE" \
5351  << "SIGMA EPSILON SIGMA14 EPSILON14\n" \
5352  << endi);
5353 
5354  for (i=0; i<numAtoms; i++)
5355  {
5356  params->get_vdw_params(&sigma, &epsilon, &sigma14, &epsilon14,
5357  atoms[i].vdw_type);
5358 
5359  DebugM(2,i+1 << " " << atomNames[i].atomname \
5360  << " " << atomNames[i].atomtype << " " \
5361  << atomNames[i].resname << " " << atoms[i].mass \
5362  << " " << atoms[i].charge << " " << sigma \
5363  << " " << epsilon << " " << sigma14 \
5364  << " " << epsilon14 << "\n" \
5365  << endi);
5366  }
5367 #endif
5368 }
float Real
Definition: common.h:109
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
int numAtoms
Definition: Molecule.h:557
k< npairi;++k){TABENERGY(const int numtypes=simParams->tableNumTypes;const float table_spacing=simParams->tableSpacing;const int npertype=(int)(namdnearbyint(simParams->tableMaxDist/simParams->tableSpacing)+1);) int table_i=(r2iilist[2 *k] >> 14)+r2_delta_expc;const int j=pairlisti[k];#define p_j BigReal diffa=r2list[k]-r2_table[table_i];#define table_four_i TABENERGY(register const int tabtype=-1-(lj_pars->A< 0?lj_pars->A:0);) BigReal kqq=kq_i *p_j-> charge
void get_vdw_params(Real *sigma, Real *epsilon, Real *sigma14, Real *epsilon14, Index index)
Definition: Parameters.h:501
void Molecule::print_bonds ( Parameters params)

Definition at line 5380 of file Molecule.C.

References DebugM, endi(), and Parameters::get_bond_params().

Referenced by NamdState::loadStructure().

5381 {
5382 #ifdef MEM_OPT_VERSION
5383  DebugM(2, "WARNING: this function is not availabe in memory optimized version!\n" << endi);
5384 #else
5385  register int i;
5386  Real k;
5387  Real x0;
5388 
5389  DebugM(2,"BOND LIST\n" << "********************************\n" \
5390  << "ATOM1 ATOM2 TYPE1 TYPE2 k x0" \
5391  << endi);
5392 
5393  for (i=0; i<numBonds; i++)
5394  {
5395  params->get_bond_params(&k, &x0, bonds[i].bond_type);
5396 
5397  DebugM(2,bonds[i].atom1+1 << " " \
5398  << bonds[i].atom2+1 << " " \
5399  << atomNames[bonds[i].atom1].atomtype << " " \
5400  << atomNames[bonds[i].atom2].atomtype << " " << k \
5401  << " " << x0 << endi);
5402  }
5403 
5404 #endif
5405 }
int numBonds
Definition: Molecule.h:560
float Real
Definition: common.h:109
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
void get_bond_params(Real *k, Real *x0, Index index)
Definition: Parameters.h:450
void Molecule::print_exclusions ( )

Definition at line 5417 of file Molecule.C.

References DebugM, and endi().

Referenced by NamdState::loadStructure().

5418 {
5419 #ifdef MEM_OPT_VERSION
5420  DebugM(2, "WARNING: this function is not availabe in memory optimized version!\n" << endi);
5421 #else
5422  register int i;
5423 
5424  DebugM(2,"EXPLICIT EXCLUSION LIST\n" \
5425  << "********************************\n" \
5426  << "ATOM1 ATOM2 " \
5427  << endi);
5428 
5429  for (i=0; i<numExclusions; i++)
5430  {
5431  DebugM(2,exclusions[i].atom1+1 << " " \
5432  << exclusions[i].atom2+1 << endi);
5433  }
5434 #endif
5435 }
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
int numExclusions
Definition: Molecule.h:571
void Molecule::print_go_params ( )

Definition at line 548 of file GoMolecule.C.

References DebugM, go_array, MAX_GO_CHAINS, and NumGoChains.

549 {
550  int i;
551  int j;
552  int index;
553 
554  DebugM(3,NumGoChains << " Go PARAMETERS 3\n" \
555  << "*****************************************" << std::endl);
556 
557  for (i=0; i<NumGoChains; i++) {
558  for (j=0; j<NumGoChains; j++) {
559  index = (i * MAX_GO_CHAINS) + j;
560  // Real epsilon; // Epsilon
561  // Real exp_a; // First exponent for attractive L-J term
562  // Real exp_b; // Second exponent for attractive L-J term
563  // Real sigmaRep; // Sigma for repulsive term
564  // Real epsilonRep; // Epsilon for replusive term
565  DebugM(3,"Go index=(" << i << "," << j << ") epsilon=" << go_array[index].epsilon \
566  << " exp_a=" << go_array[index].exp_a << " exp_b=" << go_array[index].exp_b \
567  << " exp_rep=" << go_array[index].exp_rep << " sigmaRep=" \
568  << go_array[index].sigmaRep << " epsilonRep=" << go_array[index].epsilonRep \
569  << " cutoff=" << go_array[index].cutoff << std::endl);
570  }
571  }
572 
573 }
#define DebugM(x, y)
Definition: Debug.h:59
#define MAX_GO_CHAINS
Definition: Molecule.h:37
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
int NumGoChains
Definition: Molecule.h:1590
void Molecule::print_go_sigmas ( )

Definition at line 1134 of file GoMolecule.C.

References DebugM, goSigmaIndices, goSigmas, numAtoms, and numGoAtoms.

1135 {
1136  int i; // Counter
1137  int j; // Counter
1138  Real sigma;
1139 
1140  DebugM(3,"GO SIGMA ARRAY\n" \
1141  << "***************************" << std::endl);
1142  DebugM(3, "numGoAtoms: " << numGoAtoms << std::endl);
1143 
1144  if (goSigmaIndices == NULL) {
1145  DebugM(3, "GO SIGMAS HAVE NOT BEEN BUILT" << std::endl);
1146  return;
1147  }
1148 
1149  for (i=0; i<numAtoms; i++) {
1150  for (j=0; j<numAtoms; j++) {
1151  if ( goSigmaIndices[i] != -1 && goSigmaIndices[j] != -1 ) {
1152  //DebugM(3, "i: " << i << ", j: " << j << std::endl);
1154  if (sigma > 0.0) {
1155  DebugM(3, "(" << i << "," << j << ") - +" << sigma << " ");
1156  }
1157  else {
1158  DebugM(3, "(" << i << "," << j << ") - " << sigma << " ");
1159  }
1160  } else {
1161  //DebugM(3, "0 ");
1162  }
1163  }
1164  if ( goSigmaIndices[i] != -1 ) {
1165  DebugM(3, "-----------" << std::endl);
1166  }
1167  }
1168  return;
1169 }
float Real
Definition: common.h:109
#define DebugM(x, y)
Definition: Debug.h:59
Real * goSigmas
Definition: Molecule.h:647
int numAtoms
Definition: Molecule.h:557
int32 * goSigmaIndices
Definition: Molecule.h:645
int numGoAtoms
Definition: Molecule.h:643
void Molecule::put_stir_startTheta ( Real  theta,
int  atomnum 
) const
inline

Definition at line 1312 of file Molecule.h.

1313  {
1314  stirParams[stirIndexes[atomnum]].startTheta = theta;
1315  }
void Molecule::read_alch_unpert_angles ( FILE *  fd)

Definition at line 1783 of file Molecule.C.

References NAMD_die(), and NAMD_read_int().

1783  {
1784  int atom_nums[3]; // Atom numbers for the three atoms
1785  register int j; // Loop counter
1786  int num_read=0; // Number of angles read so far
1787 
1789 
1790  if (alch_unpert_angles == NULL) {
1791  NAMD_die("memory allocation failed in Molecule::read_alch_unpert_angles");
1792  }
1793 
1794  while (num_read < num_alch_unpert_Angles) {
1795  for (j=0; j<3; j++) {
1796  atom_nums[j]=NAMD_read_int(fd, "ANGLES")-1;
1797 
1798  if (atom_nums[j] >= numAtoms) {
1799  char err_msg[128];
1800  sprintf(err_msg, "ANGLES INDEX %d GREATER THAN NATOM %d IN ANGLES # %d IN ALCH UNPERT PSF FILE", atom_nums[j]+1, numAtoms, num_read+1);
1801  NAMD_die(err_msg);
1802  }
1803  }
1804 
1805  alch_unpert_angles[num_read].atom1=atom_nums[0];
1806  alch_unpert_angles[num_read].atom2=atom_nums[1];
1807  alch_unpert_angles[num_read].atom3=atom_nums[2];
1808 
1809  ++num_read;
1810  }
1811  return;
1812 }
Angle * alch_unpert_angles
Definition: Molecule.h:577
int num_alch_unpert_Angles
Definition: Molecule.h:574
int32 atom2
Definition: structures.h:56
int32 atom1
Definition: structures.h:55
int32 atom3
Definition: structures.h:57
int numAtoms
Definition: Molecule.h:557
void NAMD_die(const char *err_msg)
Definition: common.C:85
int NAMD_read_int(FILE *fd, const char *msg)
Definition: strlib.C:302
void Molecule::read_alch_unpert_bonds ( FILE *  fd)

Definition at line 1660 of file Molecule.C.

References bond::atom1, bond::atom2, NAMD_die(), and NAMD_read_int().

1660  {
1661  int atom_nums[2]; // Atom indexes for the bonded atoms
1662  register int j; // Loop counter
1663  int num_read=0; // Number of bonds read so far
1664 
1666 
1667  if (alch_unpert_bonds == NULL) {
1668  NAMD_die("memory allocations failed in Molecule::read_alch_unpert_bonds");
1669  }
1670 
1671  while (num_read < num_alch_unpert_Bonds) {
1672  for (j=0; j<2; j++) {
1673  atom_nums[j]=NAMD_read_int(fd, "BONDS")-1;
1674 
1675  if (atom_nums[j] >= numAtoms) {
1676  char err_msg[128];
1677 
1678  sprintf(err_msg, "BOND INDEX %d GREATER THAN NATOM %d IN BOND # %d IN ALCH PSF FILE", atom_nums[j]+1, numAtoms, num_read+1);
1679  NAMD_die(err_msg);
1680  }
1681  }
1682 
1683  Bond *b = &(alch_unpert_bonds[num_read]);
1684  b->atom1=atom_nums[0];
1685  b->atom2=atom_nums[1];
1686 
1687  ++num_read;
1688  }
1689  return;
1690 }
int num_alch_unpert_Bonds
Definition: Molecule.h:573
int32 atom1
Definition: structures.h:48
Bond * alch_unpert_bonds
Definition: Molecule.h:576
int numAtoms
Definition: Molecule.h:557
void NAMD_die(const char *err_msg)
Definition: common.C:85
int NAMD_read_int(FILE *fd, const char *msg)
Definition: strlib.C:302
int32 atom2
Definition: structures.h:49
void Molecule::read_alch_unpert_dihedrals ( FILE *  fd)

Definition at line 1931 of file Molecule.C.

References NAMD_die(), and NAMD_read_int().

1931  {
1932  int atom_nums[4]; // The 4 atom indexes
1933  int num_read=0; // number of dihedrals read so far
1934  register int j; // loop counter
1935 
1937 
1938  if (alch_unpert_dihedrals == NULL) {
1939  NAMD_die("memory allocation failed in Molecule::read_alch_unpert_dihedrals");
1940  }
1941 
1942  while (num_read < num_alch_unpert_Dihedrals) {
1943  for (j=0; j<4; j++) {
1944  atom_nums[j]=NAMD_read_int(fd, "DIHEDRALS")-1;
1945 
1946  if (atom_nums[j] >= numAtoms) {
1947  char err_msg[128];
1948 
1949  sprintf(err_msg, "DIHEDRALS INDEX %d GREATER THAN NATOM %d IN DIHEDRALS # %d IN ALCH UNPERT PSF FILE", atom_nums[j]+1, numAtoms, num_read+1);
1950  NAMD_die(err_msg);
1951  }
1952  }
1953 
1954  alch_unpert_dihedrals[num_read].atom1=atom_nums[0];
1955  alch_unpert_dihedrals[num_read].atom2=atom_nums[1];
1956  alch_unpert_dihedrals[num_read].atom3=atom_nums[2];
1957  alch_unpert_dihedrals[num_read].atom4=atom_nums[3];
1958 
1959  num_read++;
1960  }
1961  return;
1962 }
int num_alch_unpert_Dihedrals
Definition: Molecule.h:575
int32 atom3
Definition: structures.h:65
Dihedral * alch_unpert_dihedrals
Definition: Molecule.h:578
int32 atom4
Definition: structures.h:66
int numAtoms
Definition: Molecule.h:557
void NAMD_die(const char *err_msg)
Definition: common.C:85
int32 atom2
Definition: structures.h:64
int NAMD_read_int(FILE *fd, const char *msg)
Definition: strlib.C:302
int32 atom1
Definition: structures.h:63
void Molecule::read_go_file ( char *  fname)

Definition at line 113 of file GoMolecule.C.

References go_val::cutoff, DebugM, endi(), go_val::epsilon, go_val::epsilonRep, go_val::exp_a, go_val::exp_b, go_val::exp_rep, FALSE, go_array, go_indices, iout, iWARN(), MAX_GO_CHAINS, MAX_RESTRICTIONS, NAMD_blank_string(), NAMD_die(), NAMD_find_first_word(), NAMD_read_line(), NumGoChains, go_val::restrictions, go_val::sigmaRep, and TRUE.

Referenced by build_go_params().

115 {
116 
117  int i; // Counter
118  int j; // Counter
119  int par_type=0; // What type of parameter are we currently
120  // dealing with? (vide infra)
121  // JLai -- uncommented
122  int skipline; // skip this line?
123  int skipall = 0; // skip rest of file;
124  char buffer[512]; // Buffer to store each line of the file
125  char first_word[512]; // First word of the current line
126  int read_count = 0; // Count of input parameters on a given line
127  int chain1 = 0; // First chain type for pair interaction
128  int chain2 = 0; // Second chain type for pair interaction
129  int int1; // First parameter int
130  int int2; // Second parameter int
131  Real r1; // Parameter Real
132  char in2[512]; // Second parameter word
133  GoValue *goValue1 = NULL; // current GoValue for loading parameters
134  GoValue *goValue2 = NULL; // other current GoValue for loading parameters
135  Bool sameGoChain = FALSE; // whether the current GoValue is within a chain or between chains
136  int restrictionCount = 0; // number of Go restrictions set for a given chain pair
137  FILE *pfile; // File descriptor for the parameter file
138 
139  /* Check to make sure that we haven't previously been told */
140  /* that all the files were read */
141  /*if (AllFilesRead)
142  {
143  NAMD_die("Tried to read another parameter file after being told that all files were read!");
144  }*/
145 
146  /* Initialize go_indices */
147  for (i=0; i<MAX_GO_CHAINS+1; i++) {
148  go_indices[i] = -1;
149  }
150 
151  /* Initialize go_array */
152  for (i=0; i<MAX_GO_CHAINS*MAX_GO_CHAINS; i++) {
153  go_array[i].epsilon = 1.25;
154  go_array[i].exp_a = 12;
155  go_array[i].exp_b = 6;
156  go_array[i].exp_rep = 12;
157  go_array[i].sigmaRep = 2.25;
158  go_array[i].epsilonRep = 0.03;
159  go_array[i].cutoff = 4.0;
160  for (j=0; j<MAX_RESTRICTIONS; j++) {
161  go_array[i].restrictions[j] = -1;
162  }
163  }
164 
165  /* Try and open the file */
166  if ( (pfile = fopen(fname, "r")) == NULL)
167  {
168  char err_msg[256];
169 
170  sprintf(err_msg, "UNABLE TO OPEN GO PARAMETER FILE %s\n", fname);
171  NAMD_die(err_msg);
172  }
173 
174  /* Keep reading in lines until we hit the EOF */
175  while (NAMD_read_line(pfile, buffer) != -1)
176  {
177  /* Get the first word of the line */
178  NAMD_find_first_word(buffer, first_word);
179  skipline=0;
180 
181  /* First, screen out things that we ignore. */
182  /* blank lines, lines that start with '!' or '*', lines that */
183  /* start with "END". */
184  if (!NAMD_blank_string(buffer) &&
185  (strncmp(first_word, "!", 1) != 0) &&
186  (strncmp(first_word, "*", 1) != 0) &&
187  (strncasecmp(first_word, "END", 3) != 0))
188  {
189  if ( skipall ) {
190  iout << iWARN << "SKIPPING PART OF GO PARAMETER FILE AFTER RETURN STATEMENT\n" << endi;
191  break;
192  }
193  /* Now, determine the apropriate parameter type. */
194  if (strncasecmp(first_word, "chaintypes", 10)==0)
195  {
196  read_count=sscanf(buffer, "%s %d %d\n", first_word, &int1, &int2);
197  if (read_count != 3) {
198  char err_msg[512];
199  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);
200  NAMD_die(err_msg);
201  }
202  chain1 = int1;
203  chain2 = int2;
204  if (chain1 < 1 || chain1 > MAX_GO_CHAINS ||
205  chain2 < 1 || chain2 > MAX_GO_CHAINS) {
206  char err_msg[512];
207  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);
208  NAMD_die(err_msg);
209  }
210  if (go_indices[chain1] == -1) {
211  go_indices[chain1] = NumGoChains;
212  NumGoChains++;
213  }
214  if (go_indices[chain2] == -1) {
215  go_indices[chain2] = NumGoChains;
216  NumGoChains++;
217  }
218  if (chain1 == chain2) {
219  sameGoChain = TRUE;
220  } else {
221  sameGoChain = FALSE;
222  }
223  //goValue = &go_array[(chain1 * MAX_GO_CHAINS) + chain2];
224  goValue1 = &go_array[(chain1*MAX_GO_CHAINS) + chain2];
225  goValue2 = &go_array[(chain2*MAX_GO_CHAINS) + chain1];
226 #if CODE_REDUNDANT
227  goValue1 = &go_array[(go_indices[chain1]*MAX_GO_CHAINS) + go_indices[chain2]];
228  goValue2 = &go_array[(go_indices[chain2]*MAX_GO_CHAINS) + go_indices[chain1]];
229 #endif
230  restrictionCount = 0; // restrictionCount applies to each chain pair separately
231  }
232  else if (strncasecmp(first_word, "epsilonRep", 10)==0)
233  {
234  read_count=sscanf(buffer, "%s %f\n", first_word, &r1);
235  if (read_count != 2) {}
236  goValue1->epsilonRep = r1;
237  if (!sameGoChain) {
238  goValue2->epsilonRep = r1;
239  }
240  }
241  else if (strncasecmp(first_word, "epsilon", 7)==0)
242  {
243  // Read in epsilon
244  read_count=sscanf(buffer, "%s %f\n", first_word, &r1);
245  if (read_count != 2) {}
246  goValue1->epsilon = r1;
247  if (!sameGoChain) {
248  goValue2->epsilon = r1;
249  }
250  }
251  else if (strncasecmp(first_word, "exp_a", 5)==0)
252  {
253  read_count=sscanf(buffer, "%s %d\n", first_word, &int1);
254  if (read_count != 2) {}
255  goValue1->exp_a = int1;
256  if (!sameGoChain) {
257  goValue2->exp_a = int1;
258  }
259  }
260  else if (strncasecmp(first_word, "exp_b", 5)==0)
261  {
262  read_count=sscanf(buffer, "%s %d\n", first_word, &int1);
263  if (read_count != 2) {}
264  goValue1->exp_b = int1;
265  if (!sameGoChain) {
266  goValue2->exp_b = int1;
267  }
268  }
269  else if (strncasecmp(first_word, "exp_rep", 5)==0)
270  {
271  read_count=sscanf(buffer, "%s %d\n", first_word, &int1);
272  if (read_count != 2) {}
273  goValue1->exp_rep = int1;
274  if (!sameGoChain) {
275  goValue2->exp_rep = int1;
276  }
277  }
278  else if (strncasecmp(first_word, "exp_Rep", 5)==0)
279  {
280  read_count=sscanf(buffer, "%s %d\n", first_word, &int1);
281  if (read_count != 2) {}
282  goValue1->exp_rep = int1;
283  if (!sameGoChain) {
284  goValue2->exp_rep = int1;
285  }
286  }
287  else if (strncasecmp(first_word, "sigmaRep", 8)==0)
288  {
289  read_count=sscanf(buffer, "%s %f\n", first_word, &r1);
290  if (read_count != 2) {}
291  goValue1->sigmaRep = r1;
292  if (!sameGoChain) {
293  goValue2->sigmaRep = r1;
294  }
295  }
296  else if (strncasecmp(first_word, "cutoff", 6)==0)
297  {
298  read_count=sscanf(buffer, "%s %f\n", first_word, &r1);
299  if (read_count != 2) {}
300  goValue1->cutoff = r1;
301  if (!sameGoChain) {
302  goValue2->cutoff = r1;
303  }
304  }
305  else if (strncasecmp(first_word, "restriction", 10)==0)
306  {
307  read_count=sscanf(buffer, "%s %d\n", first_word, &int1);
308  if (read_count != 2) {}
309  if (int1 < 0) {
310  DebugM(3, "ERROR: residue restriction value must be nonnegative. int1=" << int1 << "\n");
311  }
312  if (!sameGoChain) {
313  //goValue2->restrictions[restrictionCount] = int1;
314  DebugM(3, "ERROR: residue restrictions should not be defined between two separate chains. chain1=" << chain1 << ", chain2=" << chain2 << "\n");
315  }
316  else {
317  goValue1->restrictions[restrictionCount] = int1;
318  }
319  restrictionCount++;
320  }
321  else if (strncasecmp(first_word, "return", 4)==0)
322  {
323  skipall=8;
324  skipline=1;
325  }
326  else // if (par_type == 0)
327  {
328  /* This is an unknown paramter. */
329  /* This is BAD */
330  char err_msg[512];
331 
332  sprintf(err_msg, "UNKNOWN PARAMETER IN GO PARAMETER FILE %s\nLINE=*%s*",fname, buffer);
333  NAMD_die(err_msg);
334  }
335  }
336  else
337  {
338  skipline=1;
339  }
340  }
341 
342  /* Close the file */
343  fclose(pfile);
344 
345  return;
346 }
int exp_b
Definition: Molecule.h:109
int NAMD_read_line(FILE *fd, char *buf, int bufsize)
Definition: strlib.C:38
Real epsilonRep
Definition: Molecule.h:112
#define MAX_RESTRICTIONS
Definition: Molecule.h:38
float Real
Definition: common.h:109
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
#define FALSE
Definition: common.h:118
std::ostream & iWARN(std::ostream &s)
Definition: InfoStream.C:82
#define iout
Definition: InfoStream.h:51
void NAMD_find_first_word(char *source, char *word)
Definition: strlib.C:258
#define MAX_GO_CHAINS
Definition: Molecule.h:37
int exp_a
Definition: Molecule.h:108
int NAMD_blank_string(char *str)
Definition: strlib.C:222
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
int Bool
Definition: common.h:133
Real cutoff
Definition: Molecule.h:113
Real sigmaRep
Definition: Molecule.h:111
void NAMD_die(const char *err_msg)
Definition: common.C:85
int go_indices[MAX_GO_CHAINS+1]
Definition: Molecule.h:1589
int NumGoChains
Definition: Molecule.h:1590
int restrictions[MAX_RESTRICTIONS]
Definition: Molecule.h:114
Real epsilon
Definition: Molecule.h:107
#define TRUE
Definition: common.h:119
int exp_rep
Definition: Molecule.h:110
void Molecule::read_parm ( Ambertoppar )
void Molecule::read_parm ( AmberParm7Reader::Ambertoppar )
void Molecule::receive_GoMolecule ( MIStream msg)

Definition at line 1744 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, MAX_GO_CHAINS, MAX_RESTRICTIONS, NAMD_die(), numAtoms, numGoAtoms, NumGoChains, pointerToGoBeg, pointerToGoEnd, go_val::restrictions, and go_val::sigmaRep.

1744  {
1745  // Ported by JLai -- Original by JE
1746  // JE - receive Go info
1747  Real *a1, *a2, *a3, *a4;
1748  int *i1, *i2, *i3, *i4;
1749  int maxGoChainsSqr = MAX_GO_CHAINS*MAX_GO_CHAINS; // JE JLai Go code
1750  msg->get(NumGoChains);
1751 
1752  if (NumGoChains) {
1753  //go_indices = new int[MAX_GO_CHAINS+1];
1754  //go_array = new GoValue[MAX_GO_CHAINS*MAX_GO_CHAINS];
1755 
1756  // int go_indices[MAX_GO_CHAINS+1]; // Indices from chainIDs to go_array
1757  // GoValue go_array[MAX_GO_CHAINS*MAX_GO_CHAINS]; // Array of Go params
1758  msg->get(MAX_GO_CHAINS+1,go_indices);
1759 
1760  a1 = new Real[maxGoChainsSqr];
1761  a2 = new Real[maxGoChainsSqr];
1762  a3 = new Real[maxGoChainsSqr];
1763  a4 = new Real[maxGoChainsSqr];
1764  i1 = new int[maxGoChainsSqr];
1765  i2 = new int[maxGoChainsSqr];
1766  i3 = new int[maxGoChainsSqr];
1767  i4 = new int[maxGoChainsSqr*MAX_RESTRICTIONS];
1768 
1769  if ( (a1 == NULL) || (a2 == NULL) || (a3 == NULL) || (a4 == NULL) ||
1770  (i1 == NULL) || (i2 == NULL) || (i3 == NULL) || (i4 == NULL) )
1771  {
1772  NAMD_die("memory allocation failed in Molecule::send_Molecule");
1773  }
1774 
1775  msg->get(maxGoChainsSqr, a1);
1776  msg->get(maxGoChainsSqr, a2);
1777  msg->get(maxGoChainsSqr, a3);
1778  msg->get(maxGoChainsSqr, a4);
1779  msg->get(maxGoChainsSqr, i1);
1780  msg->get(maxGoChainsSqr, i2);
1781  msg->get(maxGoChainsSqr, i3);
1782  msg->get(maxGoChainsSqr*MAX_RESTRICTIONS, i4);
1783 
1784  for (int i=0; i<maxGoChainsSqr; i++) {
1785  go_array[i].epsilon = a1[i];
1786  go_array[i].sigmaRep = a2[i];
1787  go_array[i].epsilonRep = a3[i];
1788  go_array[i].cutoff = a4[i];
1789  go_array[i].exp_a = i1[i];
1790  go_array[i].exp_b = i2[i];
1791  go_array[i].exp_rep = i3[i];
1792  for (int j=0; j<MAX_RESTRICTIONS; j++) {
1793  go_array[i].restrictions[j] = i4[i*MAX_RESTRICTIONS + j];
1794  }
1795  }
1796 
1797  delete [] a1;
1798  delete [] a2;
1799  delete [] a3;
1800  delete [] a4;
1801  delete [] i1;
1802  delete [] i2;
1803  delete [] i3;
1804  delete [] i4;
1805 
1806  //msg->get(MAX_GO_CHAINS*MAX_GO_CHAINS, (char*)go_array);
1807 
1808  /*DebugM(3,"NumGoChains:" << NumGoChains << std::endl);
1809  for (int ii=0; ii<MAX_GO_CHAINS; ii++) {
1810  for (int jj=0; jj<MAX_GO_CHAINS; jj++) {
1811  DebugM(3,"go_array[" << ii << "][" << jj << "]:" << go_array[ii][jj] << std::endl);
1812  }
1813  }
1814  for (int ii=0; ii<MAX_GO_CHAINS+1; ii++) {
1815  DebugM(3,"go_indices[" << ii << "]:" << go_indices[ii] << std::endl);
1816  }*/
1817  }
1818 
1819  if (simParams->goForcesOn) {
1820  switch(simParams->goMethod) {
1821  case 1:
1822  msg->get(numGoAtoms);
1823  //printf("Deleting goSigmaIndiciesA\n");
1824  delete [] goSigmaIndices;
1825  goSigmaIndices = new int32[numAtoms];
1826  //printf("Deleting atomChainTypesA\n");
1827  delete [] atomChainTypes;
1829  //printf("Deleting goSigmasA\n");
1830  delete [] goSigmas;
1832  //printf("Deleting goWithinCutoffA\n");
1833  delete [] goWithinCutoff;
1834  goWithinCutoff = new bool[numGoAtoms*numGoAtoms];
1835  msg->get(numAtoms, goSigmaIndices);
1836  msg->get(numGoAtoms, atomChainTypes);
1838  msg->get(numGoAtoms*numGoAtoms*sizeof(bool), (char*)goWithinCutoff);
1839  break;
1840  case 2: //GSR
1841  msg->get(numGoAtoms);
1842  delete [] pointerToGoBeg;
1843  pointerToGoBeg = new int[numAtoms];
1844  msg->get(numAtoms,pointerToGoBeg);
1845  delete [] pointerToGoEnd;
1846  pointerToGoEnd = new int[numAtoms];
1847  msg->get(numAtoms,pointerToGoEnd);
1848  delete [] goSigmaIndices;
1849  goSigmaIndices = new int32[numAtoms];
1850  msg->get(numAtoms,goSigmaIndices);
1851  delete [] goResidIndices;
1852  goResidIndices = new int32[numAtoms];
1853  msg->get(numAtoms,goResidIndices);
1854  delete [] atomChainTypes;
1856  msg->get(numGoAtoms,atomChainTypes);
1857  msg->get(goNumLJPair);
1858  delete [] goIndxLJA;
1859  goIndxLJA = new int[goNumLJPair];
1860  msg->get(goNumLJPair,goIndxLJA);
1861  delete [] goIndxLJB;
1862  goIndxLJB = new int[goNumLJPair];
1863  msg->get(goNumLJPair,goIndxLJB);
1864  delete [] goSigmaPairA;
1865  goSigmaPairA = new double[goNumLJPair];
1867  delete [] goSigmaPairB;
1868  goSigmaPairB = new double[goNumLJPair];
1869  msg->get(goNumLJPair,goSigmaPairB);
1870  break;
1871  case 3:
1872  msg->get(numGoAtoms);
1873  //printf("Deleting goSigmaIndiciesB\n");
1874  delete [] goSigmaIndices;
1875  goSigmaIndices = new int32[numAtoms];
1876  //printf("Deleting atomChainTypesB\n");
1877  delete [] atomChainTypes;
1879  //delete [] goSigmas;
1880  //goSigmas = new Real[numGoAtoms*numGoAtoms];
1881  //delete [] goWithinCutoff;
1882  //goWithinCutoff = new bool[numGoAtoms*numGoAtoms];
1883  //printf("Deleting goCoordinatesB\n");
1884  delete [] goCoordinates;
1885  goCoordinates = new Real[numGoAtoms*3];
1886  //printf("Deleting goResidsB\n");
1887  delete [] goResids;
1888  goResids = new int[numGoAtoms];
1889  msg->get(numAtoms, goSigmaIndices);
1890  msg->get(numGoAtoms, atomChainTypes);
1891  //msg->get(numGoAtoms*numGoAtoms, goSigmas);
1892  //msg->get(numGoAtoms*numGoAtoms*sizeof(bool), (char*)goWithinCutoff);
1893  msg->get(numGoAtoms*3, goCoordinates);
1894  msg->get(numGoAtoms, goResids);
1895  break;
1896  }
1897  }
1898 
1899  delete msg;
1900 
1901 }
int exp_b
Definition: Molecule.h:109
int * pointerToGoBeg
Definition: Molecule.h:658
short int32
Definition: dumpdcd.c:24
Real epsilonRep
Definition: Molecule.h:112
Real * goCoordinates
Definition: Molecule.h:649
#define MAX_RESTRICTIONS
Definition: Molecule.h:38
float Real
Definition: common.h:109
double * goSigmaPairA
Definition: Molecule.h:656
MIStream * get(char &data)
Definition: MStream.h:29
bool * goWithinCutoff
Definition: Molecule.h:648
#define MAX_GO_CHAINS
Definition: Molecule.h:37
int exp_a
Definition: Molecule.h:108
int32 * atomChainTypes
Definition: Molecule.h:644
int * pointerToGoEnd
Definition: Molecule.h:659
int * goIndxLJA
Definition: Molecule.h:654
int goNumLJPair
Definition: Molecule.h:653
int32 * goResidIndices
Definition: Molecule.h:646
GoChoices goMethod
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
int * goResids
Definition: Molecule.h:650
Real * goSigmas
Definition: Molecule.h:647
Real cutoff
Definition: Molecule.h:113
int numAtoms
Definition: Molecule.h:557
Real sigmaRep
Definition: Molecule.h:111
void NAMD_die(const char *err_msg)
Definition: common.C:85
double * goSigmaPairB
Definition: Molecule.h:657
int go_indices[MAX_GO_CHAINS+1]
Definition: Molecule.h:1589
int NumGoChains
Definition: Molecule.h:1590
int restrictions[MAX_RESTRICTIONS]
Definition: Molecule.h:114
Real epsilon
Definition: Molecule.h:107
int32 * goSigmaIndices
Definition: Molecule.h:645
int * goIndxLJB
Definition: Molecule.h:655
int exp_rep
Definition: Molecule.h:110
int numGoAtoms
Definition: Molecule.h:643
void Molecule::receive_Molecule ( MIStream msg)

Definition at line 5806 of file Molecule.C.

References SimParameters::alchOn, gromacsPair::atom1, gromacsPair::atom2, atomNamePool, atoms, atomSigPool, SimParameters::consForceOn, SimParameters::consTorqueOn, SimParameters::constraintsOn, DebugM, SimParameters::excludeFromPressure, exclusions, SimParameters::fixedAtomsOn, MIStream::get(), Parameters::get_num_vdw_params(), SimParameters::goGroPair, gromacsPair::gromacsPair_type, SimParameters::langevinOn, SimParameters::LCPOOn, SimParameters::lesOn, SimParameters::mgridforceOn, SimParameters::movDragOn, numGaussPair, numLJPair, gromacsPair::pairC12, gromacsPair::pairC6, SimParameters::pairInteractionOn, SimParameters::qmForcesOn, SimParameters::rotDragOn, SimParameters::sdScaling, SimParameters::soluteScalingOn, SimParameters::stirOn, SimParameters::tCoupleOn, and GridforceGrid::unpack_grid().

Referenced by Node::resendMolecule().

5806  {
5807  // Get the atom information
5808  msg->get(numAtoms);
5809 
5810 #ifdef MEM_OPT_VERSION
5811 //in the memory optimized version, only the atom signatures are recved
5812 //from the master Node. --Chao Mei
5813 
5814  msg->get(massPoolSize);
5815  if(atomMassPool) delete [] atomMassPool;
5816  atomMassPool = new Real[massPoolSize];
5817  msg->get(massPoolSize, atomMassPool);
5818 
5819  msg->get(chargePoolSize);
5820  if(atomChargePool) delete [] atomChargePool;
5821  atomChargePool = new Real[chargePoolSize];
5822  msg->get(chargePoolSize, atomChargePool);
5823 
5824  //get atoms' signatures
5825  msg->get(atomSigPoolSize);
5826  if(atomSigPool) delete [] atomSigPool;
5827  atomSigPool = new AtomSignature[atomSigPoolSize];
5828  for(int i=0; i<atomSigPoolSize; i++)
5829  atomSigPool[i].unpack(msg);
5830 
5831  //get exclusions' signatures
5832  msg->get(exclSigPoolSize);
5833  if(exclSigPool) delete [] exclSigPool;
5834  exclSigPool = new ExclusionSignature[exclSigPoolSize];
5835  for(int i=0; i<exclSigPoolSize; i++)
5836  exclSigPool[i].unpack(msg);
5837 
5838  msg->get(numHydrogenGroups);
5839  msg->get(maxHydrogenGroupSize);
5840  msg->get(numMigrationGroups);
5841  msg->get(maxMigrationGroupSize);
5842  msg->get(isOccupancyValid);
5843  msg->get(isBFactorValid);
5844 
5845  //get names for atoms
5846  msg->get(atomNamePoolSize);
5847  atomNamePool = new char *[atomNamePoolSize];
5848  for(int i=0; i<atomNamePoolSize;i++) {
5849  int len;
5850  msg->get(len);
5851  atomNamePool[i] = nameArena->getNewArray(len+1);
5852  msg->get(len, atomNamePool[i]);
5853  }
5854 
5855  if(simParams->fixedAtomsOn){
5856  int numFixedAtomsSet;
5857  msg->get(numFixedAtoms);
5858  msg->get(numFixedAtomsSet);
5859  fixedAtomsSet = new AtomSetList(numFixedAtomsSet);
5860  msg->get(numFixedAtomsSet*sizeof(AtomSet), (char *)(fixedAtomsSet->begin()));
5861  }
5862 
5863  if(simParams->constraintsOn){
5864  int numConstrainedAtomsSet;
5865  msg->get(numConstraints);
5866  msg->get(numConstrainedAtomsSet);
5867  constrainedAtomsSet = new AtomSetList(numConstrainedAtomsSet);
5868  msg->get(numConstrainedAtomsSet*sizeof(AtomSet), (char *)(constrainedAtomsSet->begin()));
5869  }
5870 
5871 #else
5872  delete [] atoms;
5873  atoms= new Atom[numAtoms];
5874  msg->get(numAtoms*sizeof(Atom), (char*)atoms);
5875 
5876  // Get the bond information
5877  msg->get(numRealBonds);
5878  msg->get(numBonds);
5879  if (numBonds)
5880  {
5881  delete [] bonds;
5882  bonds=new Bond[numBonds];
5883  msg->get(numBonds*sizeof(Bond), (char*)bonds);
5884  }
5885 
5886  // Get the angle information
5887  msg->get(numAngles);
5888  if (numAngles)
5889  {
5890  delete [] angles;
5891  angles=new Angle[numAngles];
5892  msg->get(numAngles*sizeof(Angle), (char*)angles);
5893  }
5894 
5895  // Get the dihedral information
5896  msg->get(numDihedrals);
5897  if (numDihedrals)
5898  {
5899  delete [] dihedrals;
5900  dihedrals=new Dihedral[numDihedrals];
5901  msg->get(numDihedrals*sizeof(Dihedral), (char*)dihedrals);
5902  }
5903 
5904  if (simParams->sdScaling) {
5905  msg->get(num_alch_unpert_Bonds);
5907  msg->get(num_alch_unpert_Bonds*sizeof(Bond), (char*)alch_unpert_bonds);
5908 
5911  msg->get(num_alch_unpert_Angles*sizeof(Angle), (char*)alch_unpert_angles);
5912 
5916  }
5917 
5918  // Get the improper information
5919  msg->get(numImpropers);
5920  if (numImpropers)
5921  {
5922  delete [] impropers;
5923  impropers=new Improper[numImpropers];
5924  msg->get(numImpropers*sizeof(Improper), (char*)impropers);
5925  }
5926 
5927  // Get the crossterm information
5928  msg->get(numCrossterms);
5929  if (numCrossterms)
5930  {
5931  delete [] crossterms;
5932  crossterms=new Crossterm[numCrossterms];
5933  msg->get(numCrossterms*sizeof(Crossterm), (char*)crossterms);
5934  }
5935 
5936  // Get the hydrogen bond donors
5937  msg->get(numDonors);
5938  if (numDonors)
5939  {
5940  delete [] donors;
5941  donors=new Bond[numDonors];
5942  msg->get(numDonors*sizeof(Bond), (char*)donors);
5943  }
5944 
5945  // Get the hydrogen bond acceptors
5946  msg->get(numAcceptors);
5947  if (numAcceptors)
5948  {
5949  delete [] acceptors;
5950  acceptors=new Bond[numAcceptors];
5951  msg->get(numAcceptors*sizeof(Bond), (char*)acceptors);
5952  }
5953 
5954  // Get the exclusion information
5955  msg->get(numExclusions);
5956  if (numExclusions)
5957  {
5958  delete [] exclusions;
5959  exclusions=new Exclusion[numExclusions];
5960  msg->get(numExclusions*sizeof(Exclusion), (char*)exclusions);
5961  }
5962 
5963  // Get the constraint information, if they are active
5964  if (simParams->constraintsOn)
5965  {
5966  msg->get(numConstraints);
5967 
5968  delete [] consIndexes;
5969  consIndexes = new int32[numAtoms];
5970 
5971  msg->get(numAtoms, consIndexes);
5972 
5973  if (numConstraints)
5974  {
5975  delete [] consParams;
5976  consParams = new ConstraintParams[numConstraints];
5977 
5978  msg->get(numConstraints*sizeof(ConstraintParams), (char*)consParams);
5979  }
5980  }
5981 #endif
5982 
5983  /* BEGIN gf */
5984  if (simParams->mgridforceOn)
5985  {
5986  DebugM(3, "Receiving gridforce info\n");
5987 
5988  msg->get(numGridforceGrids);
5989 
5990  DebugM(3, "numGridforceGrids = " << numGridforceGrids << "\n");
5991 
5992  delete [] numGridforces;
5993  numGridforces = new int[numGridforceGrids];
5994 
5995  delete [] gridfrcIndexes; // Should I be deleting elements of these first?
5996  delete [] gridfrcParams;
5997  delete [] gridfrcGrid;
5998  gridfrcIndexes = new int32*[numGridforceGrids];
5999  gridfrcParams = new GridforceParams*[numGridforceGrids];
6000  gridfrcGrid = new GridforceGrid*[numGridforceGrids];
6001 
6002  int grandTotalGrids = 0;
6003  for (int gridnum = 0; gridnum < numGridforceGrids; gridnum++) {
6004  msg->get(numGridforces[gridnum]);
6005 
6006  gridfrcIndexes[gridnum] = new int32[numAtoms];
6007  msg->get(numAtoms, gridfrcIndexes[gridnum]);
6008 
6009  if (numGridforces[gridnum])
6010  {
6011  gridfrcParams[gridnum] = new GridforceParams[numGridforces[gridnum]];
6012  msg->get(numGridforces[gridnum]*sizeof(GridforceParams), (char*)gridfrcParams[gridnum]);
6013  }
6014 
6015  gridfrcGrid[gridnum] = GridforceGrid::unpack_grid(gridnum, msg);
6016 
6017  grandTotalGrids += gridfrcGrid[gridnum]->get_total_grids();
6018  }
6019  }
6020  /* END gf */
6021 
6022  // Get the stirring information, if stirring is active
6023  if (simParams->stirOn)
6024  {
6025  msg->get(numStirredAtoms);
6026 
6027  delete [] stirIndexes;
6028  stirIndexes = new int32[numAtoms];
6029 
6030  msg->get(numAtoms, stirIndexes);
6031 
6032  if (numStirredAtoms)
6033  {
6034  delete [] stirParams;
6035  stirParams = new StirParams[numStirredAtoms];
6036 
6037  msg->get(numStirredAtoms*sizeof(StirParams), (char*)stirParams);
6038  }
6039  }
6040 
6041  // Get the moving drag information, if it is active
6042  if (simParams->movDragOn) {
6043  msg->get(numMovDrag);
6044  delete [] movDragIndexes;
6045  movDragIndexes = new int32[numAtoms];
6046  msg->get(numAtoms, movDragIndexes);
6047  if (numMovDrag)
6048  {
6049  delete [] movDragParams;
6050  movDragParams = new MovDragParams[numMovDrag];
6051  msg->get(numMovDrag*sizeof(MovDragParams), (char*)movDragParams);
6052  }
6053  }
6054 
6055  // Get the rotating drag information, if it is active
6056  if (simParams->rotDragOn) {
6057  msg->get(numRotDrag);
6058  delete [] rotDragIndexes;
6059  rotDragIndexes = new int32[numAtoms];
6060  msg->get(numAtoms, rotDragIndexes);
6061  if (numRotDrag)
6062  {
6063  delete [] rotDragParams;
6064  rotDragParams = new RotDragParams[numRotDrag];
6065  msg->get(numRotDrag*sizeof(RotDragParams), (char*)rotDragParams);
6066  }
6067  }
6068 
6069  // Get the "constant" torque information, if it is active
6070  if (simParams->consTorqueOn) {
6071  msg->get(numConsTorque);
6072  delete [] consTorqueIndexes;
6075  if (numConsTorque)
6076  {
6077  delete [] consTorqueParams;
6078  consTorqueParams = new ConsTorqueParams[numConsTorque];
6079  msg->get(numConsTorque*sizeof(ConsTorqueParams), (char*)consTorqueParams);
6080  }
6081  }
6082 
6083  // Get the constant force information, if it's active
6084  if (simParams->consForceOn)
6085  { msg->get(numConsForce);
6086  delete [] consForceIndexes;
6088  msg->get(numAtoms, consForceIndexes);
6089  if (numConsForce)
6090  { delete [] consForce;
6091  consForce = new Vector[numConsForce];
6092  msg->get(numConsForce*sizeof(Vector), (char*)consForce);
6093  }
6094  }
6095 
6096  if (simParams->excludeFromPressure) {
6097  exPressureAtomFlags = new int32[numAtoms];
6098  msg->get(numExPressureAtoms);
6099  msg->get(numAtoms, exPressureAtomFlags);
6100  }
6101 
6102 #ifndef MEM_OPT_VERSION
6103  // Get the langevin parameters, if they are active
6104  if (simParams->langevinOn || simParams->tCoupleOn)
6105  {
6106  delete [] langevinParams;
6107  langevinParams = new Real[numAtoms];
6108 
6109  msg->get(numAtoms, langevinParams);
6110  }
6111 
6112  // Get the fixed atoms, if they are active
6113  if (simParams->fixedAtomsOn)
6114  {
6115  delete [] fixedAtomFlags;
6116  fixedAtomFlags = new int32[numAtoms];
6117 
6118  msg->get(numFixedAtoms);
6119  msg->get(numAtoms, fixedAtomFlags);
6120  msg->get(numFixedRigidBonds);
6121  }
6122 
6123  if (simParams->qmForcesOn)
6124  {
6125  if( qmAtomGroup != 0)
6126  delete [] qmAtomGroup;
6127  qmAtomGroup = new Real[numAtoms];
6128 
6129  msg->get(numAtoms, qmAtomGroup);
6130 
6131  msg->get(qmNumQMAtoms);
6132 
6133  if( qmAtmChrg != 0)
6134  delete [] qmAtmChrg;
6135  qmAtmChrg = new Real[qmNumQMAtoms];
6136 
6137  msg->get(qmNumQMAtoms, qmAtmChrg);
6138 
6139  if( qmAtmIndx != 0)
6140  delete [] qmAtmIndx;
6141  qmAtmIndx = new int[qmNumQMAtoms];
6142 
6143  msg->get(qmNumQMAtoms, qmAtmIndx);
6144 
6145  msg->get(qmNoPC);
6146 
6147  msg->get(qmNumBonds);
6148 
6149  msg->get(qmMeNumBonds);
6150 
6151  if( qmMeMMindx != 0)
6152  delete [] qmMeMMindx;
6153  qmMeMMindx = new int[qmMeNumBonds];
6154 
6155  msg->get(qmMeNumBonds, qmMeMMindx);
6156 
6157  if( qmMeQMGrp != 0)
6158  delete [] qmMeQMGrp;
6159  qmMeQMGrp = new Real[qmMeNumBonds];
6160 
6161  msg->get(qmMeNumBonds, qmMeQMGrp);
6162 
6163  msg->get(qmPCFreq);
6164 
6165  msg->get(qmNumGrps);
6166 
6167  if( qmGrpID != 0)
6168  delete [] qmGrpID;
6169  qmGrpID = new Real[qmNumGrps];
6170  msg->get(qmNumGrps, qmGrpID);
6171 
6172  if( qmCustPCSizes != 0)
6173  delete [] qmCustPCSizes;
6174  qmCustPCSizes = new int[qmNumGrps];
6175  msg->get(qmNumGrps, qmCustPCSizes);
6176 
6177  msg->get(qmTotCustPCs);
6178 
6179  if( qmCustomPCIdxs != 0)
6180  delete [] qmCustomPCIdxs;
6181  qmCustomPCIdxs = new int[qmTotCustPCs];
6182  msg->get(qmTotCustPCs, qmCustomPCIdxs);
6183  }
6184 
6185 //fepb
6186  //receive fep atom info
6187  if (simParams->alchOn || simParams->lesOn || simParams->pairInteractionOn) {
6188  delete [] fepAtomFlags;
6189  fepAtomFlags = new unsigned char[numAtoms];
6190 
6191  msg->get(numFepInitial);
6192  msg->get(numFepFinal);
6193  msg->get(numAtoms*sizeof(unsigned char), (char*)fepAtomFlags);
6194  }
6195 //fepe
6196 
6197 //soluteScaling
6198  if (simParams->soluteScalingOn) {
6199  delete [] ssAtomFlags;
6200  delete [] ss_vdw_type;
6201  delete [] ss_index;
6202  ssAtomFlags = new unsigned char[numAtoms];
6203  ss_vdw_type = new int [params->get_num_vdw_params()];
6204  ss_index = new int [numAtoms];
6205  msg->get(numAtoms*sizeof(unsigned char), (char*)ssAtomFlags);
6206  msg->get(ss_num_vdw_params);
6207  msg->get(params->get_num_vdw_params()*sizeof(int), (char*)ss_vdw_type);
6208  msg->get(numAtoms*sizeof(int), (char*)ss_index);
6209  }
6210 //soluteScaling
6211 #ifdef OPENATOM_VERSION
6212  // This needs to be refactored into its own version
6213  if (simParams->openatomOn) {
6214  delete [] fepAtomFlags;
6215  fepAtomFlags = new unsigned char[numAtoms];
6216 
6217  msg->get(numFepInitial);
6218  msg->get(numAtoms*sizeof(unsigned char), (char*)fepAtomFlags);
6219 #endif //OPENATOM_VERSION
6220 
6221  // DRUDE: receive data read from PSF
6222  msg->get(is_lonepairs_psf);
6223  if (is_lonepairs_psf) {
6224  msg->get(numLphosts);
6225  delete[] lphosts;
6226  lphosts = new Lphost[numLphosts];
6227  msg->get(numLphosts*sizeof(Lphost), (char*)lphosts);
6228  }
6229  msg->get(is_drude_psf);
6230  if (is_drude_psf) {
6231  delete[] drudeConsts;
6232  drudeConsts = new DrudeConst[numAtoms];
6233  msg->get(numAtoms*sizeof(DrudeConst), (char*)drudeConsts);
6234  msg->get(numTholes);
6235  delete[] tholes;
6236  tholes = new Thole[numTholes];
6237  msg->get(numTholes*sizeof(Thole), (char*)tholes);
6238  msg->get(numAnisos);
6239  delete[] anisos;
6240  anisos = new Aniso[numAnisos];
6241  msg->get(numAnisos*sizeof(Aniso), (char*)anisos);
6242  }
6243  msg->get(numZeroMassAtoms);
6244  // DRUDE
6245 
6246  //LCPO
6247  if (simParams->LCPOOn) {
6248  delete [] lcpoParamType;
6249  lcpoParamType = new int[numAtoms];
6250  msg->get(numAtoms, (int*)lcpoParamType);
6251  }
6252 
6253  //Receive GromacsPairStuff -- JLai
6254 
6255  if (simParams->goGroPair) {
6256  msg->get(numLJPair);
6257  delete [] indxLJA;
6258  indxLJA = new int[numLJPair];
6259  msg->get(numLJPair,indxLJA);
6260  delete [] indxLJB;
6261  indxLJB = new int[numLJPair];
6262  msg->get(numLJPair,indxLJB);
6263  delete [] pairC6;
6264  pairC6 = new Real[numLJPair];
6265  msg->get(numLJPair,pairC6);
6266  delete [] pairC12;
6267  pairC12 = new Real[numLJPair];
6268  msg->get(numLJPair,pairC12);
6269  delete [] gromacsPair_type;
6270  gromacsPair_type = new int[numLJPair];
6272  delete [] pointerToLJBeg;
6273  pointerToLJBeg = new int[numAtoms];
6274  msg->get((numAtoms),pointerToLJBeg);
6275  delete [] pointerToLJEnd;
6276  pointerToLJEnd = new int[numAtoms];
6277  msg->get((numAtoms),pointerToLJEnd);
6278  // JLai
6279  delete [] gromacsPair;
6281  for(int i=0; i < numLJPair; i++) {
6282  gromacsPair[i].atom1 = indxLJA[i];
6283  gromacsPair[i].atom2 = indxLJB[i];
6284  gromacsPair[i].pairC6 = pairC6[i];
6285  gromacsPair[i].pairC12 = pairC12[i];
6287  }
6288  //
6289  msg->get(numGaussPair);
6290  delete [] indxGaussA;
6291  indxGaussA = new int[numGaussPair];
6292  msg->get(numGaussPair,indxGaussA);
6293  delete [] indxGaussB;
6294  indxGaussB = new int[numGaussPair];
6295  msg->get(numGaussPair,indxGaussB);
6296  delete [] gA;
6297  gA = new Real[numGaussPair];
6298  msg->get(numGaussPair,gA);
6299  delete [] gMu1;
6300  gMu1 = new Real[numGaussPair];
6301  msg->get(numGaussPair,gMu1);
6302  delete [] giSigma1;
6303  giSigma1 = new Real[numGaussPair];
6304  msg->get(numGaussPair,giSigma1);
6305  delete [] gMu2;
6306  gMu2 = new Real[numGaussPair];
6307  msg->get(numGaussPair,gMu2);
6308  delete [] giSigma2;
6309  giSigma2 = new Real[numGaussPair];
6310  msg->get(numGaussPair,giSigma2);
6311  delete [] gRepulsive;
6312  gRepulsive = new Real[numGaussPair];
6313  msg->get(numGaussPair,gRepulsive);
6314  delete [] pointerToGaussBeg;
6315  pointerToGaussBeg = new int[numAtoms];
6316  msg->get((numAtoms),pointerToGaussBeg);
6317  delete [] pointerToGaussEnd;
6318  pointerToGaussEnd = new int[numAtoms];
6319  msg->get((numAtoms),pointerToGaussEnd);
6320  //
6321  }
6322 #endif
6323 
6324  // Now free the message
6325  delete msg;
6326 
6327 #ifdef MEM_OPT_VERSION
6328 
6329  build_excl_check_signatures();
6330 
6331  //set num{Calc}Tuples(Bonds,...,Impropers) to 0
6332  numBonds = numCalcBonds = 0;
6333  numAngles = numCalcAngles = 0;
6338  // JLai
6339  numLJPair = numCalcLJPair = 0;
6340  // End of JLai
6341 
6342 #else
6343 
6344  // analyze the data and find the status of each atom
6345  build_atom_status();
6346  build_lists_by_atom();
6347 
6348 
6349 #endif
6350 }
int num_alch_unpert_Dihedrals
Definition: Molecule.h:575
int * indxGaussA
Definition: Molecule.h:675
Type * getNewArray(int n)
Definition: ObjectArena.h:49
int numCalcBonds
Definition: Molecule.h:622
Real * gMu2
Definition: Molecule.h:680
int numBonds
Definition: Molecule.h:560
int numCalcLJPair
Definition: Molecule.h:663
Real * giSigma2
Definition: Molecule.h:681
short int32
Definition: dumpdcd.c:24
int numHydrogenGroups
Definition: Molecule.h:600
int numAnisos
Number of anisotropic terms.
Definition: Molecule.h:584
Angle * alch_unpert_angles
Definition: Molecule.h:577
Definition: Vector.h:64
Real * pairC6
Definition: Molecule.h:668
Real pairC6
Definition: structures.h:97
Bool excludeFromPressure
int num_alch_unpert_Bonds
Definition: Molecule.h:573
float Real
Definition: common.h:109
#define DebugM(x, y)
Definition: Debug.h:59
int * pointerToLJEnd
Definition: Molecule.h:665
int numGridforceGrids
Definition: Molecule.h:591
int numRealBonds
Definition: Molecule.h:559
MIStream * get(char &data)
Definition: MStream.h:29
int num_alch_unpert_Angles
Definition: Molecule.h:574
int numMovDrag
Definition: Molecule.h:594
Dihedral * alch_unpert_dihedrals
Definition: Molecule.h:578
Real * gA
Definition: Molecule.h:677
Bool pairInteractionOn
Real pairC12
Definition: structures.h:96
int * indxLJB
Definition: Molecule.h:667
int numFepFinal
Definition: Molecule.h:609
int * pointerToGaussBeg
Definition: Molecule.h:672
int numGaussPair
Definition: Molecule.h:674
int32 atom2
Definition: structures.h:95
int numCalcCrossterms
Definition: Molecule.h:626
int isOccupancyValid
Definition: Molecule.h:1469
int32 * consTorqueIndexes
Definition: Molecule.h:616
int64 numTotalExclusions
Definition: Molecule.h:572
Real * gMu1
Definition: Molecule.h:678
int * pointerToLJBeg
Definition: Molecule.h:664
Real * gRepulsive
Definition: Molecule.h:682
int * indxGaussB
Definition: Molecule.h:676
int64 numCalcFullExclusions
Definition: Molecule.h:628
int is_drude_psf
Definition: Molecule.h:462
int numFixedRigidBonds
Definition: Molecule.h:606
int numFepInitial
Definition: Molecule.h:608
int * pointerToGaussEnd
Definition: Molecule.h:673
int numAcceptors
Definition: Molecule.h:570
int numTholes
Number of Thole terms.
Definition: Molecule.h:583
int numCalcDihedrals
Definition: Molecule.h:624
int numExPressureAtoms
Definition: Molecule.h:599
Bond * alch_unpert_bonds
Definition: Molecule.h:576
int numFixedAtoms
Definition: Molecule.h:597
int numCalcImpropers
Definition: Molecule.h:625
int numAngles
Definition: Molecule.h:561
Real * pairC12
Definition: Molecule.h:669
int numAtoms
Definition: Molecule.h:557
int * gromacsPair_type
Definition: Molecule.h:670
int numStirredAtoms
Definition: Molecule.h:598
int numCrossterms
Definition: Molecule.h:568
int numConsForce
Definition: Molecule.h:612
HashPool< HashString > atomNamePool
Definition: CompressPsf.C:309
ConsTorqueParams * consTorqueParams
Definition: Molecule.h:617
int get_num_vdw_params(void)
Definition: Parameters.h:535
int * ss_index
Definition: Molecule.h:459
int maxMigrationGroupSize
Definition: Molecule.h:603
int numDihedrals
Definition: Molecule.h:562
int numImpropers
Definition: Molecule.h:567
int numConsTorque
Definition: Molecule.h:596
int numConstraints
Definition: Molecule.h:589
int64 numCalcExclusions
Definition: Molecule.h:627
int32 * consForceIndexes
Definition: Molecule.h:613
static GridforceGrid * unpack_grid(int gridnum, MIStream *msg)
Definition: GridForceGrid.C:60
int maxHydrogenGroupSize
Definition: Molecule.h:601
int numMigrationGroups
Definition: Molecule.h:602
Real * giSigma1
Definition: Molecule.h:679
int numZeroMassAtoms
Number of atoms with zero mass.
Definition: Molecule.h:586
Vector * consForce
Definition: Molecule.h:614
int * indxLJA
Definition: Molecule.h:666
int * ss_vdw_type
Definition: Molecule.h:458
int * numGridforces
Definition: Molecule.h:592
Index gromacsPair_type
Definition: structures.h:98
int is_lonepairs_psf
Definition: Molecule.h:463
int numLphosts
Number of lone pair host records in PSF.
Definition: Molecule.h:585
int numDonors
Definition: Molecule.h:569
int isBFactorValid
Definition: Molecule.h:1469
int numCalcAngles
Definition: Molecule.h:623
int ss_num_vdw_params
Definition: Molecule.h:457
int numRotDrag
Definition: Molecule.h:595
virtual int get_total_grids(void) const =0
HashPool< AtomSigInfo > atomSigPool
Definition: CompressPsf.C:313
int32 atom1
Definition: structures.h:94
int numLJPair
Definition: Molecule.h:662
int numExclusions
Definition: Molecule.h:571
void Molecule::reloadCharges ( float  charge[],
int  n 
)

Referenced by Node::reloadCharges().

Real Molecule::rigid_bond_length ( int  atomnum) const
inline

Definition at line 1457 of file Molecule.h.

Referenced by WorkDistrib::createAtomLists(), and outputCompressedFile().

1458  {
1459  return(rigidBondLengths[atomnum]);
1460  }
void Molecule::send_GoMolecule ( MOStream msg)

Definition at line 1635 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, MAX_GO_CHAINS, MAX_RESTRICTIONS, NAMD_die(), numAtoms, numGoAtoms, NumGoChains, pointerToGoBeg, pointerToGoEnd, MOStream::put(), go_val::restrictions, and go_val::sigmaRep.

1635  {
1636  Real *a1, *a2, *a3, *a4;
1637  int *i1, *i2, *i3, *i4;
1638  int maxGoChainsSqr = MAX_GO_CHAINS*MAX_GO_CHAINS; // JE JLai Go code
1639  msg->put(NumGoChains);
1640 
1641  if (NumGoChains) {
1642  // int go_indices[MAX_GO_CHAINS+1]; // Indices from chainIDs to go_array
1643  // GoValue go_array[MAX_GO_CHAINS*MAX_GO_CHAINS]; // Array of Go params
1644  msg->put(MAX_GO_CHAINS+1,go_indices);
1645 
1646  a1 = new Real[maxGoChainsSqr];
1647  a2 = new Real[maxGoChainsSqr];
1648  a3 = new Real[maxGoChainsSqr];
1649  a4 = new Real[maxGoChainsSqr];
1650  i1 = new int[maxGoChainsSqr];
1651  i2 = new int[maxGoChainsSqr];
1652  i3 = new int[maxGoChainsSqr];
1653  i4 = new int[maxGoChainsSqr*MAX_RESTRICTIONS];
1654 
1655  if ( (a1 == NULL) || (a2 == NULL) || (a3 == NULL) || (a4 == NULL) ||
1656  (i1 == NULL) || (i2 == NULL) || (i3 == NULL) || (i4 == NULL) )
1657  {
1658  NAMD_die("memory allocation failed in Molecules::send_Molecules");
1659  }
1660 
1661  for (int i=0; i<maxGoChainsSqr; i++) {
1662  a1[i] = go_array[i].epsilon;
1663  a2[i] = go_array[i].sigmaRep;
1664  a3[i] = go_array[i].epsilonRep;
1665  a4[i] = go_array[i].cutoff;
1666  i1[i] = go_array[i].exp_a;
1667  i2[i] = go_array[i].exp_b;
1668  i3[i] = go_array[i].exp_rep;
1669  for (int j=0; j<MAX_RESTRICTIONS; j++) {
1670  i4[i*MAX_RESTRICTIONS + j] = go_array[i].restrictions[j];
1671  }
1672  }
1673 
1674  msg->put(maxGoChainsSqr, a1);
1675  msg->put(maxGoChainsSqr, a2);
1676  msg->put(maxGoChainsSqr, a3);
1677  msg->put(maxGoChainsSqr, a4);
1678  msg->put(maxGoChainsSqr, i1);
1679  msg->put(maxGoChainsSqr, i2);
1680  msg->put(maxGoChainsSqr, i3);
1681  msg->put(maxGoChainsSqr*MAX_RESTRICTIONS, i4);
1682 
1683  delete [] a1;
1684  delete [] a2;
1685  delete [] a3;
1686  delete [] a4;
1687  delete [] i1;
1688  delete [] i2;
1689  delete [] i3;
1690  delete [] i4;
1691  }
1692 
1693  //Ported JLai
1694  if (simParams->goForcesOn) {
1695  switch(simParams->goMethod) {
1696  case 1:
1697  msg->put(numGoAtoms);
1698  msg->put(numAtoms, goSigmaIndices);
1699  msg->put(numGoAtoms, atomChainTypes);
1701  msg->put(numGoAtoms*numGoAtoms*sizeof(bool), (char*)goWithinCutoff);
1702  // printf("Molecule.C sending atomChainTypes %d %d \n", numGoAtoms, atomChainTypes);
1703  break;
1704  case 2: //GSS
1705  msg->put(numGoAtoms);
1706  msg->put(numAtoms,pointerToGoBeg);
1707  msg->put(numAtoms,pointerToGoEnd);
1708  msg->put(numAtoms,goSigmaIndices);
1709  msg->put(numAtoms,goResidIndices);
1710  msg->put(numGoAtoms,atomChainTypes);
1711  msg->put(goNumLJPair);
1712  msg->put(goNumLJPair,goIndxLJA);
1713  msg->put(goNumLJPair,goIndxLJB);
1716  break;
1717  case 3:
1718  msg->put(numGoAtoms);
1719  msg->put(numAtoms, goSigmaIndices);
1720  msg->put(numGoAtoms, atomChainTypes);
1721  //msg->put(numGoAtoms*numGoAtoms, goSigmas);
1722  //msg->put(numGoAtoms*numGoAtoms*sizeof(bool), (char*)goWithinCutoff);
1723  msg->put(numGoAtoms*3, goCoordinates);
1724  msg->put(numGoAtoms, goResids);
1725  break;
1726  }
1727  }
1728 
1729  msg->end();
1730  delete msg;
1731 }
int exp_b
Definition: Molecule.h:109
void end(void)
Definition: MStream.C:176
int * pointerToGoBeg
Definition: Molecule.h:658
Real epsilonRep
Definition: Molecule.h:112
Real * goCoordinates
Definition: Molecule.h:649
#define MAX_RESTRICTIONS
Definition: Molecule.h:38
float Real
Definition: common.h:109
double * goSigmaPairA
Definition: Molecule.h:656
bool * goWithinCutoff
Definition: Molecule.h:648
#define MAX_GO_CHAINS
Definition: Molecule.h:37
int exp_a
Definition: Molecule.h:108
int32 * atomChainTypes
Definition: Molecule.h:644
int * pointerToGoEnd
Definition: Molecule.h:659
int * goIndxLJA
Definition: Molecule.h:654
int goNumLJPair
Definition: Molecule.h:653
int32 * goResidIndices
Definition: Molecule.h:646
GoChoices goMethod
GoValue go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
Definition: Molecule.h:1588
int * goResids
Definition: Molecule.h:650
Real * goSigmas
Definition: Molecule.h:647
Real cutoff
Definition: Molecule.h:113
int numAtoms
Definition: Molecule.h:557
Real sigmaRep
Definition: Molecule.h:111
void NAMD_die(const char *err_msg)
Definition: common.C:85
double * goSigmaPairB
Definition: Molecule.h:657
int go_indices[MAX_GO_CHAINS+1]
Definition: Molecule.h:1589
MOStream * put(char data)
Definition: MStream.h:112
int NumGoChains
Definition: Molecule.h:1590
int restrictions[MAX_RESTRICTIONS]
Definition: Molecule.h:114
Real epsilon
Definition: Molecule.h:107
int32 * goSigmaIndices
Definition: Molecule.h:645
int * goIndxLJB
Definition: Molecule.h:655
int exp_rep
Definition: Molecule.h:110
int numGoAtoms
Definition: Molecule.h:643
void Molecule::send_Molecule ( MOStream msg)

Definition at line 5448 of file Molecule.C.

References SimParameters::alchOn, atomNamePool, atomSigPool, SimParameters::consForceOn, SimParameters::consTorqueOn, SimParameters::constraintsOn, DebugM, MOStream::end(), endi(), SimParameters::excludeFromPressure, SimParameters::fixedAtomsOn, Parameters::get_num_vdw_params(), SimParameters::goGroPair, SimParameters::langevinOn, SimParameters::LCPOOn, SimParameters::lesOn, SimParameters::mgridforceOn, SimParameters::movDragOn, numGaussPair, GridforceGrid::pack_grid(), SimParameters::pairInteractionOn, MOStream::put(), SimParameters::qmForcesOn, SimParameters::rotDragOn, SimParameters::sdScaling, SimParameters::soluteScalingOn, SimParameters::stirOn, and SimParameters::tCoupleOn.

Referenced by Node::resendMolecule().

5448  {
5449 #ifdef MEM_OPT_VERSION
5450 //in the memory optimized version, only the atom signatures are broadcast
5451 //to other Nodes. --Chao Mei
5452 
5453  msg->put(numAtoms);
5454 
5455  msg->put(massPoolSize);
5456  msg->put(massPoolSize, atomMassPool);
5457 
5458  msg->put(chargePoolSize);
5459  msg->put(chargePoolSize, atomChargePool);
5460 
5461  //put atoms' signatures
5462  msg->put(atomSigPoolSize);
5463  for(int i=0; i<atomSigPoolSize; i++)
5464  atomSigPool[i].pack(msg);
5465 
5466  //put atom's exclusion signatures
5467  msg->put(exclSigPoolSize);
5468  for(int i=0; i<exclSigPoolSize; i++)
5469  exclSigPool[i].pack(msg);
5470 
5471  msg->put(numHydrogenGroups);
5472  msg->put(maxHydrogenGroupSize);
5473  msg->put(numMigrationGroups);
5474  msg->put(maxMigrationGroupSize);
5475  msg->put(isOccupancyValid);
5476  msg->put(isBFactorValid);
5477 
5478  //put names for atoms
5479  msg->put(atomNamePoolSize);
5480  for(int i=0; i<atomNamePoolSize;i++) {
5481  int len = strlen(atomNamePool[i]);
5482  msg->put(len);
5483  msg->put(len*sizeof(char), atomNamePool[i]);
5484  }
5485 
5486  if(simParams->fixedAtomsOn){
5487  int numFixedAtomsSet = fixedAtomsSet->size();
5488  msg->put(numFixedAtoms);
5489  msg->put(numFixedAtomsSet);
5490  msg->put(numFixedAtomsSet*sizeof(AtomSet), (char *)(fixedAtomsSet->begin()));
5491  }
5492 
5493  if (simParams->constraintsOn) {
5494  int numConstrainedAtomsSet = constrainedAtomsSet->size();
5495  msg->put(numConstraints);
5496  msg->put(numConstrainedAtomsSet);
5497  msg->put(numConstrainedAtomsSet*sizeof(AtomSet), (char *)(constrainedAtomsSet->begin()));
5498  }
5499 
5500 #else
5501  msg->put(numAtoms);
5502  msg->put(numAtoms*sizeof(Atom), (char*)atoms);
5503 
5504  // Send the bond information
5505  msg->put(numRealBonds);
5506  msg->put(numBonds);
5507 
5508  if (numBonds)
5509  {
5510  msg->put(numBonds*sizeof(Bond), (char*)bonds);
5511  }
5512 
5513  // Send the angle information
5514  msg->put(numAngles);
5515  if (numAngles)
5516  {
5517  msg->put(numAngles*sizeof(Angle), (char*)angles);
5518  }
5519 
5520  // Send the dihedral information
5521  msg->put(numDihedrals);
5522  if (numDihedrals)
5523  {
5524  msg->put(numDihedrals*sizeof(Dihedral), (char*)dihedrals);
5525  }
5526 
5527  if (simParams->sdScaling) {
5528  msg->put(num_alch_unpert_Bonds);
5529  msg->put(num_alch_unpert_Bonds*sizeof(Bond), (char*)alch_unpert_bonds);
5530 
5532  msg->put(num_alch_unpert_Angles*sizeof(Angle), (char*)alch_unpert_angles);
5533 
5536  }
5537 
5538  // Send the improper information
5539  msg->put(numImpropers);
5540  if (numImpropers)
5541  {
5542  msg->put(numImpropers*sizeof(Improper), (char*)impropers);
5543  }
5544 
5545  // Send the crossterm information
5546  msg->put(numCrossterms);
5547  if (numCrossterms)
5548  {
5549  msg->put(numCrossterms*sizeof(Crossterm), (char*)crossterms);
5550  }
5551 
5552  // send the hydrogen bond donor information
5553  msg->put(numDonors);
5554  if(numDonors)
5555  {
5556  msg->put(numDonors*sizeof(Bond), (char*)donors);
5557  }
5558 
5559  // send the hydrogen bond acceptor information
5560  msg->put(numAcceptors);
5561  if(numAcceptors)
5562  {
5563  msg->put(numAcceptors*sizeof(Bond), (char*)acceptors);
5564  }
5565 
5566  // Send the exclusion information
5567  msg->put(numExclusions);
5568  if (numExclusions)
5569  {
5570  msg->put(numExclusions*sizeof(Exclusion), (char*)exclusions);
5571  }
5572  // Send the constraint information, if used
5573  if (simParams->constraintsOn)
5574  {
5575  msg->put(numConstraints);
5576 
5577  msg->put(numAtoms, consIndexes);
5578 
5579  if (numConstraints)
5580  {
5581  msg->put(numConstraints*sizeof(ConstraintParams), (char*)consParams);
5582  }
5583  }
5584 #endif
5585 
5586  /* BEGIN gf */
5587  // Send the gridforce information, if used
5588  if (simParams->mgridforceOn)
5589  {
5590  DebugM(3, "Sending gridforce info\n" << endi);
5591  msg->put(numGridforceGrids);
5592 
5593  for (int gridnum = 0; gridnum < numGridforceGrids; gridnum++) {
5594  msg->put(numGridforces[gridnum]);
5595  msg->put(numAtoms, gridfrcIndexes[gridnum]);
5596  if (numGridforces[gridnum])
5597  {
5598  msg->put(numGridforces[gridnum]*sizeof(GridforceParams), (char*)gridfrcParams[gridnum]);
5599  }
5600  GridforceGrid::pack_grid(gridfrcGrid[gridnum], msg);
5601  }
5602  }
5603  /* END gf */
5604 
5605  // Send the stirring information, if used
5606  if (simParams->stirOn)
5607  {
5608  //CkPrintf ("DEBUG: putting numStirredAtoms..\n");
5609  msg->put(numStirredAtoms);
5610  //CkPrintf ("DEBUG: putting numAtoms,stirIndexes.. numAtoms=%d\n",numStirredAtoms);
5611  msg->put(numAtoms, stirIndexes);
5612  //CkPrintf ("DEBUG: if numStirredAtoms..\n");
5613  if (numStirredAtoms)
5614  {
5615  //CkPrintf ("DEBUG: big put, with (char*)stirParams\n");
5616  msg->put(numStirredAtoms*sizeof(StirParams), (char*)stirParams);
5617  }
5618  }
5619 
5620 
5621  // Send the moving drag information, if used
5622  if (simParams->movDragOn) {
5623  msg->put(numMovDrag);
5624  msg->put(numAtoms, movDragIndexes);
5625  if (numMovDrag)
5626  {
5627  msg->put(numMovDrag*sizeof(MovDragParams), (char*)movDragParams);
5628  }
5629  }
5630 
5631  // Send the rotating drag information, if used
5632  if (simParams->rotDragOn) {
5633  msg->put(numRotDrag);
5634  msg->put(numAtoms, rotDragIndexes);
5635  if (numRotDrag)
5636  {
5637  msg->put(numRotDrag*sizeof(RotDragParams), (char*)rotDragParams);
5638  }
5639  }
5640 
5641  // Send the "constant" torque information, if used
5642  if (simParams->consTorqueOn) {
5643  msg->put(numConsTorque);
5645  if (numConsTorque)
5646  {
5647  msg->put(numConsTorque*sizeof(ConsTorqueParams), (char*)consTorqueParams);
5648  }
5649  }
5650 
5651  // Send the constant force information, if used
5652  if (simParams->consForceOn)
5653  { msg->put(numConsForce);
5654  msg->put(numAtoms, consForceIndexes);
5655  if (numConsForce)
5656  msg->put(numConsForce*sizeof(Vector), (char*)consForce);
5657  }
5658 
5659  if (simParams->excludeFromPressure) {
5660  msg->put(numExPressureAtoms);
5661  msg->put(numAtoms, exPressureAtomFlags);
5662  }
5663 
5664 #ifndef MEM_OPT_VERSION
5665  // Send the langevin parameters, if active
5666  if (simParams->langevinOn || simParams->tCoupleOn)
5667  {
5668  msg->put(numAtoms, langevinParams);
5669  }
5670 
5671  // Send fixed atoms, if active
5672  if (simParams->fixedAtomsOn)
5673  {
5674  msg->put(numFixedAtoms);
5675  msg->put(numAtoms, fixedAtomFlags);
5676  msg->put(numFixedRigidBonds);
5677  }
5678 
5679  if (simParams->qmForcesOn)
5680  {
5681  msg->put(numAtoms, qmAtomGroup);
5682  msg->put(qmNumQMAtoms);
5683  msg->put(qmNumQMAtoms, qmAtmChrg);
5684  msg->put(qmNumQMAtoms, qmAtmIndx);
5685  msg->put(qmNoPC);
5686  msg->put(qmNumBonds);
5687  msg->put(qmMeNumBonds);
5688  msg->put(qmMeNumBonds, qmMeMMindx);
5689  msg->put(qmMeNumBonds, qmMeQMGrp);
5690  msg->put(qmPCFreq);
5691  msg->put(qmNumGrps);
5692  msg->put(qmNumGrps, qmGrpID);
5693  msg->put(qmNumGrps, qmCustPCSizes);
5694  msg->put(qmTotCustPCs);
5695  msg->put(qmTotCustPCs, qmCustomPCIdxs);
5696  }
5697 
5698  //fepb
5699  // send fep atom info
5700  if (simParams->alchOn || simParams->lesOn || simParams->pairInteractionOn) {
5701  msg->put(numFepInitial);
5702  msg->put(numFepFinal);
5703  msg->put(numAtoms*sizeof(char), (char*)fepAtomFlags);
5704  }
5705  //fepe
5706 
5707  if (simParams->soluteScalingOn) {
5708  msg->put(numAtoms*sizeof(char), (char*)ssAtomFlags);
5709  msg->put(ss_num_vdw_params);
5710  msg->put(params->get_num_vdw_params()*sizeof(int), (char*)ss_vdw_type);
5711  msg->put(numAtoms*sizeof(int), (char*)ss_index);
5712  }
5713 
5714  #ifdef OPENATOM_VERSION
5715  // needs to be refactored into its own openatom version
5716  if (simParams->openatomOn ) {
5717  msg->put(numFepInitial);
5718  msg->put(numAtoms*sizeof(char), (char*)fepAtomFlags);
5719  }
5720  #endif //OPENATOM_VERSION
5721 
5722  // DRUDE: send data read from PSF
5723  msg->put(is_lonepairs_psf);
5724  if (is_lonepairs_psf) {
5725  msg->put(numLphosts);
5726  msg->put(numLphosts*sizeof(Lphost), (char*)lphosts);
5727  }
5728  msg->put(is_drude_psf);
5729  if (is_drude_psf) {
5730  msg->put(numAtoms*sizeof(DrudeConst), (char*)drudeConsts);
5731  msg->put(numTholes);
5732  msg->put(numTholes*sizeof(Thole), (char*)tholes);
5733  msg->put(numAnisos);
5734  msg->put(numAnisos*sizeof(Aniso), (char*)anisos);
5735  }
5736  msg->put(numZeroMassAtoms);
5737  // DRUDE
5738 
5739  //LCPO
5740  if (simParams->LCPOOn) {
5741  msg->put(numAtoms, (int*)lcpoParamType);
5742  }
5743 
5744  //Send GromacsPairStuff -- JLai
5745  if (simParams->goGroPair) {
5746  msg->put(numLJPair);
5747  msg->put(numLJPair,indxLJA);
5748  msg->put(numLJPair,indxLJB);
5749  msg->put(numLJPair,pairC6);
5750  msg->put(numLJPair,pairC12);
5752  msg->put((numAtoms),pointerToLJBeg);
5753  msg->put((numAtoms),pointerToLJEnd);
5754  msg->put(numGaussPair);
5755  msg->put(numGaussPair,indxGaussA);
5756  msg->put(numGaussPair,indxGaussB);
5757  msg->put(numGaussPair,gA);
5758  msg->put(numGaussPair,gMu1);
5759  msg->put(numGaussPair,giSigma1);
5760  msg->put(numGaussPair,gMu2);
5761  msg->put(numGaussPair,giSigma2);
5762  msg->put(numGaussPair,gRepulsive);
5763  msg->put((numAtoms),pointerToGaussBeg);
5764  msg->put((numAtoms),pointerToGaussEnd);
5765  }
5766 #endif
5767 
5768  // Broadcast the message to the other nodes
5769  msg->end();
5770  delete msg;
5771 
5772 #ifdef MEM_OPT_VERSION
5773 
5774  build_excl_check_signatures();
5775 
5776  //set num{Calc}Tuples(Bonds,...,Impropers) to 0
5777  numBonds = numCalcBonds = 0;
5778  numAngles = numCalcAngles = 0;
5783  // JLai
5784  numLJPair = numCalcLJPair = 0;
5785  // End of JLai
5786 
5787 #else
5788 
5789  // Now build arrays of indexes into these arrays by atom
5790  build_lists_by_atom();
5791 
5792 #endif
5793 }
int num_alch_unpert_Dihedrals
Definition: Molecule.h:575
int * indxGaussA
Definition: Molecule.h:675
void end(void)
Definition: MStream.C:176
int numCalcBonds
Definition: Molecule.h:622
Real * gMu2
Definition: Molecule.h:680
int numBonds
Definition: Molecule.h:560
int numCalcLJPair
Definition: Molecule.h:663
Real * giSigma2
Definition: Molecule.h:681
int numHydrogenGroups
Definition: Molecule.h:600
int numAnisos
Number of anisotropic terms.
Definition: Molecule.h:584
Angle * alch_unpert_angles
Definition: Molecule.h:577
Definition: Vector.h:64
Real * pairC6
Definition: Molecule.h:668
Bool excludeFromPressure
int num_alch_unpert_Bonds
Definition: Molecule.h:573
static void pack_grid(GridforceGrid *grid, MOStream *msg)
Definition: GridForceGrid.C:50
#define DebugM(x, y)
Definition: Debug.h:59
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
int * pointerToLJEnd
Definition: Molecule.h:665
int numGridforceGrids
Definition: Molecule.h:591
int numRealBonds
Definition: Molecule.h:559
int num_alch_unpert_Angles
Definition: Molecule.h:574
int numMovDrag
Definition: Molecule.h:594
Dihedral * alch_unpert_dihedrals
Definition: Molecule.h:578
Real * gA
Definition: Molecule.h:677
Bool pairInteractionOn
int * indxLJB
Definition: Molecule.h:667
int numFepFinal
Definition: Molecule.h:609
int * pointerToGaussBeg
Definition: Molecule.h:672
int numGaussPair
Definition: Molecule.h:674
int numCalcCrossterms
Definition: Molecule.h:626
int isOccupancyValid
Definition: Molecule.h:1469
int32 * consTorqueIndexes
Definition: Molecule.h:616
int64 numTotalExclusions
Definition: Molecule.h:572
Real * gMu1
Definition: Molecule.h:678
int * pointerToLJBeg
Definition: Molecule.h:664
Real * gRepulsive
Definition: Molecule.h:682
int * indxGaussB
Definition: Molecule.h:676
int64 numCalcFullExclusions
Definition: Molecule.h:628
int is_drude_psf
Definition: Molecule.h:462
int numFixedRigidBonds
Definition: Molecule.h:606
int numFepInitial
Definition: Molecule.h:608
int * pointerToGaussEnd
Definition: Molecule.h:673
int numAcceptors
Definition: Molecule.h:570
int numTholes
Number of Thole terms.
Definition: Molecule.h:583
int numCalcDihedrals
Definition: Molecule.h:624
int numExPressureAtoms
Definition: Molecule.h:599
Bond * alch_unpert_bonds
Definition: Molecule.h:576
int numFixedAtoms
Definition: Molecule.h:597
int numCalcImpropers
Definition: Molecule.h:625
int numAngles
Definition: Molecule.h:561
Real * pairC12
Definition: Molecule.h:669
int numAtoms
Definition: Molecule.h:557
int * gromacsPair_type
Definition: Molecule.h:670
int numStirredAtoms
Definition: Molecule.h:598
int numCrossterms
Definition: Molecule.h:568
int numConsForce
Definition: Molecule.h:612
HashPool< HashString > atomNamePool
Definition: CompressPsf.C:309
ConsTorqueParams * consTorqueParams
Definition: Molecule.h:617
int get_num_vdw_params(void)
Definition: Parameters.h:535
int * ss_index
Definition: Molecule.h:459
int maxMigrationGroupSize
Definition: Molecule.h:603
int numDihedrals
Definition: Molecule.h:562
int numImpropers
Definition: Molecule.h:567
int numConsTorque
Definition: Molecule.h:596
int numConstraints
Definition: Molecule.h:589
int64 numCalcExclusions
Definition: Molecule.h:627
int32 * consForceIndexes
Definition: Molecule.h:613
int maxHydrogenGroupSize
Definition: Molecule.h:601
int numMigrationGroups
Definition: Molecule.h:602
Real * giSigma1
Definition: Molecule.h:679
int numZeroMassAtoms
Number of atoms with zero mass.
Definition: Molecule.h:586
Vector * consForce
Definition: Molecule.h:614
int * indxLJA
Definition: Molecule.h:666
MOStream * put(char data)
Definition: MStream.h:112
int * ss_vdw_type
Definition: Molecule.h:458
int * numGridforces
Definition: Molecule.h:592
int is_lonepairs_psf
Definition: Molecule.h:463
int numLphosts
Number of lone pair host records in PSF.
Definition: Molecule.h:585
int numDonors
Definition: Molecule.h:569
int isBFactorValid
Definition: Molecule.h:1469
int numCalcAngles
Definition: Molecule.h:623
int ss_num_vdw_params
Definition: Molecule.h:457
int numRotDrag
Definition: Molecule.h:595
HashPool< AtomSigInfo > atomSigPool
Definition: CompressPsf.C:313
int numLJPair
Definition: Molecule.h:662
int numExclusions
Definition: Molecule.h:571
int Molecule::set_gridfrc_grid ( int  gridnum,
GridforceGrid grid 
)
inline

Definition at line 1289 of file Molecule.h.

References numGridforceGrids.

Referenced by Node::reloadGridforceGrid().

1290  {
1291  if (grid && gridnum >= 0 && gridnum < numGridforceGrids) {
1292  gridfrcGrid[gridnum] = grid;
1293  return 0;
1294  } else {
1295  return -1;
1296  }
1297  }
int numGridforceGrids
Definition: Molecule.h:591
void Molecule::set_qm_replaceAll ( Bool  newReplaceAll)
inline

Definition at line 818 of file Molecule.h.

Referenced by NamdState::loadStructure().

818 { qmReplaceAll = newReplaceAll; } ;
void Molecule::setBFactorData ( molfile_atom_t *  atomarray)

Definition at line 3243 of file Molecule.C.

3243  {
3244  bfactor = new float[numAtoms];
3245  for(int i=0; i<numAtoms; i++) {
3246  bfactor[i] = atomarray[i].bfactor;
3247  }
3248 }
int numAtoms
Definition: Molecule.h:557
void Molecule::setOccupancyData ( molfile_atom_t *  atomarray)

Definition at line 3236 of file Molecule.C.

3236  {
3237  occupancy = new float[numAtoms];
3238  for(int i=0; i<numAtoms; i++) {
3239  occupancy[i] = atomarray[i].occupancy;
3240  }
3241 }
int numAtoms
Definition: Molecule.h:557

Friends And Related Function Documentation

friend class AngleElem
friend

Definition at line 216 of file Molecule.h.

friend class AnisoElem
friend

Definition at line 220 of file Molecule.h.

friend class BondElem
friend

Definition at line 215 of file Molecule.h.

friend class CrosstermElem
friend

Definition at line 221 of file Molecule.h.

friend class DihedralElem
friend

Definition at line 217 of file Molecule.h.

friend class ExclElem
friend

Definition at line 214 of file Molecule.h.

friend class GromacsPairElem
friend

Definition at line 223 of file Molecule.h.

friend class ImproperElem
friend

Definition at line 218 of file Molecule.h.

friend class TholeElem
friend

Definition at line 219 of file Molecule.h.

friend class WorkDistrib
friend

Definition at line 225 of file Molecule.h.

Member Data Documentation

Angle* Molecule::alch_unpert_angles
Bond* Molecule::alch_unpert_bonds
Dihedral* Molecule::alch_unpert_dihedrals
int Molecule::alchDroppedAngles

Definition at line 564 of file Molecule.h.

Referenced by NamdState::loadStructure().

int Molecule::alchDroppedDihedrals

Definition at line 565 of file Molecule.h.

Referenced by NamdState::loadStructure().

int Molecule::alchDroppedImpropers

Definition at line 566 of file Molecule.h.

Referenced by NamdState::loadStructure().

int32* Molecule::atomChainTypes
Vector* Molecule::consForce

Definition at line 614 of file Molecule.h.

Referenced by ComputeConsForce::doForce(), and ComputeMgr::recvComputeConsForceMsg().

int32* Molecule::consForceIndexes

Definition at line 613 of file Molecule.h.

Referenced by ComputeConsForce::doForce(), and ComputeMgr::recvComputeConsForceMsg().

int32* Molecule::consTorqueIndexes
ConsTorqueParams* Molecule::consTorqueParams

Definition at line 617 of file Molecule.h.

Referenced by get_constorque_params().

BigReal Molecule::energyNative

Definition at line 685 of file Molecule.h.

Referenced by build_go_arrays(), and goInit().

BigReal Molecule::energyNonnative

Definition at line 686 of file Molecule.h.

Referenced by build_go_arrays(), and goInit().

Real* Molecule::gA

Definition at line 677 of file Molecule.h.

Referenced by get_gro_force2().

Real* Molecule::giSigma1

Definition at line 679 of file Molecule.h.

Referenced by get_gro_force2().

Real* Molecule::giSigma2

Definition at line 681 of file Molecule.h.

Referenced by get_gro_force2().

Real* Molecule::gMu1

Definition at line 678 of file Molecule.h.

Referenced by get_gro_force2().

Real* Molecule::gMu2

Definition at line 680 of file Molecule.h.

Referenced by get_gro_force2().

GoValue Molecule::go_array[MAX_GO_CHAINS *MAX_GO_CHAINS]
int Molecule::go_indices[MAX_GO_CHAINS+1]

Definition at line 1589 of file Molecule.h.

Referenced by read_go_file(), receive_GoMolecule(), and send_GoMolecule().

Real* Molecule::goCoordinates
int* Molecule::goIndxLJA

Definition at line 654 of file Molecule.h.

Referenced by build_go_sigmas2(), receive_GoMolecule(), and send_GoMolecule().

int* Molecule::goIndxLJB

Definition at line 655 of file Molecule.h.

Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule().

int Molecule::goNumLJPair

Definition at line 653 of file Molecule.h.

Referenced by build_go_sigmas2(), receive_GoMolecule(), and send_GoMolecule().

PDB* Molecule::goPDB

Definition at line 651 of file Molecule.h.

Referenced by build_go_arrays(), build_go_sigmas(), build_go_sigmas2(), and goInit().

int32* Molecule::goResidIndices

Definition at line 646 of file Molecule.h.

Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule().

int* Molecule::goResids
int32* Molecule::goSigmaIndices
double* Molecule::goSigmaPairA

Definition at line 656 of file Molecule.h.

Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule().

double* Molecule::goSigmaPairB

Definition at line 657 of file Molecule.h.

Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule().

Real* Molecule::goSigmas
bool* Molecule::goWithinCutoff
Real* Molecule::gRepulsive

Definition at line 682 of file Molecule.h.

Referenced by get_gro_force2().

int* Molecule::gromacsPair_type

Definition at line 670 of file Molecule.h.

HydrogenGroup Molecule::hydrogenGroup

Definition at line 640 of file Molecule.h.

Referenced by WorkDistrib::createAtomLists(), and outputCompressedFile().

int* Molecule::indxGaussA

Definition at line 675 of file Molecule.h.

int* Molecule::indxGaussB

Definition at line 676 of file Molecule.h.

Referenced by get_gro_force2().

int* Molecule::indxLJA

Definition at line 666 of file Molecule.h.

int* Molecule::indxLJB

Definition at line 667 of file Molecule.h.

Referenced by get_gro_force2().

int Molecule::is_drude_psf

Definition at line 462 of file Molecule.h.

int Molecule::is_lonepairs_psf

Definition at line 463 of file Molecule.h.

int Molecule::isBFactorValid

Definition at line 1469 of file Molecule.h.

int Molecule::isOccupancyValid

Definition at line 1469 of file Molecule.h.

int Molecule::maxHydrogenGroupSize

Definition at line 601 of file Molecule.h.

Referenced by NamdState::loadStructure(), and outputCompressedFile().

int Molecule::maxMigrationGroupSize

Definition at line 603 of file Molecule.h.

Referenced by NamdState::loadStructure(), and outputCompressedFile().

int Molecule::num_alch_unpert_Angles
int Molecule::num_alch_unpert_Bonds
int Molecule::num_alch_unpert_Dihedrals
int Molecule::numAcceptors

Definition at line 570 of file Molecule.h.

int Molecule::numAngles
int Molecule::numAnisos

Number of anisotropic terms.

Definition at line 584 of file Molecule.h.

Referenced by AnisoElem::getMoleculePointers().

int Molecule::numAtoms
int Molecule::numBonds
int Molecule::numCalcAngles

Definition at line 623 of file Molecule.h.

Referenced by Controller::compareChecksums(), and dumpbench().

int Molecule::numCalcAnisos

Definition at line 632 of file Molecule.h.

Referenced by Controller::compareChecksums().

int Molecule::numCalcBonds

Definition at line 622 of file Molecule.h.

Referenced by Controller::compareChecksums(), and dumpbench().

int Molecule::numCalcCrossterms

Definition at line 626 of file Molecule.h.

Referenced by Controller::compareChecksums().

int Molecule::numCalcDihedrals

Definition at line 624 of file Molecule.h.

Referenced by Controller::compareChecksums(), and dumpbench().

int64 Molecule::numCalcExclusions

Definition at line 627 of file Molecule.h.

Referenced by Controller::compareChecksums(), and dumpbench().

int64 Molecule::numCalcFullExclusions

Definition at line 628 of file Molecule.h.

Referenced by Controller::compareChecksums().

int Molecule::numCalcImpropers

Definition at line 625 of file Molecule.h.

Referenced by Controller::compareChecksums(), and dumpbench().

int Molecule::numCalcLJPair

Definition at line 663 of file Molecule.h.

int Molecule::numCalcTholes

Definition at line 631 of file Molecule.h.

Referenced by Controller::compareChecksums().

int Molecule::numConsForce

Definition at line 612 of file Molecule.h.

Referenced by NamdState::loadStructure().

int Molecule::numConsTorque

Definition at line 596 of file Molecule.h.

Referenced by is_atom_constorqued().

int Molecule::numConstraints
int Molecule::numCrossterms
int Molecule::numDihedrals
int Molecule::numDonors

Definition at line 569 of file Molecule.h.

int Molecule::numDrudeAtoms

Number of Drude particles.

Definition at line 582 of file Molecule.h.

Referenced by NamdState::loadStructure(), and Controller::receivePressure().

int Molecule::numExclusions

Definition at line 571 of file Molecule.h.

Referenced by ExclElem::getMoleculePointers(), and NamdState::loadStructure().

int Molecule::numExPressureAtoms

Definition at line 599 of file Molecule.h.

Referenced by is_atom_exPressure().

int Molecule::numFepFinal

Definition at line 609 of file Molecule.h.

Referenced by NamdState::loadStructure().

int Molecule::numFepInitial
int Molecule::numFixedAtoms
int Molecule::numFixedGroups
int Molecule::numFixedRigidBonds
int Molecule::numGaussPair

Definition at line 674 of file Molecule.h.

int Molecule::numGoAtoms
int Molecule::NumGoChains

Definition at line 1590 of file Molecule.h.

Referenced by print_go_params(), read_go_file(), receive_GoMolecule(), and send_GoMolecule().

int Molecule::numGridforceGrids
int* Molecule::numGridforces

Definition at line 592 of file Molecule.h.

int Molecule::numHydrogenGroups
int Molecule::numImpropers
int Molecule::numLJPair

Definition at line 662 of file Molecule.h.

Referenced by build_go_sigmas2(), and GromacsPairElem::getMoleculePointers().

int Molecule::numLonepairs

Number of lone pairs.

Definition at line 581 of file Molecule.h.

Referenced by NamdState::loadStructure(), num_deg_freedom(), and Controller::receivePressure().

int Molecule::numLphosts

Number of lone pair host records in PSF.

Definition at line 585 of file Molecule.h.

int Molecule::numMigrationGroups

Definition at line 602 of file Molecule.h.

Referenced by NamdState::loadStructure(), and outputCompressedFile().

int Molecule::numMovDrag

Definition at line 594 of file Molecule.h.

Referenced by is_atom_movdragged().

int Molecule::numMultipleDihedrals

Definition at line 636 of file Molecule.h.

Referenced by NamdState::loadStructure().

int Molecule::numMultipleImpropers

Definition at line 638 of file Molecule.h.

Referenced by NamdState::loadStructure().

int Molecule::numPair

Definition at line 661 of file Molecule.h.

int Molecule::numRealBonds

Definition at line 559 of file Molecule.h.

Referenced by buildBondData(), delete_qm_bonded(), and prepare_qm().

int Molecule::numRigidBonds
int Molecule::numRotDrag

Definition at line 595 of file Molecule.h.

Referenced by is_atom_rotdragged().

int Molecule::numStirredAtoms

Definition at line 598 of file Molecule.h.

Referenced by is_atom_stirred(), and NamdState::loadStructure().

int Molecule::numTholes

Number of Thole terms.

Definition at line 583 of file Molecule.h.

Referenced by TholeElem::getMoleculePointers().

int64 Molecule::numTotalExclusions

Definition at line 572 of file Molecule.h.

int Molecule::numZeroMassAtoms

Number of atoms with zero mass.

Definition at line 586 of file Molecule.h.

Real* Molecule::pairC12

Definition at line 669 of file Molecule.h.

Referenced by get_gro_force2().

Real* Molecule::pairC6

Definition at line 668 of file Molecule.h.

Referenced by get_gro_force2().

int* Molecule::pointerToGaussBeg

Definition at line 672 of file Molecule.h.

Referenced by get_gro_force2().

int* Molecule::pointerToGaussEnd

Definition at line 673 of file Molecule.h.

Referenced by get_gro_force2().

int* Molecule::pointerToGoBeg

Definition at line 658 of file Molecule.h.

Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule().

int* Molecule::pointerToGoEnd

Definition at line 659 of file Molecule.h.

Referenced by build_go_sigmas2(), get_go_force2(), receive_GoMolecule(), and send_GoMolecule().

int* Molecule::pointerToLJBeg

Definition at line 664 of file Molecule.h.

Referenced by get_gro_force2().

int* Molecule::pointerToLJEnd

Definition at line 665 of file Molecule.h.

Referenced by get_gro_force2().

Real Molecule::r_ohc

Definition at line 468 of file Molecule.h.

Real Molecule::r_om

Definition at line 467 of file Molecule.h.

int* Molecule::ss_index

Definition at line 459 of file Molecule.h.

int Molecule::ss_num_vdw_params

Definition at line 457 of file Molecule.h.

Referenced by LJTable::LJTable().

int* Molecule::ss_vdw_type

Definition at line 458 of file Molecule.h.

int Molecule::suspiciousAlchBonds

Definition at line 563 of file Molecule.h.

Referenced by NamdState::loadStructure().

BigReal Molecule::tail_corr_dUdl_1

Definition at line 473 of file Molecule.h.

BigReal Molecule::tail_corr_dUdl_2

Definition at line 473 of file Molecule.h.

BigReal Molecule::tail_corr_ener

Definition at line 471 of file Molecule.h.

Referenced by Controller::rescaleaccelMD().

BigReal Molecule::tail_corr_virial

Definition at line 472 of file Molecule.h.

BigReal Molecule::tail_corr_virial_1

Definition at line 474 of file Molecule.h.

BigReal Molecule::tail_corr_virial_2

Definition at line 474 of file Molecule.h.


The documentation for this class was generated from the following files: