FreeFOAM The Cross-Platform CFD Toolkit
PatchInteractionModel.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 | Copyright (C) 2008-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 \*---------------------------------------------------------------------------*/
25 
26 #include "PatchInteractionModel.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 template<class CloudType>
32 (
33  IStringStream
34  (
35  "(rebound stick escape)"
36  )()
37 );
38 
39 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
40 
41 template<class CloudType>
43 (
44  const interactionType& itEnum
45 )
46 {
47  switch (itEnum)
48  {
49  case itRebound:
50  {
51  return "rebound";
52  break;
53  }
54  case itStick:
55  {
56  return "stick";
57  break;
58  }
59  case itEscape:
60  {
61  return "escape";
62  break;
63  }
64  default:
65  {
66  return "other";
67  }
68  }
69 #ifdef __ICC
70  // Prevent Icc complaining about missing return statement.
71  return word::null;
72 #endif
73 }
74 
75 
76 template<class CloudType>
79 (
80  const word& itWord
81 )
82 {
83  if (itWord == "rebound")
84  {
85  return itRebound;
86  }
87  else if (itWord == "stick")
88  {
89  return itStick;
90  }
91  else if (itWord == "escape")
92  {
93  return itEscape;
94  }
95  else
96  {
97  return itOther;
98  }
99 }
100 
101 
102 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
103 
104 template<class CloudType>
106 (
107  const dictionary& dict,
108  CloudType& owner,
109  const word& type
110 )
111 :
112  dict_(dict),
113  owner_(owner),
114  coeffDict_(dict.subDict(type + "Coeffs"))
115 {}
116 
117 
118 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
119 
120 template<class CloudType>
122 {}
123 
124 
125 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
126 
127 template<class CloudType>
128 const CloudType&
130 {
131  return owner_;
132 }
133 
134 
135 template<class CloudType>
137 {
138  return dict_;
139 }
140 
141 
142 template<class CloudType>
143 const Foam::dictionary&
145 {
146  return coeffDict_;
147 }
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
153 
154 // ************************ vim: set sw=4 sts=4 et: ************************ //
155