mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-22 16:28:30 +00:00
pFlowToVTK finalized and tested
- geometry conversion now can handle separate vtk files.
This commit is contained in:
@ -33,7 +33,6 @@ bool pFlow::fileSystem::checkFileName(const word& name)
|
||||
"Invalid file name supplied " << name <<
|
||||
"the following characters are not allowd: " <<
|
||||
notPermittedCharsFile << endl;
|
||||
fatalExit;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -57,9 +56,9 @@ pFlow::fileSystem::fileSystem( const word& dir, const word& file)
|
||||
{
|
||||
isDir_ = file.empty();
|
||||
|
||||
if( !isDir_)
|
||||
if( !isDir_ && !checkFileName(file))
|
||||
{
|
||||
checkFileName(file);
|
||||
fatalExit;
|
||||
}
|
||||
|
||||
try
|
||||
@ -240,7 +239,10 @@ pFlow::fileSystem pFlow::fileSystem::operator()
|
||||
|
||||
void pFlow::fileSystem::operator += (const word& fileName)
|
||||
{
|
||||
checkFileName(fileName);
|
||||
if(!checkFileName(fileName))
|
||||
{
|
||||
fatalExit;
|
||||
}
|
||||
|
||||
if( isDir())
|
||||
{
|
||||
|
@ -70,13 +70,30 @@ void pFlow::fileStream::openOutFile
|
||||
|
||||
if(binary_)
|
||||
{
|
||||
outStream_ = makeUnique< std::ofstream>(
|
||||
if(append_)
|
||||
{
|
||||
outStream_ = makeUnique< std::ofstream>(
|
||||
path.wordPath(), std::ios_base::out| std::ios::binary|std::ios::app);
|
||||
}
|
||||
else
|
||||
{
|
||||
outStream_ = makeUnique< std::ofstream>(
|
||||
path.wordPath(), std::ios_base::out| std::ios::binary);
|
||||
}
|
||||
}
|
||||
else
|
||||
outStream_ = makeUnique< std::ofstream>(
|
||||
{
|
||||
if(append_)
|
||||
{
|
||||
outStream_ = makeUnique< std::ofstream>(
|
||||
path.wordPath(), std::ios_base::out|std::ios::app);
|
||||
}
|
||||
else
|
||||
{
|
||||
outStream_ = makeUnique< std::ofstream>(
|
||||
path.wordPath(), std::ios_base::out);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(!outStream_->is_open())
|
||||
{
|
||||
@ -103,12 +120,14 @@ pFlow::fileStream::fileStream
|
||||
(
|
||||
const fileSystem& path,
|
||||
bool outStream,
|
||||
bool binary
|
||||
bool binary,
|
||||
bool append
|
||||
)
|
||||
:
|
||||
inStream_(nullptr),
|
||||
outStream_(nullptr),
|
||||
binary_(binary)
|
||||
binary_(binary),
|
||||
append_(append)
|
||||
{
|
||||
|
||||
if(outStream)
|
||||
|
@ -52,6 +52,8 @@ protected:
|
||||
|
||||
bool binary_ = false;
|
||||
|
||||
bool append_ = false;
|
||||
|
||||
/// open input file
|
||||
void openInFile(const fileSystem& path);
|
||||
|
||||
@ -66,7 +68,7 @@ public:
|
||||
//// - Constructors
|
||||
|
||||
/// From file path and input type and format.
|
||||
fileStream( const fileSystem& path, bool outStream = false, bool binary = false);
|
||||
fileStream( const fileSystem& path, bool outStream = false, bool binary = false, bool append = false);
|
||||
|
||||
/// No copy
|
||||
fileStream(const fileStream&)= delete;
|
||||
|
@ -22,9 +22,9 @@ Licence:
|
||||
#include "oFstream.hpp"
|
||||
|
||||
|
||||
pFlow::oFstream::oFstream (const fileSystem& path, bool binary)
|
||||
pFlow::oFstream::oFstream (const fileSystem& path, bool binary, bool append)
|
||||
:
|
||||
fileStream(path, true, binary),
|
||||
fileStream(path, true, binary, append),
|
||||
Ostream
|
||||
(
|
||||
fileStream::outStream(),
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
//// - Constructors
|
||||
|
||||
/// From file path and format
|
||||
oFstream (const fileSystem& path, bool binary = false);
|
||||
oFstream (const fileSystem& path, bool binary = false, bool append = false);
|
||||
|
||||
/// No copy constructor
|
||||
oFstream( const oFstream& src) = delete;
|
||||
|
Reference in New Issue
Block a user