46 lumpedPointDisplacementPointPatchVectorField
67 const auto*
p = isA<patchType>(bf[patchi]);
101 const auto*
p = isA<patchType>(bf[patchi]);
106 const_cast<lumpedPointMovement&
>(
p->movement())
133 if (isA<patchType>(bf[patchi]))
135 patchLst.append(patchi);
140 return patchLst.shrink();
159 points0Ptr_.reset(
nullptr);
163 else if (!points0Ptr_)
184 const objectRegistry& obr = this->
patch().boundaryMesh().mesh().db();
186 lumpedPointIOMovement* ptr =
230 dict.readIfPresent(
"controllers", controllers_);
232 dict.readIfPresent(
"dataWritten", dataWritten_);
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())
319 const polyMesh&
mesh = this->
patch().boundaryMesh().mesh().mesh();
323 if (!movement().hasMapping())
328 static_cast<const pointVectorField&>
330 this->internalField()
340 movement().coupler().slaveFirst()
341 && !movement().coupler().initialized()
347 else if (movement().couplingPending(
timeIndex))
356 List<vector> forces, moments;
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();
394 const_cast<lumpedPointMovement&
>(movement()).readState();
400 if (!movement().hasInterpolator(this->
patch()))
402 const_cast<lumpedPointMovement&
>(movement()).setInterpolator
409 tmp<pointField> tdisp =
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 this->writeValueEntry(
os);
virtual void write(Ostream &os) const
Write.
Virtual base class for displacement motion solver.
const pointField & points0() const
The starting locations (obtained from the motionSolver).
const pointPatch & patch() const noexcept
Return the patch.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
vectorIOField pointIOField
pointIOField is a vectorIOField.
A FixedValue boundary condition for pointField.
static label setInterpolators(const pointVectorField &pvf, const pointField &points0)
Set all patch controls for patches of this type.
virtual ~lumpedPointDisplacementPointPatchVectorField()
Destructor. De-register movement if in use and managed by this patch.
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
Foam::pointPatchFieldMapper.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool store()
Register object with its registry and transfer ownership to the registry.
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
virtual void write(Ostream &os) const
Write.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
GeometricBoundaryField< vector, pointPatchField, pointMesh > Boundary
Type of boundary fields.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
Macros for easy insertion into run-time selection tables.
This is the point-patch responsible for managing the force integration on a 'lumped-point' basis...
#define forAll(list, i)
Loop across all elements in list.
label ownerId() const
An owner Id, if needed for bookkeeping purposes.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
static IOobject points0IO(const polyMesh &mesh)
Return IO object for points0.
vectorField pointField
pointField is a vectorField.
IO-registered version of lumpedPointMovement.
static labelList patchIds(const pointVectorField &pvf)
The ids for all patches of this type.
label size() const noexcept
The number of entries in the list.
static lumpedPointIOMovement * getMovementObject(const objectRegistry &obr)
Find the movement object or nullptr if not found.
virtual const word & name() const =0
Return name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
const Mesh & mesh() const noexcept
Return mesh.
bool checkOut()
Remove object from registry, and remove all file watches.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
pointPatchField< vector > pointPatchVectorField
static label setPatchControls(const pointVectorField &pvf, const pointField &points0)
Set all patch controls for patches of this type.
const lumpedPointMovement & movement() const
The auto-vivifying singleton for movement.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, IOobject::NO_REGISTER)))
#define WarningInFunction
Report a warning using Foam::Warning.
Basic pointPatch represents a set of points from the mesh.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
const polyBoundaryMesh & patches
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static autoPtr< lumpedPointIOMovement > New(const objectRegistry &obr, label ownerId=-1)
Create a movement object in the registry by reading system dictionary.
const std::string patch
OpenFOAM patch number as a std::string.
static int debug
Debug switch.
messageStream Info
Information stream (stdout output on master, null elsewhere)
makePointPatchTypeField(pointPatchVectorField, solidBodyMotionDisplacementPointPatchVectorField)
stopAtControls
Stop-run control options, which are primarily used when altering the stopAt condition.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Registry of regIOobjects.
The movement driver that describes initial point locations, the current state of the points/rotations...
lumpedPointDisplacementPointPatchVectorField(const pointPatch &p, const DimensionedField< vector, pointMesh > &iF)
Construct from patch and internal field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.