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 -------------------------------------------------------------------------------
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 VTKedgeFormat_H
39 #define 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
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 // ************************************************************************* //
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::fileFormats::VTKedgeFormat::read
virtual bool read(const fileName &name)
Read from file.
Definition: VTKedgeFormat.C:49
Foam::fileFormats::VTKedgeFormat
Provide a means of writing VTK legacy format.
Definition: VTKedgeFormat.H:53
Foam::fileFormats::VTKedgeFormat::write
static void write(const fileName &filename, const edgeMesh &mesh, IOstreamOption=IOstreamOption(), const dictionary &options=dictionary::null)
Write edge mesh to file.
Definition: VTKedgeFormat.C:107
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:392
Foam::fileFormats::VTKedgeFormat::VTKedgeFormat
VTKedgeFormat(const fileName &filename)
Read construct from file name.
Definition: VTKedgeFormat.C:38
edgeMesh.H
Foam::fileFormats::VTKedgeFormat::~VTKedgeFormat
virtual ~VTKedgeFormat()=default
Destructor.
Foam::IOstreamOption
The IOstreamOption is a simple container for options an IOstream can normally have.
Definition: IOstreamOption.H:63
Foam::fileFormats::VTKedgeFormat::New
static autoPtr< edgeMesh > New(const fileName &name)
Read file and return surface.
Definition: VTKedgeFormat.H:68
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:53