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