Go to the documentation of this file.
39 const scalar scaleFactor
42 const label
n = FIRECore::readPoints(is, points_);
45 Info<<
"Number of points = " <<
n <<
endl;
46 if (scaleFactor > 1.0 + SMALL || scaleFactor < 1.0 - SMALL)
48 points_ *= scaleFactor;
56 Info<<
"Number of faces = " << nFaces <<
endl;
79 <<
"no faces in file " << is.
name()
87 const label nCells = getFireLabel(is);
88 Info<<
"Number of cells = " << nCells <<
endl;
90 owner_.setSize(meshFaces_.size());
91 neigh_.setSize(meshFaces_.size());
98 for (label cellI = 0; cellI < nCells; ++cellI)
100 const label nface = getFireLabel(is);
102 for (label i = 0; i < nface; ++i)
104 const label faceI = getFireLabel(is);
106 if (owner_[faceI] == -1)
108 owner_[faceI] = cellI;
110 else if (neigh_[faceI] == -1)
112 neigh_[faceI] = cellI;
117 <<
"bad cell connectivity for face " << faceI
118 <<
" on cell " << cellI
127 <<
"no cells in file " << is.
name()
131 cellTableId_.setSize(nCells);
138 const label nSelect = getFireLabel(is);
139 Info<<
"Number of select = " << nSelect <<
endl;
141 label nCellSelections = 0;
142 label nFaceSelections = 0;
144 faceZoneId_.setSize(meshFaces_.size());
149 for (label selI = 0; selI < nSelect; ++selI)
151 std::string
name = getFireString(is);
152 const label selType = getFireLabel(is);
153 const label
count = getFireLabel(is);
158 const label selId = ++nCellSelections;
161 cellTable_.setMaterial(selId,
"fluid");
163 for (label i = 0; i <
count; ++i)
165 const label
cellId = getFireLabel(is);
167 cellTableId_[
cellId] = selId;
173 const label selId = nFaceSelections++;
177 for (label i = 0; i <
count; ++i)
179 const label
faceId = getFireLabel(is);
181 faceZoneId_[
faceId] = selId;
187 for (label i = 0; i <
count; ++i)
194 Info<< nFaceSelections <<
" face selections" <<
endl;
195 Info<< nCellSelections <<
" cell selections" <<
endl;
198 faceNames.
append(
"__MISSED_FACES__");
199 faceNames_.transfer(faceNames);
211 if (neigh_[faceI] != -1)
215 if (owner_[faceI] > neigh_[faceI])
217 Swap(owner_[faceI], neigh_[faceI]);
222 label posInternal = 0;
223 label posExternal = nInternalFaces_;
225 labelList oldToNew(meshFaces_.size(), -1);
231 if (neigh_[faceI] == -1)
233 oldToNew[faceI] = posExternal++;
237 oldToNew[faceI] = posInternal++;
248 const label zoneMissed = faceNames_.size() - 1;
249 patchSizes_.setSize(faceNames_.size());
252 patchStarts_.setSize(patchSizes_.size());
255 for (label faceI = nInternalFaces_; faceI < meshFaces_.size(); ++faceI)
257 label zoneI = faceZoneId_[faceI];
260 ++patchSizes_[zoneMissed];
264 ++patchSizes_[zoneI];
268 if (patchSizes_[zoneMissed])
270 Info<<
"collecting " << patchSizes_[zoneMissed]
271 <<
" missed boundary faces to final patch" <<
endl;
278 label
pos = nInternalFaces_;
280 forAll(patchStarts_, patchI)
282 patchStarts_[patchI] =
pos;
283 pos += patchSizes_[patchI];
286 forAll(patchSizes_, patchI)
288 patchSizes_[patchI] = 0;
293 for (label faceI = nInternalFaces_; faceI < meshFaces_.size(); ++faceI)
295 label patchI = faceZoneId_[faceI];
299 patchStarts_[zoneMissed] + patchSizes_[zoneMissed];
300 ++patchSizes_[zoneMissed];
304 oldToNew[faceI] = patchStarts_[patchI] + patchSizes_[patchI];
305 ++patchSizes_[patchI];
319 patchNames_.setSize(patchSizes_.size());
323 forAll(patchSizes_, patchI)
325 if (patchSizes_[patchI])
327 patchNames_[
nPatches] = faceNames_[patchI];
348 label meshFaceI = nInternalFaces_;
350 forAll(patchStarts_, patchI)
352 Info<<
"patch " << patchI
353 <<
" (start: " << meshFaceI <<
" size: " << patchSizes_[patchI]
354 <<
") name: " << patchNames_[patchI]
368 meshFaceI += patchSizes_[patchI];
371 mesh.addPatches(newPatches);
381 const word ext(geometryFile_.ext());
406 <<
"File-type '" << ext
407 <<
"' is not supported for reading as a FIRE mesh." <<
nl
408 <<
"If it is a compressed file, use gunzip first."
414 readPoints(is, scaleFactor);
427 readGeometry(scaleFactor_);
430 Info<<
"Creating a polyMesh" <<
endl;
443 std::move(meshFaces_),
452 cellTable_.addCellZones(
mesh, cellTableId_);
464 const scalar scaleFactor
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Foam::autoPtr< Foam::fvMesh > meshPtr(nullptr)
A class for handling words, derived from Foam::string.
A class for handling file names.
bool found(const word &enumName) const
Test if there is an enumeration corresponding to the given name.
static word defaultRegion
Return the default region name.
Input from file stream, using an ISstream.
Generic input stream using a standard (STL) stream.
static word validate(const std::string &s, const bool prefix=false)
Construct validated word (no invalid characters).
Ostream & endl(Ostream &os)
Add newline and flush stream.
void Swap(DynamicList< T, SizeMin1 > &a, DynamicList< T, SizeMin2 > &b)
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
Registry of regIOobjects.
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
word name(const complex &c)
Return string representation of complex.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
virtual const fileName & name() const
Return the name of the stream.
streamFormat
Data format (ascii | binary)
errorManip< error > abort(error &err)
faceList meshFaces_
Global face list for polyMesh.
This class supports creating polyMeshes with baffles.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
static const word null
An empty word.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
A face is a list of labels corresponding to mesh vertices.
Various functions to operate on Lists.
void setSize(const label newSize)
Alias for resize(const label)
dimensionedScalar pos(const dimensionedScalar &ds)