Loading...
Searching...
No Matches
VTKedgeFormat.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) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2021-2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::fileFormats::VTKedgeFormat
29
30Description
31 Provide a means of writing VTK legacy format.
32
33SourceFiles
34 VTKedgeFormat.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_VTKedgeFormat_H
39#define Foam_VTKedgeFormat_H
40
41#include "edgeMesh.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47namespace fileFormats
48{
50/*---------------------------------------------------------------------------*\
51 Class VTKedgeFormat Declaration
52\*---------------------------------------------------------------------------*/
53
54class VTKedgeFormat
55:
56 public edgeMesh
57{
58public:
59
60 // Constructors
61
62 //- Read construct from file name
63 explicit VTKedgeFormat(const fileName& filename);
64
65
66 // Selectors
67
68 //- Read file and return surface
69 static autoPtr<edgeMesh> New(const fileName& name)
70 {
72 }
73
74
75 //- Destructor
76 virtual ~VTKedgeFormat() = default;
78
79 // Static Functions
80
81 //- Write edge mesh to file in legacy VTK format
82 static void write
83 (
84 const fileName& filename,
85 const edgeMesh& mesh,
86 IOstreamOption /*ignored*/ = IOstreamOption(),
87 const dictionary& options = dictionary::null
88 );
89
90
91 // Member Functions
92
93 //- Read from file
94 virtual bool read(const fileName& filename) override;
95
96 //- Write to file
97 virtual void write
98 (
99 const fileName& name,
100 IOstreamOption streamOpt = IOstreamOption(),
101 const dictionary& options = dictionary::null
102 ) const override
103 {
104 write(name, *this, streamOpt, options);
105 }
106
107 //- Write to file
108 virtual void write
109 (
110 const fileName& name,
111 const word& fileType, /* ignored */
112 IOstreamOption streamOpt = IOstreamOption(),
113 const dictionary& options = dictionary::null
114 ) const override
115 {
116 write(name, *this, streamOpt, options);
118};
119
120
121// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122
123} // End namespace fileFormats
124} // End namespace Foam
125
126// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127
128#endif
129
130// ************************************************************************* //
A simple container for options an IOstream can normally have.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
static autoPtr< T > NewFrom(Args &&... args)
Construct autoPtr from derived type with forwarding arguments.
Definition autoPtr.H:193
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition dictionary.H:487
edgeMesh(const faMesh &mesh)
Construct finite-area edge mesh faMesh reference.
Definition edgeFaMesh.H:58
VTKedgeFormat(const fileName &filename)
Read construct from file name.
virtual bool read(const fileName &filename) override
Read from file.
virtual void write(const fileName &name, const word &fileType, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const override
Write to file.
static autoPtr< edgeMesh > New(const fileName &name)
Read file and return surface.
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const override
Write to file.
virtual ~VTKedgeFormat()=default
Destructor.
A class for handling file names.
Definition fileName.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
Namespace to isolate specifics for file formats, and some common utilities.
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
runTime write()