OpenLB 1.7
Loading...
Searching...
No Matches
superVtmWriter2D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2016 Albert Mink, 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_2D_H
30#define SUPER_VTM_WRITER_2D_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:
53 SuperVTMwriter2D( std::string name, int overlap = 1, bool binary = true );
57 void write(int iT=0);
59 void write(SuperF2D<T,W>& f, int iT=0);
60 void write(std::shared_ptr<SuperF2D<T,W>> ptr_f, int iT=0);
62 // the master pvd file, where all vti are linked!
63 void createMasterFile();
69 void addFunctor(SuperF2D<T,W>& f, const std::string& functorName);
71 void clearAddedFunctors();
73 std::string getName() const;
74private:
76 void preambleVTI(const std::string& fullName, int x0, int y0, int x1, int y1,
77 T originX, T originY, T delta);
79 void closeVTI(const std::string& fullNamePiece);
81 void preamblePVD(const std::string& fullNamePVD);
83 void closePVD(const std::string& fullNamePVD);
85 void preambleVTM(const std::string& fullNamePVD);
87 void closeVTM(const std::string& fullNamePVD);
90 void dataVTM(int iC, const std::string& fullNamePVD, const std::string& namePiece);
93 void dataPVDmaster(int iT, const std::string& fullNamePVDMaster,
94 const std::string& namePiece);
96 void dataArray(const std::string& fullName, SuperF2D<T,W>& f,
97 int iC, int nx, int ny);
99 void dataArrayBinary(const std::string& fullName, SuperF2D<T,W>& f,
100 int iC, int nx, int ny);
102 void closePiece(const std::string& fullNamePiece);
103private:
104 mutable OstreamManager clout;
106 bool _createFile;
108 std::string _name;
110 std::vector< SuperF2D<T,W>* > _pointerVec;
111 int _overlap;
112 bool _binary =true;
113};
114
115
116} // namespace olb
117
118
119#endif
class for marking output with some text
represents all functors that operate on a SuperStructure<T,2> in general
SuperVTMwriter2D writes any SuperF2D to vtk-based output files.
void createMasterFile()
have to be called before calling write(int iT=0), since it creates
void write(int iT=0)
writes functors stored in pointerVec every thread writes a vti file with data from his cuboids the vt...
SuperVTMwriter2D(std::string name, int overlap=1, bool binary=true)
void clearAddedFunctors()
to clear stored functors, not yet used due to lack of necessity
std::string getName() const
getter for _name
void addFunctor(SuperF2D< T, W > &f)
put functor to _pointerVec to simplify writing process of several functors
Top level namespace for all of OpenLB.