41bool Foam::cellSizeAndAlignmentControls::evalCellSizeFunctions
48 bool anyFunctionFound =
false;
52 if (controlFunctions_.size())
58 forAll(controlFunctions_, i)
60 const cellSizeAndAlignmentControl& cSF = controlFunctions_[i];
64 const searchableSurfaceControl& sSC =
67 anyFunctionFound = sSC.cellSize(pt, minSize, previousPriority);
69 if (previousPriority > maxPriority)
71 maxPriority = previousPriority;
77 return anyFunctionFound;
83Foam::cellSizeAndAlignmentControls::cellSizeAndAlignmentControls
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
109 cellSizeAndAlignmentControl::New
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);
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual ~cellSizeAndAlignmentControls()
Destructor.
scalar cellSize(const point &pt) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
vector point
Point is a vector.
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.