Commit 4b214257 authored by mark's avatar mark

ENH: use new parameters for functionObject

- Time, not objectRegistry of fvMesh
parent f8c432c5
......@@ -113,7 +113,7 @@ Foam::adiosTime Foam::adiosWrite::readData(const instant& when)
Foam::adiosTime Foam::adiosWrite::readData()
{
return readData(dataDirectory/obr_.time().timeName() + ".bp");
return readData(dataDirectory/time_.timeName() + ".bp");
}
......
......@@ -79,19 +79,17 @@ static dictionary subOrEmptyDict
Foam::adiosWrite::adiosWrite
(
const word& groupName,
const objectRegistry& obr,
const Time& runTime,
const dictionary& dict
)
:
functionObject("adiosWrite"),
adiosCoreWrite(groupName, dict),
obr_(obr),
time_(refCast<const fvMesh>(obr).time()),
time_(runTime),
restartIndex_(-1)
{
Info<< "adiosWrite constructor called (" << Pstream::nProcs()
<< " procs) with primary mesh "
<< refCast<const fvMesh>(obr).name() << endl;
Info<< "adiosWrite constructor called ("
<< Pstream::nProcs() << " procs)" << endl;
// Read dictionary
read(dict);
......@@ -287,7 +285,7 @@ bool Foam::adiosWrite::restart()
adiosTime bpTime = readData(adiosTimes[adiosTimeIndex]);
if (bpTime.valid())
{
Time& t = const_cast<Time&>(obr_.time());
Time& t = const_cast<Time&>(time_);
t.setTime(bpTime.timeValue(), bpTime.timeIndex());
Info<< "Time = " << t.timeOutputValue() << " index "
......@@ -315,8 +313,8 @@ bool Foam::adiosWrite::execute()
// function objects exist at this point (e.g. fieldAverage variables)
Info<< "adiosWrite::execute() called at time "
<< obr_.time().timeName() << " time index "
<< obr_.time().timeIndex() << endl;
<< time_.timeName() << " time index "
<< time_.timeIndex() << endl;
static bool restarted = false;
if (!restarted)
......@@ -333,8 +331,8 @@ bool Foam::adiosWrite::end()
{
// Nothing to be done here
Info<< "adiosWrite::end() called at time "
<< obr_.time().timeName() << " time index "
<< obr_.time().timeIndex() << endl;
<< time_.timeName() << " time index "
<< time_.timeIndex() << endl;
return true;
}
......@@ -343,10 +341,10 @@ bool Foam::adiosWrite::end()
bool Foam::adiosWrite::write()
{
Info<< "adiosWrite::write() called at time "
<< obr_.time().timeName() << " time index "
<< obr_.time().timeIndex() << endl;
<< time_.timeName() << " time index "
<< time_.timeIndex() << endl;
const bool wasRestart = (restartIndex_ == obr_.time().timeIndex());
const bool wasRestart = (restartIndex_ == time_.timeIndex());
// track changes in mesh points or topology.
// - could also located in updateMesh() and movePoints() instead
......@@ -383,7 +381,7 @@ bool Foam::adiosWrite::write()
*/
#endif
Info<< "Writing ADIOS data for time " << obr_.time().timeName();
Info<< "Writing ADIOS data for time " << time_.timeName();
if (wasRestart)
{
Info<< " ... skipped at restart time" << endl;
......
......@@ -86,9 +86,6 @@ class adiosWrite
// Private data
// Reference to the object registry (fvMesh)
const objectRegistry& obr_;
//- Reference to the time database
const Time& time_;
......@@ -234,12 +231,12 @@ public:
// Constructors
//- Construct for given objectRegistry and dictionary.
//- Construct from Time and dictionary
adiosWrite
(
const word& groupName,
const objectRegistry&,
const dictionary&
const Time& runTime,
const dictionary& dict
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment