STARCDedgeFormat.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) 2016-2020 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::STARCDedgeFormat
29 
30 Description
31  Read/write the lines from PROSTAR vrt/cel files.
32 
33 Note
34  Uses the extension \a .inp (input) to denote the format.
35 
36 See also
37  Foam::meshReaders::STARCD
38 
39 SourceFiles
40  STARCDedgeFormat.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef STARCDedgeFormat_H
45 #define STARCDedgeFormat_H
46 
47 #include "edgeMesh.H"
48 #include "STARCDCore.H"
49 
50 #include "Fstream.H"
51 #include "Ostream.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace fileFormats
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class STARCDedgeFormat Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class STARCDedgeFormat
65 :
66  public edgeMesh,
67  protected STARCDCore
68 {
69  // Private Member Functions
70 
71  static inline void writeLines(Ostream&, const edgeList&);
72 
73 
74  //- No copy construct
75  STARCDedgeFormat(const STARCDedgeFormat&) = delete;
76 
77  //- No copy assignment
78  void operator=(const STARCDedgeFormat&) = delete;
79 
80 
81 protected:
82 
83  // Protected Member Functions
84 
85  static void writeCase
86  (
87  Ostream& os,
88  const pointField& pointLst,
89  const label nEdges
90  );
91 
92 
93 public:
94 
95  // Constructors
96 
97  //- Construct from file name
98  explicit STARCDedgeFormat(const fileName& filename);
99 
100 
101  // Selectors
102 
103  //- Read file and return edgeMesh
104  static autoPtr<edgeMesh> New(const fileName& name)
105  {
107  }
108 
109 
110  //- Destructor
111  virtual ~STARCDedgeFormat() = default;
112 
113 
114  // Member Functions
115 
116  //- Write edge mesh
117  static void write(const fileName& name, const edgeMesh& mesh);
118 
119  //- Read from file
120  virtual bool read(const fileName& name);
121 
122  //- Write object
123  virtual void write(const fileName& name) const
124  {
125  write(name, *this);
126  }
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace fileFormats
133 } // End namespace Foam
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::fileFormats::STARCDedgeFormat::read
virtual bool read(const fileName &name)
Read from file.
Definition: STARCDedgeFormat.C:112
Foam::fileFormats::STARCDedgeFormat
Read/write the lines from PROSTAR vrt/cel files.
Definition: STARCDedgeFormat.H:63
STARCDCore.H
Foam::fileFormats::STARCDedgeFormat::write
virtual void write(const fileName &name) const
Write object.
Definition: STARCDedgeFormat.H:122
Foam::fileFormats::STARCDCore
Core routines used when reading/writing PROSTAR vrt/cel/bnd files.
Definition: STARCDCore.H:59
Foam::Field< vector >
edgeMesh.H
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::fileFormats::STARCDedgeFormat::New
static autoPtr< edgeMesh > New(const fileName &name)
Read file and return edgeMesh.
Definition: STARCDedgeFormat.H:103
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Ostream.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Fstream.H
Foam::fileFormats::STARCDedgeFormat::write
static void write(const fileName &name, const edgeMesh &mesh)
Write edge mesh.
Definition: STARCDedgeFormat.C:236
Foam::List< edge >
Foam::fileFormats::STARCDedgeFormat::~STARCDedgeFormat
virtual ~STARCDedgeFormat()=default
Destructor.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:52
Foam::fileFormats::STARCDedgeFormat::writeCase
static void writeCase(Ostream &os, const pointField &pointLst, const label nEdges)
Definition: STARCDedgeFormat.C:67