VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
WbWriterTecPlotASCII.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 WBWRITERTECPLOTASCII_H
35#define WBWRITERTECPLOTASCII_H
36
37#include <string>
38
40
42{
43public:
45 {
46 static WbWriterTecPlotASCII instance;
47 return &instance;
48 }
49
52
53private:
55 {
56 if constexpr (sizeof(unsigned char) != 1)
57 throw UbException(UB_EXARGS, "machine error char type mismatch");
58 if constexpr (sizeof(int) != 4)
59 throw UbException(UB_EXARGS, "machine error int type mismatch");
60 if constexpr (sizeof(float) != 4)
61 throw UbException(UB_EXARGS, "machine error float type mismatch");
62 }
63
64 static std::string pvdEndTag;
65
66public:
67 std::string getFileExtension() override { return ".ascii.dat"; }
68
69 // write a metafile
70 // std::string writeCollection(const std::string& filename, const std::vector<std::string>& filenames, const
71 // double& timestep, const bool& sepGroups); std::string addFilesToCollection(const std::string& filename, const
72 // std::vector<std::string>& filenames, const double& timestep, const bool& sepGroups); std::string
73 // writeParallelFile(const std::string& filename,std::vector<std::string>& pieceSources,
74 // std::vector<std::string>& pointDataNames, std::vector<std::string>& cellDataNames);
75
77 // nodes
78 // std::string writeNodes(const std::string& filename,std::vector< UbTupleFloat3 >& nodes);
79 // std::string writeNodesWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes,
80 // std::vector<std::string >& datanames, std::vector<std::vector<double > >& nodedata);
81
83 // lines
84 // 0 ---- 1
85 // nodenumbering must start with 0!
86 // std::string writeLines(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt2
87 // >& lines); std::string writeLinesWithNodeData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes,
88 // std::vector<UbTupleInt2 >& lines, std::vector< std::string >& datanames, std::vector< std::vector< double > >&
89 // nodedata);
90 //
92 // triangles
93 // 2
94 //
95 // 0---1
96 // nodenumbering must start with 0!
97 // std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes,
98 // std::vector<UbTupleInt3 >& triangles); std::string writeTrianglesWithNodeData(const std::string&
99 // filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt3 >& cells, std::vector<std::string >&
100 // datanames, std::vector<std::vector<double > >& nodedata);
101
103 // 2D
104 // cell numbering:
105 // 3---2
106 // | |
107 // 0---1
108 // nodenumbering must start with 0!
109
110 // std::string writeQuads(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector<
111 // UbTupleInt4 >& cells); std::string writeQuadsWithNodeData(const std::string& filename,std::vector<
112 // UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector<
113 // std::vector< double > >& nodedata); std::string writeQuadsWithCellData(const std::string&
114 // filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >&
115 // datanames, std::vector< std::vector< double > >& celldata); std::string writeQuadsWithNodeAndCellData(const
116 // std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells,
117 // std::vector< std::string >& nodedatanames, std::vector< std::vector<
118 // double > >& nodedata, std::vector< std::string >& celldatanames,
119 // std::vector< std::vector< double > >& celldata );
120
122 // octs
123 // 7 ---- 6
124 // /| /|
125 // 4 +--- 5 |
126 // | | | |
127 // | 3 ---+ 2
128 // |/ |/
129 // 0 ---- 1
130 std::string writeOctsU(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
131 std::vector<UbTupleUInt8> &cells);
132 // std::string writeOctsWithCellData(const std::string& filename,std::vector<UbTupleFloat3 >& nodes,
133 // std::vector<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector<std::vector<double > >&
134 // celldata);
135 std::string writeOctsWithNodeData(const std::string &filename, std::vector<UbTupleFloat3> &nodes,
136 std::vector<UbTupleUInt8> &cells, std::vector<std::string> &datanames,
137 std::vector<std::vector<double>> &nodedata) override;
138};
139
140#endif // WBWRITERTECPLOTASCII_H
141
WbWriterTecPlotASCII(const WbWriterTecPlotASCII &)=delete
std::string getFileExtension() override
static WbWriterTecPlotASCII * getInstance()
const WbWriterTecPlotASCII & operator=(const WbWriterTecPlotASCII &)=delete
std::shared_ptr< T > SPtr
#define UB_EXARGS
Definition UbException.h:73
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 writeOctsU(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleUInt8 > &cells)