Go to the documentation of this file.
146 #ifndef functionObjects_externalCoupled_H
147 #define functionObjects_externalCoupled_H
165 namespace functionObjects
172 class externalCoupled
174 public functionObjects::timeFunctionObject,
175 public externalFileCoupler
181 label calcFrequency_;
187 DynamicList<word> regionGroupNames_;
190 DynamicList<wordList> regionGroupRegions_;
193 HashTable<labelList> regionToGroups_;
196 DynamicList<wordRe> groupNames_;
199 DynamicList<wordList> groupReadFields_;
202 DynamicList<wordList> groupWriteFields_;
205 bool initialisedCoupling_;
211 static fileName groupDir
213 const fileName& commsDir,
214 const word& regionsName,
224 const word& fieldName
233 const word& fieldName
245 const label nColumns,
265 static void checkOrder(
const wordList& regionNames);
268 void performCoupling();
321 virtual bool write();
virtual void readDataMaster()
Read data files (all regions, all fields) on master (OpenFOAM)
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
A class for handling file names.
A class for managing temporary objects.
Virtual base class for function objects with a reference to Time.
This functionObject provides a simple interface for explicit coupling with an external application.
virtual ~externalCoupled()=default
Destructor.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Generic templated field type.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
PtrList< fvMesh > meshes(regionNames.size())
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
virtual bool end()
Called when Time::run() determines that the time-loop exits.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual void removeDataMaster() const
Remove data files written by master (OpenFOAM)
virtual void writeDataMaster() const
Write data files (all regions, all fields) from master (OpenFOAM)
static string patchKey
Name of patch key, e.g. '// Patch:' when looking for start of patch data.
A HashTable similar to std::unordered_map.
virtual void removeDataSlave() const
Remove data files written by slave (external code)
virtual bool write()
Write, currently a no-op.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Encapsulates the logic for coordinating between OpenFOAM and an external application.
virtual bool execute()
Called at each ++ or += of the time-loop.
const word & name() const
Return the name of this functionObject.
TypeName("externalCoupled")
Runtime type information.
Output to string buffer, using a OSstream.
static void writeGeometry(const UPtrList< const fvMesh > &meshes, const fileName &commsDir, const wordRe &groupName)
Write geometry for the group as region/patch.
static word compositeName(const wordList &)
Create single name by appending words (in sorted order),.
bool log
Switch write log to Info.
Database for solution data, solver performance and other reduced data.