Skip to content

Commit

Permalink
Merge pull request openmc-dev#1216 from dryuri92/newhex
Browse files Browse the repository at this point in the history
Support different orientations for hexagonal lattices
  • Loading branch information
smharper authored Jun 17, 2019
2 parents 1f44d74 + ba641c5 commit 2c0b16e
Show file tree
Hide file tree
Showing 12 changed files with 1,037 additions and 142 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*.pyc

# Python distribution
.settings/
dist/
openmc.egg-info/

Expand Down
7 changes: 7 additions & 0 deletions docs/source/io_formats/geometry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,13 @@ the following attributes or sub-elements:

*Default*: None

:orientation:
The orientation of the hexagonal lattice. The string "x" indicates that two
sides of the lattice are parallel to the x-axis, whereas the string "y"
indicates that two sides are parallel to the y-axis.

*Default*: "y"

:center:
The coordinates of the center of the lattice. If the lattice does not have
axial sections then only the x- and y-coordinates are specified.
Expand Down
13 changes: 13 additions & 0 deletions include/openmc/lattice.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum class LatticeType {
rect, hex
};


//==============================================================================
// Global variables
//==============================================================================
Expand Down Expand Up @@ -265,8 +266,20 @@ class HexLattice : public Lattice
void to_hdf5_inner(hid_t group_id) const;

private:
enum class Orientation {
y, //!< Flat side of lattice parallel to y-axis
x //!< Flat side of lattice parallel to x-axis
};

//! Fill universes_ vector for 'y' orientation
void fill_lattice_y(const std::vector<std::string>& univ_words);

//! Fill universes_ vector for 'x' orientation
void fill_lattice_x(const std::vector<std::string>& univ_words);

int n_rings_; //!< Number of radial tile positions
int n_axial_; //!< Number of axial tile positions
Orientation orientation_; //!< Orientation of lattice
Position center_; //!< Global center of lattice
std::array<double, 2> pitch_; //!< Lattice tile width and height
};
Expand Down
Loading

0 comments on commit 2c0b16e

Please sign in to comment.