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