MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / write_information

Method write_information

cpp/dolfinx/io/XDMFFile.cpp:438–454  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

436}
437//-----------------------------------------------------------------------------
438void 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//-----------------------------------------------------------------------------
456std::string XDMFFile::read_information(const std::string& name,
457 const std::string& xpath)

Callers 1

test_3dFunction · 0.80

Calls 1

commMethod · 0.45

Tested by 1

test_3dFunction · 0.64