FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "timeVaryingUniformFixedValueFvPatchField.H"
00027 #include <OpenFOAM/Time.H>
00028 
00029 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00030 
00031 template<class Type>
00032 Foam::timeVaryingUniformFixedValueFvPatchField<Type>::
00033 timeVaryingUniformFixedValueFvPatchField
00034 (
00035     const fvPatch& p,
00036     const DimensionedField<Type, volMesh>& iF
00037 )
00038 :
00039     fixedValueFvPatchField<Type>(p, iF),
00040     timeSeries_()
00041 {}
00042 
00043 
00044 template<class Type>
00045 Foam::timeVaryingUniformFixedValueFvPatchField<Type>::
00046 timeVaryingUniformFixedValueFvPatchField
00047 (
00048     const fvPatch& p,
00049     const DimensionedField<Type, volMesh>& iF,
00050     const dictionary& dict
00051 )
00052 :
00053     fixedValueFvPatchField<Type>(p, iF),
00054     timeSeries_(dict)
00055 {
00056    if (dict.found("value"))
00057    {
00058        fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size()));
00059    }
00060    else
00061    {
00062        updateCoeffs();
00063    }
00064 }
00065 
00066 
00067 template<class Type>
00068 Foam::timeVaryingUniformFixedValueFvPatchField<Type>::
00069 timeVaryingUniformFixedValueFvPatchField
00070 (
00071     const timeVaryingUniformFixedValueFvPatchField<Type>& ptf,
00072     const fvPatch& p,
00073     const DimensionedField<Type, volMesh>& iF,
00074     const fvPatchFieldMapper& mapper
00075 )
00076 :
00077     fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
00078     timeSeries_(ptf.timeSeries_)
00079 {}
00080 
00081 
00082 template<class Type>
00083 Foam::timeVaryingUniformFixedValueFvPatchField<Type>::
00084 timeVaryingUniformFixedValueFvPatchField
00085 (
00086     const timeVaryingUniformFixedValueFvPatchField<Type>& ptf
00087 )
00088 :
00089     fixedValueFvPatchField<Type>(ptf),
00090     timeSeries_(ptf.timeSeries_)
00091 {}
00092 
00093 
00094 template<class Type>
00095 Foam::timeVaryingUniformFixedValueFvPatchField<Type>::
00096 timeVaryingUniformFixedValueFvPatchField
00097 (
00098     const timeVaryingUniformFixedValueFvPatchField<Type>& ptf,
00099     const DimensionedField<Type, volMesh>& iF
00100 )
00101 :
00102     fixedValueFvPatchField<Type>(ptf, iF),
00103     timeSeries_(ptf.timeSeries_)
00104 {}
00105 
00106 
00107 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00108 
00109 template<class Type>
00110 void Foam::timeVaryingUniformFixedValueFvPatchField<Type>::updateCoeffs()
00111 {
00112     if (this->updated())
00113     {
00114         return;
00115     }
00116 
00117     fvPatchField<Type>::operator==
00118     (
00119         timeSeries_(this->db().time().timeOutputValue())
00120     );
00121     fixedValueFvPatchField<Type>::updateCoeffs();
00122 }
00123 
00124 
00125 template<class Type>
00126 void Foam::timeVaryingUniformFixedValueFvPatchField<Type>::write
00127 (
00128     Ostream& os
00129 ) const
00130 {
00131     fvPatchField<Type>::write(os);
00132     timeSeries_.write(os);
00133     this->writeEntry("value", os);
00134 }
00135 
00136 
00137 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines