50 ((pDistMoving[
pi] - dMoving) <= 0) &&
51 ((pDistStatic[
pi] - dStatic) <= 0)
59 if (pDistStatic[
pi] - dStatic <= 0)
64 else if (pDistMoving[
pi] - dMoving <= 0)
69 else if (dMax - pDistMoving[
pi] <= 0)
78 const scalar d1 = pDistMoving[
pi] - dMoving;
81 dMax - pDistMoving[
pi],
82 pDistStatic[
pi] - dStatic
84 scale[
pi] = 1 - d1/(d1 + d2 + rootVSmall);
119 const vector& translationVector
123 if (
mag(translationVector) < small)
131 const point displacementVector = scale_[
pi]*translationVector;
132 if (
mag(displacementVector) > small)
134 newPoints[
pi] += displacementVector;
144 staticPatchSet_.
clear();
146 forAll(meshMover_.mesh().boundaryMesh(), patchI)
154 && !meshMover_.slidingPatchSet_.found(pp.
index())
155 && !patchSet.found(pp.
index())
167 patchSet_ = meshMover_.mesh().boundaryMesh().patchSet(patchNames_);
168 createStaticPatchSet();
177 if (movingPointZones_.size())
179 forAll(movingPointZones_, i)
183 meshMover_.mesh().pointZones().findIndices(movingPointZones_[i])
188 movingPointZones.
insert(indices);
189 Info<<
" pointZone " << movingPointZones_[i]
190 <<
" will move with the object " <<
name <<
endl;
194 Info<<
" movingZone " << movingPointZones_[i]
195 <<
" not found in pointZones" <<
endl;
200 return movingPointZones;
209 if (frozenPointZones_.
size())
211 forAll(frozenPointZones_, i)
215 meshMover_.mesh().pointZones().findIndices(frozenPointZones_[i])
220 staticPointZones.
insert(indices);
221 Info<<
" pointZone " << frozenPointZones_[i]
222 <<
" is frozen (stationary)" <<
endl;
226 Info<<
" frozenZone " << frozenPointZones_[i]
227 <<
" not found in pointZones" <<
endl;
232 if (meshMover_.frozenPointZones_.size())
234 forAll(meshMover_.frozenPointZones_, i)
238 meshMover_.mesh().pointZones().findIndices
240 meshMover_.frozenPointZones_[i]
246 staticPointZones.
insert(indices);
247 Info<<
" pointZone " << meshMover_.frozenPointZones_[i]
248 <<
" is frozen (stationary)" <<
endl;
252 Info<<
" frozenZone " << meshMover_.frozenPointZones_[i]
253 <<
" not found in pointZones" <<
endl;
258 return staticPointZones;
266 const word& objectName,
275 patchNames_(
dict.lookup(
"patches")),
278 dict.lookupOrDefault<scalar>(
"maxMotionDistance",
dimLength, great)
280 movingFrozenLayerThickness_
282 dict.lookupOrDefault<scalar>(
"movingFrozenLayerThickness",
dimLength, 0)
284 staticFrozenLayerThickness_
286 dict.lookupOrDefault<scalar>(
"staticFrozenLayerThickness",
dimLength, 0)
300 "motionScale_" +
name,
311 dict.lookupOrDefault<scalar>(
"cosineScale",
dimless, 0)
315 dict.lookupOrDefault<scalar>(
"travelInterval",
dimLength, great)
#define forAll(list, i)
Loop across all elements in list.
static pointConstraints & New(const word &name, const pointMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
Run-time selectable general function of one variable.
Internal::FieldType & primitiveFieldRef()
Return a reference to the primitive field.
const Internal::FieldType & primitiveField() const
Return a const-reference to the primitive field.
bool insert(const Key &key)
Insert a new entry.
bool empty() const
Return true if the hash table is empty.
void clear()
Clear all entries from table.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void size(const label)
Override size to be inconsistent with allocated storage.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
fvMesh & mesh()
Return the fvMesh.
static autoPtr< fvMeshMover > New(fvMesh &)
Select, construct and return the fvMeshMover.
void calcScale(const pointMesh &pMesh, const scalarField &pDistMoving, const scalarField &pDistStatic, scalar dMoving, scalar dMax, scalar dStatic)
Scale the mesh point deformation with distance functions.
labelHashSet movingPointZones() const
void createStaticPatchSet()
Generate staticPatchSet_ based on patch entries.
movingObject(const word &name, const multiValveEngine &engine, const dictionary &dict)
Construct from dictionary.
pointScalarField scale_
Interpolation scale (1 at moving patches, 0 at far-field)
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
void transformPoints(pointField &newPoints, const vector &translationVector)
const scalar cosineScale_
Cosine scale for the boundary point motion, between 0 and 1.
labelHashSet patchSet_
Object patchSet.
labelHashSet staticPointZones() const
const word name
Name of the object.
void initPatchSets()
Patch-set construction.
A mesh mover using explicit node translation based on scaled distance functions per moving object....
label index() const
Return the index of this patch in the boundaryMesh.
void constrain(PointField< Type > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
Mesh representing a set of points created from polyMesh.
Class containing mesh-to-mesh mapping information.
A patch is a list of labels that address the faces in the global face list.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
static bool constraintType(const word &pt)
Return true if the given type is a constraint type.
virtual bool write(const bool write=true) const
Write using setting from DB.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
const dimensionSet dimLength
const unitConversion unitNone
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Ostream & indent(Ostream &os)
Indent stream.
dimensionedScalar cos(const dimensionedScalar &ds)