fixedGradientFvPatchField.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "fixedGradientFvPatchField.H"
00028 #include "dictionary.H"
00029
00030
00031
00032 namespace Foam
00033 {
00034
00035
00036
00037 template<class Type>
00038 fixedGradientFvPatchField<Type>::fixedGradientFvPatchField
00039 (
00040 const fvPatch& p,
00041 const DimensionedField<Type, volMesh>& iF
00042 )
00043 :
00044 fvPatchField<Type>(p, iF),
00045 gradient_(p.size(), pTraits<Type>::zero)
00046 {}
00047
00048
00049 template<class Type>
00050 fixedGradientFvPatchField<Type>::fixedGradientFvPatchField
00051 (
00052 const fixedGradientFvPatchField<Type>& ptf,
00053 const fvPatch& p,
00054 const DimensionedField<Type, volMesh>& iF,
00055 const fvPatchFieldMapper& mapper
00056 )
00057 :
00058 fvPatchField<Type>(ptf, p, iF, mapper),
00059 gradient_(ptf.gradient_, mapper)
00060 {}
00061
00062
00063 template<class Type>
00064 fixedGradientFvPatchField<Type>::fixedGradientFvPatchField
00065 (
00066 const fvPatch& p,
00067 const DimensionedField<Type, volMesh>& iF,
00068 const dictionary& dict
00069 )
00070 :
00071 fvPatchField<Type>(p, iF, dict),
00072 gradient_("gradient", dict, p.size())
00073 {
00074 evaluate();
00075 }
00076
00077
00078 template<class Type>
00079 fixedGradientFvPatchField<Type>::fixedGradientFvPatchField
00080 (
00081 const fixedGradientFvPatchField<Type>& ptf
00082 )
00083 :
00084 fvPatchField<Type>(ptf),
00085 gradient_(ptf.gradient_)
00086 {}
00087
00088
00089 template<class Type>
00090 fixedGradientFvPatchField<Type>::fixedGradientFvPatchField
00091 (
00092 const fixedGradientFvPatchField<Type>& ptf,
00093 const DimensionedField<Type, volMesh>& iF
00094 )
00095 :
00096 fvPatchField<Type>(ptf, iF),
00097 gradient_(ptf.gradient_)
00098 {}
00099
00100
00101
00102
00103 template<class Type>
00104 void fixedGradientFvPatchField<Type>::autoMap
00105 (
00106 const fvPatchFieldMapper& m
00107 )
00108 {
00109 fvPatchField<Type>::autoMap(m);
00110 gradient_.autoMap(m);
00111 }
00112
00113
00114 template<class Type>
00115 void fixedGradientFvPatchField<Type>::rmap
00116 (
00117 const fvPatchField<Type>& ptf,
00118 const labelList& addr
00119 )
00120 {
00121 fvPatchField<Type>::rmap(ptf, addr);
00122
00123 const fixedGradientFvPatchField<Type>& fgptf =
00124 refCast<const fixedGradientFvPatchField<Type> >(ptf);
00125
00126 gradient_.rmap(fgptf.gradient_, addr);
00127 }
00128
00129
00130 template<class Type>
00131 void fixedGradientFvPatchField<Type>::evaluate(const Pstream::commsTypes)
00132 {
00133 if (!this->updated())
00134 {
00135 this->updateCoeffs();
00136 }
00137
00138 Field<Type>::operator=
00139 (
00140 this->patchInternalField() + gradient_/this->patch().deltaCoeffs()
00141 );
00142
00143 fvPatchField<Type>::evaluate();
00144 }
00145
00146
00147 template<class Type>
00148 tmp<Field<Type> > fixedGradientFvPatchField<Type>::valueInternalCoeffs
00149 (
00150 const tmp<scalarField>&
00151 ) const
00152 {
00153 return tmp<Field<Type> >(new Field<Type>(this->size(), pTraits<Type>::one));
00154 }
00155
00156
00157 template<class Type>
00158 tmp<Field<Type> > fixedGradientFvPatchField<Type>::valueBoundaryCoeffs
00159 (
00160 const tmp<scalarField>&
00161 ) const
00162 {
00163 return gradient()/this->patch().deltaCoeffs();
00164 }
00165
00166
00167 template<class Type>
00168 tmp<Field<Type> > fixedGradientFvPatchField<Type>::
00169 gradientInternalCoeffs() const
00170 {
00171 return tmp<Field<Type> >
00172 (
00173 new Field<Type>(this->size(), pTraits<Type>::zero)
00174 );
00175 }
00176
00177
00178 template<class Type>
00179 tmp<Field<Type> > fixedGradientFvPatchField<Type>::
00180 gradientBoundaryCoeffs() const
00181 {
00182 return gradient();
00183 }
00184
00185
00186 template<class Type>
00187 void fixedGradientFvPatchField<Type>::write(Ostream& os) const
00188 {
00189 fvPatchField<Type>::write(os);
00190 gradient_.writeEntry("gradient", os);
00191 }
00192
00193
00194
00195
00196 }
00197
00198
Copyright © 2000-2009 OpenCFD Ltd