Go to the documentation of this file.
56 bool limitRefinementLevel
69 const labelList& cCells = cellCells[cellI];
73 if (refLevel[cCells[i]] > (refLevel[cellI]+1))
83 if (refCells.
size() > oldNCells)
85 Info<<
"Added an additional " << refCells.
size() - oldNCells
86 <<
" cells to satisfy 1:2 refinement level"
99 int main(
int argc,
char *argv[])
104 "read level from refinementLevel file"
111 Info<<
"Dividing cells into bins depending on cell volume.\nThis will"
112 <<
" correspond to refinement levels for a mesh with only 2x2x2"
114 <<
"The upper range for every bin is always 1.1 times the lower range"
115 <<
" to allow for some truncation error."
133 lowerLimits.
append(sortedVols[0]);
134 upperLimits.
append(1.1 * lowerLimits.last());
138 if (sortedVols[i] > upperLimits.last())
147 Info<<
"Collected " << bin.size() <<
" elements in bin "
148 << lowerLimits.last() <<
" .. "
149 << upperLimits.last() <<
endl;
153 lowerLimits.
append(sortedVols[i]);
154 upperLimits.
append(1.1 * lowerLimits.last());
156 Info<<
"Creating new bin " << lowerLimits.last()
157 <<
" .. " << upperLimits.last()
164 bin.
append(sortedVols.indices()[i]);
178 Info<<
"Volume bins:" <<
nl;
187 cells.insert(bin[i]);
190 Info<<
" " << lowerLimits[binI] <<
" .. " << upperLimits[binI]
191 <<
" : writing " << bin.size() <<
" cells to cellSet "
226 p[patchI] =
patches[patchI].clone(fMesh.boundaryMesh()).ptr();
229 fMesh.addFvPatches(
p);
241 if (!readLevel && refHeader.headerOk())
244 <<
"Detected " << refHeader.name() <<
" file in "
246 <<
" recreate it or use the -readLevel option to use it"
292 refLevel[bin[i]] = bins.size() - binI - 1;
293 postRefLevel[bin[i]] = refLevel[bin[i]];
301 forAll(postRefLevel.boundaryField(), patchI)
307 Info<<
"Setting field for patch "<<
endl;
313 bField[faceI] = postRefLevel[own];
317 Info<<
"Determined current refinement level and writing to "
318 << postRefLevel.name() <<
" (as volScalarField; for post processing)"
321 <<
" (as labelIOList; for meshing)" <<
nl
325 postRefLevel.write();
346 Info<<
"Collected " << refCells.
size() <<
" cells that need to be"
347 <<
" refined to get closer to overall 2:1 refinement level limit"
349 <<
"Written cells to be refined to cellSet " << refCells.
name()
354 Info<<
"After refinement this tool can be run again to see if the 2:1"
355 <<
" limit is observed all over the mesh" <<
nl <<
endl;
359 Info<<
"All cells in the mesh observe the 2:1 refinement level limit"
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual const pointField & points() const
Return raw points.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
static word defaultRegion
Return the default region name.
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
const cellList & cells() const
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
virtual bool write() const
Write using setting from DB.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOList< label > labelIOList
Label container classes.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
A patch is a list of labels that address the faces in the global face list.
virtual const labelList & faceOwner() const
Return face owner.
const labelListList & cellCells() const
const word & name() const
Return name.
int main(int argc, char *argv[])
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
label size() const
Return number of elements in table.
A list that is sorted upon construction or when explicitly requested with the sort() method.
Generic dimensioned Type class.
Mesh data needed to do the Finite Volume discretisation.
const scalarField & cellVolumes() const
A collection of cell labels.
label start() const
Return start label of this patch in the polyMesh face list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
virtual const faceList & faces() const
Return raw faces.
Xfer< T > xferCopy(const T &)
Construct by copying the contents of the arg.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool insert(const Key &key)
Insert a new entry.
bool optionFound(const word &opt) const
Return true if the named option is found.
Generic GeometricField class.
Foam::argList args(argc, argv)
#define WarningInFunction
Report a warning using Foam::Warning.
word name(const complex &)
Return a string representation of a complex.
Cell-face mesh analysis engine.