58 std::ofstream fluentMeshFile
66 Info<<
"Writing Fluent Mesh" <<
endl;
69 <<
"(0 \"OpenFOAM to Fluent Mesh File\")" <<
nl <<
nl
70 <<
"(0 \"Dimension:\")" <<
nl
71 <<
"(2 3)" <<
nl <<
nl
72 <<
"(0 \"Grid dimensions:\")" <<
nl;
79 fluentMeshFile.setf(ios::hex, ios::basefield);
82 <<
nPoints() <<
" 0 3))" << std::endl;
87 <<
nCells() <<
" 0 0))" << std::endl;
97 << nFcs <<
" 0 0))" << std::endl << std::endl;
100 fluentMeshFile.setf(ios::dec, ios::basefield);
106 fluentMeshFile.setf(ios::hex, ios::basefield);
109 << std::endl <<
"(" << std::endl;
111 fluentMeshFile.precision(10);
112 fluentMeshFile.setf(ios::scientific);
120 <<
p[pointi].x() <<
" "
122 <<
" " <<
p[pointi].z() << std::endl;
126 <<
"))" << std::endl << std::endl;
136 << own.size() <<
" 2 0)" << std::endl <<
"(" << std::endl;
142 fluentMeshFile <<
" ";
144 fluentMeshFile << l.
size() <<
" ";
148 fluentMeshFile << l[lI] + 1 <<
" ";
151 fluentMeshFile << nei[facei] + 1 <<
" ";
152 fluentMeshFile << own[facei] + 1 << std::endl;
155 fluentMeshFile <<
"))" << std::endl;
157 label nWrittenFaces = own.size();
171 <<
"(13 (" << patchi + 10 <<
" " << nWrittenFaces + 1
172 <<
" " << nWrittenFaces + patchFaces.size() <<
" ";
174 nWrittenFaces += patchFaces.size();
177 if (isA<wallFvPatch>(
boundary()[patchi]))
183 isA<symmetryPlaneFvPatch>(
boundary()[patchi])
184 || isA<symmetryFvPatch>(
boundary()[patchi])
195 <<
" 0)" << std::endl <<
"(" << std::endl;
201 fluentMeshFile <<
" ";
203 fluentMeshFile << l.
size() <<
" ";
210 fluentMeshFile << l[lI] + 1 <<
" ";
213 fluentMeshFile << patchFaceCells[facei] + 1 <<
" 0" << std::endl;
216 fluentMeshFile <<
"))" << std::endl;
221 <<
"(12 (1 1 " <<
nCells() <<
" 1 0)" <<
nl
233 int nElemPerLine = 25;
237 if (nElemPerLine == 25)
240 fluentMeshFile <<
"\n ";
243 else if (!(nElemPerLine % 5))
252 if (
cells[celli].model() == tet)
256 else if (
cells[celli].model() ==
hex)
260 else if (
cells[celli].model() == pyr)
264 else if (
cells[celli].model() == prism)
281 Info<<
"Mesh had " << nPolys <<
" polyhedrals." <<
endl;
286 fluentMeshFile.
setf(ios::dec, ios::basefield);
289 fluentMeshFile <<
"(39 (1 fluid fluid-1)())" << std::endl;
290 fluentMeshFile <<
"(39 (2 interior interior-1)())" << std::endl;
296 <<
"(39 (" << patchi + 10 <<
" ";
299 if (isA<wallFvPatch>(
boundary()[patchi]))
301 fluentMeshFile <<
"wall ";
305 isA<symmetryPlaneFvPatch>(
boundary()[patchi])
306 || isA<symmetryFvPatch>(
boundary()[patchi])
309 fluentMeshFile <<
"symmetry ";
313 fluentMeshFile <<
"pressure-outlet ";
317 <<
boundary()[patchi].name() <<
")())" << std::endl;
const fileName & caseName() const
Return the Time::caseName()
const fileName & rootPath() const
Return the Time::rootPath()
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
void size(const label n)
Older name for setAddressableSize.
reference ref() const
A reference to the entry (Error if not found)
void writeFluentMesh() const
Write Fluent mesh.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const Time & time() const
Return the top-level database.
const labelUList & owner() const
Internal face owner. Note bypassing virtual mechanism so.
const labelUList & neighbour() const
Internal face neighbour.
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
virtual const faceList & faces() const
Return raw faces.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const pointField & points() const
Return raw points.
const cellShapeList & cellShapes() const
Return cell shapes.
label nPoints() const noexcept
Number of mesh points.
label nCells() const noexcept
Number of mesh cells.
label nFaces() const noexcept
Number of mesh faces.
const cellList & cells() const
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
List< label > labelList
A List of labels.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
messageStream Info
Information stream (stdout output on master, null elsewhere)
vectorField pointField
pointField is a vectorField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
UList< face > faceUList
A UList of faces.
List< face > faceList
A List of faces.
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.