50bool Foam::displacementMotionSolverMeshMover::moveMesh
53 const label nAllowableErrors,
57 const label nRelaxIter = moveDict.get<label>(
"nRelaxIter");
63 scalar oldErrorReduction = -1;
67 for (label iter = 0; iter < 2*nRelaxIter; ++ iter)
71 if (iter == nRelaxIter)
74 <<
" : Displacement scaling for error reduction set to 0."
85 meshMover_.paramDict(),
98 if (oldErrorReduction >= 0)
100 meshMover_.setErrorReduction(oldErrorReduction);
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,
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]);
286 pointDisplacement()[pointI] = displacement[patchPointI];
290 meshMover_.setDisplacementPatchFields();
295 solverPtr_->pointDisplacement() == pointDisplacement();
298 (void)solverPtr_->newPoints();
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.
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.
displacementMotionSolverMeshMover(const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement, const bool dryRun)
Construct from a polyMesh and an IOdictionary.
virtual ~displacementMotionSolverMeshMover()
Destructor.
virtual bool move(const dictionary &, const label nAllowableErrors, labelList &checkFaces)
Move mesh using current pointDisplacement boundary values.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
Virtual base class for displacement motion solver.
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...
static labelList getFixedValueBCs(const pointVectorField &)
Extract fixed-value patchfields.
static autoPtr< indirectPrimitivePatch > getPatch(const polyMesh &, const labelList &)
Construct patch on selected patches.
const polyMesh & mesh() const
static autoPtr< externalDisplacementMeshMover > New(const word &type, const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement, const bool dryRun=false)
Return a reference to the selected meshMover model.
List< labelPair > baffles_
Baffles in the mesh.
const bool dryRun_
In dry-run mode?
const pointMesh & pMesh() const
virtual void movePoints(const pointField &)
Update local data for geometry changes.
pointVectorField & pointDisplacement()
Return reference to the point motion displacement field.
@ REGEX
Regular expression.
static bitSet getMasterPoints(const polyMesh &mesh, const labelList &meshPoints)
Determine master point for subset of points. If coupled.
static Type get(const dictionary &dict, const word &keyword, const bool noExit, enum keyType::option matchOpt=keyType::REGEX, const Type &deflt=Zero)
Wrapper around dictionary::get which does not exit.
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.
static void setDisplacementPatchFields(const labelList &patchIDs, pointVectorField &pointDisplacement)
Set patch fields on patchIDs to be consistent with.
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
Mesh representing a set of points created from polyMesh.
Mesh consisting of general polyhedral cells.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Different types of constants.
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.
const dimensionSet dimless
Dimensionless.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
vectorIOField pointIOField
pointIOField is a vectorIOField.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
vectorField pointField
pointField is a vectorField.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
#define forAll(list, i)
Loop across all elements in list.