1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::MeshedSurfaceProxy
29 A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh
30 to various file formats.
34 MeshedSurfaceProxyCore.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef MeshedSurfaceProxy_H
39 #define MeshedSurfaceProxy_H
41 #include "pointField.H"
45 #include "surfZoneList.H"
46 #include "surfaceFormatsCore.H"
47 #include "runTimeSelectionTables.H"
48 #include "memberFunctionSelectionTables.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 // Forward declaration of friend functions and operators
58 template<class Face> class MeshedSurface;
60 /*---------------------------------------------------------------------------*\
61 Class MeshedSurfaceProxy Declaration
62 \*---------------------------------------------------------------------------*/
65 class MeshedSurfaceProxy
67 public fileFormats::surfaceFormatsCore
71 const pointField& points_;
73 const List<Face>& faces_;
75 const List<surfZone>& zones_;
77 const List<label>& faceMap_;
84 //- Runtime type information
85 ClassName("MeshedSurfaceProxy");
87 //- The file format types that can be written via MeshedSurfaceProxy
88 static wordHashSet writeTypes();
90 //- Can this file format type be written via MeshedSurfaceProxy?
91 static bool canWriteType(const word& ext, const bool verbose=false);
96 //- Construct from component references
101 const List<surfZone>& = List<surfZone>(),
102 const List<label>& faceMap = List<label>()
108 virtual ~MeshedSurfaceProxy();
111 // Member Function Selectors
113 declareMemberFunctionSelectionTable
120 const fileName& name,
121 const MeshedSurfaceProxy<Face>& surf
127 static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
134 //- Return const access to the points
135 inline const pointField& points() const
140 //- Return const access to the faces
141 inline const List<Face>& faces() const
146 //- Const access to the surface zones.
147 // If zones are defined, they must be contiguous and cover the
149 inline const List<surfZone>& surfZones() const
154 //- Const access to the faceMap, zero-sized when unused
155 inline const List<label>& faceMap() const
161 inline bool useFaceMap() const
163 return faceMap_.size() == faces_.size();
168 //- Generic write routine. Chooses writer based on extension.
169 virtual void write(const fileName& name) const
174 //- Write to database
175 virtual void write(const Time&, const word& surfName = "") const;
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace Foam
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 # include "MeshedSurfaceProxy.C"
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 // ************************************************************************* //