ls1-MarDyn
ls1-MarDyn molecular dynamics code
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MmpldWriter Class Reference

Output plugin to generate a MegaMolâ„¢ Particle List Data file (*.mmpld). More...

#include <MmpldWriter.h>

Inheritance diagram for MmpldWriter:
PluginBase MmpldWriterMultiSphere MmpldWriterSimpleSphere

Public Member Functions

void readXML (XMLfileUnits &xmlconfig)
 Method readXML will be called once for each plugin section in the input file. More...
 
void init (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain)
 Method init will be called at the begin of the simulation. More...
 
void endStep (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain, unsigned long simstep)
 Method endStep will be called at the end of each time step. More...
 
void finish (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain)
 Method finish will be called at the end of the simulation. More...
 
std::string getPluginName ()
 return the name of the plugin More...
 
void SetInitSphereDataParameters (const uint8_t &bInitSphereData, const std::string &strSphereDataFilename)
 
- Public Member Functions inherited from PluginBase
 PluginBase ()
 Subclasses should use their constructur to pass parameters (e.g. filenames)
 
virtual void beforeEventNewTimestep (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep)
 Method will be called first thing in a new timestep. More...
 
virtual void beforeForces (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep)
 Method beforeForces will be called before forcefields have been applied no alterations w.r.t. Forces shall be made here. More...
 
virtual void siteWiseForces (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep)
 Method siteWiseForces will be called before forcefields have been applied alterations to sitewise forces and fullMolecule forces can be made here. More...
 
virtual void afterForces (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, unsigned long simstep)
 Method afterForces will be called after forcefields have been applied no sitewise Forces can be applied here. More...
 
virtual void registerCallbacks (std::map< std::string, FunctionWrapper > &callbackMap)
 
virtual void accessAllCallbacks (const std::map< std::string, FunctionWrapper > &callbackMap)
 

Static Public Member Functions

static PluginBasecreateInstance ()
 

Protected Member Functions

 MmpldWriter (uint64_t startTimestep, uint64_t writeFrequency, uint64_t stopTimestep, uint64_t numFramesPerFile, std::string outputPrefix)
 : writes a mmspd file used by MegaMol More...
 
virtual void SetNumSphereTypes ()
 
virtual void CalcNumSpheresPerType (ParticleContainer *particleContainer, uint64_t *numSpheresPerType)
 
virtual bool GetSpherePos (float *spherePos, Molecule *mol, uint8_t &nSphereTypeIndex)
 
void InitSphereData ()
 
std::string getOutputFilename ()
 
void MultiFileApproachReset (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp, Domain *domain)
 
void PrepareWriteControl ()
 
long get_data_frame_header_size ()
 
long get_seekTable_size ()
 
void writeSeekTableEntry (int id, uint64_t offset)
 
long get_data_list_header_size ()
 
long get_particle_data_size ()
 
long get_data_list_size (uint64_t particle_count)
 
void write_frame_header (uint32_t num_data_lists)
 
void write_particle_list_header (uint64_t particle_count, int sphereId)
 
void write_frame (ParticleContainer *particleContainer, DomainDecompBase *domainDecomp)
 

Protected Attributes

uint64_t _startTimestep
 
uint64_t _writeFrequency
 
uint64_t _stopTimestep
 
long _writeBufferSize
 
std::string _outputPrefix
 
std::string _timestampString
 
uint32_t _frameCount
 
uint8_t _numComponents
 
uint8_t _numSitesTotal
 
uint8_t _numSphereTypes
 
std::vector< uint64_t > _seekTable
 
std::vector< uint8_t > _numSitesPerComp
 
std::vector< uint8_t > _nCompSitesOffset
 
std::string _strSphereDataFilename
 
uint8_t _bInitSphereData
 
bool _bWriteControlPrepared
 
long _fileCount
 
uint32_t _numFramesPerFile
 
uint16_t _mmpldversion
 
uint32_t _numSeekEntries
 
MMPLD_Vertex_type _vertex_type
 
MMPLD_Color_type _color_type
 
std::vector< float > _global_radius
 
std::vector< std::array< uint8_t, 4 > > _global_rgba
 
std::vector< std::array< float, 2 > > _global_intensity_range
 
MPI_File _mpifh
 
MPI_Info_object _mpiinfo
 

Detailed Description

Output plugin to generate a MegaMolâ„¢ Particle List Data file (*.mmpld).

Constructor & Destructor Documentation

◆ MmpldWriter()

MmpldWriter::MmpldWriter ( uint64_t  startTimestep,
uint64_t  writeFrequency,
uint64_t  stopTimestep,
uint64_t  numFramesPerFile,
std::string  outputPrefix 
)
protected

: writes a mmspd file used by MegaMol

Depending on write frequency (for example: every timestep, or every 10th, 100th, 1000th ...) number of frames can be controlled. The *.mmspd-file can be visualized by visualization software like MegaMol. (for detail information visit: https://svn.vis.uni-stuttgart.de/trac/megamol/)

Parameters
filenameName of the *.mmspd-file (including path)
particleContainerThe molecules that have to be written to the file are stored here
domainDecompIn the parallel version, the file has to be written by more than one process. Methods to achieve this are available in domainDecomp
writeFrequencyControls the frequency of writing out the data (every timestep, every 10th, 100th, ... timestep)

Member Function Documentation

◆ endStep()

void MmpldWriter::endStep ( ParticleContainer particleContainer,
DomainDecompBase domainDecomp,
Domain domain,
unsigned long  simstep 
)
virtual

Method endStep will be called at the end of each time step.

This method will be called every time step passing the simstep as an additional parameter. It can be used e.g. to write per time step data to a file or perform additional computations.

Parameters
particleContainerparticle container storing the (local) molecules
domainDecompdomain decomposition in use
domain

Implements PluginBase.

◆ finish()

void MmpldWriter::finish ( ParticleContainer particleContainer,
DomainDecompBase domainDecomp,
Domain domain 
)
virtual

Method finish will be called at the end of the simulation.

This method will be called once at the end of the simulation. It can be used e.g. to closing output files or writing final statistics.

Parameters
particleContainerparticle container storing the (local) molecules
domainDecompdomain decomposition in use
domain
Todo:
end of frame offset may not be identical to file end!

Implements PluginBase.

◆ getPluginName()

std::string MmpldWriter::getPluginName ( )
inlinevirtual

return the name of the plugin

Implements PluginBase.

◆ init()

void MmpldWriter::init ( ParticleContainer particleContainer,
DomainDecompBase domainDecomp,
Domain domain 
)
virtual

Method init will be called at the begin of the simulation.

This method will be called once at the begin of the simulation just right before the main time step loop. It can be used e.g. to open output files or initialize statistics.

Parameters
particleContainerparticle container storing the (local) molecules
domainDecompdomain decomposition in use
domain
Todo:
MMPLD writer takes into account only LJ sites at the moment, here

Implements PluginBase.

◆ readXML()

void MmpldWriter::readXML ( XMLfileUnits xmlconfig)
virtual

Method readXML will be called once for each plugin section in the input file.

This method can be used to read in parameters from the corresponding plugin section in the xml config file. The method will be called once after an instance of the plugin is created.

Note
The same plugins may be specified multiple times in the xml config file. It is the responsibility of the plugin to handle this case in a propper way.

The following xml object structure will be provided to the plugin:

<plugin name="plugin name">
<!-- options for the specific plugin -->
</plugin>
Parameters
xmlconfigsection of the xml file

Implements PluginBase.

Member Data Documentation

◆ _startTimestep

uint64_t MmpldWriter::_startTimestep
protected

First time step to be recorded

◆ _stopTimestep

uint64_t MmpldWriter::_stopTimestep
protected

Max time step up to which shall be recorded

◆ _writeFrequency

uint64_t MmpldWriter::_writeFrequency
protected

time steps between two records


The documentation for this class was generated from the following files: