Go to the documentation of this file.
46 lumpedPointDisplacementPointPatchVectorField
67 const auto*
p = isA<patchType>(bf[patchi]);
101 const auto*
p = isA<patchType>(bf[patchi]);
133 if (isA<patchType>(bf[patchi]))
135 patchLst.append(patchi);
140 return patchLst.shrink();
159 points0Ptr_.reset(
nullptr);
163 else if (!points0Ptr_)
234 if (controllers_.empty())
237 <<
"No controllers specified, using all lumped points for patch: "
255 controllers_(rhs.controllers_),
256 dataWritten_(rhs.dataWritten_),
269 controllers_(rhs.controllers_),
270 dataWritten_(rhs.dataWritten_),
289 movement().coupler().shutdown();
305 const label
timeIndex = this->db().time().timeIndex();
309 if (movement().ownerId() == this->
patch().index())
323 if (!movement().hasMapping())
330 this->internalField()
340 movement().coupler().slaveFirst()
341 && !movement().coupler().initialized()
347 else if (movement().couplingPending(
timeIndex))
357 movement().forcesAndMoments(
mesh, forces, moments);
361 Pout<<
"gatherForces: " << forces <<
" called from patch "
364 Info<<
"output forces to file: called from patch "
366 <<
"# " << forces.size() <<
" force entries" <<
nl
367 <<
"# fx fy fz" <<
nl
368 <<
"output forces to file: "
369 << forces <<
" called from patch "
376 dataWritten_.second() = dataWritten_.first();
377 dataWritten_.first() = this->db().time().timeOutputValue();
381 movement().writeData(forces, moments, &dataWritten_);
384 movement().coupler().useSlave();
392 action = movement().coupler().waitForSlave();
400 if (!movement().hasInterpolator(this->
patch()))
410 movement().pointsDisplacement
424 action != this->db().time().stopAt()
425 && action != Time::stopAtControls::saUnknown
428 this->db().time().stopAt(action);
438 if (controllers_.size())
444 if (movement().ownerId() == this->
patch().index())
449 writeEntry(
"value",
os);
static label setInterpolators(const pointVectorField &pvf, const pointField &points0)
Set all patch controls for patches of this type.
A primitive field of type <T> with automated input and output.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
IO-registered version of lumpedPointMovement.
A class for managing temporary objects.
static label setPatchControls(const pointVectorField &pvf, const pointField &points0)
Set all patch controls for patches of this type.
static bool master(const label communicator=worldComm)
Am I the master process.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Basic pointPatch represents a set of points from the mesh.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
label ownerId() const
An owner Id, if needed for bookkeeping purposes.
const pointMesh & mesh() const noexcept
Return the mesh reference.
static labelList patchIds(const pointVectorField &pvf)
The ids for all patches of this type.
This is the point-patch responsible for managing the force integration on a 'lumped-point' basis,...
Mesh consisting of general polyhedral cells.
const pointPatch & patch() const
Return patch.
Foam::pointPatchFieldMapper.
#define forAll(list, i)
Loop across all elements in list.
static IOobject points0IO(const polyMesh &mesh)
Return IO object for points0.
Registry of regIOobjects.
makePointPatchTypeField(pointPatchVectorField, solidBodyMotionDisplacementPointPatchVectorField)
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Base class for solution control classes.
messageStream Info
Information stream (stdout output on master, null elsewhere)
static int debug
Debug switch.
virtual void write(Ostream &) const
Write.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Virtual base class for displacement motion solver.
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
virtual ~lumpedPointDisplacementPointPatchVectorField()
Destructor. De-register movement if in use and managed by this patch.
static lumpedPointIOMovement * getMovementObject(const objectRegistry &obr)
Find the movement object or nullptr if not found.
lumpedPointDisplacementPointPatchVectorField(const pointPatch &p, const DimensionedField< vector, pointMesh > &iF)
Construct from patch and internal field.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, false)))
bool checkOut()
Remove all file watches and remove object from registry.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
const std::string patch
OpenFOAM patch number as a std::string.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
virtual void write(Ostream &os) const
Write.
The movement driver that describes initial point locations, the current state of the points/rotations...
const pointBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
const polyBoundaryMesh & patches
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
const pointField & points0() const
The starting locations (obtained from the motionSolver).
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
pointPatchField< vector > pointPatchVectorField
const lumpedPointMovement & movement() const
The auto-vivifying singleton for movement.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void couplingCompleted(const label timeIndex) const
Register that coupling is completed at this calcFrequency.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static autoPtr< lumpedPointIOMovement > New(const objectRegistry &obr, label ownerId=-1)
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const objectRegistry & db() const noexcept
Return the local objectRegistry.