1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 Foam::MeshedSurfaceProxy
28 A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh
29 to various file formats.
33 MeshedSurfaceProxyCore.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef MeshedSurfaceProxy_H
38 #define MeshedSurfaceProxy_H
40 #include "pointField.H"
44 #include "surfZoneList.H"
45 #include "surfaceFormatsCore.H"
46 #include "runTimeSelectionTables.H"
47 #include "memberFunctionSelectionTables.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 // Forward declaration of friend functions and operators
57 template<class Face> class MeshedSurface;
59 /*---------------------------------------------------------------------------*\
60 Class MeshedSurfaceProxy Declaration
61 \*---------------------------------------------------------------------------*/
64 class MeshedSurfaceProxy
66 public fileFormats::surfaceFormatsCore
70 const pointField& points_;
72 const List<Face>& faces_;
74 const List<surfZone>& zones_;
76 const List<label>& faceMap_;
83 //- Runtime type information
84 ClassName("MeshedSurfaceProxy");
86 //- The file format types that can be written via MeshedSurfaceProxy
87 static wordHashSet writeTypes();
89 //- Can this file format type be written via MeshedSurfaceProxy?
90 static bool canWriteType(const word& ext, const bool verbose=false);
95 //- Construct from component references
100 const List<surfZone>& = List<surfZone>(),
101 const List<label>& faceMap = List<label>()
107 virtual ~MeshedSurfaceProxy();
110 // Member Function Selectors
112 declareMemberFunctionSelectionTable
119 const fileName& name,
120 const MeshedSurfaceProxy<Face>& surf
126 static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
133 //- Return const access to the points
134 inline const pointField& points() const
139 //- Return const access to the faces
140 inline const List<Face>& faces() const
145 //- Const access to the surface zones.
146 // If zones are defined, they must be contiguous and cover the
148 inline const List<surfZone>& surfZones() const
153 //- Const access to the faceMap, zero-sized when unused
154 inline const List<label>& faceMap() const
160 inline bool useFaceMap() const
162 return faceMap_.size() == faces_.size();
167 //- Generic write routine. Chooses writer based on extension.
168 virtual void write(const fileName& name) const
173 //- Write to database
174 virtual void write(const Time&, const word& surfName = "") const;
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 } // End namespace Foam
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 # include "MeshedSurfaceProxy.C"
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 // ************************************************************************* //