ls1-MarDyn
ls1-MarDyn molecular dynamics code
|
Base class for all Profile outputs used by KartesianProfile. More...
#include <ProfileBase.h>
Public Member Functions | |
virtual void | init (SamplingInformation &samplingInformation) |
Init function is given a pointer to the KartesianProfile object handling this profile. Same for all profiles. More... | |
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 corresponding uID. More... | |
virtual void | collectAppend (DomainDecompBase *domainDecomp, unsigned long uID)=0 |
Append all necessary communication per bin to the DomainDecomposition. Append from e.g. _localProfile. More... | |
virtual void | collectRetrieve (DomainDecompBase *domainDecomp, unsigned long uID)=0 |
Get global values after AllReduceSum per bin. Write to e.g. _globalProfile. More... | |
virtual void | output (string prefix, long unsigned accumulatedDatasets)=0 |
Whatever is necessary to output for this profile. More... | |
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. More... | |
virtual int | comms ()=0 |
1D profiles like a number density profile should return 1 here. 3D profiles that have 3 entries per bin that need to be communicated would need to return 3. Adjust as needed. Same number as commAppends in collectAppend. More... | |
Protected Member Functions | |
virtual void | writeDataEntry (unsigned long uID, ofstream &outfile) const =0 |
Write Single Data Entry for Matrix with given uID to outfile. More... | |
void | writeMatrix (ofstream &outfile) |
Matrix writing routine to avoid code duplication. More... | |
void | writeKartMatrix (ofstream &outfile) |
void | writeSimpleMatrix (ofstream &outfile) |
STUB for simple Matrix output without headers. More... | |
void | writeCylMatrix (ofstream &outfile) |
cylinder Matrix output More... | |
Protected Attributes | |
string | _profilePrefix |
SamplingInformation | _samplInfo |
long | _accumulatedDatasets = -1 |
Base class for all Profile outputs used by KartesianProfile.
The major steps for all profiles are recording the profile data, communication, writing the output file and resetting everything for the next recording period. Each of these steps has a function associated with it that needs to be implemented by all profiles inheriting this class to be able to work with KartesianProfile. KartesianProfile also needs to know the number of items added to the communication per Molecule. So a DensityProfile should return 1 via Profile::comms(). A Velocity3dProfile should return 3.
A very simple example of how to use this class is the DensityProfile.
|
pure virtual |
Append all necessary communication per bin to the DomainDecomposition. Append from e.g. _localProfile.
domainDecomp | DomainDecomposition handling the communication. |
uID | uID of molecule in sampling grid, needed to put data in right spot in the profile arrays. |
Implemented in DensityProfile, DOFProfile, KineticProfile, TemperatureProfile, Velocity3dProfile, VelocityAbsProfile, Virial2DProfile, and VirialProfile.
|
pure virtual |
Get global values after AllReduceSum per bin. Write to e.g. _globalProfile.
domainDecomp | DomainDecomposition handling the communication. |
uID | uID of molecule in sampling grid, needed to put data in right spot in the profile arrays. |
Implemented in DensityProfile, DOFProfile, KineticProfile, TemperatureProfile, Velocity3dProfile, VelocityAbsProfile, Virial2DProfile, and VirialProfile.
|
pure virtual |
1D profiles like a number density profile should return 1 here. 3D profiles that have 3 entries per bin that need to be communicated would need to return 3. Adjust as needed. Same number as commAppends in collectAppend.
Implemented in DensityProfile, DOFProfile, KineticProfile, TemperatureProfile, Velocity3dProfile, VelocityAbsProfile, Virial2DProfile, and VirialProfile.
|
inlinevirtual |
Init function is given a pointer to the KartesianProfile object handling this profile. Same for all profiles.
kartProf | Pointer to KartesianProfile. Grants access to necessary global params. |
|
pure virtual |
Whatever is necessary to output for this profile.
This function varies wildly between profiles. The Profile should output to its desired format here and handle all file IO for one profile writing step.
prefix | File prefix including the global _outputPrefix for all profiles and the current timestep. Should be appended by some specific file ending for this specific profile. |
Implemented in DensityProfile, DOFProfile, KineticProfile, TemperatureProfile, Velocity3dProfile, VelocityAbsProfile, Virial2DProfile, and VirialProfile.
|
pure virtual |
The recording step defines what kind of data needs to be recorded for a single molecule with a corresponding uID.
mol | Reference to Molecule, needed to extract info such as velocity or Virial. |
uID | uID of molecule in sampling grid, needed to put data in right spot in the profile arrays. |
Implemented in DensityProfile, DOFProfile, KineticProfile, TemperatureProfile, Velocity3dProfile, VelocityAbsProfile, Virial2DProfile, and VirialProfile.
|
pure virtual |
Used to reset all array contents for a specific uID in order to start the next recording timeframe.
uID | uID of molecule in sampling grid, needed to put data in right spot in the profile arrays. |
Implemented in DensityProfile, DOFProfile, KineticProfile, TemperatureProfile, Velocity3dProfile, VelocityAbsProfile, Virial2DProfile, and VirialProfile.
|
protected |
cylinder Matrix output
outfile | opened filestream from Profile |
|
protectedpure virtual |
Write Single Data Entry for Matrix with given uID to outfile.
uID | unique ID of bin |
outfile | outfile to write to |
|
protected |
Matrix writing routine to avoid code duplication.
outfile | opened filestream from Profile |
|
protected |
STUB for simple Matrix output without headers.
outfile | opened filestream from Profile |