55 mkDir(time().rootPath()/time().caseName()/
"fluentInterface");
58 std::ofstream fluentMeshFile
63 / time().caseName() +
".msh" 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);
90 label nFcs = nFaces();
106 fluentMeshFile.setf(
ios::hex, ios::basefield);
117 <<
" " <<
p.x() <<
" " <<
p.y() <<
" " <<
p.z() <<
'\n';
125 const auto& fcs = faces();
134 const auto& l = fcs[facei];
136 fluentMeshFile <<
" ";
137 fluentMeshFile << l.size() <<
" ";
141 fluentMeshFile << l[lI] + 1 <<
" ";
144 fluentMeshFile << nei[facei] + 1 <<
" ";
145 fluentMeshFile << own[facei] + 1 <<
std::endl;
150 label nWrittenFaces = own.size();
155 const faceUList& patchFaces = boundaryMesh()[patchi];
157 const labelUList& patchFaceCells = boundaryMesh()[patchi].faceCells();
163 <<
"(13 (" << patchi + 10 <<
" " << nWrittenFaces + 1
164 <<
" " << nWrittenFaces + patchFaces.
size() <<
" ";
166 nWrittenFaces += patchFaces.size();
169 if (isA<wallFvPatch>(
boundary()[patchi]))
175 isA<symmetryPlaneFvPatch>(
boundary()[patchi])
176 || isA<symmetryFvPatch>(
boundary()[patchi])
191 const auto& l = patchFaces[facei];
193 fluentMeshFile <<
" ";
194 fluentMeshFile << l.size() <<
" ";
201 fluentMeshFile << l[lI] + 1 <<
" ";
204 fluentMeshFile << patchFaceCells[facei] + 1 <<
" 0" <<
std::endl;
212 <<
"(12 (1 1 " << nCells() <<
" 1 0)" <<
nl 228 int nElemPerLine = 25;
232 if (nElemPerLine == 25)
235 fluentMeshFile <<
"\n ";
238 else if (!(nElemPerLine % 5))
247 if (
cells[celli].model() == tet)
252 else if (
cells[celli].model() ==
hex)
257 else if (
cells[celli].model() == pyr)
262 else if (
cells[celli].model() == prism)
278 fluentMeshFile.setf(
ios::dec, ios::basefield);
281 fluentMeshFile <<
"(39 (1 fluid fluid-1)())" <<
std::endl;
282 fluentMeshFile <<
"(39 (2 interior interior-1)())" <<
std::endl;
288 <<
"(39 (" << patchi + 10 <<
" ";
291 if (isA<wallFvPatch>(
boundary()[patchi]))
293 fluentMeshFile <<
"wall ";
297 isA<symmetryPlaneFvPatch>(
boundary()[patchi])
298 || isA<symmetryFvPatch>(
boundary()[patchi])
301 fluentMeshFile <<
"symmetry ";
305 fluentMeshFile <<
"pressure-outlet ";
314 Info<<
"Mesh had cells of these type:" <<
nl 315 <<
" hexahedra: " << nHex <<
nl 316 <<
" prisms: " << nPrism <<
nl 317 <<
" pyramids: " << nPyr <<
nl 318 <<
" tetrahedra: " << nTet <<
nl 319 <<
" polyhedra: " << nPoly <<
endl;
void size(const label n)
Older name for setAddressableSize.
IOstream & hex(IOstream &io)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< cellShape > cellShapeList
List of cellShape.
std::ios_base::fmtflags setf(std::ios_base::fmtflags f)
Set stream flag(s), return old stream flags.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
fluentFvMesh(const IOobject &io)
Construct from IOobject.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
UList< face > faceUList
UList of faces.
void writeFluentMesh() const
Write Fluent mesh.
messageStream Info
Information stream (stdout output on master, null elsewhere)
IOstream & dec(IOstream &io)
#define forAllReverse(list, i)
Reverse loop across all elements in list.
IOstream & scientific(IOstream &io)
virtual int precision() const =0
Get precision of output field.