This function object performs a file copy/replacement once a specified time has been reached. More...
Public Member Functions | |
TypeName ("timeActivatedFileUpdate") | |
Runtime type information. More... | |
timeActivatedFileUpdate (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false) | |
Construct for given objectRegistry and dictionary. More... | |
virtual | ~timeActivatedFileUpdate () |
Destructor. More... | |
virtual const word & | name () const |
Return name of the set of timeActivatedFileUpdate. More... | |
virtual void | read (const dictionary &) |
Read the timeActivatedFileUpdate data. More... | |
virtual void | execute () |
Execute, currently does nothing. More... | |
virtual void | end () |
Execute at the final time-loop, currently does nothing. More... | |
virtual void | timeSet () |
Called when time was set at the end of the Time::operator++. More... | |
virtual void | write () |
Calculate the timeActivatedFileUpdate and write. More... | |
virtual void | updateMesh (const mapPolyMesh &) |
Update for changes of mesh. More... | |
virtual void | movePoints (const polyMesh &) |
Update for changes of mesh. More... | |
Private Member Functions | |
void | updateFile () |
Update file. More... | |
timeActivatedFileUpdate (const timeActivatedFileUpdate &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const timeActivatedFileUpdate &) |
Disallow default bitwise assignment. More... | |
Private Attributes | |
word | name_ |
Name of this set of timeActivatedFileUpdate objects. More... | |
const objectRegistry & | obr_ |
Owner database. More... | |
bool | active_ |
On/off switch. More... | |
fileName | fileToUpdate_ |
Name of file to update. More... | |
List< Tuple2< scalar, fileName > > | timeVsFile_ |
List of times vs filenames. More... | |
label | lastIndex_ |
Index of last file copied. More... | |
Switch | log_ |
Switch to send output to Info as well as to file. More... | |
This function object performs a file copy/replacement once a specified time has been reached.
Example usage to update the fvSolution dictionary at various times throughout the calculation:
fileUpdate1 { type timeActivatedFileUpdate; functionObjectLibs ("libutilityFunctionObjects.so"); fileToUpdate "$FOAM_CASE/system/fvSolution"; timeVsFile ( (-1 "$FOAM_CASE/system/fvSolution.0") (0.10 "$FOAM_CASE/system/fvSolution.10") (0.20 "$FOAM_CASE/system/fvSolution.20") (0.35 "$FOAM_CASE/system/fvSolution.35") ); ... }
Function object usage
Property | Description | Required | Default value |
---|---|---|---|
type | Type name: timeActivatedFileUpdate | yes | |
fileToUpdate | Name of file to update | yes | |
timeVsFile | List of time vs file | yes | |
log | Log to standard output | no | yes |
Definition at line 114 of file timeActivatedFileUpdate.H.
|
private |
Disallow default bitwise copy construct.
timeActivatedFileUpdate | ( | const word & | name, |
const objectRegistry & | obr, | ||
const dictionary & | dict, | ||
const bool | loadFromFiles = false |
||
) |
Construct for given objectRegistry and dictionary.
Allow the possibility to load fields from files
Definition at line 68 of file timeActivatedFileUpdate.C.
References dict, and Foam::read().
|
virtual |
Destructor.
Definition at line 89 of file timeActivatedFileUpdate.C.
|
private |
Update file.
Definition at line 41 of file timeActivatedFileUpdate.C.
References Foam::cp(), Foam::endl(), timeActivatedFileUpdate::fileToUpdate_, Foam::Info, timeActivatedFileUpdate::lastIndex_, timeActivatedFileUpdate::log_, Foam::nl, timeActivatedFileUpdate::obr_, objectRegistry::time(), timeActivatedFileUpdate::timeVsFile_, Foam::type(), and dimensioned::value().
|
private |
Disallow default bitwise assignment.
TypeName | ( | "timeActivatedFileUpdate" | ) |
Runtime type information.
|
inlinevirtual |
Return name of the set of timeActivatedFileUpdate.
Definition at line 178 of file timeActivatedFileUpdate.H.
References timeActivatedFileUpdate::name_.
|
virtual |
Read the timeActivatedFileUpdate data.
Definition at line 95 of file timeActivatedFileUpdate.C.
References dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, Foam::isFile(), dictionary::lookup(), Foam::nl, Foam::tab, and Foam::type().
|
virtual |
Execute, currently does nothing.
Definition at line 132 of file timeActivatedFileUpdate.C.
|
virtual |
Execute at the final time-loop, currently does nothing.
Definition at line 141 of file timeActivatedFileUpdate.C.
|
virtual |
Called when time was set at the end of the Time::operator++.
Definition at line 147 of file timeActivatedFileUpdate.C.
|
virtual |
Calculate the timeActivatedFileUpdate and write.
Definition at line 153 of file timeActivatedFileUpdate.C.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 199 of file timeActivatedFileUpdate.H.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 203 of file timeActivatedFileUpdate.H.
|
private |
Name of this set of timeActivatedFileUpdate objects.
Definition at line 119 of file timeActivatedFileUpdate.H.
Referenced by timeActivatedFileUpdate::name().
|
private |
Owner database.
Definition at line 122 of file timeActivatedFileUpdate.H.
Referenced by timeActivatedFileUpdate::updateFile().
|
private |
On/off switch.
Definition at line 125 of file timeActivatedFileUpdate.H.
|
private |
Name of file to update.
Definition at line 128 of file timeActivatedFileUpdate.H.
Referenced by timeActivatedFileUpdate::updateFile().
List of times vs filenames.
Definition at line 131 of file timeActivatedFileUpdate.H.
Referenced by timeActivatedFileUpdate::updateFile().
|
private |
Index of last file copied.
Definition at line 134 of file timeActivatedFileUpdate.H.
Referenced by timeActivatedFileUpdate::updateFile().
|
private |
Switch to send output to Info as well as to file.
Definition at line 137 of file timeActivatedFileUpdate.H.
Referenced by timeActivatedFileUpdate::updateFile().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.