44 ensightFile <<
setw(12) << sf[i] <<
nl;
48 ensightFile <<
setw(12) << scalar(0) <<
nl;
89 label offset = map1.
size();
93 mf[i + offset] =
component(vf[map2[i]], cmpt);
114 ensightFile << key <<
nl;
116 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
118 writeData(map(vf, prims, cmpt), ensightFile);
124 writeData(data, ensightFile);
130 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
133 toMaster<< map(vf, prims, cmpt);
141 void writeAllDataBinary
147 std::ofstream& ensightFile
156 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
170 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
173 toMaster<< map(vf, prims, cmpt);
181 void writeAllFaceData
195 ensightFile << key <<
nl;
197 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
199 writeData(map(pf, prims, cmpt), ensightFile);
201 forAll (patchProcessors, i)
203 if (patchProcessors[i] != 0)
205 label slave = patchProcessors[i];
209 writeData(pf, ensightFile);
216 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
219 toMaster<< map(pf, prims, cmpt);
227 void writeAllFaceDataBinary
234 std::ofstream& ensightFile
243 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
247 forAll (patchProcessors, i)
249 if (patchProcessors[i] != 0)
251 label slave = patchProcessors[i];
262 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
265 toMaster<< map(pf, prims, cmpt);
277 const Foam::label ensightPatchI,
290 <<
setw(10) << ensightPatchI <<
nl;
296 boundaryFaceSet.
tris,
306 boundaryFaceSet.
quads,
316 boundaryFaceSet.
polys,
333 bool writePatchFieldBinary
336 const Foam::label patchi,
337 const Foam::label ensightPatchI,
341 std::ofstream& ensightFile
352 writeAllFaceDataBinary
355 boundaryFaceSet.
tris,
362 writeAllFaceDataBinary
365 boundaryFaceSet.
quads,
372 writeAllFaceDataBinary
375 boundaryFaceSet.
polys,
418 if (allPatchNames[i] == patchName)
429 word pfName = patchName +
'.' + fieldName;
431 word timeFile = prepend +
itoa(timeIndex);
438 ensightCaseFile.
setf(ios_base::left);
442 <<
" per element: 1 "
443 <<
setw(15) << pfName
444 << (
' ' + prepend +
"***." + pfName).c_str()
449 fileName ensightFileName(timeFile +
"." + pfName);
452 postProcPath/ensightFileName,
459 OFstream& ensightFile = *ensightFilePtr;
473 boundaryFaceSets[patchi],
474 nPatchPrims.
find(patchName)(),
489 nPatchPrims.
find(patchName)(),
497 delete ensightFilePtr;
503 void ensightFieldAscii
509 const Foam::label timeIndex,
513 Info<<
"Converting field " << fieldObject.
name() <<
endl;
515 word timeFile = prepend +
itoa(timeIndex);
539 fileName ensightFileName(timeFile +
"." + fieldObject.
name());
542 postProcPath/ensightFileName,
549 OFstream& ensightFile = *ensightFilePtr;
553 if (patchNames.
empty())
559 ensightCaseFile.
setf(ios_base::left);
563 <<
" per element: 1 "
564 <<
setw(15) << vf.name()
565 << (
' ' + prepend +
"***." + vf.name()).c_str()
582 ensightFile <<
"hexa8" <<
nl;
584 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
588 map(vf, hexes, wedges, cmpt),
596 writeData(data, ensightFile);
602 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
605 toMaster<< map(vf, hexes, wedges, cmpt);
610 writeAllData(
"penta6", vf, prisms, meshCellSets.
nPrisms, ensightFile);
611 writeAllData(
"pyramid5", vf, pyrs, meshCellSets.
nPyrs, ensightFile);
612 writeAllData(
"tetra4", vf, tets, meshCellSets.
nTets, ensightFile);
613 writeAllData(
"nfaced", vf, polys, meshCellSets.
nPolys, ensightFile);
618 forAll(allPatchNames, patchi)
620 const word& patchName = allPatchNames[
patchi];
623 if (patchNames.
empty() || patchNames.
found(patchName))
631 vf.boundaryField()[
patchi],
635 nPatchPrims.
find(patchName)(),
657 nPatchPrims.
find(patchName)(),
671 delete ensightFilePtr;
677 void ensightFieldBinary
683 const Foam::label timeIndex,
687 Info<<
"Converting field (binary) " << fieldObject.
name() <<
endl;
689 word timeFile = prepend +
itoa(timeIndex);
709 std::ofstream *ensightFilePtr = NULL;
713 fileName ensightFileName(timeFile +
"." + fieldObject.
name());
714 ensightFilePtr =
new std::ofstream
716 (postProcPath/ensightFileName).c_str(),
717 ios_base::out | ios_base::binary | ios_base::trunc
722 std::ofstream& ensightFile = *ensightFilePtr;
726 if (patchNames.
empty())
732 ensightCaseFile.
setf(ios_base::left);
736 <<
" per element: 1 "
737 <<
setw(15) << vf.name()
738 << (
' ' + prepend +
"***." + vf.name()).c_str()
753 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
757 map(vf, hexes, wedges, cmpt),
771 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
774 toMaster<< map(vf, hexes, wedges, cmpt);
818 forAll(allPatchNames, patchi)
820 const word& patchName = allPatchNames[
patchi];
823 if (patchNames.
empty() || patchNames.
found(patchName))
829 writePatchFieldBinary
831 vf.boundaryField()[
patchi],
835 nPatchPrims.
find(patchName)(),
851 writePatchFieldBinary
857 nPatchPrims.
find(patchName)(),
883 const Foam::label timeIndex,
890 ensightFieldBinary<Type>
902 ensightFieldAscii<Type>