mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-12 16:26:23 +00:00
pFlowToVTK finalized and tested
- geometry conversion now can handle separate vtk files.
This commit is contained in:
@ -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;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user