Skip to content
Snippets Groups Projects
Commit a8798c89 authored by Sergey Lesnik's avatar Sergey Lesnik
Browse files

Bug fix blockMesh: enable write() from polyMesh

parent b4afe262
Branches
No related merge requests found
......@@ -246,13 +246,13 @@ Foam::word Foam::OFstream::incrBlock(const word name)
<< "Add word to the block name LIFO stack: " << name << '\n';
}
this->indent();
this->write(name);
this->write(nl);
this->indent();
this->write(char(token::BEGIN_BLOCK));
this->write(nl);
this->incrIndent();
OSstream::indent();
OSstream::write(name);
OSstream::write(nl);
OSstream::indent();
OSstream::write(char(token::BEGIN_BLOCK));
OSstream::write(nl);
OSstream::incrIndent();
return name;
}
......@@ -267,9 +267,9 @@ void Foam::OFstream::decrBlock()
popBlockNamesStack();
this->decrIndent();
this->indent();
this->write(char(token::END_BLOCK));
OSstream::decrIndent();
OSstream::indent();
OSstream::write(char(token::END_BLOCK));
}
......@@ -313,6 +313,24 @@ void Foam::OFstream::popBlockNamesStack()
}
Foam::Ostream& Foam::OFstream::write
(
const char* data,
std::streamsize byteSize
)
{
adiosWritePrimitives
(
"fields",
this->getBlockId(),
byteSize/sizeof(scalar),
reinterpret_cast<const scalar*>(data)
);
return *this;
}
Foam::Ostream& Foam::OFstream::parwrite(const parIOType* buf, const label count)
{
if (format() != PARALLEL)
......
......@@ -181,6 +181,9 @@ public:
virtual void popBlockNamesStack();
//- Write field with the scalar primitive type
virtual Ostream& write(const char*, std::streamsize);
virtual Ostream& parwrite(const parIOType*, const label);
virtual Ostream& stringStream();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment