initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / basic / calculated / calculatedFvPatchField.C
blob9aaa91de2461245c69892a1d48fc401f1daa5d76
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 namespace Foam
35 template<class Type>
36 const word& fvPatchField<Type>::calculatedType()
38     return calculatedFvPatchField<Type>::typeName;
41 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
43 template<class Type>
44 calculatedFvPatchField<Type>::calculatedFvPatchField
46     const fvPatch& p,
47     const DimensionedField<Type, volMesh>& iF
50     fvPatchField<Type>(p, iF)
54 template<class Type>
55 calculatedFvPatchField<Type>::calculatedFvPatchField
57     const calculatedFvPatchField<Type>& ptf,
58     const fvPatch& p,
59     const DimensionedField<Type, volMesh>& iF,
60     const fvPatchFieldMapper& mapper
63     fvPatchField<Type>(ptf, p, iF, mapper)
67 template<class Type>
68 calculatedFvPatchField<Type>::calculatedFvPatchField
70     const fvPatch& p,
71     const DimensionedField<Type, volMesh>& iF,
72     const dictionary& dict,
73     const bool valueRequired
76     fvPatchField<Type>(p, iF, dict, valueRequired)
80 template<class Type>
81 calculatedFvPatchField<Type>::calculatedFvPatchField
83     const calculatedFvPatchField<Type>& ptf
86     fvPatchField<Type>(ptf)
90 template<class Type>
91 calculatedFvPatchField<Type>::calculatedFvPatchField
93     const calculatedFvPatchField<Type>& ptf,
94     const DimensionedField<Type, volMesh>& iF
97     fvPatchField<Type>(ptf, iF)
101 template<class Type>
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())
112     {
113         return patchTypeCstrIter()
114         (
115             pf.patch(),
116             DimensionedField<Type, volMesh>::null()
117         );
118     }
119     else
120     {
121         return tmp<fvPatchField<Type> >
122         (
123             new calculatedFvPatchField<Type>
124             (
125                 pf.patch(),
126                 DimensionedField<Type, volMesh>::null()
127             )
128         );
129     }
133 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
135 template<class Type>
136 tmp<Field<Type> > calculatedFvPatchField<Type>::valueInternalCoeffs
138     const tmp<scalarField>&
139 ) const
141     FatalErrorIn
142     (
143         "calculatedFvPatchField<Type>::"
144         "valueInternalCoeffs(const tmp<scalarField>&) const"
145     )   << "\n    "
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."
152         << exit(FatalError);
154     return *this;
158 template<class Type>
159 tmp<Field<Type> > calculatedFvPatchField<Type>::valueBoundaryCoeffs
161     const tmp<scalarField>&
162 ) const
164     FatalErrorIn
165     (
166         "calculatedFvPatchField<Type>::"
167         "valueBoundaryCoeffs(const tmp<scalarField>&) const"
168     )   << "\n    "
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."
175         << exit(FatalError);
177     return *this;
180 template<class Type>
181 tmp<Field<Type> > calculatedFvPatchField<Type>::gradientInternalCoeffs() const
183     FatalErrorIn
184     (
185         "calculatedFvPatchField<Type>::"
186         "gradientInternalCoeffs() const"
187     )   << "\n    "
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."
195         << exit(FatalError);
197     return *this;
200 template<class Type>
201 tmp<Field<Type> > calculatedFvPatchField<Type>::gradientBoundaryCoeffs() const
203     FatalErrorIn
204     (
205         "calculatedFvPatchField<Type>::"
206         "gradientBoundaryCoeffs() const"
207     )   << "\n    "
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."
215         << exit(FatalError);
217     return *this;
221 // Write
222 template<class Type>
223 void calculatedFvPatchField<Type>::write(Ostream& os) const
225     fvPatchField<Type>::write(os);
226     this->writeEntry("value", os);
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 } // End namespace Foam
234 // ************************************************************************* //