1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "calculatedFvPatchField.H"
28 #include "fvPatchFieldMapper.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 const word& fvPatchField<Type>::calculatedType()
38 return calculatedFvPatchField<Type>::typeName;
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 calculatedFvPatchField<Type>::calculatedFvPatchField
47 const DimensionedField<Type, volMesh>& iF
50 fvPatchField<Type>(p, iF)
55 calculatedFvPatchField<Type>::calculatedFvPatchField
57 const calculatedFvPatchField<Type>& ptf,
59 const DimensionedField<Type, volMesh>& iF,
60 const fvPatchFieldMapper& mapper
63 fvPatchField<Type>(ptf, p, iF, mapper)
68 calculatedFvPatchField<Type>::calculatedFvPatchField
71 const DimensionedField<Type, volMesh>& iF,
72 const dictionary& dict,
73 const bool valueRequired
76 fvPatchField<Type>(p, iF, dict, valueRequired)
81 calculatedFvPatchField<Type>::calculatedFvPatchField
83 const calculatedFvPatchField<Type>& ptf
86 fvPatchField<Type>(ptf)
91 calculatedFvPatchField<Type>::calculatedFvPatchField
93 const calculatedFvPatchField<Type>& ptf,
94 const DimensionedField<Type, volMesh>& iF
97 fvPatchField<Type>(ptf, iF)
102 template<class Type2>
103 tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
105 const fvPatchField<Type2>& pf
108 typename patchConstructorTable::iterator patchTypeCstrIter =
109 patchConstructorTablePtr_->find(pf.patch().type());
111 if (patchTypeCstrIter != patchConstructorTablePtr_->end())
113 return patchTypeCstrIter()
116 DimensionedField<Type, volMesh>::null()
121 return tmp<fvPatchField<Type> >
123 new calculatedFvPatchField<Type>
126 DimensionedField<Type, volMesh>::null()
133 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
136 tmp<Field<Type> > calculatedFvPatchField<Type>::valueInternalCoeffs
138 const tmp<scalarField>&
143 "calculatedFvPatchField<Type>::"
144 "valueInternalCoeffs(const tmp<scalarField>&) const"
146 "valueInternalCoeffs cannot be called for a calculatedFvPatchField"
147 << "\n on patch " << this->patch().name()
148 << " of field " << this->dimensionedInternalField().name()
149 << " in file " << this->dimensionedInternalField().objectPath()
150 << "\n You are probably trying to solve for a field with a "
151 "default boundary condition."
159 tmp<Field<Type> > calculatedFvPatchField<Type>::valueBoundaryCoeffs
161 const tmp<scalarField>&
166 "calculatedFvPatchField<Type>::"
167 "valueBoundaryCoeffs(const tmp<scalarField>&) const"
169 "valueBoundaryCoeffs cannot be called for a calculatedFvPatchField"
170 << "\n on patch " << this->patch().name()
171 << " of field " << this->dimensionedInternalField().name()
172 << " in file " << this->dimensionedInternalField().objectPath()
173 << "\n You are probably trying to solve for a field with a "
174 "default boundary condition."
181 tmp<Field<Type> > calculatedFvPatchField<Type>::gradientInternalCoeffs() const
185 "calculatedFvPatchField<Type>::"
186 "gradientInternalCoeffs() const"
188 "gradientInternalCoeffs cannot be called for a "
189 "calculatedFvPatchField"
190 << "\n on patch " << this->patch().name()
191 << " of field " << this->dimensionedInternalField().name()
192 << " in file " << this->dimensionedInternalField().objectPath()
193 << "\n You are probably trying to solve for a field with a "
194 "default boundary condition."
201 tmp<Field<Type> > calculatedFvPatchField<Type>::gradientBoundaryCoeffs() const
205 "calculatedFvPatchField<Type>::"
206 "gradientBoundaryCoeffs() const"
208 "gradientBoundaryCoeffs cannot be called for a "
209 "calculatedFvPatchField"
210 << "\n on patch " << this->patch().name()
211 << " of field " << this->dimensionedInternalField().name()
212 << " in file " << this->dimensionedInternalField().objectPath()
213 << "\n You are probably trying to solve for a field with a "
214 "default boundary condition."
223 void calculatedFvPatchField<Type>::write(Ostream& os) const
225 fvPatchField<Type>::write(os);
226 this->writeEntry("value", os);
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 } // End namespace Foam
234 // ************************************************************************* //