39 const scalar scaleFactor
45 Info<<
"Number of points = " <<
n <<
endl;
46 if (scaleFactor > 1.0 + SMALL || scaleFactor < 1.0 - SMALL)
55 const label
nFaces = getFireLabel(is);
57 meshFaces_.setSize(
nFaces);
63 const label size = getFireLabel(is);
65 face&
f = meshFaces_[faceI];
69 f[fp] = getFireLabel(is);
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 std::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
Various functions to operate on Lists.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
bool found(const word &enumName) const
True if there is an enumeration corresponding to the given name.
Input from file stream, using an ISstream.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
streamFormat
Data format (ascii | binary)
Generic input stream using a standard (STL) stream.
virtual const fileName & name() const
Return the name of the stream.
void clear()
Clear the list, i.e. set size to zero.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Face selection method for createBaffles.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
virtual void validate()
Validate the turbulence fields after construction.
This class supports creating polyMeshes with baffles.
pointField points_
Points supporting the mesh.
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
static word defaultRegion
Return the default region name.
A patch is a list of labels that address the faces in the global face list.
A class for handling words, derived from Foam::string.
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
dimensionedScalar pos(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
errorManip< error > abort(error &err)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.