Loading...
Searching...
No Matches
foamVtmWriterI.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2018-2025 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29
30template<Foam::vtk::fileTag FileType, Foam::vtk::fileTag DataType>
31inline bool Foam::vtk::vtmWriter::appendTyped
32(
33 const fileName& file
34)
35{
36 bool ok = append(file, FileType);
37 if (ok) entries_.back().setDataType(DataType);
38 return ok;
39}
40
41
42template<Foam::vtk::fileTag FileType, Foam::vtk::fileTag DataType>
43inline bool Foam::vtk::vtmWriter::appendTyped
44(
45 const word& name,
46 const fileName& file
47)
48{
49 bool ok = append(name, file, FileType);
50 if (ok) entries_.back().setDataType(DataType);
51 return ok;
52}
53
54
55// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
60}
61
63inline bool Foam::vtk::vtmWriter::append_poly(const fileName& file)
64{
65 return appendTyped<vtk::fileTag::POLY_DATA>(file);
66}
67
68
70(
71 const word& name,
72 const fileName& file
73)
74{
75 return appendTyped<vtk::fileTag::POLY_DATA>(name, file);
76}
77
79inline bool Foam::vtk::vtmWriter::append_ugrid(const fileName& file)
80{
81 return appendTyped<vtk::fileTag::UNSTRUCTURED_GRID>(file);
82}
83
84
86(
87 const word& name,
88 const fileName& file
90{
91 return appendTyped<vtk::fileTag::UNSTRUCTURED_GRID>(name, file);
92}
93
94
95template<Foam::vtk::fileTag DataType>
97{
98 return appendTyped<vtk::fileTag::VTK_HDF, DataType>(file);
99}
100
101
102template<Foam::vtk::fileTag DataType>
104(
105 const word& name,
106 const fileName& file
107)
108{
109 return appendTyped<vtk::fileTag::VTK_HDF, DataType>(name, file);
110}
111
112
113// ************************************************************************* //
A class for handling file names.
Definition fileName.H:75
bool append(const fileName &file)
Add a file. The name is either empty or created with autoName.
static word ext()
File extension (always "vtm").
bool append_poly(const fileName &file)
Add a PolyData (.vtp) file.
bool append_ugrid(const fileName &file)
Add an UnstructuredGrid (.vtu) file.
bool append_hdf(const fileName &file)
Add a (.vtkhdf) file. Often need to specify the content type as well (PolyData, UnstructuredGrid).
A class for handling words, derived from Foam::string.
Definition word.H:66
auto & name
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
@ MULTI_BLOCK
"vtkMultiBlockDataSet"
const Foam::Enum< fileTag > fileExtension
File extension (without ".") for some vtk XML file content types.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127