suanPan
🧮 An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework
Loading...
Searching...
No Matches
vtkParser.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2026 Theodore Chang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
17
18#ifndef VTKPARSER_H
19#define VTKPARSER_H
20
21#include <Recorder/OutputType.h>
22#include <suanPan.h>
23
24class DomainBase;
25
26#ifdef SUANPAN_VTK
27
28class vtkUnstructuredGrid;
29
30int vtk_parser(const shared_ptr<DomainBase>&, std::istringstream&);
31
32struct vtkInfo {
33 bool color_bar = true;
34 bool per_element = false;
35 bool per_material = false;
36 bool per_section = false;
37 double scale = 0.;
38 int canvas_size[2] = {500, 500};
39 OutputType display_type = OutputType::U;
40 OutputType record_type = OutputType::U;
41 std::string category{"U"};
42 std::string file_name;
43 std::string title_name;
44 unsigned font_size = 8;
45
46 void set(const OutputType in) { record_type = to_token(category = to_category(display_type = in)); }
47};
48
49void vtk_cell_plot(const shared_ptr<DomainBase>&, vtkInfo);
50
51#else
52
53inline int vtk_parser(const shared_ptr<DomainBase>&, std::istringstream&) {
54 suanpan_warning("Visualisation related functionalities are not available as the current build is not compiled with the VTK support.\n");
55 return 0;
56}
57
58#endif
59
60#endif
61
std::string to_category(const OutputType L)
Definition OutputType.cpp:160
OutputType
Definition OutputType.h:23
constexpr OutputType to_token(const std::string_view L)
Definition OutputType.h:271
The DomainBase class is a template.
Definition DomainBase.h:94
std::set< T > set
Definition container.h:54
#define suanpan_warning(...)
Definition suanPan.h:348
int vtk_parser(const shared_ptr< DomainBase > &, std::istringstream &)
Definition vtkParser.h:53