-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into transient
- Loading branch information
Showing
94 changed files
with
3,708 additions
and
1,493 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#ifndef OPENMC_BOUNDING_BOX_H | ||
#define OPENMC_BOUNDING_BOX_H | ||
|
||
#include <algorithm> // for min, max | ||
|
||
#include "openmc/constants.h" | ||
|
||
namespace openmc { | ||
|
||
//============================================================================== | ||
//! Coordinates for an axis-aligned cuboid that bounds a geometric object. | ||
//============================================================================== | ||
|
||
struct BoundingBox { | ||
double xmin = -INFTY; | ||
double xmax = INFTY; | ||
double ymin = -INFTY; | ||
double ymax = INFTY; | ||
double zmin = -INFTY; | ||
double zmax = INFTY; | ||
|
||
inline BoundingBox operator&(const BoundingBox& other) | ||
{ | ||
BoundingBox result = *this; | ||
return result &= other; | ||
} | ||
|
||
inline BoundingBox operator|(const BoundingBox& other) | ||
{ | ||
BoundingBox result = *this; | ||
return result |= other; | ||
} | ||
|
||
// intersect operator | ||
inline BoundingBox& operator&=(const BoundingBox& other) | ||
{ | ||
xmin = std::max(xmin, other.xmin); | ||
xmax = std::min(xmax, other.xmax); | ||
ymin = std::max(ymin, other.ymin); | ||
ymax = std::min(ymax, other.ymax); | ||
zmin = std::max(zmin, other.zmin); | ||
zmax = std::min(zmax, other.zmax); | ||
return *this; | ||
} | ||
|
||
// union operator | ||
inline BoundingBox& operator|=(const BoundingBox& other) | ||
{ | ||
xmin = std::min(xmin, other.xmin); | ||
xmax = std::max(xmax, other.xmax); | ||
ymin = std::min(ymin, other.ymin); | ||
ymax = std::max(ymax, other.ymax); | ||
zmin = std::min(zmin, other.zmin); | ||
zmax = std::max(zmax, other.zmax); | ||
return *this; | ||
} | ||
}; | ||
|
||
} // namespace openmc | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.