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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::fileFormats::VTKedgeFormat
29 
30 Description
31  Provide a means of writing VTK legacy format.
32 
33 SourceFiles
34  VTKedgeFormat.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_VTKedgeFormat_H
39 #define Foam_VTKedgeFormat_H
40 
41 #include "edgeMesh.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 namespace fileFormats
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class VTKedgeFormat Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class VTKedgeFormat
55 :
56  public edgeMesh
57 {
58 public:
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 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);
117  }
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace fileFormats
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
virtual ~VTKedgeFormat()=default
Destructor.
A class for handling file names.
Definition: fileName.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A simple container for options an IOstream can normally have.
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
A class for handling words, derived from Foam::string.
Definition: word.H:63
static void write(const fileName &filename, const edgeMesh &mesh, IOstreamOption=IOstreamOption(), const dictionary &options=dictionary::null)
Write edge mesh to file in legacy VTK format.
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:486
VTKedgeFormat(const fileName &filename)
Read construct from file name.
Definition: VTKedgeFormat.C:31
static autoPtr< edgeMesh > New(const fileName &name)
Read file and return surface.
Definition: VTKedgeFormat.H:68
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:47
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual bool read(const fileName &filename) override
Read from file.
Definition: VTKedgeFormat.C:42
Provide a means of writing VTK legacy format.
Definition: VTKedgeFormat.H:49
Namespace for OpenFOAM.