STARCDsurfaceFormat.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::STARCDsurfaceFormat
26 
27 Description
28  Read/write the surface shells 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  STARCDsurfaceFormat.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef STARCDsurfaceFormat_H
42 #define STARCDsurfaceFormat_H
43 
44 #include "MeshedSurface.H"
45 #include "MeshedSurfaceProxy.H"
46 #include "UnsortedMeshedSurface.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 namespace fileFormats
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class STARCDsurfaceFormat Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class Face>
62 :
63  public MeshedSurface<Face>,
65 {
66  // Private Data
67 
68  //- STAR-CD identifier for shell shapes (2d elements)
69  static const int starcdShellShape_ = 3;
70 
71  //- STAR-CD identifier for shell type (shells vs. baffles)
72  static const int starcdShellType_ = 4;
73 
74 
75  // Private Member Functions
76 
77  static inline void writeShell
78  (
79  Ostream&,
80  const Face&,
81  const label cellId,
82  const label cellTableId
83  );
84 
85 
86 public:
87 
88  // Constructors
89 
90  //- Construct from file name
92 
93  //- Disallow default bitwise copy construction
95 
96 
97  // Selectors
98 
99  //- Read file and return surface
101  {
103  (
105  );
106  }
107 
108 
109  //- Destructor
110  virtual ~STARCDsurfaceFormat()
111  {}
112 
113 
114  // Member Functions
115 
116  //- Write surface mesh components by proxy
117  static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
118 
119  //- Read from file
120  virtual bool read(const fileName&);
121 
122  //- Write object
123  virtual void write(const fileName& name) const
124  {
126  }
127 
128 
129  // Member Operators
130 
131  //- Disallow default bitwise assignment
132  void operator=(const STARCDsurfaceFormat<Face>&) = delete;
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace fileFormats
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #ifdef NoRepository
144  #include "STARCDsurfaceFormat.C"
145 #endif
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:85
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Internal class used by the STARCDsurfaceFormat.
Read/write the surface shells from pro-STAR vrt/cel files.
static void write(const fileName &, const MeshedSurfaceProxy< Face > &)
Write surface mesh components by proxy.
virtual bool read(const fileName &)
Read from file.
void operator=(const STARCDsurfaceFormat< Face > &)=delete
Disallow default bitwise assignment.
static autoPtr< MeshedSurface< Face > > New(const fileName &name)
Read file and return surface.
STARCDsurfaceFormat(const fileName &)
Construct from file name.
A class for handling file names.
Definition: fileName.H:82
const label cellId
Namespace for OpenFOAM.
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
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47