patchInteractionData.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-2021 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\*---------------------------------------------------------------------------*/
28
30#include "dictionaryEntry.H"
32
33// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
34
36:
37 interactionTypeName_(),
38 patchName_(),
39 e_(0),
40 mu_(0)
41{}
42
43
44// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
45
46Foam::Istream& Foam::operator>>
47(
48 Istream& is,
50)
51{
53
54 const dictionaryEntry dictEntry(dictionary::null, is);
55 const dictionary& dict = dictEntry.dict();
56
57 pid.patchName_ = dictEntry.keyword();
58
59 dict.readEntry("type", pid.interactionTypeName_);
60 pid.e_ = dict.getOrDefault<scalar>("e", 1);
61 pid.mu_ = dict.getOrDefault<scalar>("mu", 0);
62
63 return is;
64}
65
66
67// ************************************************************************* //
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:58
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A keyword and a list of tokens is a 'dictionaryEntry'.
virtual const dictionary & dict() const noexcept
Return dictionary (ie, this)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
const keyType & keyword() const noexcept
Return keyword.
Definition: entry.H:195
Helper class for the LocalInteraction patch interaction model.
patchInteractionData()
Default construct.
#define FUNCTION_NAME
pid_t pid()
Return the PID of this process.
Definition: MSwindows.C:330
dictionary dict