mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: respond to externalCoupled lock file contents
- waitForSlave now return a Time::stopAtControls enumeration:
unknown: when lockfile has no specially recognized content.
endTime: when lockfile contains "status=done"
writeNow: when lockfile contains "action=writeNow"
nextWrite: when lockfile contains "action=nextWrite"
noWriteNow: when lockfile contains "action=noWriteNow"
These values can be used by the caller to terminate the master
(OpenFOAM) as desired in response to information placed there by the
slave process.
This commit is contained in:
@ -187,6 +187,8 @@ void Foam::lumpedPointDisplacementPointPatchVectorField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
enum Time::stopAtControls action = Time::stopAtControls::saUnknown;
|
||||
|
||||
const bool masterPatch = (movement().ownerId() == this->patch().index());
|
||||
if (masterPatch)
|
||||
{
|
||||
@ -250,13 +252,14 @@ void Foam::lumpedPointDisplacementPointPatchVectorField::updateCoeffs()
|
||||
{
|
||||
movement().writeData(forces, moments);
|
||||
|
||||
// signal external source to execute
|
||||
// Signal external source to execute
|
||||
movement().coupler().useSlave();
|
||||
}
|
||||
}
|
||||
|
||||
// Wait for slave to provide data - includes MPI barrier
|
||||
movement().coupler().waitForSlave();
|
||||
// Wait for slave to provide data (includes MPI barrier)
|
||||
// and catch any abort information sent from slave
|
||||
action = movement().coupler().waitForSlave();
|
||||
|
||||
// Read data passed back from external source - includes MPI barrier
|
||||
const_cast<lumpedPointMovement&>(movement()).readState();
|
||||
@ -271,6 +274,16 @@ void Foam::lumpedPointDisplacementPointPatchVectorField::updateCoeffs()
|
||||
this->operator==(tdisp);
|
||||
|
||||
fixedValuePointPatchField<vector>::updateCoeffs();
|
||||
|
||||
// Process any abort information sent from slave
|
||||
if
|
||||
(
|
||||
action != this->db().time().stopAt()
|
||||
&& action != Time::stopAtControls::saUnknown
|
||||
)
|
||||
{
|
||||
this->db().time().stopAt(action);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user