edgeMeshFormat.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 -------------------------------------------------------------------------------
10 License
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 Class
27  Foam::fileFormats::edgeMeshFormat
28 
29 Description
30  Provide a means of reading/writing the single-file OpenFOAM edge format.
31 
32 Note
33  This class provides more methods than the regular edge format interface.
34 
35 SourceFiles
36  edgeMeshFormat.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef edgeMeshFormat_H
41 #define edgeMeshFormat_H
42 
43 #include "edgeMesh.H"
44 #include "Ostream.H"
45 #include "OFstream.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 namespace fileFormats
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class edgeMeshFormat Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class edgeMeshFormat
59 :
60  public edgeMesh
61 {
62  // Private Member Functions
63 
64  //- No copy construct
65  edgeMeshFormat(const edgeMeshFormat&) = delete;
66 
67  //- No copy assignment
68  void operator=(const edgeMeshFormat&) = delete;
69 
70 
71 protected:
72 
73  // Protected Member Functions
74 
75  //- Write header information
76  static void writeHeader
77  (
78  Ostream&,
79  const pointField&,
80  const edgeList&
81  );
82 
83 
84 public:
85 
86  // Constructors
87 
88  //- Construct from file name
89  edgeMeshFormat(const fileName&);
90 
91 
92  // Selectors
93 
94  //- Read file and return edgeMesh
95  static autoPtr<edgeMesh> New(const fileName& name)
96  {
98  }
99 
100 
101  //- Destructor
102  virtual ~edgeMeshFormat() = default;
103 
104 
105  // Member Functions
106 
107  //- Read edgeMesh components from stream
108  static bool read
109  (
110  Istream&,
111  pointField&,
112  edgeList&
113  );
114 
115  //- Write edgeMesh components to stream
116  static Ostream& write
117  (
118  Ostream&,
119  const pointField&,
120  const edgeList&
121  );
122 
123  //- Write edgeMesh with a mimicked IOobject header
124  static void write(const fileName&, const edgeMesh&);
125 
126  //- Read from file
127  virtual bool read(const fileName&);
128 
129  //- Write object
130  virtual void write(const fileName& name) const
131  {
132  write(name, *this);
133  }
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace fileFormats
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::fileFormats::edgeMeshFormat
Provide a means of reading/writing the single-file OpenFOAM edge format.
Definition: edgeMeshFormat.H:57
Foam::fileFormats::edgeMeshFormat::New
static autoPtr< edgeMesh > New(const fileName &name)
Read file and return edgeMesh.
Definition: edgeMeshFormat.H:94
OFstream.H
Foam::Field< vector >
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
edgeMesh.H
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::fileFormats::edgeMeshFormat::write
static Ostream & write(Ostream &, const pointField &, const edgeList &)
Write edgeMesh components to stream.
Definition: edgeMeshFormat.C:118
Foam::fileFormats::edgeMeshFormat::writeHeader
static void writeHeader(Ostream &, const pointField &, const edgeList &)
Write header information.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fileFormats::edgeMeshFormat::write
virtual void write(const fileName &name) const
Write object.
Definition: edgeMeshFormat.H:129
Foam::fileFormats::edgeMeshFormat::read
static bool read(Istream &, pointField &, edgeList &)
Read edgeMesh components from stream.
Definition: edgeMeshFormat.C:97
Ostream.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< edge >
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::fileFormats::edgeMeshFormat::~edgeMeshFormat
virtual ~edgeMeshFormat()=default
Destructor.
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:52