OpenLB 1.8.1
Loading...
Searching...
No Matches
vtkSurfaceWriter.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2024 Adrian Kummerlaender
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 IO_VTK_SURFACE_WRITER_H
25#define IO_VTK_SURFACE_WRITER_H
26
27#ifdef FEATURE_VTK
28
29#include "stlReader.h"
30#include "fileName.h"
31
32#include <vtkSmartPointer.h>
33#include <vtkUnstructuredGrid.h>
34#include <vtkPoints.h>
35#include <vtkCellArray.h>
36
37namespace olb {
38
39template<typename T>
40class vtkSurfaceWriter {
41private:
42 STLreader<T>& _surfaceI;
43 CuboidDecomposition3D<T>& _cuboidDecomposition;
44 LoadBalancer<T>& _loadBalancer;
45
46 const std::string _fileName;
47 std::vector<FunctorPtr<AnalyticalF3D<T,T>>> _f;
48
49 vtkSmartPointer<vtkUnstructuredGrid> _grid;
50 vtkSmartPointer<vtkPoints> _points;
51 vtkSmartPointer<vtkCellArray> _cells;
52 std::vector<const STLtriangle<T>*> _localTriangles;
53
54 void init();
55
56public:
57 vtkSurfaceWriter(STLreader<T>& surfaceI,
58 CuboidDecomposition3D<T>& cuboidDecomposition,
59 LoadBalancer<T>& loadBalancer,
60 const std::string& fileName):
61 _surfaceI(surfaceI),
62 _cuboidDecomposition(cuboidDecomposition),
63 _loadBalancer(loadBalancer),
64 _fileName(fileName)
65 {
66 init();
67 }
68
69 void addFunctor(FunctorPtr<AnalyticalF3D<T,T>>&& f) {
70 _f.emplace_back(std::move(f));
71 }
72
73 void write(int iT);
74
75};
76
77}
78
79#endif
80
81#endif
These functions help you to create file names.
void write(BlockReduction3D2D< T > &blockReduction, int iT, const plotParam< T > param={}, const std::vector< T > &valueArea=std::vector< T >{})
This function is used to plot heat maps as jpeg files.
Top level namespace for all of OpenLB.
Input in STL format – header file.