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 "patchWriter.H"
00027 #include "writeFuns.H"
00028
00029
00030
00031 template<class Type>
00032 void Foam::patchWriter::write
00033 (
00034 const PtrList<GeometricField<Type, fvPatchField, volMesh> >& flds
00035 )
00036 {
00037 forAll(flds, fieldI)
00038 {
00039 const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldI];
00040
00041 os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
00042 << nFaces_ << " float" << std::endl;
00043
00044 DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nFaces_);
00045
00046 forAll(patchIDs_, j)
00047 {
00048 label patchI = patchIDs_[j];
00049
00050 const fvPatchField<Type>& pfld = fld.boundaryField()[patchI];
00051
00052 if (nearCellValue_)
00053 {
00054 writeFuns::insert(pfld.patchInternalField()(), fField);
00055 }
00056 else
00057 {
00058 writeFuns::insert(pfld, fField);
00059 }
00060 }
00061 writeFuns::write(os_, binary_, fField);
00062 }
00063 }
00064
00065
00066 template<class Type>
00067 void Foam::patchWriter::write
00068 (
00069 const PtrList<GeometricField<Type, pointPatchField, pointMesh> >& flds
00070 )
00071 {
00072 forAll(flds, fieldI)
00073 {
00074 const GeometricField<Type, pointPatchField, pointMesh>& fld =
00075 flds[fieldI];
00076
00077 os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
00078 << nPoints_ << " float" << std::endl;
00079
00080 DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nPoints_);
00081
00082 forAll(patchIDs_, j)
00083 {
00084 label patchI = patchIDs_[j];
00085
00086 const pointPatchField<Type>& pfld = fld.boundaryField()[patchI];
00087
00088 writeFuns::insert(pfld.patchInternalField()(), fField);
00089 }
00090 writeFuns::write(os_, binary_, fField);
00091 }
00092 }
00093
00094
00095 template<class Type>
00096 void Foam::patchWriter::write
00097 (
00098 const PrimitivePatchInterpolation<primitivePatch>& pInter,
00099 const PtrList<GeometricField<Type, fvPatchField, volMesh> >& flds
00100 )
00101 {
00102 forAll(flds, fieldI)
00103 {
00104 const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldI];
00105
00106 os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
00107 << nPoints_ << " float" << std::endl;
00108
00109 DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nPoints_);
00110
00111 forAll(patchIDs_, j)
00112 {
00113 label patchI = patchIDs_[j];
00114
00115 const fvPatchField<Type>& pfld = fld.boundaryField()[patchI];
00116
00117 if (nearCellValue_)
00118 {
00119 writeFuns::insert
00120 (
00121 pInter.faceToPointInterpolate
00122 (
00123 pfld.patchInternalField()()
00124 )(),
00125 fField
00126 );
00127 }
00128 else
00129 {
00130 writeFuns::insert
00131 (
00132 pInter.faceToPointInterpolate(pfld)(),
00133 fField
00134 );
00135 }
00136 }
00137 writeFuns::write(os_, binary_, fField);
00138 }
00139 }
00140
00141
00142