Fix tutorials: coupled/conjugateHeatFoam/conjugateCavity: fix Allrun file
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvsPatchFields / basic / calculated / calculatedFvsPatchField.C
blob75c6da7d6986c17c5f18eddc7fcdbcb917c9743e
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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 "calculatedFvsPatchField.H"
28 #include "fvPatchFieldMapper.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 namespace Foam
35 template<class Type>
36 const word& fvsPatchField<Type>::calculatedType()
38     return calculatedFvsPatchField<Type>::typeName;
41 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
43 template<class Type>
44 calculatedFvsPatchField<Type>::calculatedFvsPatchField
46     const fvPatch& p,
47     const DimensionedField<Type, surfaceMesh>& iF
50     fvsPatchField<Type>(p, iF)
54 template<class Type>
55 calculatedFvsPatchField<Type>::calculatedFvsPatchField
57     const calculatedFvsPatchField<Type>& ptf,
58     const fvPatch& p,
59     const DimensionedField<Type, surfaceMesh>& iF,
60     const fvPatchFieldMapper& mapper
63     fvsPatchField<Type>(ptf, p, iF, mapper)
67 template<class Type>
68 calculatedFvsPatchField<Type>::calculatedFvsPatchField
70     const fvPatch& p,
71     const DimensionedField<Type, surfaceMesh>& iF,
72     const dictionary& dict
75     fvsPatchField<Type>(p, iF, Field<Type>("value", dict, p.size()))
79 template<class Type>
80 calculatedFvsPatchField<Type>::calculatedFvsPatchField
82     const calculatedFvsPatchField<Type>& ptf
85     fvsPatchField<Type>(ptf)
89 template<class Type>
90 calculatedFvsPatchField<Type>::calculatedFvsPatchField
92     const calculatedFvsPatchField<Type>& ptf,
93     const DimensionedField<Type, surfaceMesh>& iF
96     fvsPatchField<Type>(ptf, iF)
100 template<class Type>
101 template<class Type2>
102 tmp<fvsPatchField<Type> > fvsPatchField<Type>::NewCalculatedType
104     const fvsPatchField<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             Field<Type>::null()
116         );
117     }
118     else
119     {
120         return tmp<fvsPatchField<Type> >
121         (
122             new calculatedFvsPatchField<Type>
123             (
124                 pf.patch(),
125                 Field<Type>::null()
126             )
127         );
128     }
132 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
134 // Write
135 template<class Type>
136 void calculatedFvsPatchField<Type>::write(Ostream& os) const
138     fvsPatchField<Type>::write(os);
139     this->writeEntry("value", os);
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 } // End namespace Foam
147 // ************************************************************************* //