36 namespace pointMeshMovers
58 w[bi] = wbi/
pow(
max(1 - wbi, small), 0.62);
63 const scalar
lambda = 1/sumw;
80 void Foam::pointMeshMovers::multiRigidBody::bodyMesh::calcWeights
101 weight_.primitiveFieldRef() = weight(pDist.primitiveField());
107 weight_.primitiveFieldRef() = 0;
125 pointZones_(
dict.lookupOrDefault(
"pointZones",
wordReList::null())),
126 pointZoneSet_(
mesh.pointZones().
zoneSet(pointZones_)),
127 di_(
dict.lookupOrDefault<scalar>(
"innerDistance", 0.0)),
133 name_ +
".motionScale",
160 name_ +
".motionScale",
181 if (
dict.isDict(
"bodies"))
189 if (bodyDict.
found(
"patches"))
209 if (
dict.isDict(
"exterior"))
217 dict.subDict(
"exterior")
276 min(
max((do_ - pDist)/(do_ - di_), scalar(0)), scalar(1))
298 if (poly().
nPoints() != points0().size())
301 <<
"The number of points in the mesh seems to have changed." <<
endl
302 <<
"In constant/polyMesh there are " << points0().size()
303 <<
" points; in the current mesh there are " << poly().nPoints()
323 average(transforms0, weights(pointi, w))
324 .transformPoint(points0[pointi]);
343 forAll(newPoints0, pointi)
348 <<
"Cannot determine co-ordinates of introduced vertices."
349 <<
" New vertex " << pointi <<
" at co-ordinate "
357 for (
int iter=0; iter<3; iter++)
362 if (bodyMeshes_[bi].do_ > 0)
367 bodyMeshes_[bi].patchSet_,
368 bodyMeshes_[bi].pointZoneSet_,
377 forAll(newPoints0, pointi)
383 weight[pointi] = bodyMeshes_[bi].weight(pDist[pointi]);
391 bodyMeshes_[bi].weight_ = 0;
396 forAll(newPoints0, pointi)
402 newPoints0[pointi] = points0_[oldPointi];
414 forAll(newPoints0, pointi)
421 average(transforms0, weights(pointi, w))
422 .invTransformPoint(
points[pointi]);
428 points0_.primitiveFieldRef() = newPoints0;
432 points0_.instance() = poly().time().name();
445 bodyMeshes_[bi].calcWeights(points0);
459 average(transforms0, weights(pointi, w))
460 .invTransformPoint(points0[pointi]);
465 points0_.instance() = poly().time().name();
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
static pointMesh & New(const word &name, const polyMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
bool insert(const Key &key)
Insert a new entry.
Template class for intrusive linked lists.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
void append(T *)
Append an element at the end of the list.
label size() const
Return the number of elements in the UPtrList.
T & last()
Return reference to the last element of the list.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
void constrain(PointField< Type > &pf, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints) and.
Calculates the distance to the specified sets of patch and pointZone points or for all points.
static autoPtr< pointMeshMover > New(const polyMesh &, const dictionary &)
Select constructed from polyMesh and dictionary.
Motion of the mesh specified as a list of pointMeshMovers.
virtual void mapMesh(const polyMeshMap &)=0
Update from another mesh using the given map.
Class containing the patches and point motion weighting for each body.
bodyMesh(const polyMesh &mesh, const word &name, const dictionary &dict)
Type weight(const Type &pDist) const
Abstract base-class for multiple rigid body mesh motion.
~multiRigidBody()
Destructor.
virtual void topoChange(const polyTopoChangeMap &)
Update local data for topology changes.
virtual tmp< pointField > newPoints()
Return point location obtained from the current motion field.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
multiRigidBody(const polyMesh &, const dictionary &dict)
Construct from polyMesh and dictionary.
PtrList< bodyMesh > bodyMeshes_
List of the bodyMeshes containing the patches and point motion.
Mesh representing a set of points created from polyMesh.
Class containing mesh-to-mesh mapping information.
Mesh consisting of general polyhedral cells.
virtual const pointField & points() const
Return raw points.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const labelList & reversePointMap() const
Reverse point map.
const labelList & pointMap() const
Old point map.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
Zone container returned by zoneGenerator::generate.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedScalar lambda(viscosity->lookup("lambda"))
defineTypeNameAndDebug(externalDisplacement, 0)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const dimensionSet & dimless
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
vectorField pointField
pointField is a vectorField.
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< typename powProduct< Type, r >::type, GeoMesh, Field > > pow(const DimensionedField< Type, GeoMesh, PrimitiveField > &df, typename powProduct< Type, r >::type)
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
faceListList boundary(nPatches)