1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "calculatedFvPatchField.H"
27 #include "fvPatchFieldMapper.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 const word& fvPatchField<Type>::calculatedType()
37 return calculatedFvPatchField<Type>::typeName;
40 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43 calculatedFvPatchField<Type>::calculatedFvPatchField
46 const DimensionedField<Type, volMesh>& iF
49 fvPatchField<Type>(p, iF)
54 calculatedFvPatchField<Type>::calculatedFvPatchField
56 const calculatedFvPatchField<Type>& ptf,
58 const DimensionedField<Type, volMesh>& iF,
59 const fvPatchFieldMapper& mapper
62 fvPatchField<Type>(ptf, p, iF, mapper)
67 calculatedFvPatchField<Type>::calculatedFvPatchField
70 const DimensionedField<Type, volMesh>& iF,
71 const dictionary& dict,
72 const bool valueRequired
75 fvPatchField<Type>(p, iF, dict, valueRequired)
80 calculatedFvPatchField<Type>::calculatedFvPatchField
82 const calculatedFvPatchField<Type>& ptf
85 fvPatchField<Type>(ptf)
90 calculatedFvPatchField<Type>::calculatedFvPatchField
92 const calculatedFvPatchField<Type>& ptf,
93 const DimensionedField<Type, volMesh>& iF
96 fvPatchField<Type>(ptf, iF)
101 template<class Type2>
102 tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
104 const fvPatchField<Type2>& pf
107 typename patchConstructorTable::iterator patchTypeCstrIter =
108 patchConstructorTablePtr_->find(pf.patch().type());
110 if (patchTypeCstrIter != patchConstructorTablePtr_->end())
112 return patchTypeCstrIter()
115 DimensionedField<Type, volMesh>::null()
120 return tmp<fvPatchField<Type> >
122 new calculatedFvPatchField<Type>
125 DimensionedField<Type, volMesh>::null()
132 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
135 tmp<Field<Type> > calculatedFvPatchField<Type>::valueInternalCoeffs
137 const tmp<scalarField>&
142 "calculatedFvPatchField<Type>::"
143 "valueInternalCoeffs(const tmp<scalarField>&) const"
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."
158 tmp<Field<Type> > calculatedFvPatchField<Type>::valueBoundaryCoeffs
160 const tmp<scalarField>&
165 "calculatedFvPatchField<Type>::"
166 "valueBoundaryCoeffs(const tmp<scalarField>&) const"
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."
180 tmp<Field<Type> > calculatedFvPatchField<Type>::gradientInternalCoeffs() const
184 "calculatedFvPatchField<Type>::"
185 "gradientInternalCoeffs() const"
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."
200 tmp<Field<Type> > calculatedFvPatchField<Type>::gradientBoundaryCoeffs() const
204 "calculatedFvPatchField<Type>::"
205 "gradientBoundaryCoeffs() const"
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."
222 void calculatedFvPatchField<Type>::write(Ostream& os) const
224 fvPatchField<Type>::write(os);
225 this->writeEntry("value", os);
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 } // End namespace Foam
233 // ************************************************************************* //