43 displacementPointSmoothingMotionSolver,
49 displacementMotionSolver,
50 displacementPointSmoothingMotionSolver,
68 const label faceI(iter.key());
70 const face& fPoints(
mesh().faces()[faceI]);
74 const label pointI(fPoints[fPointI]);
76 affectedPoints[pointI] =
true;
84 orEqOp<unsigned int>(),
88 forAll(affectedPoints, pointI)
90 if (affectedPoints[pointI])
96 const label cellI(pCells[pointCellI]);
111 (relaxationFactors_.size() == 0)
112 || (relaxationFactors_.size() == 1 && relaxationFactors_[0] == 1.0)
120 const pointField oldRelaxedPoints(relaxedPoints_);
130 const label faceI(iter.key());
132 const face& fPoints(
mesh().faces()[faceI]);
136 const label pointI(fPoints[fPointI]);
138 relaxationLevel[pointI] = 0;
151 bool complete(
false);
159 forAll(relaxationLevel, pointI)
161 if (relaxationLevel[pointI] >= 0)
165 relaxationFactors_[relaxationLevel[pointI]]
168 relaxedPoints_[pointI] =
169 (1 -
x)*oldRelaxedPoints[pointI]
170 +
x*(
points0()[pointI] + pointDisplacement()[pointI]);
176 markAffectedFaces(affectedFaces, markedFaces);
177 labelList markedFacesList(markedFaces.toc());
180 meshGeometry_.correct(relaxedPoints_, markedFacesList);
195 affectedFaces.
clear();
196 markAffectedFaces(markedFaces, affectedFaces);
203 const label faceI(iter.key());
205 const face& fPoints(
mesh().faces()[faceI]);
209 const label pointI(fPoints[fPointI]);
211 pointsToRelax[pointI] =
true;
215 forAll(pointsToRelax, pointI)
219 pointsToRelax[pointI]
220 && (relaxationLevel[pointI] < relaxationFactors_.size() - 1)
223 ++ relaxationLevel[pointI];
239 reduce(complete, andOp<bool>());
243 bool converged(
true);
246 const face& fPoints(
mesh().faces()[faceI]);
250 const label pointI(fPoints[fPointI]);
252 if (relaxationLevel[pointI] > 0)
254 facesToMove_.insert(faceI);
264 reduce(converged, andOp<bool>());
286 facesToMove_.resize(2*
mesh().nFaces());
289 facesToMove_.insert(faceI);
294 facesToMove_.resize(2*(
mesh().nBoundaryFaces()));
297 label faceI =
mesh().nInternalFaces();
302 facesToMove_.insert(faceI);
337 const polyMesh&
mesh,
338 const IOdictionary&
dict,
343 displacementMotionSolver(
mesh,
dict, pointDisplacement,
points0, typeName),
355 readLabel(coeffDict().lookup(
"nPointSmootherIter"))
374 return relaxedPoints_;
385 movePoints(curPoints());
388 pointDisplacement().boundaryFieldRef().updateCoeffs();
392 markAffectedFaces(facesToMove_, affectedFaces);
394 for(label i = 0; i < nPointSmootherIter_; i ++)
396 meshGeometry_.correct
398 points0() + pointDisplacement().internalField(),
406 pointSmoother_->update
410 points0() + pointDisplacement().internalField(),
418 twoDCorrectPoints(relaxedPoints_);
422 pointDisplacement().primitiveFieldRef() = relaxedPoints_-
points0();
425 const pointConstraints& pcs =
427 pcs.constrainDisplacement(pointDisplacement(),
false);
430 relaxedPoints_ =
points0() + pointDisplacement().internalField();
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces, const bool dryRun=false)
Check mesh with mesh settings in dict. Collects incorrect faces.
Virtual base class for displacement motion solver.
A face is a list of labels corresponding to mesh vertices.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Abstract base class for point smoothing methods. Handles parallel communication via reset and average...
vectorIOField pointIOField
pointIOField is a vectorIOField.
static const pointConstraints & New(const pointMesh &mesh, Args &&... args)
Get existing or create MeshObject registered with typeName.
const Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
label nFaces() const noexcept
Number of mesh faces.
Lookup type of boundary radiation properties.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
virtual void solve()
Solve for motion.
Macros for easy insertion into run-time selection tables.
displacementPointSmoothingMotionSolver(const polyMesh &, const IOdictionary &)
Construct from a polyMesh and an IOdictionary.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
#define forAll(list, i)
Loop across all elements in list.
dictionary meshQualityDict_
Mesh quality dictionary.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
vectorField pointField
pointField is a vectorField.
scalarList relaxationFactors_
Relaxation factors to use in each iteration.
void clear()
Clear the list, i.e. set size to zero.
void clear()
Remove all entries from table.
void markAffectedFaces(const labelHashSet &changedFaces, labelHashSet &affectedFaces)
Mark affected faces.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
defineTypeNameAndDebug(combustionModel, 0)
virtual void setFacesToMove(const dictionary &)
Set all the faces to be moved.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, IOobject::NO_REGISTER)))
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Mesh consisting of general polyhedral cells.
List< Key > toc() const
The table of contents (the keys) in unsorted order.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
List< label > labelList
A List of labels.
const polyMesh & mesh() const
Return reference to mesh.
A class for managing temporary objects.
bool relax()
Relax the points.
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)