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

openmc-dev / openmc / 14386648657

10 Apr 2025 05:30PM UTC coverage: 85.118% (+0.07%) from 85.044%
14386648657

Pull #3370

github

web-flow
Merge 993e23d39 into 07f533461
Pull Request #3370: Fix negative distances from bins_crossed for CylindricalMesh

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

199 existing lines in 18 files now uncovered.

51665 of 60698 relevant lines covered (85.12%)

37166875.55 hits per line

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

0.0
/include/openmc/bounding_box.h
1
#ifndef OPENMC_BOUNDING_BOX_H
2
#define OPENMC_BOUNDING_BOX_H
3

4
#include <algorithm> // for min, max
5

6
#include "openmc/constants.h"
7
#include "openmc/position.h"
8

9
namespace openmc {
10

11
//==============================================================================
12
//! Coordinates for an axis-aligned cuboid that bounds a geometric object.
13
//==============================================================================
14

15
struct BoundingBox {
16
  double xmin = -INFTY;
17
  double xmax = INFTY;
18
  double ymin = -INFTY;
19
  double ymax = INFTY;
20
  double zmin = -INFTY;
21
  double zmax = INFTY;
22

23
  inline BoundingBox operator&(const BoundingBox& other)
24
  {
25
    BoundingBox result = *this;
26
    return result &= other;
27
  }
28

29
  inline BoundingBox operator|(const BoundingBox& other)
30
  {
31
    BoundingBox result = *this;
32
    return result |= other;
33
  }
34

35
  // intersect operator
36
  inline BoundingBox& operator&=(const BoundingBox& other)
37
  {
38
    xmin = std::max(xmin, other.xmin);
39
    xmax = std::min(xmax, other.xmax);
40
    ymin = std::max(ymin, other.ymin);
41
    ymax = std::min(ymax, other.ymax);
42
    zmin = std::max(zmin, other.zmin);
43
    zmax = std::min(zmax, other.zmax);
44
    return *this;
45
  }
46

47
  // union operator
48
  inline BoundingBox& operator|=(const BoundingBox& other)
49
  {
UNCOV
50
    xmin = std::min(xmin, other.xmin);
×
UNCOV
51
    xmax = std::max(xmax, other.xmax);
×
UNCOV
52
    ymin = std::min(ymin, other.ymin);
×
UNCOV
53
    ymax = std::max(ymax, other.ymax);
×
UNCOV
54
    zmin = std::min(zmin, other.zmin);
×
UNCOV
55
    zmax = std::max(zmax, other.zmax);
×
UNCOV
56
    return *this;
×
57
  }
58

59
  inline Position min() const { return {xmin, ymin, zmin}; }
60
  inline Position max() const { return {xmax, ymax, zmax}; }
61
};
62

63
} // namespace openmc
64

65
#endif
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