ls1-MarDyn
ls1-MarDyn molecular dynamics code
TemperatureProfile.h
1//
2// Created by Kruegener on 10/22/2018.
3//
4
5#ifndef MARDYN_TEMPERATUREPROFILE_H
6#define MARDYN_TEMPERATUREPROFILE_H
7
8#include "ProfileBase.h"
9#include "plugins/SpatialProfile.h"
10
11class DOFProfile;
12class KineticProfile;
13
17class TemperatureProfile final : public ProfileBase {
18public:
19 TemperatureProfile(DOFProfile * dofProf, KineticProfile * kinProf) :
20 _dofProfile(dofProf), _kineticProfile(kinProf), _localProfile(), _globalProfile() {
21 }
22 ~~TemperatureProfile() final = default;
23 void record(Molecule &mol, unsigned long uID) final {
24 _localProfile[uID] += 1;
25 }
26 void collectAppend(DomainDecompBase *domainDecomp, unsigned long uID) final {
27 domainDecomp->collCommAppendLongDouble(_localProfile[uID]);
28 }
29 void collectRetrieve(DomainDecompBase *domainDecomp, unsigned long uID) final {
30 _globalProfile[uID] = domainDecomp->collCommGetLongDouble();
31 }
32 void output(string prefix, long unsigned accumulatedDatasets) final;
33 void reset(unsigned long uID) final {
34 _localProfile[uID] = 0.0;
35 _globalProfile[uID] = 0.0;
36 }
37 int comms() final {return 1;}
38
39private:
40 DOFProfile * _dofProfile;
41 KineticProfile * _kineticProfile;
42
43 // Local 1D Profile
44 std::map<unsigned, long double> _localProfile;
45 // Global 1D Profile
46 std::map<unsigned, long double> _globalProfile;
47
48 void writeDataEntry(unsigned long uID, ofstream &outfile) const final;
49};
50
51
52#endif //MARDYN_TEMPERATUREPROFILE_H
Records (NO OUTPUT) the DOF of molecules per bin specified by Sampling grid in KartesianProfile.
Definition: DOFProfile.h:15
handle boundary region and multiple processes
Definition: DomainDecompBase.h:51
FullMolecule modeled as LJ sphere with point polarities.
Definition: FullMolecule.h:18
Records (NO OUTPUT) the 2xKinetic Profile of molecules per bin specified by Sampling grid in Kartesia...
Definition: KineticProfile.h:14
Base class for all Profile outputs used by KartesianProfile.
Definition: ProfileBase.h:34
Outputs the temperature of molecules per bin specified by Sampling grid in KartesianProfile.
Definition: TemperatureProfile.h:17
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: TemperatureProfile.h:33
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: TemperatureProfile.h:23
void collectRetrieve(DomainDecompBase *domainDecomp, unsigned long uID) final
Get global values after AllReduceSum per bin. Write to e.g. _globalProfile.
Definition: TemperatureProfile.h:29
void output(string prefix, long unsigned accumulatedDatasets) final
Whatever is necessary to output for this profile.
Definition: TemperatureProfile.cpp:10
void collectAppend(DomainDecompBase *domainDecomp, unsigned long uID) final
Append all necessary communication per bin to the DomainDecomposition. Append from e....
Definition: TemperatureProfile.h:26
int comms() final
1D profiles like a number density profile should return 1 here. 3D profiles that have 3 entries per b...
Definition: TemperatureProfile.h:37