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

calculatedFvsPatchField.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 "calculatedFvsPatchField.H"
00027 #include <finiteVolume/fvPatchFieldMapper.H>
00028 
00029 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033 
00034 template<class Type>
00035 const word& fvsPatchField<Type>::calculatedType()
00036 {
00037     return calculatedFvsPatchField<Type>::typeName;
00038 }
00039 
00040 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00041 
00042 template<class Type>
00043 calculatedFvsPatchField<Type>::calculatedFvsPatchField
00044 (
00045     const fvPatch& p,
00046     const DimensionedField<Type, surfaceMesh>& iF
00047 )
00048 :
00049     fvsPatchField<Type>(p, iF)
00050 {}
00051 
00052 
00053 template<class Type>
00054 calculatedFvsPatchField<Type>::calculatedFvsPatchField
00055 (
00056     const calculatedFvsPatchField<Type>& ptf,
00057     const fvPatch& p,
00058     const DimensionedField<Type, surfaceMesh>& iF,
00059     const fvPatchFieldMapper& mapper
00060 )
00061 :
00062     fvsPatchField<Type>(ptf, p, iF, mapper)
00063 {}
00064 
00065 
00066 template<class Type>
00067 calculatedFvsPatchField<Type>::calculatedFvsPatchField
00068 (
00069     const fvPatch& p,
00070     const DimensionedField<Type, surfaceMesh>& iF,
00071     const dictionary& dict
00072 )
00073 :
00074     fvsPatchField<Type>(p, iF, Field<Type>("value", dict, p.size()))
00075 {}
00076 
00077 
00078 template<class Type>
00079 calculatedFvsPatchField<Type>::calculatedFvsPatchField
00080 (
00081     const calculatedFvsPatchField<Type>& ptf
00082 )
00083 :
00084     fvsPatchField<Type>(ptf)
00085 {}
00086 
00087 
00088 template<class Type>
00089 calculatedFvsPatchField<Type>::calculatedFvsPatchField
00090 (
00091     const calculatedFvsPatchField<Type>& ptf,
00092     const DimensionedField<Type, surfaceMesh>& iF
00093 )
00094 :
00095     fvsPatchField<Type>(ptf, iF)
00096 {}
00097 
00098 
00099 template<class Type>
00100 template<class Type2>
00101 tmp<fvsPatchField<Type> > fvsPatchField<Type>::NewCalculatedType
00102 (
00103     const fvsPatchField<Type2>& pf
00104 )
00105 {
00106     typename patchConstructorTable::iterator patchTypeCstrIter =
00107         patchConstructorTablePtr_->find(pf.patch().type());
00108 
00109     if (patchTypeCstrIter != patchConstructorTablePtr_->end())
00110     {
00111         return patchTypeCstrIter()
00112         (
00113             pf.patch(),
00114             Field<Type>::null()
00115         );
00116     }
00117     else
00118     {
00119         return tmp<fvsPatchField<Type> >
00120         (
00121             new calculatedFvsPatchField<Type>
00122             (
00123                 pf.patch(),
00124                 Field<Type>::null()
00125             )
00126         );
00127     }
00128 }
00129 
00130 
00131 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00132 
00133 // Write
00134 template<class Type>
00135 void calculatedFvsPatchField<Type>::write(Ostream& os) const
00136 {
00137     fvsPatchField<Type>::write(os);
00138     this->writeEntry("value", os);
00139 }
00140 
00141 
00142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00143 
00144 } // End namespace Foam
00145 
00146 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines