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 #include "mixedPointPatchField.H"
00027 #include <OpenFOAM/pointPatchFieldMapper.H>
00028
00029
00030
00031 namespace Foam
00032 {
00033
00034
00035
00036 template<class Type>
00037 void mixedPointPatchField<Type>::checkFieldSize() const
00038 {
00039 if
00040 (
00041 this->size() != this->patch().size()
00042 || refValue_.size() != this->patch().size()
00043 || valueFraction_.size() != this->patch().size()
00044 )
00045 {
00046 FatalErrorIn
00047 (
00048 "void mixedPointPatchField<Type>::checkField() const"
00049 ) << "field does not correspond to patch. " << endl
00050 << "Field size: " << this->size() << " value size: "
00051 << refValue_.size()
00052 << " valueFraction size: " << valueFraction_.size()
00053 << " patch size: " << this->patch().size()
00054 << abort(FatalError);
00055 }
00056 }
00057
00058
00059
00060
00061 template<class Type>
00062 mixedPointPatchField<Type>::mixedPointPatchField
00063 (
00064 const pointPatch& p,
00065 const DimensionedField<Type, pointMesh>& iF
00066 )
00067 :
00068 valuePointPatchField<Type>(p, iF),
00069 refValue_(p.size()),
00070 valueFraction_(p.size())
00071 {}
00072
00073
00074 template<class Type>
00075 mixedPointPatchField<Type>::mixedPointPatchField
00076 (
00077 const pointPatch& p,
00078 const DimensionedField<Type, pointMesh>& iF,
00079 const dictionary& dict
00080 )
00081 :
00082 valuePointPatchField<Type>(p, iF, dict, false),
00083 refValue_("refValue", dict, p.size()),
00084 valueFraction_("valueFraction", dict, p.size())
00085 {}
00086
00087
00088 template<class Type>
00089 mixedPointPatchField<Type>::mixedPointPatchField
00090 (
00091 const mixedPointPatchField<Type>& ptf,
00092 const pointPatch& p,
00093 const DimensionedField<Type, pointMesh>& iF,
00094 const pointPatchFieldMapper& mapper
00095 )
00096 :
00097 valuePointPatchField<Type>
00098 (
00099 ptf,
00100 p,
00101 iF,
00102 mapper
00103 ),
00104 refValue_(ptf.refValue_, mapper),
00105 valueFraction_(ptf.valueFraction_, mapper)
00106
00107 {}
00108
00109
00110 template<class Type>
00111 mixedPointPatchField<Type>::mixedPointPatchField
00112 (
00113 const mixedPointPatchField<Type>& ptf,
00114 const DimensionedField<Type, pointMesh>& iF
00115 )
00116 :
00117 valuePointPatchField<Type>(ptf, iF),
00118 refValue_(ptf.refValue_),
00119 valueFraction_(ptf.valueFraction_)
00120 {}
00121
00122
00123
00124
00125
00126 template<class Type>
00127 void mixedPointPatchField<Type>::autoMap
00128 (
00129 const pointPatchFieldMapper& m
00130 )
00131 {
00132 Field<Type>::autoMap(m);
00133 refValue_.autoMap(m);
00134 valueFraction_.autoMap(m);
00135 }
00136
00137
00138
00139 template<class Type>
00140 void mixedPointPatchField<Type>::rmap
00141 (
00142 const pointPatchField<Type>& ptf,
00143 const labelList& addr
00144 )
00145 {
00146 const mixedPointPatchField<Type>& mptf =
00147 refCast<const mixedPointPatchField<Type> >(ptf);
00148
00149 Field<Type>::rmap(mptf, addr);
00150 refValue_.rmap(mptf.refValue_, addr);
00151 valueFraction_.rmap(mptf.valueFraction_, addr);
00152 }
00153
00154
00155
00156 template<class Type>
00157 void mixedPointPatchField<Type>::evaluate(const Pstream::commsTypes)
00158 {
00159 Field<Type>::operator=
00160 (
00161 valueFraction_*refValue_
00162 + (1.0 - valueFraction_)*this->patchInternalField()
00163 );
00164
00165
00166 Field<Type>& iF = const_cast<Field<Type>&>(this->internalField());
00167
00168 this->setInInternalField(iF, *this);
00169 }
00170
00171
00172
00173 template<class Type>
00174 void mixedPointPatchField<Type>::write(Ostream& os) const
00175 {
00176 pointPatchField<Type>::write(os);
00177 refValue_.writeEntry("refValue", os);
00178 valueFraction_.writeEntry("valueFraction", os);
00179 }
00180
00181
00182
00183
00184 }
00185
00186