STARCDedgeFormat.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fileFormats::STARCDedgeFormat
26 
27 Description
28  Read/write the lines from pro-STAR vrt/cel files.
29 
30  Note:
31  Uses the extension \a .inp (input) to denote the format.
32 
33 See also
34  Foam::meshReaders::STARCD
35 
36 SourceFiles
37  STARCDedgeFormat.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef STARCDedgeFormat_H
42 #define STARCDedgeFormat_H
43 
44 #include "edgeMesh.H"
45 #include "STARCDCore.H"
46 
47 #include "IFstream.H"
48 #include "Ostream.H"
49 #include "OFstream.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 namespace fileFormats
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class STARCDedgeFormat Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class STARCDedgeFormat
63 :
64  public edgeMesh,
65  public STARCDCore
66 {
67  // Private Data
68 
69  //- STAR-CD identifier for line shapes (1d elements)
70  static const int starcdLineShape_ = 2;
71 
72  //- STAR-CD identifier for line type
73  static const int starcdLineType_ = 5;
74 
75 
76  // Private Member Functions
77 
78  static inline void writeLines
79  (
80  Ostream&,
81  const edgeList&
82  );
83 
84 
85 protected:
86 
87  // Protected Member Functions
88 
89  static void writeCase
90  (
91  Ostream&,
92  const pointField&,
93  const label nEdges
94  );
95 
96 
97 public:
98 
99  // Constructors
100 
101  //- Construct from file name
102  STARCDedgeFormat(const fileName&);
103 
104  //- Disallow default bitwise copy construction
105  STARCDedgeFormat(const STARCDedgeFormat&) = delete;
106 
107 
108  // Selectors
109 
110  //- Read file and return edgeMesh
111  static autoPtr<edgeMesh> New(const fileName& name)
112  {
113  return autoPtr<edgeMesh>
114  (
115  new STARCDedgeFormat(name)
116  );
117  }
118 
119 
120  //- Destructor
121  virtual ~STARCDedgeFormat()
122  {}
123 
124 
125  // Member Functions
126 
127  //- Write edge mesh
128  static void write(const fileName&, const edgeMesh&);
129 
130  //- Read from file
131  virtual bool read(const fileName&);
132 
133  //- Write object
134  virtual void write(const fileName& name) const
135  {
136  write(name, *this);
137  }
138 
139 
140  // Member Operators
141 
142  //- Disallow default bitwise assignment
143  void operator=(const STARCDedgeFormat&) = delete;
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace fileFormats
150 } // End namespace Foam
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
A class for handling file names.
Definition: fileName.H:79
static autoPtr< edgeMesh > New(const fileName &name)
Read file and return edgeMesh.
Read/write the lines from pro-STAR vrt/cel files.
virtual bool read(const fileName &)
Read from file.
Core routines used when reading/writing pro-STAR vrt/cel/bnd files.
Definition: STARCDCore.H:52
STARCDedgeFormat(const fileName &)
Construct from file name.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Points connected by edges.
Definition: edgeMesh.H:69
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
void operator=(const STARCDedgeFormat &)=delete
Disallow default bitwise assignment.
static void writeCase(Ostream &, const pointField &, const label nEdges)
virtual ~STARCDedgeFormat()
Destructor.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
static void write(const fileName &, const edgeMesh &)
Write edge mesh.
Namespace for OpenFOAM.