Loading...
Searching...
No Matches
ccmBoundaryInfo.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) 2016 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Description
27 Container for holding STARCCM boundary information
28
29\*---------------------------------------------------------------------------*/
30
31#ifndef Foam_ccmBoundaryInfo_H
32#define Foam_ccmBoundaryInfo_H
33
34#include "word.H"
35#include "Ostream.H"
36
37// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38
40// internal use only - skip doxygen documentation
41namespace Foam
42{
43namespace ccm
44{
45
46class ccmBoundaryInfo;
47Ostream& operator<<(Ostream& os, const ccmBoundaryInfo& entry);
48
49/*---------------------------------------------------------------------------*\
50 Class Foam::ccm::ccmBoundaryInfo Declaration
51\*---------------------------------------------------------------------------*/
52
53//- Helper when reading raw boundary information
54class ccmBoundaryInfo
55{
56public:
57
58 //- The ccm region
59 int ccmIndex;
60
61 //- Number of faces
62 label size;
63
64 //- The openfoam patch id to map to
65 label patchId;
66
67 //- The patch name, as per the BoundaryRegion "Label" entry
68 std::string patchName;
69
70 //- The patch type, as per the BoundaryRegion "BoundaryType" entry
71 std::string patchType;
72
73
74 //- Default construct
75 ccmBoundaryInfo()
76 :
77 ccmIndex(0),
78 size(0),
79 patchId(-1),
80 patchName(),
81 patchType("patch")
82 {}
83
84
85 //- Set patch name, default to "patch_CCMID" for an empty string
86 void setPatchName(const std::string& str)
87 {
88 if (str.empty())
89 {
90 patchName = "patch_" + ::Foam::name(ccmIndex);
91 }
92 else
93 {
94 patchName = str;
95 }
96 }
97
98
99 //- Info doesn't match if the ccm boundaries are different
100 bool operator!=(const ccmBoundaryInfo& rhs) const
101 {
102 return ccmIndex != rhs.ccmIndex;
103 }
104
105
106 //- Ostream Operator
107 friend Ostream& operator<<(Ostream& os, const ccmBoundaryInfo& entry)
108 {
109 os << "BoundaryFaces-" << entry.ccmIndex;
110 os << " size=" << entry.size;
111 os << " name=" << entry.patchName;
112 os << " type=" << entry.patchType;
113 os << " foam-patch=" << entry.patchId;
114
115 return os;
116 }
117};
118
119
120// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121
122} // End namespace ccm
123} // End namespace Foam
124
126// internal use only - skip doxygen documentation
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130#endif
131
132// ************************************************************************* //
OBJstream os(runTime.globalPath()/outputName)
label patchId(-1)
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
Ostream & operator<<(Ostream &os, const interfaceEntry &entry)
Namespace for OpenFOAM.
bool operator!=(const eddy &a, const eddy &b)
Definition eddy.H:297
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127