Loading...
Searching...
No Matches
boundaryPatch.C
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) 2011 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
29#include "boundaryPatch.H"
30#include "dictionary.H"
31#include "Ostream.H"
32
33// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34
36(
37 const word& name,
38 const label index,
39 const label size,
40 const label start,
41 const word& physicalType
42)
45 size_(size),
46 start_(start)
47{}
48
49
51(
52 const word& name,
53 const dictionary& dict,
54 const label index
55)
58 size_(dict.get<label>("nFaces")),
59 start_(dict.get<label>("startFace"))
60{}
61
62
63Foam::boundaryPatch::boundaryPatch(const boundaryPatch& p, const label index)
64:
68}
69
70
71// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72
74{
75 // if (!type_.empty()) os.writeEntry("type", type_);
77 os.writeEntry("nFaces", size_);
78 os.writeEntry("startFace", start_);
79}
80
81
82// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
83
84Foam::Ostream& Foam::operator<<(Ostream& os, const boundaryPatch& p)
85{
86 p.write(os);
87 os.check(FUNCTION_NAME);
88 return os;
89}
90
91
92// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Like polyPatch but without reference to mesh. Used in boundaryMesh to hold data on patches....
boundaryPatch(const word &name, const label index, const label size, const label start, const word &physicalType=word::null)
Construct from components.
virtual void write(Ostream &os) const
Write dictionary entries (without surrounding braces).
label size() const noexcept
The size of the patch.
label start() const noexcept
The start of the patch.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const word & physicalType() const noexcept
The (optional) physical type of the patch.
void write(Ostream &os) const
Write (physicalType, inGroups) dictionary entries (without surrounding braces).
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & name() const noexcept
The patch name.
patchIdentifier(const patchIdentifier &)=default
Copy construct.
A class for handling words, derived from Foam::string.
Definition word.H:66
volScalarField & p
OBJstream os(runTime.globalPath()/outputName)
#define FUNCTION_NAME
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dictionary dict