processorPointPatchField.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 "processorPointPatchField.H"
00028 #include "transformField.H"
00029 #include "processorPolyPatch.H"
00030
00031
00032
00033 namespace Foam
00034 {
00035
00036
00037
00038 template<class Type>
00039 processorPointPatchField<Type>::processorPointPatchField
00040 (
00041 const pointPatch& p,
00042 const DimensionedField<Type, pointMesh>& iF
00043 )
00044 :
00045 coupledPointPatchField<Type>(p, iF),
00046 procPatch_(refCast<const processorPointPatch>(p))
00047 {}
00048
00049
00050 template<class Type>
00051 processorPointPatchField<Type>::processorPointPatchField
00052 (
00053 const pointPatch& p,
00054 const DimensionedField<Type, pointMesh>& iF,
00055 const dictionary& dict
00056 )
00057 :
00058 coupledPointPatchField<Type>(p, iF, dict),
00059 procPatch_(refCast<const processorPointPatch>(p))
00060 {}
00061
00062
00063 template<class Type>
00064 processorPointPatchField<Type>::processorPointPatchField
00065 (
00066 const processorPointPatchField<Type>& ptf,
00067 const pointPatch& p,
00068 const DimensionedField<Type, pointMesh>& iF,
00069 const pointPatchFieldMapper& mapper
00070 )
00071 :
00072 coupledPointPatchField<Type>(ptf, p, iF, mapper),
00073 procPatch_(refCast<const processorPointPatch>(ptf.patch()))
00074 {}
00075
00076
00077 template<class Type>
00078 processorPointPatchField<Type>::processorPointPatchField
00079 (
00080 const processorPointPatchField<Type>& ptf,
00081 const DimensionedField<Type, pointMesh>& iF
00082 )
00083 :
00084 coupledPointPatchField<Type>(ptf, iF),
00085 procPatch_(refCast<const processorPointPatch>(ptf.patch()))
00086 {}
00087
00088
00089
00090
00091 template<class Type>
00092 processorPointPatchField<Type>::~processorPointPatchField()
00093 {}
00094
00095
00096
00097
00098 template<class Type>
00099 void processorPointPatchField<Type>::initSwapAdd(Field<Type>& pField) const
00100 {
00101 if (Pstream::parRun())
00102 {
00103
00104 Field<Type> pf(this->patchInternalField(pField));
00105
00106 OPstream::write
00107 (
00108 Pstream::blocking,
00109 procPatch_.neighbProcNo(),
00110 reinterpret_cast<const char*>(pf.begin()),
00111 pf.byteSize()
00112 );
00113 }
00114 }
00115
00116
00117 template<class Type>
00118 void processorPointPatchField<Type>::swapAdd(Field<Type>& pField) const
00119 {
00120 if (Pstream::parRun())
00121 {
00122 Field<Type> pnf(this->size());
00123
00124 IPstream::read
00125 (
00126 Pstream::blocking,
00127 procPatch_.neighbProcNo(),
00128 reinterpret_cast<char*>(pnf.begin()),
00129 pnf.byteSize()
00130 );
00131
00132 if (doTransform())
00133 {
00134 const processorPolyPatch& ppp = procPatch_.procPolyPatch();
00135 const tensorField& forwardT = ppp.forwardT();
00136
00137 if (forwardT.size() == 1)
00138 {
00139 transform(pnf, forwardT[0], pnf);
00140 }
00141 else
00142 {
00143 const labelList& nonGlobalPatchPoints =
00144 procPatch_.nonGlobalPatchPoints();
00145 const labelListList& pointFaces = ppp.pointFaces();
00146
00147 forAll(nonGlobalPatchPoints, pfi)
00148 {
00149 pnf[pfi] = transform
00150 (
00151 forwardT[pointFaces[nonGlobalPatchPoints[pfi]][0]],
00152 pnf[pfi]
00153 );
00154 }
00155 }
00156 }
00157
00158 addToInternalField(pField, pnf);
00159 }
00160 }
00161
00162
00163
00164
00165 }
00166
00167
Copyright © 2000-2009 OpenCFD Ltd