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 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 VTKedgeFormat_H
39#define VTKedgeFormat_H
40
41#include "edgeMesh.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47namespace fileFormats
48{
49
50/*---------------------------------------------------------------------------*\
51 Class VTKedgeFormat Declaration
52\*---------------------------------------------------------------------------*/
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;
77
78
79 // Static Functions
80
81 //- Write edge mesh to file
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& name);
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
103 {
104 write(name, *this, streamOpt, options);
105 }
106};
107
108
109// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110
111} // End namespace fileFormats
112} // End namespace Foam
113
114// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115
116#endif
117
118// ************************************************************************* //
The IOstreamOption is 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:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:56
Provide a means of writing VTK legacy format.
Definition: VTKedgeFormat.H:56
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
Write to file.
Definition: VTKedgeFormat.H:97
virtual bool read(const fileName &name)
Read from file.
Definition: VTKedgeFormat.C:49
static autoPtr< edgeMesh > New(const fileName &name)
Read file and return surface.
Definition: VTKedgeFormat.H:68
virtual ~VTKedgeFormat()=default
Destructor.
A class for handling file names.
Definition: fileName.H:76
dynamicFvMesh & mesh
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
runTime write()