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 -------------------------------------------------------------------------------
11 License
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 
29 #include "patchInteractionData.H"
30 #include "dictionaryEntry.H"
31 #include "PatchInteractionModel.H"
32 
33 // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
34 
36 :
37  interactionTypeName_(),
38  patchName_(),
39  e_(0),
40  mu_(0)
41 {}
42 
43 
44 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
45 
46 Foam::Istream& Foam::operator>>
47 (
48  Istream& is,
50 )
51 {
52  is.check(FUNCTION_NAME);
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 // ************************************************************************* //
PatchInteractionModel.H
Foam::dictionaryEntry
A keyword and a list of tokens is a 'dictionaryEntry'.
Definition: dictionaryEntry.H:65
Foam::patchInteractionData
Helper class for the LocalInteraction patch interaction model.
Definition: patchInteractionData.H:53
patchInteractionData.H
Foam::dictionaryEntry::dict
virtual const dictionary & dict() const noexcept
Return dictionary (ie, this)
Definition: dictionaryEntry.C:102
Foam::entry::keyword
const keyType & keyword() const noexcept
Return keyword.
Definition: entry.H:195
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:392
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::pid
pid_t pid()
Return the PID of this process.
Definition: MSwindows.C:330
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:302
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::IOstream::check
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:58
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
dictionaryEntry.H
Foam::patchInteractionData::patchInteractionData
patchInteractionData()
Default construct.
Definition: patchInteractionData.C:35
FUNCTION_NAME
#define FUNCTION_NAME
Definition: messageStream.H:295
Foam::dictionary::getOrDefault
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:148