patchInteractionData.C
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-2020 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 \*---------------------------------------------------------------------------*/
25 
26 #include "patchInteractionData.H"
27 #include "dictionaryEntry.H"
28 #include "PatchInteractionModel.H"
29 
30 // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
31 
33 :
34  interactionTypeName_("unknownInteractionTypeName"),
35  patchName_("unknownPatch"),
36  e_(0.0),
37  mu_(0.0)
38 {}
39 
40 
41 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
42 
44 {
45  return interactionTypeName_;
46 }
47 
48 
50 {
51  return patchName_;
52 }
53 
54 
55 Foam::scalar Foam::patchInteractionData::e() const
56 {
57  return e_;
58 }
59 
60 
61 Foam::scalar Foam::patchInteractionData::mu() const
62 {
63  return mu_;
64 }
65 
66 
67 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
68 
69 Foam::Istream& Foam::operator>>
70 (
71  Istream& is,
73 )
74 {
75  is.check("Istream& operator>>(Istream&, patchInteractionData&)");
76 
78 
79  pid.patchName_ = entry.keyword();
80  entry.lookup("type") >> pid.interactionTypeName_;
81  pid.e_ = entry.lookupOrDefault<scalar>("e", 1.0);
82  pid.mu_ = entry.lookupOrDefault<scalar>("mu", 0.0);
83 
84  return is;
85 }
86 
87 
88 // ************************************************************************* //
const word & patchName() const
Return const access to the patch name.
Helper class for the LocalInteraction patch interaction model.
const keyType & keyword() const
Return keyword.
Definition: entry.H:123
const word & interactionTypeName() const
Return const access to the interaction type name.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:92
scalar mu() const
Return const access to the restitution coefficient.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
A keyword and a list of tokens is a &#39;dictionaryEntry&#39;.
scalar e() const
Return const access to the elasticity coefficient.
A class for handling words, derived from string.
Definition: word.H:59
patchInteractionData()
Construct null.
static const dictionary null
Null dictionary.
Definition: dictionary.H:242
pid_t pid()
Return the PID of this process.
Definition: POSIX.C:73
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
A keyword and a list of tokens is an &#39;entry&#39;.
Definition: entry.H:65
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:844