54 mkDir(time().rootPath()/time().caseName()/
"fluentInterface");
57 ofstream fluentMeshFile
63 time().caseName() +
".msh" 70 <<
"(0 \"FOAM to Fluent Mesh File\")" << std::endl << std::endl
71 <<
"(0 \"Dimension:\")" << std::endl
72 <<
"(2 3)" << std::endl << std::endl
73 <<
"(0 \"Grid dimensions:\")" <<
std::endl;
91 label nFcs = nFaces();
98 << nFcs <<
" 0 0))" << std::endl <<
std::endl;
107 fluentMeshFile.setf(
ios::hex, ios::basefield);
121 << p[pointi].x() <<
" " 137 << own.size() <<
" 2 0)" << std::endl <<
"(" <<
std::endl;
143 fluentMeshFile <<
" ";
145 fluentMeshFile << l.
size() <<
" ";
149 fluentMeshFile << l[lI] + 1 <<
" ";
152 fluentMeshFile << nei[facei] + 1 <<
" ";
153 fluentMeshFile << own[facei] + 1 <<
std::endl;
158 label nWrittenFaces = own.size();
166 boundaryMesh()[
patchi].faceCells();
172 <<
"(13 (" << patchi + 10 <<
" " << nWrittenFaces + 1
173 <<
" " << nWrittenFaces + patchFaces.
size() <<
" ";
175 nWrittenFaces += patchFaces.size();
178 if (isA<wallFvPatch>(
boundary()[patchi]))
184 isA<symmetryPlaneFvPatch>(
boundary()[patchi])
185 || isA<symmetryFvPatch>(
boundary()[patchi])
196 <<
" 0)" << std::endl <<
"(" <<
std::endl;
202 fluentMeshFile <<
" ";
204 fluentMeshFile << l.
size() <<
" ";
211 fluentMeshFile << l[lI] + 1 <<
" ";
214 fluentMeshFile << patchFaceCells[facei] + 1 <<
" 0" <<
std::endl;
232 bool hasWarned =
false;
236 if (cells[celli].model() == tet)
238 fluentMeshFile <<
" " << 2;
240 else if (cells[celli].model() == hex)
242 fluentMeshFile <<
" " << 4;
244 else if (cells[celli].model() == pyr)
246 fluentMeshFile <<
" " << 5;
248 else if (cells[celli].model() == prism)
250 fluentMeshFile <<
" " << 6;
259 <<
"foamMeshToFluent: cell shape for cell " 260 << celli <<
" only supported by Fluent polyhedral meshes." 262 <<
" Suppressing any further messages for polyhedral" 263 <<
" cells." <<
endl;
265 fluentMeshFile <<
" " << 7;
275 fluentMeshFile <<
"(39 (1 fluid fluid-1)())" <<
std::endl;
276 fluentMeshFile <<
"(39 (2 interior interior-1)())" <<
std::endl;
282 <<
"(39 (" << patchi + 10 <<
" ";
285 if (isA<wallFvPatch>(
boundary()[patchi]))
287 fluentMeshFile <<
"wall ";
291 isA<symmetryPlaneFvPatch>(
boundary()[patchi])
292 || isA<symmetryFvPatch>(
boundary()[patchi])
295 fluentMeshFile <<
"symmetry ";
299 fluentMeshFile <<
"pressure-outlet ";
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static const cellModel * lookup(const word &)
Look up a model by name and return a pointer to the model or nullptr.
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
IOstream & hex(IOstream &io)
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
UList< label > labelUList
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
vectorField pointField
pointField is a vectorField.
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
fluentFvMesh(const IOobject &io)
Construct from IOobject.
const cellShapeList & cellShapes
List< label > labelList
A List of labels.
faceListList boundary(nPatches)
const pointField & points() const
Return block points.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
#define WarningInFunction
Report a warning using Foam::Warning.
void writeFluentMesh() const
Write Fluent mesh.
IOstream & dec(IOstream &io)
IOstream & scientific(IOstream &io)
virtual int precision() const =0
Get precision of output field.