OpenFOAM
12
The OpenFOAM Foundation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
STARCDCore.H
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration | Website: https://openfoam.org
5
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
License
9
This file is part of OpenFOAM.
10
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
13
the Free Software Foundation, either version 3 of the License, or
14
(at your option) any later version.
15
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
19
for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23
24
Class
25
Foam::fileFormats::STARCDCore
26
27
Description
28
Core routines used when reading/writing pro-STAR vrt/cel/bnd files.
29
30
SourceFiles
31
STARCDCore.C
32
33
\*---------------------------------------------------------------------------*/
34
35
#ifndef STARCDCore_H
36
#define STARCDCore_H
37
38
#include "
IFstream.H
"
39
#include "
pointField.H
"
40
41
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43
namespace
Foam
44
{
45
46
namespace
fileFormats
47
{
48
49
/*---------------------------------------------------------------------------*\
50
Class fileFormats::STARCDCore Declaration
51
\*---------------------------------------------------------------------------*/
52
53
class
STARCDCore
54
{
55
protected
:
56
57
// Protected Member Functions
58
59
//- Read header
60
static
bool
readHeader
(
IFstream
&,
const
word
& fileSignature);
61
62
//- Write header for fileType (CELL|VERTEX|BOUNDARY)
63
static
void
writeHeader
(
Ostream
&,
const
word
&
fileType
);
64
65
66
protected
:
67
68
enum
cellType
69
{
70
starcdFluidType
= 1,
71
starcdSolidType
= 2,
72
starcdBaffleType
= 3,
73
starcdShellType
= 4,
74
starcdLineType
= 5,
75
starcdPointType
= 6
76
};
77
78
enum
shapeType
79
{
80
starcdPoint
= 1,
81
starcdLine
= 2,
82
starcdShell
= 3,
83
starcdHex
= 11,
84
starcdPrism
= 12,
85
starcdTet
= 13,
86
starcdPyr
= 14,
87
starcdPoly
= 255
88
};
89
90
91
public
:
92
93
// Public Member Functions
94
95
//- Read points from a (.vrt) file
96
// The file format is as follows:
97
// \verbatim
98
// Line 1:
99
// PROSTAR_VERTEX newline
100
//
101
// Line 2:
102
// {version} 0 0 0 0 0 0 0 newline
103
//
104
// Body:
105
// {vertexId} {x} {y} {z} newline
106
// \endverbatim
107
static
bool
readPoints
(
IFstream
&,
pointField
&,
labelList
& ids);
108
109
//- Write header and points to (.vrt) file
110
static
void
writePoints
(
Ostream
&,
const
pointField
&);
111
112
113
// Constructors
114
115
//- Construct null
116
STARCDCore
();
117
118
};
119
120
121
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122
123
}
// End namespace fileFormats
124
}
// End namespace Foam
125
126
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127
128
#endif
129
130
// ************************************************************************* //
IFstream.H
Foam::Field< vector >
Foam::IFstream
Input from file stream.
Definition:
IFstream.H:85
Foam::List< label >
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition:
Ostream.H:57
Foam::fileFormats::STARCDCore
Core routines used when reading/writing pro-STAR vrt/cel/bnd files.
Definition:
STARCDCore.H:53
Foam::fileFormats::STARCDCore::writeHeader
static void writeHeader(Ostream &, const word &fileType)
Write header for fileType (CELL|VERTEX|BOUNDARY)
Definition:
STARCDCore.C:75
Foam::fileFormats::STARCDCore::cellType
cellType
Definition:
STARCDCore.H:68
Foam::fileFormats::STARCDCore::starcdFluidType
@ starcdFluidType
Definition:
STARCDCore.H:69
Foam::fileFormats::STARCDCore::starcdLineType
@ starcdLineType
Definition:
STARCDCore.H:73
Foam::fileFormats::STARCDCore::starcdShellType
@ starcdShellType
Definition:
STARCDCore.H:72
Foam::fileFormats::STARCDCore::starcdPointType
@ starcdPointType
Definition:
STARCDCore.H:74
Foam::fileFormats::STARCDCore::starcdSolidType
@ starcdSolidType
Definition:
STARCDCore.H:70
Foam::fileFormats::STARCDCore::starcdBaffleType
@ starcdBaffleType
Definition:
STARCDCore.H:71
Foam::fileFormats::STARCDCore::shapeType
shapeType
Definition:
STARCDCore.H:78
Foam::fileFormats::STARCDCore::starcdPrism
@ starcdPrism
Definition:
STARCDCore.H:83
Foam::fileFormats::STARCDCore::starcdShell
@ starcdShell
Definition:
STARCDCore.H:81
Foam::fileFormats::STARCDCore::starcdPyr
@ starcdPyr
Definition:
STARCDCore.H:85
Foam::fileFormats::STARCDCore::starcdLine
@ starcdLine
Definition:
STARCDCore.H:80
Foam::fileFormats::STARCDCore::starcdPoly
@ starcdPoly
Definition:
STARCDCore.H:86
Foam::fileFormats::STARCDCore::starcdPoint
@ starcdPoint
Definition:
STARCDCore.H:79
Foam::fileFormats::STARCDCore::starcdHex
@ starcdHex
Definition:
STARCDCore.H:82
Foam::fileFormats::STARCDCore::starcdTet
@ starcdTet
Definition:
STARCDCore.H:84
Foam::fileFormats::STARCDCore::readHeader
static bool readHeader(IFstream &, const word &fileSignature)
Read header.
Definition:
STARCDCore.C:41
Foam::fileFormats::STARCDCore::readPoints
static bool readPoints(IFstream &, pointField &, labelList &ids)
Read points from a (.vrt) file.
Definition:
STARCDCore.C:96
Foam::fileFormats::STARCDCore::writePoints
static void writePoints(Ostream &, const pointField &)
Write header and points to (.vrt) file.
Definition:
STARCDCore.C:138
Foam::fileFormats::STARCDCore::STARCDCore
STARCDCore()
Construct null.
Definition:
STARCDCore.C:34
Foam::word
A class for handling words, derived from string.
Definition:
word.H:62
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.H:214
Foam::fileType
fileType
Enumeration of file types.
Definition:
fileName.H:67
pointField.H
src
fileFormats
starcd
STARCDCore.H
Generated by
1.9.1