51 ((pDistMoving[
pi] - dMoving) <= 0) &&
52 ((pDistStatic[
pi] - dStatic) <= 0)
60 if (pDistStatic[
pi] - dStatic <= 0)
65 else if (pDistMoving[
pi] - dMoving <= 0)
70 else if (dMax - pDistMoving[
pi] <= 0)
79 const scalar d1 = pDistMoving[
pi] - dMoving;
82 dMax - pDistMoving[
pi],
83 pDistStatic[
pi] - dStatic
85 scale[
pi] = 1 - d1/(d1 + d2 + rootVSmall);
118 const vector& translationVector
122 if (
mag(translationVector) < small)
130 const point displacementVector = scale_[
pi]*translationVector;
131 if (
mag(displacementVector) > small)
133 newPoints[
pi] += displacementVector;
143 staticPatchSet_.
clear();
145 forAll(meshMover_.mesh().boundaryMesh(), patchI)
153 && !meshMover_.slidingPatchSet_.found(pp.
index())
154 && !patchSet.found(pp.
index())
166 patchSet_ = meshMover_.mesh().boundaryMesh().patchSet
171 if (patchSet_.empty())
174 <<
"Empty patchSet in " << dict_.name()
178 createStaticPatchSet();
187 if (movingPointZones_.size())
189 forAll(movingPointZones_, i)
193 meshMover_.mesh().pointZones().findIndices(movingPointZones_[i])
198 movingPointZones.
insert(indices);
199 Info<<
" pointZone " << movingPointZones_[i]
200 <<
" will move with the object " <<
name <<
endl;
204 Info<<
" movingZone " << movingPointZones_[i]
205 <<
" not found in pointZones" <<
endl;
210 return movingPointZones;
219 if (frozenPointZones_.
size())
221 forAll(frozenPointZones_, i)
225 meshMover_.mesh().pointZones().findIndices(frozenPointZones_[i])
230 staticPointZones.
insert(indices);
231 Info<<
" pointZone " << frozenPointZones_[i]
232 <<
" is frozen (stationary)" <<
endl;
236 Info<<
" frozenZone " << frozenPointZones_[i]
237 <<
" not found in pointZones" <<
endl;
242 if (meshMover_.frozenPointZones_.size())
244 forAll(meshMover_.frozenPointZones_, i)
248 meshMover_.mesh().pointZones().findIndices
250 meshMover_.frozenPointZones_[i]
256 staticPointZones.
insert(indices);
257 Info<<
" pointZone " << meshMover_.frozenPointZones_[i]
258 <<
" is frozen (stationary)" <<
endl;
262 Info<<
" frozenZone " << meshMover_.frozenPointZones_[i]
263 <<
" not found in pointZones" <<
endl;
268 return staticPointZones;
276 const word& objectName,
288 dict.lookupOrDefault<scalar>(
"maxMotionDistance",
dimLength, great)
290 movingFrozenLayerThickness_
292 dict.lookupOrDefault<scalar>(
"movingFrozenLayerThickness",
dimLength, 0)
294 staticFrozenLayerThickness_
296 dict.lookupOrDefault<scalar>(
"staticFrozenLayerThickness",
dimLength, 0)
310 "motionScale_" +
name,
319 cosine_(
dict.lookupOrDefault(
"cosineScaling", false)),
322 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.
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 keyword definitions, which are a keyword followed by any number of values (e....
const dictionary & dict() const
Return the dynamicMeshDict/mover dict.
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)
labelHashSet staticPointZones() const
const word name
Name of the object.
void initPatchSets()
Patch-set construction.
Switch cosine_
Switch to use cosine-based scaling.
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 FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimless
const dimensionSet dimLength
const unitConversion unitNone
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
List< wordRe > wordReList
A List of wordRe (word or regular expression)
Ostream & indent(Ostream &os)
Indent stream.
dimensionedScalar cos(const dimensionedScalar &ds)