ls1-MarDyn
ls1-MarDyn molecular dynamics code
ProfileBase.h
1//
2// Created by Kruegener on 8/19/2018.
3//
4
5#ifndef MARDYN_TRUNK_PROFILEBASE_H
6#define MARDYN_TRUNK_PROFILEBASE_H
7
8#include "../../Domain.h"
9#include "../../parallel/DomainDecompBase.h"
10
11class SpatialProfile;
12
14 double universalInvProfileUnit[3]; // Inv. Bin Sizes
15 double universalProfileUnit[3]; // Bin Sizes
16 double globalLength[3]; // Size of Domain
17 double segmentVolume; // Size of one Sampling grid bin
18 double universalCentre[3]; // Centre coords for cylinder system
19 unsigned long globalNumMolecules; // number of molecules in system
20 unsigned long numMolFixRegion; // number of molecules in Fix Region
21 bool cylinder; // Cartesian or Cylinder output
22};
23
35
36public:
37
38 virtual ~~ProfileBase() {};
39
44 virtual void init(SamplingInformation& samplingInformation) { _samplInfo = samplingInformation; };
45
51 virtual void record(Molecule& mol, unsigned long uID) = 0;
52
58 virtual void collectAppend(DomainDecompBase* domainDecomp, unsigned long uID) = 0;
59
65 virtual void collectRetrieve(DomainDecompBase* domainDecomp, unsigned long uID) = 0;
66
74 virtual void output(string prefix, long unsigned accumulatedDatasets) = 0;
75
80 virtual void reset(unsigned long uID) = 0;
81
87 virtual int comms() = 0;
88
89protected:
90 // output file prefix
91 string _profilePrefix;
92
93 SamplingInformation _samplInfo;
94 long _accumulatedDatasets = -1; // Number of Datasets between output writes / profile resets // -1 if not set properly
95
101 virtual void writeDataEntry(unsigned long uID, ofstream& outfile) const = 0;
102
107 void writeMatrix(ofstream& outfile);
108
109 void writeKartMatrix(ofstream& outfile);
110
115 // TODO: implement if needed
116 void writeSimpleMatrix(ofstream& outfile);
117
122 void writeCylMatrix(ofstream& outfile);
123};
124
125#endif //MARDYN_TRUNK_PROFILEBASE_H
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
virtual void output(string prefix, long unsigned accumulatedDatasets)=0
Whatever is necessary to output for this profile.
virtual void writeDataEntry(unsigned long uID, ofstream &outfile) const =0
Write Single Data Entry for Matrix with given uID to outfile.
virtual void reset(unsigned long uID)=0
Used to reset all array contents for a specific uID in order to start the next recording timeframe.
virtual void collectAppend(DomainDecompBase *domainDecomp, unsigned long uID)=0
Append all necessary communication per bin to the DomainDecomposition. Append from e....
void writeCylMatrix(ofstream &outfile)
cylinder Matrix output
Definition: ProfileBase.cpp:49
void writeMatrix(ofstream &outfile)
Matrix writing routine to avoid code duplication.
Definition: ProfileBase.cpp:8
virtual void init(SamplingInformation &samplingInformation)
Init function is given a pointer to the KartesianProfile object handling this profile....
Definition: ProfileBase.h:44
virtual void record(Molecule &mol, unsigned long uID)=0
The recording step defines what kind of data needs to be recorded for a single molecule with a corres...
virtual void collectRetrieve(DomainDecompBase *domainDecomp, unsigned long uID)=0
Get global values after AllReduceSum per bin. Write to e.g. _globalProfile.
virtual int comms()=0
1D profiles like a number density profile should return 1 here. 3D profiles that have 3 entries per b...
void writeSimpleMatrix(ofstream &outfile)
STUB for simple Matrix output without headers.
Definition: ProfileBase.cpp:45
SpatialProfile is a Plugin that is called like any other plugin derived from PluginBase....
Definition: SpatialProfile.h:73
Definition: ProfileBase.h:13