BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / finiteVolume / fields / fvPatchFields / basic / calculated / calculatedFvPatchField.C
blob1f179134fec59dec3a5cf49d478830d4be750fdd
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
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
19     for more details.
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 namespace Foam
34 template<class Type>
35 const word& fvPatchField<Type>::calculatedType()
37     return calculatedFvPatchField<Type>::typeName;
40 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
42 template<class Type>
43 calculatedFvPatchField<Type>::calculatedFvPatchField
45     const fvPatch& p,
46     const DimensionedField<Type, volMesh>& iF
49     fvPatchField<Type>(p, iF)
53 template<class Type>
54 calculatedFvPatchField<Type>::calculatedFvPatchField
56     const calculatedFvPatchField<Type>& ptf,
57     const fvPatch& p,
58     const DimensionedField<Type, volMesh>& iF,
59     const fvPatchFieldMapper& mapper
62     fvPatchField<Type>(ptf, p, iF, mapper)
66 template<class Type>
67 calculatedFvPatchField<Type>::calculatedFvPatchField
69     const fvPatch& p,
70     const DimensionedField<Type, volMesh>& iF,
71     const dictionary& dict,
72     const bool valueRequired
75     fvPatchField<Type>(p, iF, dict, valueRequired)
79 template<class Type>
80 calculatedFvPatchField<Type>::calculatedFvPatchField
82     const calculatedFvPatchField<Type>& ptf
85     fvPatchField<Type>(ptf)
89 template<class Type>
90 calculatedFvPatchField<Type>::calculatedFvPatchField
92     const calculatedFvPatchField<Type>& ptf,
93     const DimensionedField<Type, volMesh>& iF
96     fvPatchField<Type>(ptf, iF)
100 template<class Type>
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())
111     {
112         return patchTypeCstrIter()
113         (
114             pf.patch(),
115             DimensionedField<Type, volMesh>::null()
116         );
117     }
118     else
119     {
120         return tmp<fvPatchField<Type> >
121         (
122             new calculatedFvPatchField<Type>
123             (
124                 pf.patch(),
125                 DimensionedField<Type, volMesh>::null()
126             )
127         );
128     }
132 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
134 template<class Type>
135 tmp<Field<Type> > calculatedFvPatchField<Type>::valueInternalCoeffs
137     const tmp<scalarField>&
138 ) const
140     FatalErrorIn
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);
153     return *this;
157 template<class Type>
158 tmp<Field<Type> > calculatedFvPatchField<Type>::valueBoundaryCoeffs
160     const tmp<scalarField>&
161 ) const
163     FatalErrorIn
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);
176     return *this;
179 template<class Type>
180 tmp<Field<Type> > calculatedFvPatchField<Type>::gradientInternalCoeffs() const
182     FatalErrorIn
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);
196     return *this;
199 template<class Type>
200 tmp<Field<Type> > calculatedFvPatchField<Type>::gradientBoundaryCoeffs() const
202     FatalErrorIn
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);
216     return *this;
220 // Write
221 template<class Type>
222 void calculatedFvPatchField<Type>::write(Ostream& os) const
224     fvPatchField<Type>::write(os);
225     this->writeEntry("value", os);
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 } // End namespace Foam
233 // ************************************************************************* //