pFlowToVTK finalized and tested

- geometry conversion now can handle separate vtk files.
This commit is contained in:
Hamidreza Norouzi
2024-03-30 08:35:16 -07:00
parent 815b134e1e
commit ef0e752929
13 changed files with 460 additions and 382 deletions

View File

@ -21,11 +21,14 @@ Licence:
#include "vtkFile.hpp"
bool pFlow::vtkFile::openStream()
bool pFlow::vtkFile::openStream(bool wHeader)
{
oStream_ = makeUnique<oFstream>( fileName() );
oStream_ = makeUnique<oFstream>( fileName(), false, append_ );
if( !oStream_ )return false;
return writeHeader();
if(wHeader)
return writeHeader();
else
return true;
}
bool pFlow::vtkFile::vtkFile::writeHeader()
@ -49,15 +52,17 @@ pFlow::vtkFile::vtkFile
(
const fileSystem dir,
const word& bName,
real time
real time,
bool append
)
:
dirPath_(dir),
baseName_(bName),
time_(time)
time_(time),
append_(append)
{
if(!openStream())
if(!openStream(!append))
{
fatalErrorInFunction <<
" error in creating vtkFile "<<fileName()<<endl;

View File

@ -40,15 +40,21 @@ protected:
real time_ = 0.0;
bool append_=false;
uniquePtr<oFstream> oStream_= nullptr;
bool openStream();
bool openStream(bool wHeader);
virtual bool writeHeader();
public:
vtkFile(const fileSystem dir, const word& bName, real time);
vtkFile(
const fileSystem dir,
const word& bName,
real time,
bool append = false);
virtual ~vtkFile() = default;
@ -56,7 +62,7 @@ public:
{
if(!oStream_)
{
if(!openStream())
if(!openStream(!append_))
{
fatalErrorInFunction<<
" error in opening vtkFile "<< fileName() <<endl;