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) 2011-2012 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 "calculatedFvPatchField.H"
27 #include "fvPatchFieldMapper.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 template<class Type>
33 {
35 }
36 
37 
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 
40 template<class Type>
42 (
43  const fvPatch& p,
45 )
46 :
48 {}
49 
50 
51 template<class Type>
53 (
55  const fvPatch& p,
57  const fvPatchFieldMapper& mapper
58 )
59 :
60  fvPatchField<Type>(ptf, p, iF, mapper)
61 {}
62 
63 
64 template<class Type>
66 (
67  const fvPatch& p,
69  const dictionary& dict,
70  const bool valueRequired
71 )
72 :
73  fvPatchField<Type>(p, iF, dict, valueRequired)
74 {}
75 
76 
77 template<class Type>
79 (
81 )
82 :
84 {}
85 
86 
87 template<class Type>
89 (
92 )
93 :
94  fvPatchField<Type>(ptf, iF)
95 {}
96 
97 
98 template<class Type>
101 (
102  const fvPatch& p
103 )
104 {
105  typename patchConstructorTable::iterator patchTypeCstrIter =
106  patchConstructorTablePtr_->find(p.type());
107 
108  if (patchTypeCstrIter != patchConstructorTablePtr_->end())
109  {
110  return patchTypeCstrIter()
111  (
112  p,
114  );
115  }
116  else
117  {
118  return tmp<fvPatchField<Type> >
119  (
121  (
122  p,
124  )
125  );
126  }
127 }
128 
129 
130 template<class Type>
131 template<class Type2>
133 (
134  const fvPatchField<Type2>& pf
135 )
136 {
137  return NewCalculatedType(pf.patch());
138 }
139 
140 
141 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
142 
143 template<class Type>
146 (
147  const tmp<scalarField>&
148 ) const
149 {
151  (
152  "calculatedFvPatchField<Type>::"
153  "valueInternalCoeffs(const tmp<scalarField>&) const"
154  ) << "\n "
155  "valueInternalCoeffs cannot be called for a calculatedFvPatchField"
156  << "\n on patch " << this->patch().name()
157  << " of field " << this->dimensionedInternalField().name()
158  << " in file " << this->dimensionedInternalField().objectPath()
159  << "\n You are probably trying to solve for a field with a "
160  "default boundary condition."
161  << exit(FatalError);
162 
163  return *this;
164 }
165 
166 
167 template<class Type>
170 (
171  const tmp<scalarField>&
172 ) const
173 {
175  (
176  "calculatedFvPatchField<Type>::"
177  "valueBoundaryCoeffs(const tmp<scalarField>&) const"
178  ) << "\n "
179  "valueBoundaryCoeffs cannot be called for a calculatedFvPatchField"
180  << "\n on patch " << this->patch().name()
181  << " of field " << this->dimensionedInternalField().name()
182  << " in file " << this->dimensionedInternalField().objectPath()
183  << "\n You are probably trying to solve for a field with a "
184  "default boundary condition."
185  << exit(FatalError);
186 
187  return *this;
188 }
189 
190 
191 template<class Type>
194 {
196  (
197  "calculatedFvPatchField<Type>::"
198  "gradientInternalCoeffs() const"
199  ) << "\n "
200  "gradientInternalCoeffs cannot be called for a "
201  "calculatedFvPatchField"
202  << "\n on patch " << this->patch().name()
203  << " of field " << this->dimensionedInternalField().name()
204  << " in file " << this->dimensionedInternalField().objectPath()
205  << "\n You are probably trying to solve for a field with a "
206  "default boundary condition."
207  << exit(FatalError);
208 
209  return *this;
210 }
211 
212 
213 template<class Type>
216 {
218  (
219  "calculatedFvPatchField<Type>::"
220  "gradientBoundaryCoeffs() const"
221  ) << "\n "
222  "gradientBoundaryCoeffs cannot be called for a "
223  "calculatedFvPatchField"
224  << "\n on patch " << this->patch().name()
225  << " of field " << this->dimensionedInternalField().name()
226  << " in file " << this->dimensionedInternalField().objectPath()
227  << "\n You are probably trying to solve for a field with a "
228  "default boundary condition."
229  << exit(FatalError);
230 
231  return *this;
232 }
233 
234 
235 template<class Type>
237 {
239  this->writeEntry("value", os);
240 }
241 
242 
243 // ************************************************************************* //
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for handling words, derived from string.
Definition: word.H:59
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Foam::fvPatchFieldMapper.
static const word & calculatedType()
Return the type of the calculated for of fvPatchField.
calculatedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
runTime write()
dictionary dict
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
volScalarField & p
Definition: createFields.H:51
tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
static tmp< fvPatchField< Type > > NewCalculatedType(const fvPatch &)
Return a pointer to a new calculatedFvPatchField created on.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:314
rDeltaT dimensionedInternalField()
error FatalError
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void write(Ostream &) const
Write.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:300
A class for managing temporary objects.
Definition: PtrList.H:118
tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.