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