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 | Copyright (C) 2011-2016 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  //- Disallow default bitwise copy construct
86 
87  //- Disallow default bitwise assignment
88  void operator=(const STARCDedgeFormat&);
89 
90 
91 protected:
92 
93  // Protected Member Functions
94 
95  static void writeCase
96  (
97  Ostream&,
98  const pointField&,
99  const label nEdges
100  );
101 
102 public:
103 
104  // Constructors
105 
106  //- Construct from file name
107  STARCDedgeFormat(const fileName&);
108 
109 
110  // Selectors
111 
112  //- Read file and return edgeMesh
113  static autoPtr<edgeMesh> New(const fileName& name)
114  {
115  return autoPtr<edgeMesh>
116  (
117  new STARCDedgeFormat(name)
118  );
119  }
120 
121 
122  //- Destructor
123  virtual ~STARCDedgeFormat()
124  {}
125 
126 
127  // Member Functions
128 
129  //- Write edge mesh
130  static void write(const fileName&, const edgeMesh&);
131 
132  //- Read from file
133  virtual bool read(const fileName&);
134 
135  //- Write object
136  virtual void write(const fileName& name) const
137  {
138  write(name, *this);
139  }
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace fileFormats
146 } // End namespace Foam
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A class for handling file names.
Definition: fileName.H:69
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
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Points connected by edges.
Definition: edgeMesh.H:69
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
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:53
static void write(const fileName &, const edgeMesh &)
Write edge mesh.
Namespace for OpenFOAM.