24 const Real start_r = (nrings - 1) * pitch;
26 const Real startx = start_r * std::cos(theta0);
27 const Real starty = start_r * std::sin(theta0);
28 for (
int i = 0; i < nrings; i++)
30 int n_rods_in_row = nrings + i;
31 const Real
y = starty - i * pitch * std::sin(theta0);
32 const Real x_row = startx + i * pitch * std::cos(theta0);
33 for (
int j = 0; j < n_rods_in_row; j++)
35 const Real
x = x_row + j * pitch;
68TEST(MeshTests, triRodCoordinates)
75 std::vector<Point> positions;
77 std::sort(positions.begin(), positions.end(),
pointLess);
79 std::vector<Point> positions2;
81 std::sort(positions2.begin(), positions2.end(),
pointLess);
83 ASSERT_EQ(positions.size(), positions2.size());
85 std::stringstream msg;
86 for (
size_t i = 0; i < positions.size(); i++)
87 if (!positions[i].absolute_fuzzy_equals(positions2[i]))
88 msg <<
"point " << i + 1 <<
" differs: " << positions[i] <<
" != " << positions2[i] <<
"\n";
90 if (msg.str().size() > 0)
static void pinPositions(std::vector< Point > &positions, unsigned int nrings, Real pitch, Point center)
Calculates and stores the pin positions/centers for a hexagonal assembly containing the given number ...