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

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