OpenLB 1.7
Loading...
Searching...
No Matches
superVtmWriter3D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2016-2017 Albert Mink, Maximilian Gaedtke, Markus Morhard Mathias J. Krause
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
29#ifndef SUPER_VTM_WRITER_3D_H
30#define SUPER_VTM_WRITER_3D_H
31
32#include <sstream>
33#include <vector>
34#include "io/ostreamManager.h"
36
37namespace olb {
38
50template<typename T, typename OUT_T=float, typename W=T>
52public:
54 SuperVTMwriter3D( const std::string& name, int overlap = 1, bool binary=true, bool compress=true );
57 const std::string& name, int overlap = 1, bool binary=true, bool compress=true );
61 void write(int iT=0);
63 void writePVD(int iT);
65 void writeGlobalVTI(int iT, int iC);
67 void writeVTI(int iT, int iCloc);
68
70 void write(SuperF3D<T,W>& f, int iT=0);
71 void write(std::shared_ptr<SuperF3D<T,W>> ptr_f, int iT=0);
72
74 // the master pvd file, where all vti are linked!
75 void createMasterFile();
76
82 void addFunctor(SuperF3D<T,W>& f, const std::string& functorName);
83
85 void clearAddedFunctors();
86
88 std::string getName() const;
89
90private:
91 CuboidGeometry3D<T>* _cGeometry = nullptr;
92
94 void preambleVTI(const std::string& fullName, const Vector<int,3> extent0, const Vector<int,3> extent1,
95 T origin[], T delta);
97 void closeVTI(const std::string& fullNamePiece);
99 void preamblePVD(const std::string& fullNamePVD);
101 void closePVD(const std::string& fullNamePVD);
103 void preambleVTM(const std::string& fullNamePVD);
105 void closeVTM(const std::string& fullNamePVD);
108 void dataVTM(int iC, const std::string& fullNamePVD, const std::string& namePiece);
111 void dataPVDmaster(int iT, const std::string& fullNamePVDMaster,
112 const std::string& namePiece);
114 void dataArray(const std::string& fullName, SuperF3D<T,W>& f,
115 int iC, const Vector<int,3> extent1);
117 void closePiece(const std::string& fullNamePiece);
118
119 OstreamManager clout;
121 bool _createFile;
123 std::string const _name;
125 std::vector< SuperF3D<T,W>* > _pointerVec;
126 int _overlap;
128 bool _binary;
130 bool _compress;
131
132};
133
134
135} // namespace olb
136
137
138#endif
A cuboid geometry represents a voxel mesh.
class for marking output with some text
represents all functors that operate on a SuperStructure<T,3> in general
SuperVTMwriter3D writes any SuperF3D to vtk-based output files.
std::string getName() const
getter for _name
void write(int iT=0)
writes functors stored in pointerVec every process writes a vti file with data for each of its cuboid...
void createMasterFile()
have to be called before calling write(int iT=0), since it creates
void writeGlobalVTI(int iT, int iC)
writes the vti file for cuboid iC at timestep iT
void clearAddedFunctors()
to clear stored functors, not yet used due to lack of necessity
SuperVTMwriter3D(const std::string &name, int overlap=1, bool binary=true, bool compress=true)
Construct writer for functor output.
void addFunctor(SuperF3D< T, W > &f)
put functor to _pointerVec to simplify writing process of several functors
void writeVTI(int iT, int iCloc)
writes the vti file for cuboid iCloc at timestep iT
void writePVD(int iT)
writes only the linking pvd file for timestep iT, blocks must be written separately (e....
Plain old scalar vector.
Definition vector.h:47
Top level namespace for all of OpenLB.