cellMotionFvPatchField.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 "cellMotionFvPatchField.H"
00028 #include "fvMesh.H"
00029 #include "volMesh.H"
00030 #include "pointFields.H"
00031
00032
00033
00034 namespace Foam
00035 {
00036
00037
00038
00039 template<class Type>
00040 cellMotionFvPatchField<Type>::cellMotionFvPatchField
00041 (
00042 const fvPatch& p,
00043 const DimensionedField<Type, volMesh>& iF
00044 )
00045 :
00046 fixedValueFvPatchField<Type>(p, iF)
00047 {}
00048
00049
00050 template<class Type>
00051 cellMotionFvPatchField<Type>::cellMotionFvPatchField
00052 (
00053 const cellMotionFvPatchField<Type>& ptf,
00054 const fvPatch& p,
00055 const DimensionedField<Type, volMesh>& iF,
00056 const fvPatchFieldMapper& mapper
00057 )
00058 :
00059 fixedValueFvPatchField<Type>(ptf, p, iF, mapper)
00060 {}
00061
00062
00063 template<class Type>
00064 cellMotionFvPatchField<Type>::cellMotionFvPatchField
00065 (
00066 const fvPatch& p,
00067 const DimensionedField<Type, volMesh>& iF,
00068 const dictionary& dict
00069 )
00070 :
00071 fixedValueFvPatchField<Type>(p, iF)
00072 {
00073 fvPatchField<Type>::operator=(Field<Type>("value", dict, p.size()));
00074 }
00075
00076
00077 template<class Type>
00078 cellMotionFvPatchField<Type>::cellMotionFvPatchField
00079 (
00080 const cellMotionFvPatchField<Type>& ptf
00081 )
00082 :
00083 fixedValueFvPatchField<Type>(ptf)
00084 {}
00085
00086
00087 template<class Type>
00088 cellMotionFvPatchField<Type>::cellMotionFvPatchField
00089 (
00090 const cellMotionFvPatchField<Type>& ptf,
00091 const DimensionedField<Type, volMesh>& iF
00092 )
00093 :
00094 fixedValueFvPatchField<Type>(ptf, iF)
00095 {}
00096
00097
00098
00099
00100 template<class Type>
00101 void cellMotionFvPatchField<Type>::updateCoeffs()
00102 {
00103 if (this->updated())
00104 {
00105 return;
00106 }
00107
00108 const fvPatch& p = this->patch();
00109 const polyPatch& pp = p.patch();
00110 const fvMesh& mesh = this->dimensionedInternalField().mesh();
00111 const pointField& points = mesh.points();
00112
00113 word pfName = this->dimensionedInternalField().name();
00114 pfName.replace("cell", "point");
00115
00116 const GeometricField<Type, pointPatchField, pointMesh>& pointMotion =
00117 this->db().objectRegistry::
lookupObject<GeometricField<Type, pointPatchField, pointMesh> >
00118 (
00119 pfName
00120 );
00121
00122 forAll(p, i)
00123 {
00124 this->operator[](i) = pp[i].average(points, pointMotion);
00125 }
00126
00127 fixedValueFvPatchField<Type>::updateCoeffs();
00128 }
00129
00130
00131 template<class Type>
00132 void cellMotionFvPatchField<Type>::write(Ostream& os) const
00133 {
00134 fvPatchField<Type>::write(os);
00135 this->writeEntry("value", os);
00136 }
00137
00138
00139
00140
00141 }
00142
00143
00144
Copyright © 2000-2009 OpenCFD Ltd