170#ifndef functionObjects_externalCoupled_H
171#define functionObjects_externalCoupled_H
189namespace functionObjects
198 public functionObjects::timeFunctionObject,
199 public externalFileCoupler
205 label calcFrequency_;
211 DynamicList<word> regionGroupNames_;
214 DynamicList<wordList> regionGroupRegions_;
217 HashTable<labelList> regionToGroups_;
220 DynamicList<wordRe> groupNames_;
223 DynamicList<wordList> groupReadFields_;
226 DynamicList<wordList> groupWriteFields_;
229 bool initialisedCoupling_;
235 static fileName groupDir
237 const fileName& commsDir,
238 const word& regionsName,
239 const wordRe& groupName
246 const UPtrList<const fvMesh>&
meshes,
247 const wordRe& groupName,
248 const word& fieldName
255 const UPtrList<const fvMesh>&
meshes,
256 const wordRe& groupName,
269 const label nColumns,
292 void performCoupling();
336 virtual bool execute(
const label subIndex);
345 virtual bool write();
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Generic templated field type.
A HashTable similar to std::unordered_map.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Database for solution data, solver performance and other reduced data.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Encapsulates the logic for coordinating between OpenFOAM and an external application.
A class for handling file names.
const word & name() const noexcept
Return the name of this functionObject.
Provides a simple file-based communication interface for explicit coupling with an external applicati...
externalCoupled(const externalCoupled &)=delete
No copy construct.
virtual void writeDataMaster() const
Write data files (all regions, all fields) from master (OpenFOAM)
virtual void removeDataSlave() const
Remove data files written by slave (external code)
void operator=(const externalCoupled &)=delete
No copy assignment.
static string patchKey
Name of patch key, e.g. '// Patch:' when looking for start of patch data.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
TypeName("externalCoupled")
Runtime type information.
virtual void readDataMaster()
Read data files (all regions, all fields) on master (OpenFOAM)
virtual ~externalCoupled()=default
Destructor.
virtual void removeDataMaster() const
Remove data files written by master (OpenFOAM)
virtual bool execute()
Called at each ++ or += of the time-loop.
virtual bool write()
Write, currently a no-op.
virtual bool end()
Called when Time::run() determines that the time-loop exits.
static word compositeName(const wordList &)
Computes the natural logarithm of an input volScalarField.
Virtual base class for function objects with a reference to Time.
A class for managing temporary objects.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
A class for handling words, derived from Foam::string.
Foam::PtrList< Foam::fvMesh > meshes(regionNames.size())
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.