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();
170 <<
"(13 (" << patchi + 10 <<
" " << nWrittenFaces + 1
171 <<
" " << nWrittenFaces + patchFaces.size() <<
" ";
173 nWrittenFaces += patchFaces.size();
194 <<
" 0)" << std::endl <<
"(" << std::endl;
200 fluentMeshFile <<
" ";
202 fluentMeshFile << l.
size() <<
" ";
209 fluentMeshFile << l[lI] + 1 <<
" ";
212 fluentMeshFile << patchFaceCells[facei] + 1 <<
" 0" << std::endl;
215 fluentMeshFile <<
"))" << std::endl;
220 <<
"(12 (1 1 " <<
nCells() <<
" 1 0)" <<
nl
232 int nElemPerLine = 25;
236 if (nElemPerLine == 25)
239 fluentMeshFile <<
"\n ";
242 else if (!(nElemPerLine % 5))
251 if (
cells[celli].model() == tet)
255 else if (
cells[celli].model() ==
hex)
259 else if (
cells[celli].model() == pyr)
263 else if (
cells[celli].model() == prism)
280 Info<<
"Mesh had " << nPolys <<
" polyhedrals." <<
endl;
285 fluentMeshFile.setf(ios::dec, ios::basefield);
288 fluentMeshFile <<
"(39 (1 fluid fluid-1)())" << std::endl;
289 fluentMeshFile <<
"(39 (2 interior interior-1)())" << std::endl;
295 <<
"(39 (" << patchi + 10 <<
" ";
300 fluentMeshFile <<
"wall ";
308 fluentMeshFile <<
"symmetry ";
312 fluentMeshFile <<
"pressure-outlet ";
316 <<
boundary()[patchi].name() <<
")())" << std::endl;
const fileName & rootPath() const noexcept
Return the Time::rootPath().
const fileName & caseName() const noexcept
Return the Time::caseName().
void size(const label n)
Older name for setAddressableSize.
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
fluentFvMesh(const IOobject &io)
Construct from IOobject.
void writeFluentMesh() const
Write Fluent 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.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
virtual const faceList & faces() const
Return raw faces.
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
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).
List< face > faceList
List of faces.
IOstream & hex(IOstream &io)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
List< cellShape > cellShapeList
List of cellShape.
constexpr char nl
The newline '\n' character (0x0a).
UList< face > faceUList
UList of faces.
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.