OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
olb::SuperParticleSysVtuWriterMag< T > Class Template Reference

#include <superParticleSysVTUout.h>

+ Inheritance diagram for olb::SuperParticleSysVtuWriterMag< T >:
+ Collaboration diagram for olb::SuperParticleSysVtuWriterMag< T >:

Public Member Functions

 SuperParticleSysVtuWriterMag (SuperParticleSystem3D< T, MagneticParticle3D > &, std::string const, const std::bitset< 9 > &properties, bool binary=true)
 
 SuperParticleSysVtuWriterMag (const SuperParticleSysVtuWriterMag< T > &rhs)
 
 SuperParticleSysVtuWriterMag (const SuperParticleSysVtuWriterMag< T > &&rhs)
 
void write (int iT=0)
 
void set (int)
 
- Public Member Functions inherited from olb::SuperParticleSysVtuWriter< T, MagneticParticle3D >
 SuperParticleSysVtuWriter (SuperParticleSystem3D< T, MagneticParticle3D > &, std::string const, unsigned short properties, bool binary=true)
 
 SuperParticleSysVtuWriter (const SuperParticleSysVtuWriter< T, MagneticParticle3D > &rhs)
 
 SuperParticleSysVtuWriter (const SuperParticleSysVtuWriter< T, MagneticParticle3D > &&rhs)
 
void write (int iT=0)
 
int numofpsys ()
 
void set (unsigned short)
 

Public Attributes

const int pPropActive = 0
 
const int pPropCuboid = 1
 
const int pPropMass = 2
 
const int pPropRadius = 3
 
const int pPropVelocity = 4
 
const int pPropForce = 5
 
const int pPropAVel = 6
 
const int pPropTorque = 7
 
const int pPropMoment = 8
 

Additional Inherited Members

- Public Types inherited from olb::SuperParticleSysVtuWriter< T, MagneticParticle3D >
enum  particleProperties
 
- Protected Member Functions inherited from olb::SuperParticleSysVtuWriter< T, MagneticParticle3D >
void preambleVTU (const std::string &fullName)
 performes <VTKFile ...>, <ImageData ...> and <PieceExtent ...>
 
void closeVTU (const std::string &fullNamePiece)
 performes </ImageData> and </VTKFile>
 
void preamblePVD (const std::string &fullNamePVD)
 performes <VTKFile ...> and <Collection>
 
void closePVD (const std::string &fullNamePVD)
 performes </Collection> and </VTKFile>
 
void dataPVD (int iT, int iR, const std::string &fullNamePVD, const std::string &namePiece)
 performes <DataSet timestep= ... file=namePiece >
 
void dataPVDmaster (int iT, int iR, const std::string &fullNamePVDMaster, const std::string &namePiece)
 performes <DataSet timestep= ... file=namePiece >
 
void dataArray (const std::string &fullName)
 writes functors stored at pointerVec
 
void dataArrayBinary (const std::string &fullName)
 writes functors stored at pointerVec
 
void preambleOneFile (const std::string &fullName)
 performes <VTKFile...> and <ImageData ...>
 
void writePieceToOneFile (const std::string &fullName)
 writes instantaniously given functor, without adding to _pointerVec
 
void createMasterFile ()
 
- Protected Attributes inherited from olb::SuperParticleSysVtuWriter< T, MagneticParticle3D >
SuperParticleSystem3D< T, MagneticParticle3D > & _psys
 
std::string _name
 
unsigned short _properties
 
bool _binary
 
bool _haveMaster
 
OstreamManager clout
 

Detailed Description

template<typename T>
class olb::SuperParticleSysVtuWriterMag< T >

Definition at line 106 of file superParticleSysVTUout.h.

Constructor & Destructor Documentation

◆ SuperParticleSysVtuWriterMag() [1/3]

template<typename T >
olb::SuperParticleSysVtuWriterMag< T >::SuperParticleSysVtuWriterMag ( SuperParticleSystem3D< T, MagneticParticle3D > & psys,
std::string const filename,
const std::bitset< 9 > & properties,
bool binary = true )

Definition at line 690 of file superParticleSysVTUout.hh.

692 :
693 SuperParticleSysVtuWriter<T, MagneticParticle3D>(psys, filename, 0, binary), _properties(properties) {}

◆ SuperParticleSysVtuWriterMag() [2/3]

template<typename T >
olb::SuperParticleSysVtuWriterMag< T >::SuperParticleSysVtuWriterMag ( const SuperParticleSysVtuWriterMag< T > & rhs)

Definition at line 681 of file superParticleSysVTUout.hh.

681 :
682 SuperParticleSysVtuWriter<T, MagneticParticle3D>(rhs), _properties(rhs._properties) {}

◆ SuperParticleSysVtuWriterMag() [3/3]

template<typename T >
olb::SuperParticleSysVtuWriterMag< T >::SuperParticleSysVtuWriterMag ( const SuperParticleSysVtuWriterMag< T > && rhs)

Definition at line 685 of file superParticleSysVTUout.hh.

685 :
686 SuperParticleSysVtuWriter<T, MagneticParticle3D>(rhs), _properties(rhs._properties) {}

Member Function Documentation

◆ set()

template<typename T >
void olb::SuperParticleSysVtuWriterMag< T >::set ( int pref)

Definition at line 1324 of file superParticleSysVTUout.hh.

1325{
1326 _properties.set(pref);
1327}

◆ write()

template<typename T >
void olb::SuperParticleSysVtuWriterMag< T >::write ( int iT = 0)

Definition at line 1279 of file superParticleSysVTUout.hh.

1280{
1281 //std::cout << "Write derived" << std::endl;
1282 int rank = 0;
1283 int size = 1;
1284#ifdef PARALLEL_MODE_MPI
1285 rank = singleton::mpi().getRank();
1286 size = singleton::mpi().getSize();
1287#endif
1288
1289 if (rank == 0) { // master only
1290 if (!this->_haveMaster) {
1291 this->createMasterFile();
1292 }
1293
1294 std::string fullNamePVDmaster = singleton::directories().getVtkOutDir()
1295 + createFileName(this->_name) + "_master.pvd";
1296 std::string fullNamePVD = singleton::directories().getVtkOutDir() + "data/"
1297 + createFileName(this->_name, iT) + ".pvd";
1298
1299 this->preamblePVD(fullNamePVD); // timestep
1300 for (int iR = 0; iR < size; iR++) { // cuboid
1301 std::string namePiece = "data/" + createFileName(this->_name, iT, iR) + ".vtu";
1302 // puts name of .vti piece to a .pvd file [fullNamePVD]
1303 this->dataPVD(iT, iR, fullNamePVD, namePiece);
1304 // adds a namePiece to master.pvd file.
1305 // To do so we overwrite closePVD() and add new entry.
1306 this->dataPVDmaster(iT, iR, fullNamePVDmaster, namePiece);
1307 } // cuboid
1308 this->closePVD(fullNamePVD); // timestep
1309 } // master only
1310
1311 std::string fullNameVTU = singleton::directories().getVtkOutDir()
1312 + "data/" + createFileName(this->_name, iT, rank) + ".vtu";
1313 this->preambleVTU(fullNameVTU);
1314 if (this->_binary) {
1315 this->dataArrayBinary(fullNameVTU);
1316 }
1317 else {
1318 this->dataArray(fullNameVTU);
1319 }
1320 this->closeVTU(fullNameVTU);
1321}
void preamblePVD(const std::string &fullNamePVD)
performes <VTKFile ...> and <Collection>
void dataPVDmaster(int iT, int iR, const std::string &fullNamePVDMaster, const std::string &namePiece)
performes <DataSet timestep= ... file=namePiece >
void closeVTU(const std::string &fullNamePiece)
performes </ImageData> and </VTKFile>
void preambleVTU(const std::string &fullName)
performes <VTKFile ...>, <ImageData ...> and <PieceExtent ...>
void dataPVD(int iT, int iR, const std::string &fullNamePVD, const std::string &namePiece)
performes <DataSet timestep= ... file=namePiece >
void closePVD(const std::string &fullNamePVD)
performes </Collection> and </VTKFile>
std::string getVtkOutDir() const
Definition singleton.h:97
int getSize() const
Returns the number of processes.
int getRank() const
Returns the process ID.
MpiManager & mpi()
Directories & directories()
Definition singleton.h:150
std::string createFileName(std::string name)
for .pvd masterFile
Definition fileName.hh:34

References olb::createFileName(), olb::singleton::directories(), olb::singleton::MpiManager::getRank(), olb::singleton::MpiManager::getSize(), olb::singleton::Directories::getVtkOutDir(), and olb::singleton::mpi().

+ Here is the call graph for this function:

Member Data Documentation

◆ pPropActive

template<typename T >
const int olb::SuperParticleSysVtuWriterMag< T >::pPropActive = 0

Definition at line 108 of file superParticleSysVTUout.h.

◆ pPropAVel

template<typename T >
const int olb::SuperParticleSysVtuWriterMag< T >::pPropAVel = 6

Definition at line 114 of file superParticleSysVTUout.h.

◆ pPropCuboid

template<typename T >
const int olb::SuperParticleSysVtuWriterMag< T >::pPropCuboid = 1

Definition at line 109 of file superParticleSysVTUout.h.

◆ pPropForce

template<typename T >
const int olb::SuperParticleSysVtuWriterMag< T >::pPropForce = 5

Definition at line 113 of file superParticleSysVTUout.h.

◆ pPropMass

template<typename T >
const int olb::SuperParticleSysVtuWriterMag< T >::pPropMass = 2

Definition at line 110 of file superParticleSysVTUout.h.

◆ pPropMoment

template<typename T >
const int olb::SuperParticleSysVtuWriterMag< T >::pPropMoment = 8

Definition at line 116 of file superParticleSysVTUout.h.

◆ pPropRadius

template<typename T >
const int olb::SuperParticleSysVtuWriterMag< T >::pPropRadius = 3

Definition at line 111 of file superParticleSysVTUout.h.

◆ pPropTorque

template<typename T >
const int olb::SuperParticleSysVtuWriterMag< T >::pPropTorque = 7

Definition at line 115 of file superParticleSysVTUout.h.

◆ pPropVelocity

template<typename T >
const int olb::SuperParticleSysVtuWriterMag< T >::pPropVelocity = 4

Definition at line 112 of file superParticleSysVTUout.h.


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