-----------------------------------------------------------------------------
| 436 | } |
| 437 | //----------------------------------------------------------------------------- |
| 438 | void XDMFFile::write_information(const std::string& name, |
| 439 | const std::string& value, |
| 440 | const std::string& xpath) |
| 441 | { |
| 442 | pugi::xml_node node = _xml_doc->select_node(xpath.c_str()).node(); |
| 443 | if (!node) |
| 444 | throw std::runtime_error("XML node '" + xpath + "' not found."); |
| 445 | |
| 446 | pugi::xml_node info_node = node.append_child("Information"); |
| 447 | assert(info_node); |
| 448 | info_node.append_attribute("Name") = name.c_str(); |
| 449 | info_node.append_attribute("Value") = value.c_str(); |
| 450 | |
| 451 | // Save XML file (on process 0 only) |
| 452 | if (MPI::rank(_comm.comm()) == 0) |
| 453 | _xml_doc->save_file(_filename.c_str(), " "); |
| 454 | } |
| 455 | //----------------------------------------------------------------------------- |
| 456 | std::string XDMFFile::read_information(const std::string& name, |
| 457 | const std::string& xpath) |