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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016 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::STARCDsurfaceFormat
29 
30 Description
31  Read/write the surface shells 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  STARCDsurfaceFormat.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef STARCDsurfaceFormat_H
45 #define STARCDsurfaceFormat_H
46 
47 #include "MeshedSurface.H"
48 #include "MeshedSurfaceProxy.H"
49 #include "UnsortedMeshedSurface.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 namespace fileFormats
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class fileFormats::STARCDsurfaceFormat Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class Face>
65 :
66  public MeshedSurface<Face>,
68 {
69  // Private Member Functions
70 
71  static inline void writeShell
72  (
73  Ostream& os,
74  const Face& f,
75  const label cellId,
76  const label cellTableId
77  );
78 
79 
80 public:
81 
82  // Constructors
83 
84  //- Construct from file name
85  STARCDsurfaceFormat(const fileName& filename);
86 
87 
88  //- Destructor
89  virtual ~STARCDsurfaceFormat() = default;
90 
91 
92  // Static Member Functions
93 
94  //- Write surface mesh components by proxy
95  static void write
96  (
97  const fileName& filename,
98  const MeshedSurfaceProxy<Face>& surf,
99  const dictionary& options = dictionary::null
100  );
101 
102 
103  // Member Functions
104 
105  //- Read from file
106  virtual bool read(const fileName& filename);
107 
108  //- Write surface mesh to file
109  virtual void write
110  (
111  const fileName& name,
112  const dictionary& options = dictionary::null
113  ) const
114  {
115  write(name, MeshedSurfaceProxy<Face>(*this), options);
116  }
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace fileFormats
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #ifdef NoRepository
128  #include "STARCDsurfaceFormat.C"
129 #endif
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
Foam::fileFormats::STARCDsurfaceFormat::~STARCDsurfaceFormat
virtual ~STARCDsurfaceFormat()=default
Destructor.
MeshedSurfaceProxy.H
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
STARCDsurfaceFormat.C
Foam::fileFormats::STARCDsurfaceFormat::write
static void write(const fileName &filename, const MeshedSurfaceProxy< Face > &surf, const dictionary &options=dictionary::null)
Write surface mesh components by proxy.
Definition: STARCDsurfaceFormat.C:241
Foam::MeshedSurfaceProxy
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
Definition: MeshedSurface.H:78
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:385
UnsortedMeshedSurface.H
Foam::label
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:62
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fileFormats::STARCDsurfaceFormat
Read/write the surface shells from PROSTAR vrt/cel files.
Definition: STARCDsurfaceFormat.H:63
cellId
label cellId
Definition: interrogateWallPatches.H:67
Foam::fileFormats::STARCDsurfaceFormat::read
virtual bool read(const fileName &filename)
Read from file.
Definition: STARCDsurfaceFormat.C:82
f
labelList f(nPoints)
Foam::fileFormats::STARCDsurfaceFormatCore
Internal class used by the STARCDsurfaceFormat.
Definition: STARCDsurfaceFormatCore.H:55
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::fileFormats::STARCDsurfaceFormat::STARCDsurfaceFormat
STARCDsurfaceFormat(const fileName &filename)
Construct from file name.
Definition: STARCDsurfaceFormat.C:70
Foam::MeshedSurface
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: triSurfaceTools.H:80
MeshedSurface.H
STARCDsurfaceFormatCore.H