NAMD
|
#include <algorithm>
#include "CompressPsf.h"
#include "strlib.h"
#include "Molecule.h"
#include "Parameters.h"
#include "SimParameters.h"
#include "InfoStream.h"
#include "UniqueSet.h"
#include "UniqueSetIter.h"
Go to the source code of this file.
Classes | |
struct | BasicAtomInfo |
struct | AtomSigInfo |
struct | ExclSigInfo |
class | HashString |
class | HashReal |
Definition at line 1314 of file CompressPsf.C.
References UniqueSet< Elem >::add(), g_mol, and Molecule::numAtoms.
Referenced by buildExclusions().
Definition at line 1330 of file CompressPsf.C.
References UniqueSet< Elem >::add(), g_mol, and Molecule::numAtoms.
Referenced by buildExclusions().
void build14Excls | ( | UniqueSet< Exclusion > & | allExcls, |
vector< int > * | eachAtomNeighbors, | ||
int | modified | ||
) |
Definition at line 1354 of file CompressPsf.C.
References UniqueSet< Elem >::add(), g_mol, and Molecule::numAtoms.
Referenced by buildExclusions().
void buildAngleData | ( | ) |
Definition at line 1081 of file CompressPsf.C.
References ANGLE, angle::angle_type, AtomSigInfo::angleSigIndices, angle::atom1, angle::atom2, angle::atom3, eachAtomSigs, g_mol, Molecule::getAllAngles(), Molecule::numAngles, TupleSignature::setOffsets(), and sigsOfAngles.
Referenced by loadMolInfo().
void buildAtomData | ( | ) |
Definition at line 764 of file CompressPsf.C.
References atomNamePool, atomTypePool, chargePool, g_mol, Molecule::getAtomNames(), Molecule::getAtoms(), Molecule::getAtomSegResInfo(), massPool, Molecule::numAtoms, seg_resid::resid, resNamePool, and segNamePool.
Referenced by loadMolInfo().
void buildBondData | ( | ) |
Definition at line 843 of file CompressPsf.C.
References bond::atom1, bond::atom2, BOND, bond::bond_type, AtomSigInfo::bondSigIndices, eachAtomClusterID, eachAtomSigs, eachClusterID, eachClusterSize, g_mol, g_numClusters, Molecule::getAllBonds(), TupleSignature::isReal, lookupCstPool(), NAMD_die(), Molecule::numAtoms, Molecule::numBonds, Molecule::numRealBonds, TupleSignature::offset, and sigsOfBonds.
Referenced by loadMolInfo().
void buildCrosstermData | ( | ) |
Definition at line 1165 of file CompressPsf.C.
References crossterm::atom1, crossterm::atom2, crossterm::atom3, crossterm::atom4, crossterm::atom5, crossterm::atom6, crossterm::atom7, crossterm::atom8, CROSSTERM, crossterm::crossterm_type, AtomSigInfo::crosstermSigIndices, eachAtomSigs, g_mol, Molecule::getAllCrossterms(), Molecule::numCrossterms, TupleSignature::setOffsets(), and sigsOfCrossterms.
Referenced by loadMolInfo().
void buildDihedralData | ( | ) |
Definition at line 1107 of file CompressPsf.C.
References dihedral::atom1, dihedral::atom2, dihedral::atom3, dihedral::atom4, DIHEDRAL, dihedral::dihedral_type, AtomSigInfo::dihedralSigIndices, eachAtomSigs, g_mol, Molecule::getAllDihedrals(), Molecule::numDihedrals, TupleSignature::setOffsets(), and sigsOfDihedrals.
Referenced by loadMolInfo().
void buildExclusionData | ( | ) |
void buildExclusions | ( | ) |
Definition at line 1197 of file CompressPsf.C.
References SimParameters::amberOn, Exclusion::atom1, Exclusion::atom2, atomSigPool, UniqueSetIter< T >::begin(), AtomSigInfo::bondSigIndices, build12Excls(), build13Excls(), build14Excls(), UniqueSet< Elem >::clear(), eachAtomExclSigs, UniqueSetIter< T >::end(), endi(), SimParameters::exclude, ExclSigInfo::fullExclOffset, g_mol, g_simParam, iINFO(), iout, TupleSignature::isReal, ExclSigInfo::modExclOffset, Exclusion::modified, NONE, Molecule::numAtoms, TupleSignature::offset, ONEFOUR, ONETHREE, ONETWO, SimParameters::readExclusions, SCALED14, sigsOfBonds, sigsOfExclusions, UniqueSet< Elem >::size(), and ExclSigInfo::sortExclOffset().
Referenced by compress_molecule_info().
void buildImproperData | ( | ) |
Definition at line 1136 of file CompressPsf.C.
References improper::atom1, improper::atom2, improper::atom3, improper::atom4, eachAtomSigs, g_mol, Molecule::getAllImpropers(), IMPROPER, improper::improper_type, AtomSigInfo::improperSigIndices, Molecule::numImpropers, TupleSignature::setOffsets(), and sigsOfImpropers.
Referenced by loadMolInfo().
void clearGlobalVectors | ( | ) |
Definition at line 419 of file CompressPsf.C.
References atomNamePool, atomTypePool, chargePool, eachClusterSize, massPool, resNamePool, segNamePool, sigsOfAngles, sigsOfBonds, sigsOfDihedrals, sigsOfExclusions, and sigsOfImpropers.
void compress_molecule_info | ( | Molecule * | mol, |
char * | psfFileName, | ||
Parameters * | param, | ||
SimParameters * | simParam, | ||
ConfigList * | cfgList | ||
) |
Definition at line 436 of file CompressPsf.C.
References buildExclusions(), g_cfgList, g_mol, g_param, g_simParam, integrateAllAtomSigs(), loadMolInfo(), and outputCompressedFile().
Referenced by NamdState::loadStructure().
void flipNum | ( | char * | elem, |
int | elemSize, | ||
int | numElems | ||
) |
Definition at line 406 of file CompressPsf.C.
Referenced by OutputAtomRecord::flip().
void getExtraBonds | ( | StringList * | file | ) |
void integrateAllAtomSigs | ( | ) |
Definition at line 505 of file CompressPsf.C.
References atomSigPool, eachAtomSigs, g_mol, Molecule::numAtoms, sigsOfAngles, sigsOfBonds, sigsOfCrossterms, sigsOfDihedrals, sigsOfImpropers, and AtomSigInfo::sortTupleSigIndices().
Referenced by compress_molecule_info().
void loadMolInfo | ( | ) |
Before entering this function, all information about Molecule has been obtained. The Molecule::build_atom_status should also be called.
Definition at line 473 of file CompressPsf.C.
References buildAngleData(), buildAtomData(), buildBondData(), buildCrosstermData(), buildDihedralData(), buildImproperData(), eachAtomSigs, g_mol, g_param, and Molecule::numAtoms.
Referenced by compress_molecule_info().
int operator!= | ( | const FourBodyConsts & | f1, |
const FourBodyConsts & | f2 | ||
) |
Definition at line 353 of file CompressPsf.C.
References four_body_consts::delta, four_body_consts::k, and four_body_consts::n.
int operator== | ( | const AtomSigInfo & | s1, |
const AtomSigInfo & | s2 | ||
) |
Definition at line 146 of file CompressPsf.C.
References AtomSigInfo::angleSigIndices, AtomSigInfo::bondSigIndices, AtomSigInfo::crosstermSigIndices, AtomSigInfo::dihedralSigIndices, and AtomSigInfo::improperSigIndices.
int operator== | ( | const ExclSigInfo & | s1, |
const ExclSigInfo & | s2 | ||
) |
Definition at line 253 of file CompressPsf.C.
References ExclSigInfo::fullExclOffset, and ExclSigInfo::modExclOffset.
int operator== | ( | const AngleValue & | a1, |
const AngleValue & | a2 | ||
) |
Definition at line 348 of file CompressPsf.C.
References AngleValue::k, AngleValue::k_ub, AngleValue::r_ub, and AngleValue::theta0.
int operator== | ( | const DihedralValue & | d1, |
const DihedralValue & | d2 | ||
) |
Definition at line 358 of file CompressPsf.C.
References MAX_MULTIPLICITY, DihedralValue::multiplicity, and DihedralValue::values.
int operator== | ( | const ImproperValue & | d1, |
const ImproperValue & | d2 | ||
) |
Definition at line 370 of file CompressPsf.C.
References MAX_MULTIPLICITY, ImproperValue::multiplicity, and ImproperValue::values.
void outputCompressedFile | ( | FILE * | txtOfp, |
FILE * | binOfp | ||
) |
Output the compressed psf files. The binary per-atom file contains two part. The first part is used for the parallel input containing info such as atom signature ids; the second part is used for the parallel output containing infor such as cluster ids and whether an atom is water or not.
-Chao Mei
Definition at line 541 of file CompressPsf.C.
References AtomSigInfo::angleSigIndices, atomData, OutputAtomRecord::shortVals::atomNameIdx, atomNamePool, OutputAtomRecord::integerVals::atomSigIdx, atomSigPool, HydrogenGroupID::atomsInGroup, OutputAtomRecord::integerVals::atomsInGroup, HydrogenGroupID::atomsInMigrationGroup, OutputAtomRecord::integerVals::atomsInMigrationGroup, OutputAtomRecord::shortVals::atomTypeIdx, atomTypePool, ResizeArray< Elem >::begin(), AtomSigInfo::bondSigIndices, OutputAtomRecord::shortVals::chargeIdx, chargePool, COMPRESSED_PSF_MAGICNUM, COMPRESSED_PSF_VER, AtomSigInfo::crosstermSigIndices, Parameters::dihedral_array, AtomSigInfo::dihedralSigIndices, eachAtomClusterID, OutputAtomRecord::integerVals::exclSigIdx, OutputAtomRecord::fSet, ExclSigInfo::fullExclOffset, g_mol, g_numClusters, g_param, g_simParam, Molecule::getAtoms(), Molecule::getBFactorData(), Molecule::getOccupancyData(), HydrogenGroupID::GPID, OutputAtomRecord::integerVals::GPID, Molecule::hydrogenGroup, OutputAtomRecord::integerVals::hydrogenList, atom_constants::hydrogenList, Parameters::improper_array, AtomSigInfo::improperSigIndices, Molecule::is_water(), OutputAtomRecord::iSet, OutputAtomRecord::shortVals::massIdx, massPool, Molecule::maxHydrogenGroupSize, Molecule::maxMigrationGroupSize, ExclSigInfo::modExclOffset, HydrogenGroupID::MPID, OutputAtomRecord::integerVals::MPID, DihedralValue::multiplicity, ImproperValue::multiplicity, Molecule::numAtoms, Parameters::NumDihedralParams, Molecule::numHydrogenGroups, Parameters::NumImproperParams, Molecule::numMigrationGroups, TupleSignature::output(), OutputAtomRecord::integerVals::resID, ResizeArray< Elem >::resize(), OutputAtomRecord::shortVals::resNameIdx, resNamePool, Molecule::rigid_bond_length(), OutputAtomRecord::floatVals::rigidBondLength, SimParameters::rigidBonds, OutputAtomRecord::shortVals::segNameIdx, segNamePool, sigsOfAngles, sigsOfBonds, sigsOfCrossterms, sigsOfDihedrals, sigsOfExclusions, sigsOfImpropers, OutputAtomRecord::sSet, OutputAtomRecord::shortVals::vdw_type, and atom_constants::vdw_type.
Referenced by compress_molecule_info().
Definition at line 314 of file CompressPsf.C.
Referenced by outputCompressedFile().
HashPool<HashString> atomNamePool |
Definition at line 309 of file CompressPsf.C.
Referenced by buildAtomData(), clearGlobalVectors(), Molecule::get_atom_from_name(), outputCompressedFile(), Molecule::receive_Molecule(), and Molecule::send_Molecule().
HashPool<AtomSigInfo> atomSigPool |
Definition at line 313 of file CompressPsf.C.
Referenced by buildExclusions(), integrateAllAtomSigs(), outputCompressedFile(), Molecule::receive_Molecule(), Molecule::send_Molecule(), ParallelIOMgr::updateMolInfo(), and Molecule::~Molecule().
HashPool<HashString> atomTypePool |
Definition at line 310 of file CompressPsf.C.
Referenced by buildAtomData(), clearGlobalVectors(), Molecule::get_atomtype(), and outputCompressedFile().
Definition at line 311 of file CompressPsf.C.
Referenced by buildAtomData(), clearGlobalVectors(), and outputCompressedFile().
int* eachAtomClusterID = NULL |
Definition at line 317 of file CompressPsf.C.
Referenced by buildBondData(), and outputCompressedFile().
ExclSigInfo* eachAtomExclSigs |
Definition at line 330 of file CompressPsf.C.
Referenced by buildExclusions().
AtomSigInfo* eachAtomSigs |
Definition at line 327 of file CompressPsf.C.
Referenced by buildAngleData(), buildBondData(), buildCrosstermData(), buildDihedralData(), buildImproperData(), integrateAllAtomSigs(), and loadMolInfo().
vector<int> eachClusterID |
Definition at line 319 of file CompressPsf.C.
Referenced by buildBondData().
vector<int> eachClusterSize |
Definition at line 318 of file CompressPsf.C.
Referenced by buildBondData(), and clearGlobalVectors().
vector<AngleValue> extraAngleParams |
Definition at line 339 of file CompressPsf.C.
vector<Angle> extraAngles |
Definition at line 334 of file CompressPsf.C.
vector<BondValue> extraBondParams |
Definition at line 338 of file CompressPsf.C.
vector<Bond> extraBonds |
Definition at line 333 of file CompressPsf.C.
vector<DihedralValue> extraDihedralParams |
Definition at line 340 of file CompressPsf.C.
vector<Dihedral> extraDihedrals |
Definition at line 335 of file CompressPsf.C.
vector<ImproperValue> extraImproperParams |
Definition at line 341 of file CompressPsf.C.
vector<Improper> extraImpropers |
Definition at line 336 of file CompressPsf.C.
ConfigList* g_cfgList = NULL |
Definition at line 35 of file CompressPsf.C.
Referenced by compress_molecule_info().
Molecule* g_mol = NULL |
Very tricky part:
Generating the tuple type affects the Parameter object. Particularly, the "multiplicity" field in the TUPLE_array will be changed in the function assign_TUPLE_index. TUPLE=dihedral, improper.
And when we read the compressed psf files, assign_TUPLE_index functions will not be called so that the value of "multiplicity" will not be updated. This results in the incorrect energy from bonded interaction.
Therefore, we need to store its value in the compressed psf file. When it comes to read them, we need to update the Parameter object with these values.
Definition at line 32 of file CompressPsf.C.
Referenced by build12Excls(), build13Excls(), build14Excls(), buildAngleData(), buildAtomData(), buildBondData(), buildCrosstermData(), buildDihedralData(), buildExclusions(), buildImproperData(), compress_molecule_info(), integrateAllAtomSigs(), loadMolInfo(), and outputCompressedFile().
int g_numClusters = 0 |
Definition at line 320 of file CompressPsf.C.
Referenced by buildBondData(), and outputCompressedFile().
Parameters* g_param = NULL |
Definition at line 33 of file CompressPsf.C.
Referenced by compress_molecule_info(), loadMolInfo(), and outputCompressedFile().
SimParameters* g_simParam = NULL |
Definition at line 34 of file CompressPsf.C.
Referenced by buildExclusions(), compress_molecule_info(), and outputCompressedFile().
Definition at line 312 of file CompressPsf.C.
Referenced by buildAtomData(), clearGlobalVectors(), and outputCompressedFile().
HashPool<HashString> resNamePool |
Definition at line 308 of file CompressPsf.C.
Referenced by buildAtomData(), clearGlobalVectors(), and outputCompressedFile().
HashPool<HashString> segNamePool |
Definition at line 307 of file CompressPsf.C.
Referenced by buildAtomData(), clearGlobalVectors(), and outputCompressedFile().
HashPool<TupleSignature> sigsOfAngles |
Definition at line 323 of file CompressPsf.C.
Referenced by buildAngleData(), clearGlobalVectors(), integrateAllAtomSigs(), and outputCompressedFile().
HashPool<TupleSignature> sigsOfBonds |
Definition at line 322 of file CompressPsf.C.
Referenced by buildBondData(), buildExclusions(), clearGlobalVectors(), integrateAllAtomSigs(), and outputCompressedFile().
HashPool<TupleSignature> sigsOfCrossterms |
Definition at line 326 of file CompressPsf.C.
Referenced by buildCrosstermData(), integrateAllAtomSigs(), and outputCompressedFile().
HashPool<TupleSignature> sigsOfDihedrals |
Definition at line 324 of file CompressPsf.C.
Referenced by buildDihedralData(), clearGlobalVectors(), integrateAllAtomSigs(), and outputCompressedFile().
HashPool<ExclSigInfo> sigsOfExclusions |
Definition at line 329 of file CompressPsf.C.
Referenced by buildExclusions(), clearGlobalVectors(), and outputCompressedFile().
HashPool<TupleSignature> sigsOfImpropers |
Definition at line 325 of file CompressPsf.C.
Referenced by buildImproperData(), clearGlobalVectors(), integrateAllAtomSigs(), and outputCompressedFile().