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-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::fileFormats::STARCDsurfaceFormat
29
30Description
31 Read/write the surface shells from PROSTAR vrt/cel files.
32
33 Output stream options:
34 - ASCII only
35 - compression on/off
36
37 Output dictionary options: ignored
38
39Note
40 Uses the extension \a .inp (input) to denote the format.
41
42See also
43 Foam::meshReaders::STARCD
44
45SourceFiles
46 STARCDsurfaceFormat.C
47
48\*---------------------------------------------------------------------------*/
49
50#ifndef STARCDsurfaceFormat_H
51#define STARCDsurfaceFormat_H
52
53#include "MeshedSurface.H"
54#include "MeshedSurfaceProxy.H"
57
58// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59
60namespace Foam
61{
62namespace fileFormats
63{
64
65/*---------------------------------------------------------------------------*\
66 Class fileFormats::STARCDsurfaceFormat Declaration
67\*---------------------------------------------------------------------------*/
68
69template<class Face>
71:
72 public MeshedSurface<Face>,
74{
75 // Private Member Functions
76
77 static inline void writeShell
78 (
79 Ostream& os,
80 const Face& f,
81 const label cellId,
82 const label cellTableId
83 );
84
85
86public:
87
88 // Constructors
89
90 //- Construct from file name
91 STARCDsurfaceFormat(const fileName& filename);
92
93
94 //- Destructor
95 virtual ~STARCDsurfaceFormat() = default;
96
97
98 // Static Functions
99
100 //- Write surface mesh components by proxy
101 static void write
102 (
103 const fileName& filename,
104 const MeshedSurfaceProxy<Face>& surf,
105 IOstreamOption streamOpt = IOstreamOption(),
106 const dictionary& /*unused*/ = dictionary::null
107 );
108
109
110 // Member Functions
111
112 //- Read from file
113 virtual bool read(const fileName& filename);
114
115 //- Write surface mesh to file
116 virtual void write
117 (
118 const fileName& name,
119 IOstreamOption streamOpt = IOstreamOption(),
120 const dictionary& options = dictionary::null
121 ) const
122 {
123 write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
124 }
125};
126
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130} // End namespace fileFormats
131} // End namespace Foam
132
133// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134
135#ifdef NoRepository
136 #include "STARCDsurfaceFormat.C"
137#endif
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141#endif
142
143// ************************************************************************* //
The IOstreamOption is a simple container for options an IOstream can normally have.
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:99
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Internal class used by the STARCDsurfaceFormat.
Read/write the surface shells from PROSTAR vrt/cel files.
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
Write surface mesh to file.
virtual ~STARCDsurfaceFormat()=default
Destructor.
virtual bool read(const fileName &filename)
Read from file.
A class for handling file names.
Definition: fileName.H:76
OBJstream os(runTime.globalPath()/outputName)
label cellId
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
runTime write()
labelList f(nPoints)