Skip to content

Commit 995f1ea

Browse files
apply style locally
1 parent 47c9ac3 commit 995f1ea

File tree

3 files changed

+32
-29
lines changed

3 files changed

+32
-29
lines changed

include/openmc/boundary_condition.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,18 @@ class RotationalPeriodicBC : public PeriodicBC {
145145
public:
146146
enum PeriodicAxis { x, y, z };
147147
RotationalPeriodicBC(int i_surf, int j_surf, PeriodicAxis axis = z);
148-
float compute_periodic_rotation(float rise_1, float run_1, float rise_2, float run_2) const;
148+
float compute_periodic_rotation(
149+
float rise_1, float run_1, float rise_2, float run_2) const;
149150
void handle_particle(Particle& p, const Surface& surf) const override;
150151

151152
protected:
152153
//! Angle about the axis by which particle coordinates will be rotated
153154
double angle_;
154-
//! 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
155+
//! Ensure that choice of axes is right handed. axis_1_idx_ corresponds to the
156+
//! independent axis and axis_2_idx_ corresponds to the dependent axis in the
157+
//! 2D plane perpendicular to the planes' axis of rotation
155158
int zero_axis_idx;
156-
int axis_1_idx_;
159+
int axis_1_idx_;
157160
int axis_2_idx_;
158161
};
159162

openmc/surface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class Surface(IDManagerMixin, ABC):
124124
Boundary condition that defines the behavior for particles hitting the
125125
surface. Defaults to transmissive boundary condition where particles
126126
freely pass through the surface. Note that only axis-aligned
127-
periodicity is supported periodic around the o x-, y-, and z-axes.
127+
periodicity is supported periodic around the x-, y-, and z-axes.
128128
albedo : float, optional
129129
Albedo of the surfaces as a ratio of particle weight after interaction
130130
with the surface to the initial weight. Values must be positive. Only

src/boundary_condition.cpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -158,35 +158,35 @@ void TranslationalPeriodicBC::handle_particle(
158158
// RotationalPeriodicBC implementation
159159
//==============================================================================
160160

161-
RotationalPeriodicBC::RotationalPeriodicBC(int i_surf, int j_surf, PeriodicAxis axis)
161+
RotationalPeriodicBC::RotationalPeriodicBC(
162+
int i_surf, int j_surf, PeriodicAxis axis)
162163
: PeriodicBC(i_surf, j_surf)
163164
{
164165
Surface& surf1 {*model::surfaces[i_surf_]};
165166
Surface& surf2 {*model::surfaces[j_surf_]};
166167

167168
// below convention for right handed coordinate system
168-
switch(axis) {
169-
case x:
170-
zero_axis_idx = 0; // x component of plane must be zero
171-
axis_1_idx_ = 1; // y component independent
172-
axis_2_idx_ = 2; // z component dependent
173-
break;
174-
case y:
175-
zero_axis_idx = 1; // y component of plane must be zero
176-
axis_1_idx_ = 2; // z component independent
177-
axis_2_idx_ = 0; // x component dependent
178-
break;
179-
case z:
180-
zero_axis_idx = 2; // z component of plane must be zero
181-
axis_1_idx_ = 0; // x component independent
182-
axis_2_idx_ = 1; // y component dependent
183-
break;
184-
default:
185-
throw std::invalid_argument(
186-
fmt::format("You've specified an axis that is not x, y, or z."));
169+
switch (axis) {
170+
case x:
171+
zero_axis_idx = 0; // x component of plane must be zero
172+
axis_1_idx_ = 1; // y component independent
173+
axis_2_idx_ = 2; // z component dependent
174+
break;
175+
case y:
176+
zero_axis_idx = 1; // y component of plane must be zero
177+
axis_1_idx_ = 2; // z component independent
178+
axis_2_idx_ = 0; // x component dependent
179+
break;
180+
case z:
181+
zero_axis_idx = 2; // z component of plane must be zero
182+
axis_1_idx_ = 0; // x component independent
183+
axis_2_idx_ = 1; // y component dependent
184+
break;
185+
default:
186+
throw std::invalid_argument(
187+
fmt::format("You've specified an axis that is not x, y, or z."));
187188
}
188189

189-
190190
// Compute the surface normal vectors and make sure they are perpendicular
191191
// to the correct axis
192192
Direction norm1 = surf1.normal({0, 0, 0});
@@ -276,10 +276,10 @@ void RotationalPeriodicBC::handle_particle(
276276
Direction u = p.u();
277277
double cos_theta = std::cos(theta);
278278
double sin_theta = std::sin(theta);
279-
Position new_r = {
280-
cos_theta * r[axis_1_idx_] - sin_theta * r[axis_2_idx_], sin_theta * r[axis_1_idx_] + cos_theta * r[axis_2_idx_], r[zero_axis_idx]};
281-
Direction new_u = {
282-
cos_theta * u[axis_1_idx_] - sin_theta * u[axis_2_idx_], sin_theta * u[axis_1_idx_] + cos_theta * u[axis_2_idx_], u[zero_axis_idx]};
279+
Position new_r = {cos_theta * r[axis_1_idx_] - sin_theta * r[axis_2_idx_],
280+
sin_theta * r[axis_1_idx_] + cos_theta * r[axis_2_idx_], r[zero_axis_idx]};
281+
Direction new_u = {cos_theta * u[axis_1_idx_] - sin_theta * u[axis_2_idx_],
282+
sin_theta * u[axis_1_idx_] + cos_theta * u[axis_2_idx_], u[zero_axis_idx]};
283283

284284
// Handle the effects of the surface albedo on the particle's weight.
285285
BoundaryCondition::handle_albedo(p, surf);

0 commit comments

Comments
 (0)