Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / finiteVolume / fields / fvPatchFields / derived / freestream / freestreamFvPatchField.C
bloba7b9db9fd75516f1f7fa0ed11c1a469e80fd9087
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 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
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 "freestreamFvPatchField.H"
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 namespace Foam
33 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
35 template<class Type>
36 freestreamFvPatchField<Type>::freestreamFvPatchField
38     const fvPatch& p,
39     const DimensionedField<Type, volMesh>& iF
42     inletOutletFvPatchField<Type>(p, iF)
46 template<class Type>
47 freestreamFvPatchField<Type>::freestreamFvPatchField
49     const freestreamFvPatchField<Type>& ptf,
50     const fvPatch& p,
51     const DimensionedField<Type, volMesh>& iF,
52     const fvPatchFieldMapper& mapper
55     inletOutletFvPatchField<Type>(ptf, p, iF, mapper)
59 template<class Type>
60 freestreamFvPatchField<Type>::freestreamFvPatchField
62     const fvPatch& p,
63     const DimensionedField<Type, volMesh>& iF,
64     const dictionary& dict
67     inletOutletFvPatchField<Type>(p, iF)
69     freestreamValue() = Field<Type>("freestreamValue", dict, p.size());
71     if (dict.found("value"))
72     {
73         fvPatchField<Type>::operator=
74         (
75             Field<Type>("value", dict, p.size())
76         );
77     }
78     else
79     {
80         fvPatchField<Type>::operator=(freestreamValue());
81     }
83     dict.readIfPresent("phi", this->phiName_);
87 template<class Type>
88 freestreamFvPatchField<Type>::freestreamFvPatchField
90     const freestreamFvPatchField<Type>& ptf
93     inletOutletFvPatchField<Type>(ptf)
97 template<class Type>
98 freestreamFvPatchField<Type>::freestreamFvPatchField
100     const freestreamFvPatchField<Type>& ptf,
101     const DimensionedField<Type, volMesh>& iF
104     inletOutletFvPatchField<Type>(ptf, iF)
108 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
110 template<class Type>
111 void freestreamFvPatchField<Type>::write(Ostream& os) const
113     fvPatchField<Type>::write(os);
114     if (this->phiName_ != "phi")
115     {
116         os.writeKeyword("phi")
117             << this->phiName_ << token::END_STATEMENT << nl;
118     }
119     freestreamValue().writeEntry("freestreamValue", os);
120     this->writeEntry("value", os);
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 } // End namespace Foam
128 // ************************************************************************* //