83 std::string
name = handler_.getName();
88 #ifdef MERCURYDPM_USE_MPI
91 fileName = handler_.getDPMBase()->getName() +
"Processor_" + std::to_string(
PROCESSOR_ID) +
92 '_' +
name +
'_' + std::to_string(fileCounter++) +
".vtu";
96 fileName = handler_.getDPMBase()->getName() +
98 std::to_string(fileCounter++) +
".vtu";
101 fileName = handler_.getDPMBase()->getName() +
103 std::to_string(fileCounter++) +
".vtu";
108 file.open(fileName.c_str(), std::ios_base::out);
111 logger(
WARN,
"File % could not be opened", fileName);
115 file <<
"<?xml version=\"1.0\"?>\n";
116 file <<
"<!-- time " << handler_.getDPMBase()->getTime() <<
"-->\n";
117 file <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
118 file <<
"<UnstructuredGrid>\n";
127 file <<
" <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
128 file <<
" </DataArray>\n";
129 file <<
" <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
130 file <<
" </DataArray>\n";
131 file <<
" <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
132 file <<
" </DataArray>\n";
133 file <<
"</Cells>\n";
134 file <<
"</Piece>\n";
135 file <<
"</UnstructuredGrid>\n";
136 file <<
"</VTKFile>\n";
#define PROCESSOR_ID
Definition: GeneralDefine.h:63
#define NUMBER_OF_PROCESSORS
For the MPI communication routines this quantity is often required. defining this macro makes the cod...
Definition: GeneralDefine.h:62
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
Definition: BaseVTKWriter.h:40
void setFileCounter(unsigned fileCounter)
Definition: BaseVTKWriter.h:61
BaseVTKWriter(H &handler)
Definition: BaseVTKWriter.h:44
virtual void writeVTK() const =0
void writeVTKFooterAndClose(std::fstream &file) const
Definition: BaseVTKWriter.h:123
H & handler_
particle handler from which the particles should be written
Definition: BaseVTKWriter.h:72
std::fstream makeVTKFileWithHeader() const
Definition: BaseVTKWriter.h:80
BaseVTKWriter(const BaseVTKWriter &other)
Definition: BaseVTKWriter.h:49
unsigned int fileCounter
Definition: BaseVTKWriter.h:74
unsigned getFileCounter() const
Definition: BaseVTKWriter.h:56
std::string name
Definition: MercuryProb.h:48