ENH: write ensightWrite case on each write (closes #733)

- allows processing of the data during the calculation.
This commit is contained in:
Mark Olesen 2018-05-08 09:25:07 +02:00
parent 9531212f14
commit b24bd516ae
2 changed files with 15 additions and 34 deletions

View File

@ -98,19 +98,6 @@ Foam::functionObjects::ensightWrite::ensightWrite
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::ensightWrite::~ensightWrite()
{
if (ensCase_.valid())
{
// finalize case
ensCase().write();
ensCase_.clear();
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::ensightWrite::read(const dictionary& dict)
@ -271,19 +258,14 @@ bool Foam::functionObjects::ensightWrite::write()
<< "Unprocessed field " << ignored << endl;
}
ensCase().write(); // Flush case information
return true;
}
bool Foam::functionObjects::ensightWrite::end()
{
if (ensCase_.valid())
{
// finalize case
ensCase().write();
ensCase_.clear();
}
return true;
}
@ -294,7 +276,7 @@ void Foam::functionObjects::ensightWrite::updateMesh(const mapPolyMesh& mpm)
if (ensMesh_.valid())
{
ensMesh_().expire();
ensMesh_->expire();
}
}
@ -305,7 +287,7 @@ void Foam::functionObjects::ensightWrite::movePoints(const polyMesh& mpm)
if (ensMesh_.valid())
{
ensMesh_().expire();
ensMesh_->expire();
}
}

View File

@ -60,7 +60,7 @@ Description
writeControl | Output control | recommended | timeStep
directory | The output directory name | no | "ensightWrite"
overwrite | Remove existing directory | no | false
format | ASCII or binary format | no | same as simulation
format | Either ascii or binary | no | same as simulation
width | Mask width for \c data/XXXX | no | 8
noPatches | Suppress writing patches | no | false
patches | Select patches to write | no |
@ -99,7 +99,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
// Forward declarations
class dictionary;
namespace functionObjects
@ -154,17 +154,16 @@ class ensightWrite
template<class Type>
int writeVolField(const word& inputName, int& state);
//- Process by trying to apply for various volume field types.
int process(const word& inputName);
//- Disallow default bitwise copy construct
//- No copy construct
ensightWrite(const ensightWrite&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const ensightWrite&) = delete;
public:
//- Runtime type information
@ -183,28 +182,28 @@ public:
//- Destructor
virtual ~ensightWrite();
virtual ~ensightWrite() = default;
// Member Functions
//- Read the ensightWrite specification
virtual bool read(const dictionary&);
virtual bool read(const dictionary& dict);
//- Do nothing
virtual bool execute();
//- Write fields
//- Write fields, flush case file
virtual bool write();
//- Execute at the final time-loop, flush case file
//- Do nothing at the final time-loop
virtual bool end();
//- Update for changes of mesh
virtual void updateMesh(const mapPolyMesh&);
virtual void updateMesh(const mapPolyMesh& mpm);
//- Update for mesh point-motion
virtual void movePoints(const polyMesh&);
virtual void movePoints(const polyMesh& mpm);
};