53 mkDir(time().rootPath()/time().caseName()/
"fluentInterface");
56 ofstream fluentMeshFile
62 time().caseName() +
".msh" 69 <<
"(0 \"FOAM to Fluent Mesh File\")" << std::endl << std::endl
70 <<
"(0 \"Dimension:\")" << std::endl
71 <<
"(2 3)" << std::endl << std::endl
72 <<
"(0 \"Grid dimensions:\")" <<
std::endl;
90 label nFcs = nFaces();
97 << nFcs <<
" 0 0))" << std::endl <<
std::endl;
106 fluentMeshFile.setf(
ios::hex, ios::basefield);
120 << p[pointi].x() <<
" " 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;
157 label nWrittenFaces = own.size();
165 boundaryMesh()[
patchi].faceCells();
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;
231 bool hasWarned =
false;
235 if (cells[celli].model() == tet)
237 fluentMeshFile <<
" " << 2;
239 else if (cells[celli].model() == hex)
241 fluentMeshFile <<
" " << 4;
243 else if (cells[celli].model() == pyr)
245 fluentMeshFile <<
" " << 5;
247 else if (cells[celli].model() == prism)
249 fluentMeshFile <<
" " << 6;
258 <<
"foamMeshToFluent: cell shape for cell " 259 << celli <<
" only supported by Fluent polyhedral meshes." 261 <<
" Suppressing any further messages for polyhedral" 262 <<
" cells." <<
endl;
264 fluentMeshFile <<
" " << 7;
274 fluentMeshFile <<
"(39 (1 fluid fluid-1)())" <<
std::endl;
275 fluentMeshFile <<
"(39 (2 interior interior-1)())" <<
std::endl;
281 <<
"(39 (" << patchi + 10 <<
" ";
284 if (isA<wallFvPatch>(
boundary()[patchi]))
286 fluentMeshFile <<
"wall ";
290 isA<symmetryPlaneFvPatch>(
boundary()[patchi])
291 || isA<symmetryFvPatch>(
boundary()[patchi])
294 fluentMeshFile <<
"symmetry ";
298 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 NULL.
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
const pointField & points() const
Return block points.
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)
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.
IOstream & dec(IOstream &io)
void writeFluentMesh() const
Write Fluent mesh.
IOstream & scientific(IOstream &io)
virtual int precision() const =0
Get precision of output field.