FreeFOAM The Cross-Platform CFD Toolkit
calculatedFvPatchField.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) 1991-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 "calculatedFvPatchField.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 
34 template<class Type>
36 {
38 }
39 
40 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
41 
42 template<class Type>
44 (
45  const fvPatch& p,
47 )
48 :
50 {}
51 
52 
53 template<class Type>
55 (
57  const fvPatch& p,
59  const fvPatchFieldMapper& mapper
60 )
61 :
62  fvPatchField<Type>(ptf, p, iF, mapper)
63 {}
64 
65 
66 template<class Type>
68 (
69  const fvPatch& p,
71  const dictionary& dict,
72  const bool valueRequired
73 )
74 :
75  fvPatchField<Type>(p, iF, dict, valueRequired)
76 {}
77 
78 
79 template<class Type>
81 (
83 )
84 :
86 {}
87 
88 
89 template<class Type>
91 (
94 )
95 :
96  fvPatchField<Type>(ptf, iF)
97 {}
98 
99 
100 template<class Type>
101 template<class Type2>
103 (
104  const fvPatchField<Type2>& pf
105 )
106 {
107  typename patchConstructorTable::iterator patchTypeCstrIter =
108  patchConstructorTablePtr_->find(pf.patch().type());
109 
110  if (patchTypeCstrIter != patchConstructorTablePtr_->end())
111  {
112  return patchTypeCstrIter()
113  (
114  pf.patch(),
116  );
117  }
118  else
119  {
120  return tmp<fvPatchField<Type> >
121  (
123  (
124  pf.patch(),
126  )
127  );
128  }
129 }
130 
131 
132 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
133 
134 template<class Type>
136 (
137  const tmp<scalarField>&
138 ) const
139 {
141  (
142  "calculatedFvPatchField<Type>::"
143  "valueInternalCoeffs(const tmp<scalarField>&) const"
144  ) << "\n "
145  "valueInternalCoeffs cannot be called for a calculatedFvPatchField"
146  << "\n on patch " << this->patch().name()
147  << " of field " << this->dimensionedInternalField().name()
148  << " in file " << this->dimensionedInternalField().objectPath()
149  << "\n You are probably trying to solve for a field with a "
150  "default boundary condition."
151  << exit(FatalError);
152 
153  return *this;
154 }
155 
156 
157 template<class Type>
159 (
160  const tmp<scalarField>&
161 ) const
162 {
164  (
165  "calculatedFvPatchField<Type>::"
166  "valueBoundaryCoeffs(const tmp<scalarField>&) const"
167  ) << "\n "
168  "valueBoundaryCoeffs cannot be called for a calculatedFvPatchField"
169  << "\n on patch " << this->patch().name()
170  << " of field " << this->dimensionedInternalField().name()
171  << " in file " << this->dimensionedInternalField().objectPath()
172  << "\n You are probably trying to solve for a field with a "
173  "default boundary condition."
174  << exit(FatalError);
175 
176  return *this;
177 }
178 
179 template<class Type>
181 {
183  (
184  "calculatedFvPatchField<Type>::"
185  "gradientInternalCoeffs() const"
186  ) << "\n "
187  "gradientInternalCoeffs cannot be called for a "
188  "calculatedFvPatchField"
189  << "\n on patch " << this->patch().name()
190  << " of field " << this->dimensionedInternalField().name()
191  << " in file " << this->dimensionedInternalField().objectPath()
192  << "\n You are probably trying to solve for a field with a "
193  "default boundary condition."
194  << exit(FatalError);
195 
196  return *this;
197 }
198 
199 template<class Type>
201 {
203  (
204  "calculatedFvPatchField<Type>::"
205  "gradientBoundaryCoeffs() const"
206  ) << "\n "
207  "gradientBoundaryCoeffs cannot be called for a "
208  "calculatedFvPatchField"
209  << "\n on patch " << this->patch().name()
210  << " of field " << this->dimensionedInternalField().name()
211  << " in file " << this->dimensionedInternalField().objectPath()
212  << "\n You are probably trying to solve for a field with a "
213  "default boundary condition."
214  << exit(FatalError);
215 
216  return *this;
217 }
218 
219 
220 // Write
221 template<class Type>
223 {
225  this->writeEntry("value", os);
226 }
227 
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 } // End namespace Foam
232 
233 // ************************ vim: set sw=4 sts=4 et: ************************ //