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(),
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();
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
Virtual base class for displacement motion solver.
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...
virtual void movePoints(const pointField &)
Update local data for geometry changes.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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 dictionary & paramDict() const
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bitSet getMasterEdges(const polyMesh &mesh, const labelList &meshEdges)
Determine master edge for subset of edges. If coupled.
const dimensionSet dimless
Dimensionless.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Macros for easy insertion into run-time selection tables.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Mesh representing a set of points created from polyMesh.
#define forAll(list, i)
Loop across all elements in list.
virtual ~displacementMotionSolverMeshMover()
Destructor.
vectorField pointField
pointField is a vectorField.
scalar setErrorReduction(const scalar)
Set the errorReduction (by how much to scale the displacement.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
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)
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...
List< labelPair > baffles_
Baffles in the mesh.
displacementMotionSolverMeshMover(const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement, const bool dryRun)
Construct from a polyMesh and an IOdictionary.
static bitSet getMasterPoints(const polyMesh &mesh, const labelList &meshPoints)
Determine master point for subset of points. If coupled.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
virtual bool move(const dictionary &, const label nAllowableErrors, labelList &checkFaces)
Move mesh using current pointDisplacement boundary values.
Mesh consisting of general polyhedral cells.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
List< label > labelList
A List of labels.
Defines the attributes of an object for which implicit objectRegistry management is supported...
A primitive field of type <T> with automated input and output.
static constexpr const zero Zero
Global zero (0)