Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / surfMesh / surfaceFormats / starcd / STARCDsurfaceFormat.H
blobccadd7719504d1c46215d4c87a383bab4e8f1de2
1 /*---------------------------------------------------------------------------*\
2   =========                 |
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 -------------------------------------------------------------------------------
8 License
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/>.
24 Class
25     Foam::fileFormats::STARCDsurfaceFormat
27 Description
28     Read/write the surface shells from pro-STAR vrt/cel files.
30 Note
31     Uses the extension @a .inp (input) to denote the format.
33 See Also
34     Foam::meshReaders::STARCD
36 SourceFiles
37     STARCDsurfaceFormat.C
39 \*---------------------------------------------------------------------------*/
41 #ifndef STARCDsurfaceFormat_H
42 #define STARCDsurfaceFormat_H
44 #include "MeshedSurface.H"
45 #include "MeshedSurfaceProxy.H"
46 #include "UnsortedMeshedSurface.H"
47 #include "STARCDsurfaceFormatCore.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
53 namespace fileFormats
56 /*---------------------------------------------------------------------------*\
57                      Class STARCDsurfaceFormat Declaration
58 \*---------------------------------------------------------------------------*/
60 template<class Face>
61 class STARCDsurfaceFormat
63     public MeshedSurface<Face>,
64     public STARCDsurfaceFormatCore
66     // Private Data
68         //- STAR-CD identifier for shell shapes (2d elements)
69         static const int starcdShellShape_ = 3;
71         //- STAR-CD identifier for shell type (shells vs. baffles)
72         static const int starcdShellType_  = 4;
75     // Private Member Functions
77         static inline void writeShell
78         (
79             Ostream&,
80             const Face&,
81             const label cellId,
82             const label cellTableId
83         );
85         //- Disallow default bitwise copy construct
86         STARCDsurfaceFormat(const STARCDsurfaceFormat<Face>&);
88         //- Disallow default bitwise assignment
89         void operator=(const STARCDsurfaceFormat<Face>&);
92 public:
94     // Constructors
96         //- Construct from file name
97         STARCDsurfaceFormat(const fileName&);
100     // Selectors
102         //- Read file and return surface
103         static autoPtr<MeshedSurface<Face> > New(const fileName& name)
104         {
105             return autoPtr<MeshedSurface<Face> >
106             (
107                 new STARCDsurfaceFormat<Face>(name)
108             );
109         }
112     //- Destructor
113     virtual ~STARCDsurfaceFormat()
114     {}
117     // Member Functions
119         //- Write surface mesh components by proxy
120         static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
122         //- Read from file
123         virtual bool read(const fileName&);
125         //- Write object
126         virtual void write(const fileName& name) const
127         {
128             write(name, MeshedSurfaceProxy<Face>(*this));
129         }
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 } // End namespace fileFormats
136 } // End namespace Foam
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 #ifdef NoRepository
141 #   include "STARCDsurfaceFormat.C"
142 #endif
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 #endif
148 // ************************************************************************* //