41 bool Foam::cellSizeAndAlignmentControls::evalCellSizeFunctions
48 bool anyFunctionFound =
false;
52 if (controlFunctions_.size())
58 forAll(controlFunctions_, i)
60 const cellSizeAndAlignmentControl& cSF = controlFunctions_[i];
62 if (isA<searchableSurfaceControl>(cSF))
64 const searchableSurfaceControl& sSC =
65 refCast<const searchableSurfaceControl>(cSF);
67 anyFunctionFound = sSC.cellSize(pt, minSize, previousPriority);
69 if (previousPriority > maxPriority)
71 maxPriority = previousPriority;
77 return anyFunctionFound;
83 Foam::cellSizeAndAlignmentControls::cellSizeAndAlignmentControls
86 const dictionary& shapeControlDict,
87 const conformationSurfaces& geometryToConformTo,
88 const scalar& defaultCellSize
91 shapeControlDict_(shapeControlDict),
92 geometryToConformTo_(geometryToConformTo),
93 controlFunctions_(shapeControlDict_.size()),
94 defaultCellSize_(defaultCellSize)
98 for (
const entry& dEntry : shapeControlDict_)
100 const word& shapeControlEntryName = dEntry.keyword();
101 const dictionary& controlFunctionDict = dEntry.dict();
103 Info<<
nl <<
"Shape Control : " << shapeControlEntryName <<
endl;
106 controlFunctions_.set
112 shapeControlEntryName,
114 geometryToConformTo_,
125 SortableList<label> functionPriorities(functionI);
127 forAll(controlFunctions_, funcI)
129 functionPriorities[funcI] = controlFunctions_[funcI].maxPriority();
132 functionPriorities.reverseSort();
135 invert(functionPriorities.size(), functionPriorities.indices());
137 controlFunctions_.reorder(invertedFunctionPriorities);
154 scalar size = defaultCellSize_;
155 label maxPriority = -1;
157 evalCellSizeFunctions(pt, size, maxPriority);
169 scalar size = defaultCellSize_;
172 evalCellSizeFunctions(pt, size, maxPriority);
scalar cellSize(const point &pt) const
constexpr char nl
The newline '\n' character (0x0a)
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.
#define forAll(list, i)
Loop across all elements in list.
const scalar & defaultCellSize_
defineTypeNameAndDebug(combustionModel, 0)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
virtual ~cellSizeAndAlignmentControls()
Destructor.
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
vector point
Point is a vector.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< label > labelList
A List of labels.
Ostream & incrIndent(Ostream &os)
Increment the indent level.