• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmc-dev / openmc / 6580456192

19 Oct 2023 09:29PM UTC coverage: 84.49% (-0.1%) from 84.617%
6580456192

push

github

web-flow
Property name swap for points in local mesh coordinates (#2732)

8 of 8 new or added lines in 1 file covered. (100.0%)

61 existing lines in 10 files now uncovered.

46945 of 55563 relevant lines covered (84.49%)

84839400.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/include/openmc/xml_interface.h
1
#ifndef OPENMC_XML_INTERFACE_H
2
#define OPENMC_XML_INTERFACE_H
3

4
#include <cstddef> // for size_t
5
#include <sstream> // for stringstream
6
#include <string>
7

8
#include "pugixml.hpp"
9
#include "xtensor/xadapt.hpp"
10
#include "xtensor/xarray.hpp"
11

12
#include "openmc/position.h"
13
#include "openmc/vector.h"
14

15
namespace openmc {
16

17
inline bool check_for_node(pugi::xml_node node, const char* name)
18
{
19
  return node.attribute(name) || node.child(name);
×
20
}
21

22
std::string get_node_value(pugi::xml_node node, const char* name,
23
  bool lowercase = false, bool strip = false);
24

25
bool get_node_value_bool(pugi::xml_node node, const char* name);
26

27
template<typename T>
28
vector<T> get_node_array(
×
29
  pugi::xml_node node, const char* name, bool lowercase = false)
30
{
31
  // Get value of node attribute/child
32
  std::string s {get_node_value(node, name, lowercase)};
×
33

34
  // Read values one by one into vector
35
  std::stringstream iss {s};
×
UNCOV
36
  T value;
×
37
  vector<T> values;
×
38
  while (iss >> value)
×
39
    values.push_back(value);
×
40

41
  return values;
×
42
}
UNCOV
43

×
44
template<typename T>
45
xt::xarray<T> get_node_xarray(
46
  pugi::xml_node node, const char* name, bool lowercase = false)
UNCOV
47
{
×
48
  vector<T> v = get_node_array<T>(node, name, lowercase);
49
  vector<std::size_t> shape = {v.size()};
UNCOV
50
  return xt::adapt(v, shape);
×
UNCOV
51
}
×
UNCOV
52

×
UNCOV
53
Position get_node_position(
×
UNCOV
54
  pugi::xml_node node, const char* name, bool lowercase = false);
×
55

UNCOV
56
} // namespace openmc
×
57
#endif // OPENMC_XML_INTERFACE_H
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc