Skip to content

Commit f1d71b5

Browse files
syntax corrections
1 parent 5dea22b commit f1d71b5

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

include/openmc/boundary_condition.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ class TranslationalPeriodicBC : public PeriodicBC {
143143

144144
class RotationalPeriodicBC : public PeriodicBC {
145145
public:
146-
RotationalPeriodicBC(int i_surf, int j_surf);
146+
enum PeriodicAxis { x, y, z };
147+
RotationalPeriodicBC(int i_surf, int j_surf, PeriodicAxis axis = z);
147148
float compute_periodic_rotation(float rise_1, float run_1, float rise_2, float run_2) const;
148149
void handle_particle(Particle& p, const Surface& surf) const override;
149150

150151
protected:
151152
//! Angle about the axis by which particle coordinates will be rotated
152153
double angle_;
153-
enum PeriodicAxis {x, y, z};
154154
//! Ensure that choice of axes is right handed. axis_1_idx_ corresponds to the independent axis and axis_2_idx_ corresponds to the dependent axis in the 2D plane perpendicular to the planes' axis of rotation
155155
int zero_axis_idx;
156156
int axis_1_idx_;

openmc/surface.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,8 @@ class Surface(IDManagerMixin, ABC):
123123
boundary_type : {'transmission', 'vacuum', 'reflective', 'periodic', 'white'}, optional
124124
Boundary condition that defines the behavior for particles hitting the
125125
surface. Defaults to transmissive boundary condition where particles
126-
freely pass through the surface. Note that periodic boundary conditions
127-
can only be applied to x-, y-, and z-planes, and only axis-aligned
128-
periodicity is supported.
126+
freely pass through the surface. Note that only axis-aligned
127+
periodicity is supported periodic around the o x-, y-, and z-axes.
129128
albedo : float, optional
130129
Albedo of the surfaces as a ratio of particle weight after interaction
131130
with the surface to the initial weight. Values must be positive. Only

src/boundary_condition.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ RotationalPeriodicBC::RotationalPeriodicBC(int i_surf, int j_surf, PeriodicAxis
182182
axis_2_idx_ = 1; // y component dependent
183183
break;
184184
default:
185-
throw std::invalid_argument(fmt::format("You've specified an axis {} that is not x, y, or z."),axis)
185+
throw std::invalid_argument(
186+
fmt::format("You've specified an axis that is not x, y, or z."));
186187
}
187188

188189

@@ -221,7 +222,8 @@ RotationalPeriodicBC::RotationalPeriodicBC(int i_surf, int j_surf, PeriodicAxis
221222
surf2.id_));
222223
}
223224

224-
angle_ = compute_periodic_rotation(norm1[axis_2_idx_], norm1[axis_1_idx_], norm2[axis_2_idx_], norm2[axis_1_idx_])
225+
angle_ = compute_periodic_rotation(norm1[axis_2_idx_], norm1[axis_1_idx_],
226+
norm2[axis_2_idx_], norm2[axis_1_idx_]);
225227

226228
// Warn the user if the angle does not evenly divide a circle
227229
double rem = std::abs(std::remainder((2 * PI / angle_), 1.0));

0 commit comments

Comments
 (0)