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

Method read_information

cpp/dolfinx/io/XDMFFile.cpp:456–471  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

454}
455//-----------------------------------------------------------------------------
456std::string XDMFFile::read_information(const std::string& name,
457 const std::string& xpath)
458{
459 pugi::xml_node node = _xml_doc->select_node(xpath.c_str()).node();
460 if (!node)
461 throw std::runtime_error("XML node '" + xpath + "' not found.");
462 pugi::xml_node info_node
463 = node.select_node(("Information[@Name='" + name + "']").c_str()).node();
464 if (!info_node)
465 throw std::runtime_error("<Information> with name '" + name
466 + "' not found.");
467
468 // Read data and trim any leading/trailing whitespace
469 std::string value_str = info_node.attribute("Value").as_string();
470 return value_str;
471}
472//-----------------------------------------------------------------------------
473void XDMFFile::flush()
474{

Callers 1

test_3dFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_3dFunction · 0.64