Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f8c5f92
fix distortion in projection plots
gridley Aug 14, 2023
62be490
refactor projectionplot to inherit from raytraceplot
gridley Aug 15, 2023
8def766
implement phong plotting
gridley Aug 17, 2023
c9eeb3f
factor out geometry info from particle to geometron
gridley Aug 17, 2023
30b6be6
factor particle geometry state out into Geometron
gridley Aug 18, 2023
5e0554c
remove unnecessary include
gridley Aug 21, 2023
7010b92
use geometron in plotting
gridley Aug 21, 2023
210d351
move plot ray tracing logic to Ray class
gridley Aug 21, 2023
f2e13fb
initial pass at moving raytracing logic to its own class
gridley Aug 22, 2023
f2553d3
bugfix
gridley Aug 22, 2023
f82b538
actually kinda works now
gridley Aug 22, 2023
e2d9502
typo fix
gridley Aug 23, 2023
ee35d76
correct handling of normal vectors
gridley Aug 23, 2023
be8d6fa
fix ParticleLost exception message, add stop() to Ray
gridley Aug 23, 2023
4c96aeb
pass in verbosity in plotting
gridley Aug 23, 2023
1a79ea9
produces nice images now
gridley Aug 23, 2023
abd0e97
update plot test
gridley Aug 23, 2023
7c6f2f6
use r_local for surface normal
gridley Aug 26, 2023
a39322d
add phong plot to python API
gridley Aug 27, 2023
7853945
finish phong python API
gridley Aug 27, 2023
fdf7c75
group dagmc vars
gridley Sep 9, 2023
072e352
more helpful ParticleLost message
gridley Sep 9, 2023
da09424
simplify omp scheduling in phongplot
gridley Sep 9, 2023
d140f74
address review comments
gridley Sep 9, 2023
86e6596
fix fmt arguments in ray loss
gridley Sep 9, 2023
d1ddaf7
update ray trace plot test
gridley Sep 9, 2023
8930f5d
pass geometron pointer for dagmc surface reflections
gridley Sep 9, 2023
ba824dd
accept all plot types in openmc.model(plots=
gridley Sep 20, 2023
748cf37
add phong plot handling for an edge case on hex lattices
gridley Sep 20, 2023
e938418
try to please cpplinter
gridley Oct 4, 2023
3be30a3
more palatable error handling
gridley Oct 5, 2023
ef6709e
make mark_as_lost virtual
gridley Oct 5, 2023
51f3e9e
fix comment
gridley Oct 5, 2023
c696065
My additions to RT
pshriwise Sep 5, 2023
c784767
Removing commented code
pshriwise Oct 5, 2023
e7cba18
Fixup after rebase
pshriwise Oct 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions include/openmc/cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ constexpr int32_t OP_UNION {std::numeric_limits<int32_t>::max() - 4};
//==============================================================================

class Cell;
class Geometron;
class ParentCell;
class CellInstance;
class Universe;
Expand Down Expand Up @@ -82,7 +83,7 @@ class Region {

//! Find the oncoming boundary of this cell.
std::pair<double, int32_t> distance(
Position r, Direction u, int32_t on_surface, Particle* p) const;
Position r, Direction u, int32_t on_surface) const;

//! Get the BoundingBox for this cell.
BoundingBox bounding_box(int32_t cell_id) const;
Expand Down Expand Up @@ -114,7 +115,7 @@ class Region {
//!
//! Uses the comobination of half-spaces and binary operators to determine
//! if short circuiting can be used. Short cicuiting uses the relative and
//! absolute depth of parenthases in the expression.
//! absolute depth of parentheses in the expression.
bool contains_complex(Position r, Direction u, int32_t on_surface) const;

//! BoundingBox if the paritcle is in a simple cell.
Expand Down Expand Up @@ -183,7 +184,7 @@ class Cell {

//! Find the oncoming boundary of this cell.
virtual std::pair<double, int32_t> distance(
Position r, Direction u, int32_t on_surface, Particle* p) const = 0;
Position r, Direction u, int32_t on_surface, Geometron* p) const = 0;

//! Write all information needed to reconstruct the cell to an HDF5 group.
//! \param group_id An HDF5 group id.
Expand Down Expand Up @@ -260,7 +261,7 @@ class Cell {
//! \param[in] instance of the cell to find parent cells for
//! \param[in] p particle used to do a fast search for parent cells
//! \return parent cells
vector<ParentCell> find_parent_cells(int32_t instance, Particle& p) const;
vector<ParentCell> find_parent_cells(int32_t instance, Geometron& p) const;

//! Determine the path to this cell instance in the geometry hierarchy
//! \param[in] instance of the cell to find parent cells for
Expand Down Expand Up @@ -333,9 +334,9 @@ class CSGCell : public Cell {
vector<int32_t> surfaces() const override { return region_.surfaces(); }

std::pair<double, int32_t> distance(
Position r, Direction u, int32_t on_surface, Particle* p) const override
Position r, Direction u, int32_t on_surface, Geometron* p) const override
{
return region_.distance(r, u, on_surface, p);
return region_.distance(r, u, on_surface);
}

bool contains(Position r, Direction u, int32_t on_surface) const override
Expand Down
6 changes: 3 additions & 3 deletions include/openmc/dagmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DAGSurface : public Surface {
double evaluate(Position r) const override;
double distance(Position r, Direction u, bool coincident) const override;
Direction normal(Position r) const override;
Direction reflect(Position r, Direction u, Particle* p) const override;
Direction reflect(Position r, Direction u, Geometron* p) const override;

inline void to_hdf5_inner(hid_t group_id) const override {};

Expand All @@ -60,7 +60,7 @@ class DAGCell : public Cell {
bool contains(Position r, Direction u, int32_t on_surface) const override;

std::pair<double, int32_t> distance(
Position r, Direction u, int32_t on_surface, Particle* p) const override;
Position r, Direction u, int32_t on_surface, Geometron* p) const override;

BoundingBox bounding_box() const override;

Expand Down Expand Up @@ -129,7 +129,7 @@ class DAGUniverse : public Universe {
//! string of the ID ranges for entities of dimension \p dim
std::string dagmc_ids_for_dim(int dim) const;

bool find_cell(Particle& p) const override;
bool find_cell(Geometron& p) const override;

void to_hdf5(hid_t universes_group) const override;

Expand Down
16 changes: 9 additions & 7 deletions include/openmc/geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace openmc {

class BoundaryInfo;
class Particle;
class Geometron;

//==============================================================================
// Global variables
Expand Down Expand Up @@ -39,7 +39,7 @@ inline bool coincident(double d1, double d2)
//! Check for overlapping cells at a particle's position.
//==============================================================================

bool check_cell_overlap(Particle& p, bool error = true);
bool check_cell_overlap(Geometron& p, bool error = true);

//==============================================================================
//! Get the cell instance for a particle at the specified universe level
Expand All @@ -50,7 +50,7 @@ bool check_cell_overlap(Particle& p, bool error = true);
//! should be computed. \return The instance of the cell at the specified level.
//==============================================================================

int cell_instance_at_level(const Particle& p, int level);
int cell_instance_at_level(const Geometron& p, int level);

//==============================================================================
//! Locate a particle in the geometry tree and set its geometry data fields.
Expand All @@ -60,20 +60,22 @@ int cell_instance_at_level(const Particle& p, int level);
//! \return True if the particle's location could be found and ascribed to a
//! valid geometry coordinate stack.
//==============================================================================
bool exhaustive_find_cell(Particle& p);
bool neighbor_list_find_cell(Particle& p); // Only usable on surface crossings
bool exhaustive_find_cell(Geometron& p, bool verbose = false);
bool neighbor_list_find_cell(
Geometron& p, bool verbose = false); // Only usable on surface crossings

//==============================================================================
//! Move a particle into a new lattice tile.
//==============================================================================

void cross_lattice(Particle& p, const BoundaryInfo& boundary);
void cross_lattice(
Geometron& p, const BoundaryInfo& boundary, bool verbose = false);

//==============================================================================
//! Find the next boundary a particle will intersect.
//==============================================================================

BoundaryInfo distance_to_boundary(Particle& p);
BoundaryInfo distance_to_boundary(Geometron& p);

} // namespace openmc

Expand Down
6 changes: 3 additions & 3 deletions include/openmc/particle.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ class Particle : public ParticleData {

//! mark a particle as lost and create a particle restart file
//! \param message A warning message to display
void mark_as_lost(const char* message);
virtual void mark_as_lost(const char* message) override;

void mark_as_lost(const std::string& message)
virtual void mark_as_lost(const std::string& message) override
{
mark_as_lost(message.c_str());
}

void mark_as_lost(const std::stringstream& message)
virtual void mark_as_lost(const std::stringstream& message) override
{
mark_as_lost(message.str());
}
Expand Down
Loading