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

calculatedFvPatchField.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 "calculatedFvPatchField.H"
00028 #include "fvPatchFieldMapper.H"
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 
00035 template<class Type>
00036 const word& fvPatchField<Type>::calculatedType()
00037 {
00038     return calculatedFvPatchField<Type>::typeName;
00039 }
00040 
00041 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00042 
00043 template<class Type>
00044 calculatedFvPatchField<Type>::calculatedFvPatchField
00045 (
00046     const fvPatch& p,
00047     const DimensionedField<Type, volMesh>& iF
00048 )
00049 :
00050     fvPatchField<Type>(p, iF)
00051 {}
00052 
00053 
00054 template<class Type>
00055 calculatedFvPatchField<Type>::calculatedFvPatchField
00056 (
00057     const calculatedFvPatchField<Type>& ptf,
00058     const fvPatch& p,
00059     const DimensionedField<Type, volMesh>& iF,
00060     const fvPatchFieldMapper& mapper
00061 )
00062 :
00063     fvPatchField<Type>(ptf, p, iF, mapper)
00064 {}
00065 
00066 
00067 template<class Type>
00068 calculatedFvPatchField<Type>::calculatedFvPatchField
00069 (
00070     const fvPatch& p,
00071     const DimensionedField<Type, volMesh>& iF,
00072     const dictionary& dict,
00073     const bool valueRequired
00074 )
00075 :
00076     fvPatchField<Type>(p, iF, dict, valueRequired)
00077 {}
00078 
00079 
00080 template<class Type>
00081 calculatedFvPatchField<Type>::calculatedFvPatchField
00082 (
00083     const calculatedFvPatchField<Type>& ptf
00084 )
00085 :
00086     fvPatchField<Type>(ptf)
00087 {}
00088 
00089 
00090 template<class Type>
00091 calculatedFvPatchField<Type>::calculatedFvPatchField
00092 (
00093     const calculatedFvPatchField<Type>& ptf,
00094     const DimensionedField<Type, volMesh>& iF
00095 )
00096 :
00097     fvPatchField<Type>(ptf, iF)
00098 {}
00099 
00100 
00101 template<class Type>
00102 template<class Type2>
00103 tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
00104 (
00105     const fvPatchField<Type2>& pf
00106 )
00107 {
00108     typename patchConstructorTable::iterator patchTypeCstrIter =
00109         patchConstructorTablePtr_->find(pf.patch().type());
00110 
00111     if (patchTypeCstrIter != patchConstructorTablePtr_->end())
00112     {
00113         return patchTypeCstrIter()
00114         (
00115             pf.patch(),
00116             DimensionedField<Type, volMesh>::null()
00117         );
00118     }
00119     else
00120     {
00121         return tmp<fvPatchField<Type> >
00122         (
00123             new calculatedFvPatchField<Type>
00124             (
00125                 pf.patch(),
00126                 DimensionedField<Type, volMesh>::null()
00127             )
00128         );
00129     }
00130 }
00131 
00132 
00133 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00134 
00135 template<class Type>
00136 tmp<Field<Type> > calculatedFvPatchField<Type>::valueInternalCoeffs
00137 (
00138     const tmp<scalarField>&
00139 ) const
00140 {
00141     FatalErrorIn
00142     (
00143         "calculatedFvPatchField<Type>::"
00144         "valueInternalCoeffs(const tmp<scalarField>&) const"
00145     )   << "\n    "
00146            "valueInternalCoeffs cannot be called for a calculatedFvPatchField"
00147         << "\n    on patch " << this->patch().name()
00148         << " of field " << this->dimensionedInternalField().name()
00149         << " in file " << this->dimensionedInternalField().objectPath()
00150         << "\n    You are probably trying to solve for a field with a "
00151            "default boundary condition."
00152         << exit(FatalError);
00153 
00154     return *this;
00155 }
00156 
00157 
00158 template<class Type>
00159 tmp<Field<Type> > calculatedFvPatchField<Type>::valueBoundaryCoeffs
00160 (
00161     const tmp<scalarField>&
00162 ) const
00163 {
00164     FatalErrorIn
00165     (
00166         "calculatedFvPatchField<Type>::"
00167         "valueBoundaryCoeffs(const tmp<scalarField>&) const"
00168     )   << "\n    "
00169            "valueBoundaryCoeffs cannot be called for a calculatedFvPatchField"
00170         << "\n    on patch " << this->patch().name()
00171         << " of field " << this->dimensionedInternalField().name()
00172         << " in file " << this->dimensionedInternalField().objectPath()
00173         << "\n    You are probably trying to solve for a field with a "
00174            "default boundary condition."
00175         << exit(FatalError);
00176 
00177     return *this;
00178 }
00179 
00180 template<class Type>
00181 tmp<Field<Type> > calculatedFvPatchField<Type>::gradientInternalCoeffs() const
00182 {
00183     FatalErrorIn
00184     (
00185         "calculatedFvPatchField<Type>::"
00186         "gradientInternalCoeffs() const"
00187     )   << "\n    "
00188            "gradientInternalCoeffs cannot be called for a "
00189            "calculatedFvPatchField"
00190         << "\n    on patch " << this->patch().name()
00191         << " of field " << this->dimensionedInternalField().name()
00192         << " in file " << this->dimensionedInternalField().objectPath()
00193         << "\n    You are probably trying to solve for a field with a "
00194            "default boundary condition."
00195         << exit(FatalError);
00196 
00197     return *this;
00198 }
00199 
00200 template<class Type>
00201 tmp<Field<Type> > calculatedFvPatchField<Type>::gradientBoundaryCoeffs() const
00202 {
00203     FatalErrorIn
00204     (
00205         "calculatedFvPatchField<Type>::"
00206         "gradientBoundaryCoeffs() const"
00207     )   << "\n    "
00208            "gradientBoundaryCoeffs cannot be called for a "
00209            "calculatedFvPatchField"
00210         << "\n    on patch " << this->patch().name()
00211         << " of field " << this->dimensionedInternalField().name()
00212         << " in file " << this->dimensionedInternalField().objectPath()
00213         << "\n    You are probably trying to solve for a field with a "
00214            "default boundary condition."
00215         << exit(FatalError);
00216 
00217     return *this;
00218 }
00219 
00220 
00221 // Write
00222 template<class Type>
00223 void calculatedFvPatchField<Type>::write(Ostream& os) const
00224 {
00225     fvPatchField<Type>::write(os);
00226     this->writeEntry("value", os);
00227 }
00228 
00229 
00230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00231 
00232 } // End namespace Foam
00233 
00234 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd