ls1-MarDyn
ls1-MarDyn molecular dynamics code
DOFProfile.h
1//
2// Created by Kruegener on 10/22/2018.
3//
4
5#ifndef MARDYN_DOFPROFILE_H
6#define MARDYN_DOFPROFILE_H
7
8
9#include "ProfileBase.h"
10#include "plugins/SpatialProfile.h"
11
15class DOFProfile final : public ProfileBase {
16public:
17 ~~DOFProfile() final = default;
18 void record(Molecule &mol, unsigned long uID) final {
19 _localProfile[uID] += 3.0 + (long double) (mol.component()->getRotationalDegreesOfFreedom());
20 }
21 void collectAppend(DomainDecompBase *domainDecomp, unsigned long uID) final {
22 domainDecomp->collCommAppendInt(_localProfile[uID]);
23 }
24 void collectRetrieve(DomainDecompBase *domainDecomp, unsigned long uID) final {
25 _globalProfile[uID] = domainDecomp->collCommGetInt();
26 }
27 void output(string prefix, long unsigned accumulatedDatasets) final;
28 void reset(unsigned long uID) final {
29 _localProfile[uID] = 0;
30 _globalProfile[uID] = 0;
31 }
32 int comms() final {return 1;}
33
34 int getGlobalDOF(unsigned long uid) const {
35 return _globalProfile.at(uid);
36 }
37
38private:
39 // Local 1D Profile
40 std::map<unsigned, int> _localProfile;
41 // Global 1D Profile
42 std::map<unsigned, int> _globalProfile;
43
44 void writeDataEntry(unsigned long uID, ofstream &outfile) const final;
45};
46
47
48#endif //MARDYN_DOFPROFILE_H
Records (NO OUTPUT) the DOF of molecules per bin specified by Sampling grid in KartesianProfile.
Definition: DOFProfile.h:15
void record(Molecule &mol, unsigned long uID) final
The recording step defines what kind of data needs to be recorded for a single molecule with a corres...
Definition: DOFProfile.h:18
int comms() final
1D profiles like a number density profile should return 1 here. 3D profiles that have 3 entries per b...
Definition: DOFProfile.h:32
void collectAppend(DomainDecompBase *domainDecomp, unsigned long uID) final
Append all necessary communication per bin to the DomainDecomposition. Append from e....
Definition: DOFProfile.h:21
void reset(unsigned long uID) final
Used to reset all array contents for a specific uID in order to start the next recording timeframe.
Definition: DOFProfile.h:28
void collectRetrieve(DomainDecompBase *domainDecomp, unsigned long uID) final
Get global values after AllReduceSum per bin. Write to e.g. _globalProfile.
Definition: DOFProfile.h:24
void output(string prefix, long unsigned accumulatedDatasets) final
Whatever is necessary to output for this profile.
Definition: DOFProfile.cpp:7
handle boundary region and multiple processes
Definition: DomainDecompBase.h:51
FullMolecule modeled as LJ sphere with point polarities.
Definition: FullMolecule.h:18
Base class for all Profile outputs used by KartesianProfile.
Definition: ProfileBase.h:34