Skip to content
Snippets Groups Projects
Commit 830e555e authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Merge pull request #237 from norihiro-w/fix-vtu-output-precision

Fix a bug that precision given in Writer() is unused  in VTU output
parents 5438043c 113248f1
No related branches found
No related tags found
No related merge requests found
...@@ -442,6 +442,7 @@ int BoostVtuInterface::write(std::ostream& stream) ...@@ -442,6 +442,7 @@ int BoostVtuInterface::write(std::ostream& stream)
celldata_node.put("<xmlattr>.Scalars", "MaterialIDs"); celldata_node.put("<xmlattr>.Scalars", "MaterialIDs");
std::stringstream oss(std::stringstream::out); std::stringstream oss(std::stringstream::out);
oss.precision(stream.precision());
oss << std::endl << data_array_indent; oss << std::endl << data_array_indent;
for (unsigned i = 0; i < nElems; i++) for (unsigned i = 0; i < nElems; i++)
oss << elements[i]->getValue() << " "; oss << elements[i]->getValue() << " ";
......
...@@ -373,6 +373,7 @@ int RapidVtuInterface::write(std::ostream& stream) ...@@ -373,6 +373,7 @@ int RapidVtuInterface::write(std::ostream& stream)
celldata_node->append_attribute(_doc->allocate_attribute("Scalars", "MaterialIDs")); celldata_node->append_attribute(_doc->allocate_attribute("Scalars", "MaterialIDs"));
std::stringstream oss(std::stringstream::out); std::stringstream oss(std::stringstream::out);
oss.precision(stream.precision());
oss << std::endl << data_array_indent; oss << std::endl << data_array_indent;
for (unsigned i=0; i<nElems; i++) for (unsigned i=0; i<nElems; i++)
oss << elements[i]->getValue() << " "; oss << elements[i]->getValue() << " ";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment