Go to the documentation of this file.
118 #ifndef externalCoupledFunctionObject_H
119 #define externalCoupledFunctionObject_H
202 const word& regionsName,
234 const word& fieldName
245 const word& fieldName
260 const label nColumns,
336 virtual bool start();
339 virtual bool execute(
const bool forceWrite);
void writeData() const
Write data for all regions, all fields.
HashTable< labelList > regionToGroups_
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from string.
A class for handling file names.
DynamicList< wordList > groupReadFields_
void createLockFile() const
Create lock file.
virtual bool timeSet()
Called when time was set at the end of the Time::operator++.
A class for managing temporary objects.
void readLines(const label nRows, autoPtr< IFstream > &masterFilePtr, OStringStream &data) const
Read (and distribute) lines from stream. Every processor.
void readColumns(const label nRows, const label nColumns, autoPtr< IFstream > &masterFilePtr, List< scalarField > &data) const
Read (and distribute) scalar columns from stream. Every processor.
fileName baseDir() const
Return the file path to the base communications directory.
This functionObject provides a simple interface for explicit coupling with an external application....
void removeWriteFiles() const
Remove files written by OpenFOAM.
fileName commsDir_
Path to communications directory.
static word lockName
Name of lock file.
static tmp< Field< Type > > gatherAndCombine(const Field< Type > &fld)
Helper: append data from all processors onto master.
virtual bool execute(const bool forceWrite)
Called at each ++ or += of the time-loop.
virtual bool start()
Called at the start of the time-loop.
virtual bool read(const dictionary &)
Read and set the function object if its data have changed.
A wordRe is a word, but can also have a regular expression for matching words.
Mesh consisting of general polyhedral cells.
Abstract base-class for Time/database function objects.
DynamicList< wordRe > groupNames_
void removeReadFiles() const
Remove files written by external code.
void wait() const
Wait for response from external source.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static string patchKey
Name of patch key, e.g. '# Patch:' when looking for start of patch data.
void operator=(const externalCoupledFunctionObject &)
Disallow default bitwise assignmen.
bool initialised_
Initialised flag.
virtual bool adjustTimeStep()
Called at the end of Time::adjustDeltaT() if adjustTime is true.
label calcFrequency_
Calculation frequency.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
DynamicList< wordList > regionGroupRegions_
A list of keyword definitions, which are a keyword followed by any number of values (e....
label waitInterval_
Interval time between checking for return data [s].
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
DynamicList< word > regionGroupNames_
Names of (composite) regions.
virtual bool enabled() const
Return the enabled flag.
static fileName groupDir(const fileName &commsDir, const word ®ionsName, const wordRe &groupName)
Return the file path to the communications directory for the region.
label timeOut_
Time out time [s].
bool initByExternal_
Flag to indicate values are initialised by external application.
An STL-conforming hash table.
static void writeGeometry(const UPtrList< const fvMesh > &meshes, const fileName &commsDir, const wordRe &groupName)
Write geometry for the group/patch.
static void checkOrder(const wordList &)
externalCoupledFunctionObject(const externalCoupledFunctionObject &)
Disallow default bitwise copy construc.
virtual ~externalCoupledFunctionObject()
Destructor.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
TypeName("externalCoupled")
Runtime type information.
const Time & time_
Reference to the time database.
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
virtual const word & name() const
Name.
fileName lockFile() const
Return the file path to the lock file.
Output to memory buffer stream.
DynamicList< wordList > groupWriteFields_
Switch enabled_
Switch for the execution - defaults to 'yes/on'.
static word compositeName(const wordList &)
Create single name by appending words (in sorted order),.
virtual bool end()
Called when Time::run() determines that the time-loop exits.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual void on()
Switch the function object on.
void removeLockFile() const
Remove lock file.
Database for solution data, solver performance and other reduced data.
void readData()
Read data for all regions, all fields.
virtual void off()
Switch the function object off.