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 Class 00025 Foam::directMappedFixedValueFvPatchField 00026 00027 Description 00028 Recycles the value at a set of cells or patch faces back to *this. Can not 00029 sample internal faces (since volField not defined on faces). 00030 00031 mode = NEARESTCELL : sample nearest cell 00032 mode = NEARESTPATCHFACE : sample nearest face on selected patch 00033 mode = NEARESTFACE : sample nearest face on any patch. Note: does not 00034 warn if nearest actually is on internal face! 00035 00036 SourceFiles 00037 directMappedFixedValueFvPatchField.C 00038 00039 \*---------------------------------------------------------------------------*/ 00040 00041 #ifndef directMappedFixedValueFvPatchField_H 00042 #define directMappedFixedValueFvPatchField_H 00043 00044 #include <finiteVolume/fixedValueFvPatchFields.H> 00045 #include <finiteVolume/directMappedFvPatch.H> 00046 00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00048 00049 namespace Foam 00050 { 00051 00052 /*---------------------------------------------------------------------------*\ 00053 Class directMappedFixedValueFvPatch Declaration 00054 \*---------------------------------------------------------------------------*/ 00055 00056 template<class Type> 00057 class directMappedFixedValueFvPatchField 00058 : 00059 public fixedValueFvPatchField<Type> 00060 { 00061 // Private data 00062 00063 //- If true adjust the mapped field to maintain average value average_ 00064 bool setAverage_; 00065 00066 //- Average value the mapped field is adjusted to maintain if 00067 // setAverage_ is set true 00068 Type average_; 00069 00070 public: 00071 00072 //- Runtime type information 00073 TypeName("directMapped"); 00074 00075 00076 // Constructors 00077 00078 //- Construct from patch and internal field 00079 directMappedFixedValueFvPatchField 00080 ( 00081 const fvPatch&, 00082 const DimensionedField<Type, volMesh>& 00083 ); 00084 00085 //- Construct from patch, internal field and dictionary 00086 directMappedFixedValueFvPatchField 00087 ( 00088 const fvPatch&, 00089 const DimensionedField<Type, volMesh>&, 00090 const dictionary& 00091 ); 00092 00093 //- Construct by mapping given directMappedFixedValueFvPatchField 00094 // onto a new patch 00095 directMappedFixedValueFvPatchField 00096 ( 00097 const directMappedFixedValueFvPatchField<Type>&, 00098 const fvPatch&, 00099 const DimensionedField<Type, volMesh>&, 00100 const fvPatchFieldMapper& 00101 ); 00102 00103 //- Construct as copy 00104 directMappedFixedValueFvPatchField 00105 ( 00106 const directMappedFixedValueFvPatchField<Type>& 00107 ); 00108 00109 //- Construct and return a clone 00110 virtual tmp<fvPatchField<Type> > clone() const 00111 { 00112 return tmp<fvPatchField<Type> > 00113 ( 00114 new directMappedFixedValueFvPatchField<Type>(*this) 00115 ); 00116 } 00117 00118 //- Construct as copy setting internal field reference 00119 directMappedFixedValueFvPatchField 00120 ( 00121 const directMappedFixedValueFvPatchField<Type>&, 00122 const DimensionedField<Type, volMesh>& 00123 ); 00124 00125 //- Construct and return a clone setting internal field reference 00126 virtual tmp<fvPatchField<Type> > clone 00127 ( 00128 const DimensionedField<Type, volMesh>& iF 00129 ) const 00130 { 00131 return tmp<fvPatchField<Type> > 00132 ( 00133 new directMappedFixedValueFvPatchField<Type>(*this, iF) 00134 ); 00135 } 00136 00137 00138 // Member functions 00139 00140 // Evaluation functions 00141 00142 //- Update the coefficients associated with the patch field 00143 virtual void updateCoeffs(); 00144 00145 //- Write 00146 virtual void write(Ostream&) const; 00147 }; 00148 00149 00150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00151 00152 } // End namespace Foam 00153 00154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00155 00156 #ifdef NoRepository 00157 # include <finiteVolume/directMappedFixedValueFvPatchField.C> 00158 #endif 00159 00160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00161 00162 #endif 00163 00164 // ************************ vim: set sw=4 sts=4 et: ************************ //