Go to the documentation of this file.
41 externalDisplacementMeshMover,
42 displacementMotionSolverMeshMover,
50 bool Foam::displacementMotionSolverMeshMover::moveMesh
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()(),
132 pointDisplacement.mesh().time().constant(),
133 pointDisplacement.db(),
146 pointDisplacement.mesh().time().constant(),
147 pointDisplacement.db(),
152 pointDisplacement.mesh()().
points()
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();
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
List< label > labelList
A List of labels.
displacementMotionSolverMeshMover(const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement, const bool dryRun)
Construct from a polyMesh and an IOdictionary.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual const pointField & points() const
Return raw points.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
scalar setErrorReduction(const scalar)
Set the errorReduction (by how much to scale the displacement.
static autoPtr< displacementMotionSolver > New(const word &solverTypeName, const polyMesh &, const IOdictionary &, const pointVectorField &pointDisplacement, const pointIOField &points0)
Select constructed from polyMesh, dictionary and components.
virtual ~displacementMotionSolverMeshMover()
Destructor.
A class for handling words, derived from Foam::string.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
static constexpr const zero Zero
Global zero (0)
virtual void movePoints(const pointField &)
Update local data for geometry changes.
bool scaleMesh(labelList &checkFaces, const bool smoothMesh=true, const label nAllow=0)
Move mesh with given scale. Return true if mesh ok or has.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
static bitSet getMasterEdges(const polyMesh &mesh, const labelList &meshEdges)
Determine master edge for subset of edges. If coupled.
vectorIOField pointIOField
pointIOField is a vectorIOField.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual void movePoints(const pointField &)
Update local data for geometry changes.
virtual bool move(const dictionary &, const label nAllowableErrors, labelList &checkFaces)
Move mesh using current pointDisplacement boundary values.
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const Type & lookupObject(const word &name, const bool recursive=false) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
List< labelPair > baffles_
Baffles in the mesh.
Mesh representing a set of points created from polyMesh.
const dictionary & paramDict() const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static const word null
An empty word.
static void setDisplacementPatchFields(const labelList &patchIDs, pointVectorField &pointDisplacement)
Set patch fields on patchIDs to be consistent with.
defineTypeNameAndDebug(combustionModel, 0)
static bitSet getMasterPoints(const polyMesh &mesh, const labelList &meshPoints)
Determine master point for subset of points. If coupled.
const dimensionSet dimless
Dimensionless.