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
00028
00029
00030
00031 #include "writeFluentFields.H"
00032 #include <finiteVolume/emptyFvPatchFields.H>
00033
00034
00035
00036 namespace Foam
00037 {
00038
00039
00040
00041 void writeFluentField
00042 (
00043 const volScalarField& phi,
00044 const label fluentFieldIdentifier,
00045 Ostream& stream
00046 )
00047 {
00048 const scalarField& phiInternal = phi.internalField();
00049
00050
00051 stream
00052 << "(300 ("
00053 << fluentFieldIdentifier << " "
00054 << "1 "
00055
00056 << "1 "
00057 << "0 0 "
00058 << "1 " << phiInternal.size()
00059 << ")(" << endl;
00060
00061 forAll (phiInternal, cellI)
00062 {
00063 stream << phiInternal[cellI] << endl;
00064 }
00065
00066 stream
00067 << "))" << endl;
00068
00069 label nWrittenFaces = phiInternal.size();
00070
00071
00072 forAll (phi.boundaryField(), patchI)
00073 {
00074 if (isType<emptyFvPatchScalarField>(phi.boundaryField()[patchI]))
00075 {
00076
00077
00078 const scalarField& phiInternal = phi.internalField();
00079
00080
00081 const labelList emptyFaceCells =
00082 phi.boundaryField()[patchI].patch().patch().faceCells();
00083
00084
00085 stream
00086 << "(300 ("
00087 << fluentFieldIdentifier << " "
00088 << patchI + 10 << " "
00089 << "1 "
00090 << "0 0 "
00091 << nWrittenFaces + 1 << " "
00092 << nWrittenFaces + emptyFaceCells.size()
00093 << ")(" << endl;
00094
00095 nWrittenFaces += emptyFaceCells.size();
00096
00097 forAll (emptyFaceCells, faceI)
00098 {
00099 stream << phiInternal[emptyFaceCells[faceI]] << endl;
00100 }
00101
00102 stream
00103 << "))" << endl;
00104 }
00105 else
00106 {
00107
00108 label nWrittenFaces = phiInternal.size();
00109
00110 const scalarField& patchPhi = phi.boundaryField()[patchI];
00111
00112
00113 stream
00114 << "(300 ("
00115 << fluentFieldIdentifier << " "
00116 << patchI + 10 << " "
00117 << "1 "
00118 << "0 0 "
00119 << nWrittenFaces + 1 << " " << nWrittenFaces + patchPhi.size()
00120
00121 << ")(" << endl;
00122
00123 nWrittenFaces += patchPhi.size();
00124
00125 forAll (patchPhi, faceI)
00126 {
00127 stream << patchPhi[faceI] << endl;
00128 }
00129
00130 stream
00131 << "))" << endl;
00132 }
00133 }
00134 }
00135
00136
00137
00138
00139 }
00140
00141