FreeFOAM The Cross-Platform CFD Toolkit
patchInteractionData.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 | Copyright (C) 2009-2010 OpenCFD Ltd.
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 Class
25  Foam::patchInteractionData
26 
27 Description
28  Helper class for the LocalInteraction patch interaction model
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef patchInteractionData_H
33 #define patchInteractionData_H
34 
35 #include <OpenFOAM/Istream.H>
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 /*---------------------------------------------------------------------------*\
42  Class patchInteractionData Declaration
43 \*---------------------------------------------------------------------------*/
44 
45 // Forward declaration of classes
46 class patchInteractionData;
47 
48 // Forward declaration of friend functions
49 Istream& operator>>
50 (
51  Istream& is,
52  patchInteractionData& pid
53 );
54 
55 
57 {
58  // Private data
59 
60  //- Interaction type name
61  word interactionTypeName_;
62 
63  //- Patch name
64  word patchName_;
65 
66  //- Elasticity coefficient
67  scalar e_;
68 
69  //- Restitution coefficient
70  scalar mu_;
71 
72 
73 public:
74 
75  // Constructor
76 
77  //- Construct null
79 
80 
81  // Member functions
82 
83  // Access
84 
85  //- Return const access to the interaction type name
86  const word& interactionTypeName() const;
87 
88  //- Return const access to the patch name
89  const word& patchName() const;
90 
91  //- Return const access to the elasticity coefficient
92  scalar e() const;
93 
94  //- Return const access to the restitution coefficient
95  scalar mu() const;
96 
97 
98  // I-O
99 
100  //- Istream operator
101  friend Istream& operator>>
102  (
103  Istream& is,
105  );
106 /* {
107  is.check
108  (
109  "Istream& operator>>"
110  "(Istream&, patchInteractionData&)"
111  );
112 
113  const dictionaryEntry entry(dictionary::null, is);
114 
115  pid.patchName_ = entry.keyword();
116  entry.lookup("type") >> pid.interactionTypeName_;
117  pid.e_ = entry.lookupOrDefault<scalar>("e", 1.0);
118  pid.mu_ = entry.lookupOrDefault<scalar>("mu", 0.0);
119 
120  if
121  (
122  PatchInteractionModel<CloudType>::wordToInteractionType
123  (
124  pid.interactionTypeName_
125  )
126  == PatchInteractionModel<CloudType>::itOther)
127  {
128  FatalErrorIn
129  (
130  "friend Istream& operator>>"
131  "("
132  "Istream&, "
133  "patchInteractionData&"
134  ")"
135  ) << "Unknown patch interaction type "
136  << pid.interactionTypeName_
137  << ". Valid selections are:"
138  << PatchInteractionModel<CloudType>::
139  interactionTypeNames_
140  << endl << abort(FatalError);
141  }
142 
143  return is;
144  }
145 */};
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************ vim: set sw=4 sts=4 et: ************************ //