OpenLB 1.7
Loading...
Searching...
No Matches
superParticleSysVTUout.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2013 Thomas Henn, 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
24#ifndef SUPERPARTICLESYSVTUOUT_H
25#define SUPERPARTICLESYSVTUOUT_H
26
27#include <stddef.h>
28#include <sys/types.h>
29#include <cstdint>
30#include <fstream>
31#include <iostream>
32#include <string>
33#include <bitset>
34
35#include "core/singleton.h"
36#include "io/base64.h"
37#include "io/base64.hh"
38#include "io/fileName.h"
39#include "io/ostreamManager.h"
41
42namespace olb {
43
44template<typename T, template<typename U> class PARTICLETYPE>
45class SuperParticleSystem3D;
46
47template<typename T, template<typename U> class PARTICLETYPE>
49public:
50 // SuperParticleSysVtuWriter() = default;
52 std::string const,
53 unsigned short properties,
54 bool binary = true);
57
58 void write(int iT = 0);
59
60 int numofpsys();
61
62 void set(unsigned short);
63
65 : unsigned short {velocity = 1, radius = 2, mass = 4, force = 8, cuboid = 16, active = 32};
66
67//private:
68protected:
70 void preambleVTU(const std::string& fullName);
72 void closeVTU(const std::string& fullNamePiece);
74 void preamblePVD(const std::string& fullNamePVD);
76 void closePVD(const std::string& fullNamePVD);
78 void dataPVD(int iT, int iR, const std::string& fullNamePVD,
79 const std::string& namePiece);
81 void dataPVDmaster(int iT, int iR, const std::string& fullNamePVDMaster,
82 const std::string& namePiece);
84 void dataArray(const std::string& fullName);
86 void dataArrayBinary(const std::string& fullName);
88 void preambleOneFile(const std::string& fullName);
90 void writePieceToOneFile(const std::string& fullName);
91
92 void createMasterFile();
93
94//private:
95protected:
97 std::string _name;
98 unsigned short _properties;
99 bool _binary;
102
103};
104
105template<typename T>
106class SuperParticleSysVtuWriterMag : public SuperParticleSysVtuWriter<T, MagneticParticle3D> {
107public:
108 const int pPropActive = 0;
109 const int pPropCuboid = 1;
110 const int pPropMass = 2;
111 const int pPropRadius = 3;
112 const int pPropVelocity = 4;
113 const int pPropForce = 5;
114 const int pPropAVel = 6;
115 const int pPropTorque = 7;
116 const int pPropMoment = 8;
117
119 std::string const,
120 const std::bitset<9>& properties,
121 bool binary = true);
124
125 void write(int iT = 0);
126 void set(int);
127
128private:
129 void dataArray(const std::string& fullName);
130 void dataArrayBinary(const std::string& fullName);
131
132 std::bitset<9> _properties;
133
134};
135
136} // namespace OLB
137
138#endif /* SUPERPARTICLESYSVTUOUT_H */
class for marking output with some text
SuperParticleSysVtuWriterMag(SuperParticleSystem3D< T, MagneticParticle3D > &, std::string const, const std::bitset< 9 > &properties, bool binary=true)
void preambleOneFile(const std::string &fullName)
performes <VTKFile...> and <ImageData ...>
void preamblePVD(const std::string &fullNamePVD)
performes <VTKFile ...> and <Collection>
SuperParticleSysVtuWriter(SuperParticleSystem3D< T, PARTICLETYPE > &, std::string const, unsigned short properties, bool binary=true)
void writePieceToOneFile(const std::string &fullName)
writes instantaniously given functor, without adding to _pointerVec
void dataPVDmaster(int iT, int iR, const std::string &fullNamePVDMaster, const std::string &namePiece)
performes <DataSet timestep= ... file=namePiece >
SuperParticleSystem3D< T, PARTICLETYPE > & _psys
void closeVTU(const std::string &fullNamePiece)
performes </ImageData> and </VTKFile>
void preambleVTU(const std::string &fullName)
performes <VTKFile ...>, <ImageData ...> and <PieceExtent ...>
void dataArrayBinary(const std::string &fullName)
writes functors stored at pointerVec
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>
void dataArray(const std::string &fullName)
writes functors stored at pointerVec
The class superParticleSystem is the basis for particulate flows within OpenLB.
These functions help you to create file names.
Top level namespace for all of OpenLB.
Definition of singletons: global, publicly available information.