AC3DsurfaceFormat.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 -------------------------------------------------------------------------------
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::AC3DsurfaceFormat
29 
30 Description
31  Read/write AC3D format.
32 
33  http://www.inivis.com/ac3d/man/ac3dfileformat.html
34 
35  Output stream options:
36  - ASCII only
37  - compression on/off
38 
39  Output dictionary options: ignored
40 
41 Note
42  On input, the faces are already organized as zones.
43  The output is always sorted by zones.
44  In the absence of zones, a single zone will be assigned.
45 
46 SourceFiles
47  AC3DsurfaceFormat.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef AC3DsurfaceFormat_H
52 #define AC3DsurfaceFormat_H
53 
54 #include "MeshedSurface.H"
55 #include "MeshedSurfaceProxy.H"
56 #include "UnsortedMeshedSurface.H"
57 #include "AC3DsurfaceFormatCore.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 namespace fileFormats
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class fileFormats::AC3DsurfaceFormat Declaration
68 \*---------------------------------------------------------------------------*/
69 
70 template<class Face>
72 :
73  public MeshedSurface<Face>,
75 {
76 public:
77 
78  // Constructors
79 
80  //- Construct from file name
81  AC3DsurfaceFormat(const fileName& filename);
82 
83 
84  //- Destructor
85  virtual ~AC3DsurfaceFormat() = default;
86 
87 
88  // Static Functions
89 
90  //- Write surface mesh components by proxy
91  static void write
92  (
93  const fileName& filename,
94  const MeshedSurfaceProxy<Face>& surf,
95  IOstreamOption streamOpt = IOstreamOption(),
96  const dictionary& /*unused*/ = dictionary::null
97  );
98 
99  //- Write UnsortedMeshedSurface, the output is always sorted by zones.
100  static void write
101  (
102  const fileName& filename,
103  const UnsortedMeshedSurface<Face>& surf,
104  IOstreamOption streamOpt = IOstreamOption(),
105  const dictionary& /*unused*/ = dictionary::null
106  );
107 
108 
109  // Member Functions
110 
111  //- Read from file
112  virtual bool read(const fileName& filename);
113 
114  //- Write surface mesh to file
115  virtual void write
116  (
117  const fileName& name,
118  IOstreamOption streamOpt = IOstreamOption(),
119  const dictionary& options = dictionary::null
120  ) const
121  {
122  write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
123  }
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace fileFormats
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #ifdef NoRepository
135  #include "AC3DsurfaceFormat.C"
136 #endif
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
Foam::fileFormats::AC3DsurfaceFormat::~AC3DsurfaceFormat
virtual ~AC3DsurfaceFormat()=default
Destructor.
MeshedSurfaceProxy.H
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::fileFormats::AC3DsurfaceFormat::write
static void write(const fileName &filename, const MeshedSurfaceProxy< Face > &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &=dictionary::null)
Write surface mesh components by proxy.
Definition: AC3DsurfaceFormat.C:304
AC3DsurfaceFormatCore.H
Foam::fileFormats::AC3DsurfaceFormat::AC3DsurfaceFormat
AC3DsurfaceFormat(const fileName &filename)
Construct from file name.
Definition: AC3DsurfaceFormat.C:38
Foam::MeshedSurfaceProxy
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
Definition: MeshedSurface.H:82
Foam::fileFormats::AC3DsurfaceFormat::read
virtual bool read(const fileName &filename)
Read from file.
Definition: AC3DsurfaceFormat.C:50
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:392
UnsortedMeshedSurface.H
Foam::fileFormats::AC3DsurfaceFormat
Read/write AC3D format.
Definition: AC3DsurfaceFormat.H:70
Foam::UnsortedMeshedSurface
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
Definition: MeshedSurface.H:83
Foam::IOstreamOption
The IOstreamOption is a simple container for options an IOstream can normally have.
Definition: IOstreamOption.H:63
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fileFormats::AC3DsurfaceFormatCore
Internal class used by the AC3DsurfaceFormat.
Definition: AC3DsurfaceFormatCore.H:55
AC3DsurfaceFormat.C
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::MeshedSurface
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: triSurfaceTools.H:80
MeshedSurface.H