STARCDsurfaceFormat.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::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  //- Disallow default bitwise copy construct
87 
88  //- Disallow default bitwise assignment
89  void operator=(const STARCDsurfaceFormat<Face>&);
90 
91 
92 public:
93 
94  // Constructors
95 
96  //- Construct from file name
98 
99 
100  // Selectors
101 
102  //- Read file and return surface
104  {
106  (
108  );
109  }
110 
111 
112  //- Destructor
113  virtual ~STARCDsurfaceFormat()
114  {}
115 
116 
117  // Member Functions
118 
119  //- Write surface mesh components by proxy
120  static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
121 
122  //- Read from file
123  virtual bool read(const fileName&);
124 
125  //- Write object
126  virtual void write(const fileName& name) const
127  {
128  write(name, MeshedSurfaceProxy<Face>(*this));
129  }
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace fileFormats
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #ifdef NoRepository
141  #include "STARCDsurfaceFormat.C"
142 #endif
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
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
Read/write the surface shells from pro-STAR vrt/cel files.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:72
virtual bool read(const fileName &)
Read from file.
Internal class used by the STARCDsurfaceFormat.
static void write(const fileName &, const MeshedSurfaceProxy< Face > &)
Write surface mesh components by proxy.
static autoPtr< MeshedSurface< Face > > New(const fileName &name)
Read file and return surface.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
Definition: MeshedSurface.H:73
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
label cellId
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Namespace for OpenFOAM.