VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
WbWriterVtkASCII.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 WBWRITERVTKASCII_H
35#define WBWRITERVTKASCII_H
36
38
40{
41public:
43 {
44 static WbWriterVtkASCII instance;
45 return &instance;
46 }
47
48private:
50 WbWriterVtkASCII(const WbWriterVtkASCII &); // no copy allowed
51 const WbWriterVtkASCII &operator=(const WbWriterVtkASCII &); // no copy allowed
52
53public:
54 std::string getFileExtension() override { return ".ascii.vtk"; }
55
57 // lines
58 // 0 ---- 1
59 // nodenumbering must start with 0!
60 std::string writeLines(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
61 std::vector<UbTupleInt2> &lines) override;
62
64 // triangles
65 // cell numbering:
66 // 2
67 //
68 // 0---1
69 // nodenumbering must start with 0!
70 std::string writeTriangles(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
71 std::vector<UbTupleInt3> &cells) override;
72 std::string writeTrianglesWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
73 std::vector<UbTupleInt3> &cells, std::vector<std::string> &datanames,
74 std::vector<std::vector<double>> &nodedata) override;
75
77 // 2D
78 // cell numbering:
79 // 3---2
80 // | |
81 // 0---1
82 // nodenumbering must start with 0!
83 std::string writeQuads(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
84 std::vector<UbTupleInt4> &cells) override;
85 std::string writeQuadsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
86 std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
87 std::vector<std::vector<double>> &nodedata) override;
88 std::string writeQuadsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
89 std::vector<UbTupleInt4> &cells, std::vector<std::string> &datanames,
90 std::vector<std::vector<double>> &celldata) override;
91 std::string writeQuadsWithNodeAndCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
92 std::vector<UbTupleInt4> &cells, std::vector<std::string> &nodedatanames,
93 std::vector<std::vector<double>> &nodedata,
94 std::vector<std::string> &celldatanames,
95 std::vector<std::vector<double>> &celldata) override;
96
98 // octs
99 // 7 ---- 6
100 // /| /|
101 // 4 +--- 5 |
102 // | | | |
103 // | 3 ---+ 2
104 // |/ |/
105 // 0 ---- 1
106 std::string writeOcts(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
107 std::vector<UbTupleInt8> &cells) override;
108 std::string writeOctsBinary(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
109 std::vector<UbTupleInt8> &cells);
110 std::string writeOctsWithCellData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
111 std::vector<UbTupleInt8> &cells, std::vector<std::string> &datanames,
112 std::vector<std::vector<double>> &celldata) override;
113 std::string writeOctsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
114 std::vector<UbTupleUInt8> &cells, std::vector<std::string> &datanames,
115 std::vector<std::vector<double>> &nodedata) override;
116};
117
118#endif // WBWRITERVTKASCII_H
119
std::string getFileExtension() override
std::string writeOctsBinary(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt8 > &cells)
static WbWriterVtkASCII * getInstance()
std::shared_ptr< T > SPtr
std::string writeQuadsWithNodeData(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt4 > &cells, std::vector< std::string > &datanames, std::vector< std::vector< double > > &nodedata) override
std::string writeLines(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt2 > &lines) override
std::string writeTrianglesWithNodeData(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt3 > &cells, std::vector< std::string > &datanames, std::vector< std::vector< double > > &nodedata) override
std::string writeOcts(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt8 > &cells) override
std::string writeQuads(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt4 > &cells) override
std::string writeTriangles(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt3 > &cells) override
std::string writeOctsWithCellData(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt8 > &cells, std::vector< std::string > &datanames, std::vector< std::vector< double > > &celldata) override
std::string writeQuadsWithNodeAndCellData(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt4 > &cells, std::vector< std::string > &nodedatanames, std::vector< std::vector< double > > &nodedata, std::vector< std::string > &celldatanames, std::vector< std::vector< double > > &celldata) override
std::string writeOctsWithNodeData(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleUInt8 > &cells, std::vector< std::string > &datanames, std::vector< std::vector< double > > &nodedata) override
std::string writeQuadsWithCellData(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt4 > &cells, std::vector< std::string > &datanames, std::vector< std::vector< double > > &celldata) override