VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
WbWriter.h
Go to the documentation of this file.
1//=======================================================================================
2// ____ ____ __ ______ __________ __ __ __ __
3// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
4// \ \ | | | | | |_) | | | | | | | / \ | |
5// \ \ | | | | | _ / | | | | | | / /\ \ | |
6// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
7// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
8// \ \ | | ________________________________________________________________
9// \ \ | | | ______________________________________________________________|
10// \ \| | | | __ __ __ __ ______ _______
11// \ | | |_____ | | | | | | | | | _ \ / _____)
12// \ | | _____| | | | | | | | | | | \ \ \_______
13// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
14// \ _____| |__| |________| \_______/ |__| |______/ (_______/
15//
16// This file is part of VirtualFluids. VirtualFluids is free software: you can
17// redistribute it and/or modify it under the terms of the GNU General Public
18// License as published by the Free Software Foundation, either version 3 of
19// the License, or (at your option) any later version.
20//
21// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
22// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24// for more details.
25//
26// SPDX-License-Identifier: GPL-3.0-or-later
27// SPDX-FileCopyrightText: Copyright © VirtualFluids Project contributors, see AUTHORS.md in root folder
28//
33//=======================================================================================
34#ifndef WBWRITER_H
35#define WBWRITER_H
36
37#include <fstream>
38#include <iostream>
39#include <map>
40#include <sstream>
41#include <string>
42#include <vector>
43
44#include <basics/DataTypes.h>
48
50{
51public:
53 virtual ~WbWriter() = default;
54
56 // rein virtuelle Methoden
57 virtual std::string getFileExtension() = 0;
58
60 // nodes
61 virtual std::string writeNodes(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/)
62 {
63 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
64 }
65 virtual std::string writeNodesWithNodeData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
66 std::vector<std::string> & /*datanames*/,
67 std::vector<std::vector<double>> & /*nodedata*/)
68 {
69 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
70 }
71 virtual std::string writeNodesWithNodeDataDouble(const std::string & /*filename*/,
72 std::vector<UbTupleDouble3> & /*nodes*/,
73 std::vector<std::string> & /*datanames*/,
74 std::vector<std::vector<double>> & /*nodedata*/)
75 {
76 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
77 }
78
80 // lines
81 // 0 ---- 1
82 // nodenumbering must start with 0!
83 virtual std::string writeLines(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
84 std::vector<UbTupleInt2> & /*lines*/)
85 {
86 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
87 }
88 virtual std::string writePolyLines(const std::string & /*filename*/, real* /*coordinatesX*/,
89 real* /*coordinatesY*/, real* /*coordinatesZ*/, uint /*numberOfCoordinates*/)
90 {
91 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
92 }
93 virtual std::string writePolyLines(const std::string & /*filename*/, std::vector<real>& /*coordinatesX*/,
94 std::vector<real>& /*coordinatesY*/, std::vector<real>& /*coordinatesZ*/)
95 {
96 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
97 }
98 virtual std::string writeLinesWithNodeData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
99 std::vector<UbTupleInt2> & /*lines*/)
100 {
101 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
102 }
103 virtual std::string writeLinesWithLineData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
104 std::vector<UbTupleInt2> & /*lines*/, std::vector<std::string> & /*datanames*/,
105 std::vector<std::vector<float>> & /*celldata*/)
106 {
107 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
108 }
110 // triangles
111 // cell numbering:
112 // 2
113 //
114 // 0 === 1
115 // nodenumbering must start with 0!
116 virtual std::string writeTriangles(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
117 std::vector<UbTupleInt3> & /*cells*/)
118 {
119 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
120 }
121 virtual std::string writeTrianglesWithNodeData(const std::string & /*filename*/,
122 std::vector<UbTupleFloat3> & /*nodes*/,
123 std::vector<UbTupleInt3> & /*cells*/,
124 std::vector<std::string> & /*datanames*/,
125 std::vector<std::vector<double>> & /*nodedata*/)
126 {
127 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
128 }
129
131 // quads
132 // cell numbering:
133 // 3---2
134 // | |
135 // 0---1
136 // nodenumbering must start with 0!
137 virtual std::string writeQuads(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
138 std::vector<UbTupleInt4> & /*cells*/)
139 {
140 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
141 }
142 virtual std::string writeQuadsWithNodeData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
143 std::vector<UbTupleInt4> & /*cells*/,
144 std::vector<std::string> & /*datanames*/,
145 std::vector<std::vector<double>> & /*nodedata*/)
146 {
147 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
148 }
149 virtual std::string writeQuadsWithCellData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
150 std::vector<UbTupleInt4> & /*cells*/,
151 std::vector<std::string> & /*datanames*/,
152 std::vector<std::vector<double>> & /*celldata*/)
153 {
154 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
155 }
156 virtual std::string writeQuadsWithNodeAndCellData(
157 const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/, std::vector<UbTupleInt4> & /*cells*/,
158 std::vector<std::string> & /*nodedatanames*/, std::vector<std::vector<double>> & /*nodedata*/,
159 std::vector<std::string> & /*celldatanames*/, std::vector<std::vector<double>> & /*celldata*/)
160 {
161 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
162 }
163
165 // octs
166 // 7 ---- 6
167 // /| /|
168 // 4 +--- 5 |
169 // | | | |
170 // | 3 ---+ 2
171 // |/ |/
172 // 0 ---- 1
173 virtual std::string writeOcts(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
174 std::vector<UbTupleInt8> & /*cells*/)
175 {
176 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
177 }
178 virtual std::string writeOctsWithCellData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
179 std::vector<UbTupleInt8> & /*cells*/,
180 std::vector<std::string> & /*datanames*/,
181 std::vector<std::vector<double>> & /*celldata*/)
182 {
183 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
184 }
185 virtual std::string writeOctsWithNodeData(const std::string & /*filename*/, std::vector<UbTupleFloat3> & /*nodes*/,
186 std::vector<UbTupleUInt8> & /*cells*/,
187 std::vector<std::string> & /*datanames*/,
188 std::vector<std::vector<double>> & /*nodedata*/)
189 {
190 throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name());
191 }
192
193private:
194};
195
196#endif // WBWRITER_H
197
virtual std::string writeQuadsWithCellData(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleInt4 > &, std::vector< std::string > &, std::vector< std::vector< double > > &)
Definition WbWriter.h:149
virtual std::string writeNodesWithNodeDataDouble(const std::string &, std::vector< UbTupleDouble3 > &, std::vector< std::string > &, std::vector< std::vector< double > > &)
Definition WbWriter.h:71
virtual std::string writeNodes(const std::string &, std::vector< UbTupleFloat3 > &)
Definition WbWriter.h:61
virtual std::string writeQuads(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleInt4 > &)
Definition WbWriter.h:137
virtual std::string writeLines(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleInt2 > &)
Definition WbWriter.h:83
virtual std::string writeOctsWithCellData(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleInt8 > &, std::vector< std::string > &, std::vector< std::vector< double > > &)
Definition WbWriter.h:178
virtual std::string writeOctsWithNodeData(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleUInt8 > &, std::vector< std::string > &, std::vector< std::vector< double > > &)
Definition WbWriter.h:185
virtual std::string writeTrianglesWithNodeData(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleInt3 > &, std::vector< std::string > &, std::vector< std::vector< double > > &)
Definition WbWriter.h:121
virtual std::string getFileExtension()=0
virtual std::string writeLinesWithLineData(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleInt2 > &, std::vector< std::string > &, std::vector< std::vector< float > > &)
Definition WbWriter.h:103
virtual std::string writeOcts(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleInt8 > &)
Definition WbWriter.h:173
virtual std::string writePolyLines(const std::string &, real *, real *, real *, uint)
Definition WbWriter.h:88
virtual std::string writeLinesWithNodeData(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleInt2 > &)
Definition WbWriter.h:98
virtual std::string writeQuadsWithNodeData(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleInt4 > &, std::vector< std::string > &, std::vector< std::vector< double > > &)
Definition WbWriter.h:142
virtual std::string writeTriangles(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleInt3 > &)
Definition WbWriter.h:116
virtual std::string writeQuadsWithNodeAndCellData(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< UbTupleInt4 > &, std::vector< std::string > &, std::vector< std::vector< double > > &, std::vector< std::string > &, std::vector< std::vector< double > > &)
Definition WbWriter.h:156
virtual ~WbWriter()=default
virtual std::string writeNodesWithNodeData(const std::string &, std::vector< UbTupleFloat3 > &, std::vector< std::string > &, std::vector< std::vector< double > > &)
Definition WbWriter.h:65
virtual std::string writePolyLines(const std::string &, std::vector< real > &, std::vector< real > &, std::vector< real > &)
Definition WbWriter.h:93
float real
Definition DataTypes.h:42
unsigned int uint
Definition DataTypes.h:47
#define UB_EXARGS
Definition UbException.h:73