Commit 3c8ae761 authored by Kendrick, Coleman's avatar Kendrick, Coleman
Browse files

clang formatting

parent c0072e10
......@@ -1008,7 +1008,7 @@ public:
void testTracksForFlatPlate() {
// Flat plate centered at origin, 5 mm x 5 mm x 2 mm
// Thin side of plate (2mm) is facing the beam
constexpr double WIDTH{0.005}; // along x axis
constexpr double WIDTH{0.005}; // along x axis
constexpr double LENGTH{0.005}; // along y axis
constexpr double HEIGHT{0.002}; // along z axis
......@@ -1016,12 +1016,13 @@ public:
// This puts the thin side facing the +x axis
constexpr V3D BEAM_DIRECTION{1.0, 0.0, 0.0};
auto plate = ComponentCreationHelper::createCuboid(0.5*WIDTH, 0.5*LENGTH, 0.5*HEIGHT, 0.0, BEAM_DIRECTION);
auto plate = ComponentCreationHelper::createCuboid(
0.5 * WIDTH, 0.5 * LENGTH, 0.5 * HEIGHT, 0.0, BEAM_DIRECTION);
// Test center of plate
Track origin(V3D{0.0, 0.0, 0.0}, BEAM_DIRECTION);
plate->interceptSurface(origin);
TS_ASSERT_EQUALS(origin.totalDistInsideObject(), WIDTH*0.5);
TS_ASSERT_EQUALS(origin.totalDistInsideObject(), WIDTH * 0.5);
Track front_midpoint(V3D{0.25 * WIDTH, 0.0, 0.0}, BEAM_DIRECTION);
plate->interceptSurface(front_midpoint);
......@@ -1034,26 +1035,30 @@ public:
// Repeat above tests but shift plate to the midpoint along the +y axis
Track yshifted(V3D{0.0, 0.25 * LENGTH, 0.0}, BEAM_DIRECTION);
plate->interceptSurface(yshifted);
TS_ASSERT_EQUALS(yshifted.totalDistInsideObject(), WIDTH*0.5);
TS_ASSERT_EQUALS(yshifted.totalDistInsideObject(), WIDTH * 0.5);
front_midpoint = Track(V3D{0.25 * WIDTH, 0.25 * LENGTH, 0.0}, BEAM_DIRECTION);
front_midpoint =
Track(V3D{0.25 * WIDTH, 0.25 * LENGTH, 0.0}, BEAM_DIRECTION);
plate->interceptSurface(front_midpoint);
TS_ASSERT_EQUALS(front_midpoint.totalDistInsideObject(), 0.25 * WIDTH);
back_midpoint = Track(V3D{-0.25 * WIDTH, 0.25 * LENGTH, 0.0}, BEAM_DIRECTION);
back_midpoint =
Track(V3D{-0.25 * WIDTH, 0.25 * LENGTH, 0.0}, BEAM_DIRECTION);
plate->interceptSurface(back_midpoint);
TS_ASSERT_EQUALS(back_midpoint.totalDistInsideObject(), 0.75 * WIDTH);
// shift plate to the midpoint along the +z axis
Track zshifted(V3D{0.0, 0.0, 0.25 * HEIGHT}, BEAM_DIRECTION);
plate->interceptSurface(zshifted);
TS_ASSERT_EQUALS(zshifted.totalDistInsideObject(), WIDTH*0.5);
TS_ASSERT_EQUALS(zshifted.totalDistInsideObject(), WIDTH * 0.5);
front_midpoint = Track(V3D{0.25 * WIDTH, 0.0, 0.25 * HEIGHT}, BEAM_DIRECTION);
front_midpoint =
Track(V3D{0.25 * WIDTH, 0.0, 0.25 * HEIGHT}, BEAM_DIRECTION);
plate->interceptSurface(front_midpoint);
TS_ASSERT_EQUALS(front_midpoint.totalDistInsideObject(), 0.25 * WIDTH);
back_midpoint = Track(V3D{-0.25 * WIDTH, 0.0, 0.25 * HEIGHT}, BEAM_DIRECTION);
back_midpoint =
Track(V3D{-0.25 * WIDTH, 0.0, 0.25 * HEIGHT}, BEAM_DIRECTION);
plate->interceptSurface(back_midpoint);
TS_ASSERT_EQUALS(back_midpoint.totalDistInsideObject(), 0.75 * WIDTH);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment