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

Function get_counter

cpp/dolfinx/io/VTKFile.cpp:39–49  ·  view source on GitHub ↗

Get counter string to include in filename

Source from the content-addressed store, hash-verified

37
38/// Get counter string to include in filename
39std::string get_counter(const pugi::xml_node& node, const std::string& name)
40{
41 // Count number of entries
42 const size_t n = std::distance(node.children(name.c_str()).begin(),
43 node.children(name.c_str()).end());
44
45 // Compute counter string
46 constexpr int num_digits = 6;
47 std::string counter = std::to_string(n);
48 return std::string(num_digits - counter.size(), '0').append(counter);
49}
50//----------------------------------------------------------------------------
51
52/// Convert a container to a std::stringstream

Callers 2

write_functionFunction · 0.85
writeMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected