39 bool Foam::cellSizeAndAlignmentControls::evalCellSizeFunctions
46 bool anyFunctionFound =
false;
50 if (controlFunctions_.size())
56 forAll(controlFunctions_, i)
58 const cellSizeAndAlignmentControl& cSF = controlFunctions_[i];
60 if (isA<searchableSurfaceControl>(cSF))
62 const searchableSurfaceControl& sSC =
63 refCast<const searchableSurfaceControl>(cSF);
65 anyFunctionFound = sSC.cellSize(pt, minSize, previousPriority);
67 if (previousPriority > maxPriority)
69 maxPriority = previousPriority;
75 return anyFunctionFound;
81 Foam::cellSizeAndAlignmentControls::cellSizeAndAlignmentControls
84 const dictionary& shapeControlDict,
85 const conformationSurfaces& geometryToConformTo,
86 const scalar& defaultCellSize
89 shapeControlDict_(shapeControlDict),
90 geometryToConformTo_(geometryToConformTo),
91 controlFunctions_(shapeControlDict_.size()),
92 defaultCellSize_(defaultCellSize)
98 word shapeControlEntryName = iter().keyword();
100 const dictionary& controlFunctionDict
102 shapeControlDict_.subDict(shapeControlEntryName)
105 Info<<
nl <<
"Shape Control : " << shapeControlEntryName <<
endl;
108 controlFunctions_.set
114 shapeControlEntryName,
116 geometryToConformTo_,
127 SortableList<label> functionPriorities(functionI);
129 forAll(controlFunctions_, funcI)
131 functionPriorities[funcI] = controlFunctions_[funcI].maxPriority();
134 functionPriorities.reverseSort();
137 invert(functionPriorities.size(), functionPriorities.indices());
139 controlFunctions_.reorder(invertedFunctionPriorities);
157 label maxPriority = -1;
159 evalCellSizeFunctions(pt, size, maxPriority);
174 evalCellSizeFunctions(pt, size, maxPriority);
scalar cellSize(const point &pt) const
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static autoPtr< cellSizeAndAlignmentControl > New(const Time &runTime, const word &name, const dictionary &controlFunctionDict, const conformationSurfaces &geometryToConformTo, const scalar &defaultCellSize)
Return a reference to the selected cellShapeControl.
const scalar & defaultCellSize_
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
List< label > labelList
A List of labels.
defineTypeNameAndDebug(combustionModel, 0)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
virtual ~cellSizeAndAlignmentControls()
Destructor.
vector point
Point is a vector.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
static const label labelMin