OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

timeVaryingUniformFixedValueFvPatchField.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "timeVaryingUniformFixedValueFvPatchField.H"
00028 #include "Time.H"
00029 
00030 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00031 
00032 template<class Type>
00033 Foam::timeVaryingUniformFixedValueFvPatchField<Type>::
00034 timeVaryingUniformFixedValueFvPatchField
00035 (
00036     const fvPatch& p,
00037     const DimensionedField<Type, volMesh>& iF
00038 )
00039 :
00040     fixedValueFvPatchField<Type>(p, iF),
00041     timeSeries_()
00042 {}
00043 
00044 
00045 template<class Type>
00046 Foam::timeVaryingUniformFixedValueFvPatchField<Type>::
00047 timeVaryingUniformFixedValueFvPatchField
00048 (
00049     const fvPatch& p,
00050     const DimensionedField<Type, volMesh>& iF,
00051     const dictionary& dict
00052 )
00053 :
00054     fixedValueFvPatchField<Type>(p, iF),
00055     timeSeries_(dict)
00056 {
00057    if (dict.found("value"))
00058    {
00059        fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size()));
00060    }
00061    else
00062    {
00063        updateCoeffs();
00064    }
00065 }
00066 
00067 
00068 template<class Type>
00069 Foam::timeVaryingUniformFixedValueFvPatchField<Type>::
00070 timeVaryingUniformFixedValueFvPatchField
00071 (
00072     const timeVaryingUniformFixedValueFvPatchField<Type>& ptf,
00073     const fvPatch& p,
00074     const DimensionedField<Type, volMesh>& iF,
00075     const fvPatchFieldMapper& mapper
00076 )
00077 :
00078     fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
00079     timeSeries_(ptf.timeSeries_)
00080 {}
00081 
00082 
00083 template<class Type>
00084 Foam::timeVaryingUniformFixedValueFvPatchField<Type>::
00085 timeVaryingUniformFixedValueFvPatchField
00086 (
00087     const timeVaryingUniformFixedValueFvPatchField<Type>& ptf
00088 )
00089 :
00090     fixedValueFvPatchField<Type>(ptf),
00091     timeSeries_(ptf.timeSeries_)
00092 {}
00093 
00094 
00095 template<class Type>
00096 Foam::timeVaryingUniformFixedValueFvPatchField<Type>::
00097 timeVaryingUniformFixedValueFvPatchField
00098 (
00099     const timeVaryingUniformFixedValueFvPatchField<Type>& ptf,
00100     const DimensionedField<Type, volMesh>& iF
00101 )
00102 :
00103     fixedValueFvPatchField<Type>(ptf, iF),
00104     timeSeries_(ptf.timeSeries_)
00105 {}
00106 
00107 
00108 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00109 
00110 template<class Type>
00111 void Foam::timeVaryingUniformFixedValueFvPatchField<Type>::updateCoeffs()
00112 {
00113     if (this->updated())
00114     {
00115         return;
00116     }
00117 
00118     fvPatchField<Type>::operator==
00119     (
00120         timeSeries_(this->db().time().timeOutputValue())
00121     );
00122     fixedValueFvPatchField<Type>::updateCoeffs();
00123 }
00124 
00125 
00126 template<class Type>
00127 void Foam::timeVaryingUniformFixedValueFvPatchField<Type>::write
00128 (
00129     Ostream& os
00130 ) const
00131 {
00132     fvPatchField<Type>::write(os);
00133     timeSeries_.write(os);
00134     this->writeEntry("value", os);
00135 }
00136 
00137 
00138 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd