EMH: Adding a hook to functionObject called 'timeSet' at the

end of Time::operator++. This allows to know if the next timeIndex will be
a dumping time. The function object "partialWrite" modifyes the write option
of the those fields which will be written down at given intervals of the overall
outout times.
This commit is contained in:
Sergio Ferraris
2013-06-07 10:11:07 +01:00
parent 2e1ccf40b7
commit a50d78ea93
83 changed files with 547 additions and 152 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -202,6 +202,18 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::end()
}
template<class OutputFilter>
bool Foam::OutputFilterFunctionObject<OutputFilter>::timeSet()
{
if (active())
{
ptr_->timeSet();
}
return true;
}
template<class OutputFilter>
bool Foam::OutputFilterFunctionObject<OutputFilter>::read
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -201,6 +201,8 @@ public:
//- Called when Time::run() determines that the time-loop exits
virtual bool end();
//- Called when time was set at the end of the Time::operator++
virtual bool timeSet();
//- Read and set the function object if its data have changed
virtual bool read(const dictionary&);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -120,6 +120,12 @@ bool Foam::functionObject::end()
}
bool Foam::functionObject::timeSet()
{
return false;
}
Foam::autoPtr<Foam::functionObject> Foam::functionObject::iNew::operator()
(
const word& name,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -157,6 +157,9 @@ public:
// By default it simply calls execute().
virtual bool end();
//- Called when time was set at the end of the Time::operator++
virtual bool timeSet();
//- Read and set the function object if its data have changed
virtual bool read(const dictionary&) = 0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -190,6 +190,27 @@ bool Foam::functionObjectList::end()
}
bool Foam::functionObjectList::timeSet()
{
bool ok = true;
if (execution_)
{
if (!updated_)
{
read();
}
forAll(*this, objectI)
{
ok = operator[](objectI).timeSet() && ok;
}
}
return ok;
}
bool Foam::functionObjectList::read()
{
bool ok = true;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -163,6 +163,9 @@ public:
//- Called when Time::run() determines that the time-loop exits
virtual bool end();
//- Called when time was set at the end of the Time::operator++
virtual bool timeSet();
//- Read and set the function objects if their data have changed
virtual bool read();