52 const dictionary& moveDict,
53 const label nAllowableErrors,
57 const label nRelaxIter = moveDict.get<label>(
"nRelaxIter");
61 Info<< typeName <<
" : Moving mesh ..." <<
endl;
63 scalar oldErrorReduction = -1;
67 for (label iter = 0; iter < 2*nRelaxIter; ++ iter)
69 Info<< typeName <<
" : Iteration " << iter <<
endl;
71 if (iter == nRelaxIter)
74 <<
" : Displacement scaling for error reduction set to 0."
92 Info<< typeName <<
" : Successfully moved mesh" <<
endl;
98 if (oldErrorReduction >= 0)
103 Info<< typeName <<
" : Finished moving mesh ..." <<
endl;
126 pointDisplacement.
mesh()(),
133 pointDisplacement.db(),
147 pointDisplacement.db(),
157 adaptPatchIDs_(getFixedValueBCs(pointDisplacement)),
158 adaptPatchPtr_(getPatch(
mesh(), adaptPatchIDs_)),
165 pointDisplacement.time().
timeName(),
166 pointDisplacement.db(),
189 fieldSmoother_(
mesh())
204 const label nAllowableErrors,
213 const label nSmoothPatchThickness = meshRefinement::get<label>
218 const word minThicknessName = meshRefinement::get<word>
225 if (minThicknessName ==
"none")
232 (minThicknessName ==
"none")
237 const bitSet isPatchMasterPoint
242 adaptPatchPtr_().meshPoints()
246 const bitSet isPatchMasterEdge
251 adaptPatchPtr_().meshEdges
263 pointDisplacement().internalField(),
264 adaptPatchPtr_().meshPoints()
267 fieldSmoother_.minSmoothField
269 nSmoothPatchThickness,
280 forAll(displacement, patchPointI)
282 const label pointI(adaptPatchPtr_().meshPoints()[patchPointI]);
284 resid +=
mag(pointDisplacement()[pointI]-displacement[patchPointI]);
286 pointDisplacement()[pointI] = displacement[patchPointI];
290 meshMover_.setDisplacementPatchFields();
295 solverPtr_->pointDisplacement() == pointDisplacement();
298 (void)solverPtr_->newPoints();
299 pointDisplacement() == solverPtr_->pointDisplacement();
302 return moveMesh(moveDict, nAllowableErrors, checkFaces);
311 solverPtr_->movePoints(
p);
314 meshMover_.movePoints();
317 meshMover_.correct();
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A primitive field of type <T> with automated input and output.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Quality-based under-relaxation wrapped around generic displacementMotionSolver.
virtual ~displacementMotionSolverMeshMover()
Destructor.
Virtual base class for displacement motion solver.
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...
List< labelPair > baffles_
Baffles in the mesh.
@ REGEX
Regular expression.
static bitSet getMasterPoints(const polyMesh &mesh, const labelList &meshPoints)
Determine master point for subset of points. If coupled.
static bitSet getMasterEdges(const polyMesh &mesh, const labelList &meshEdges)
Determine master edge for subset of edges. If coupled.
scalar setErrorReduction(const scalar)
Set the errorReduction (by how much to scale the displacement.
void movePoints()
Update for new mesh geometry.
const dictionary & paramDict() const
static void setDisplacementPatchFields(const labelList &patchIDs, pointVectorField &pointDisplacement)
Set patch fields on patchIDs to be consistent with.
bool scaleMesh(labelList &checkFaces, const bool smoothMesh=true, const label nAllow=0)
Move mesh with given scale. Return true if mesh ok or has.
const Type & lookupObject(const word &name, const bool recursive=false) const
constant condensation/saturation model.
Mesh representing a set of points created from polyMesh.
Mesh consisting of general polyhedral cells.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const dimensionSet dimless
Dimensionless.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
#define forAll(list, i)
Loop across all elements in list.