Go to the source code of this file.
|
const double | tol = 1e-8 |
|
const double | eps = 1e-9 |
|
◆ pointLess()
bool pointLess |
( |
const Point & |
a, |
|
|
const Point & |
b |
|
) |
| |
Definition at line 57 of file MeshTests.C.
Referenced by TEST().
59 for (
int i = 0; i < LIBMESH_DIM; i++)
bool relativeEq(double x, double y)
◆ relativeEq()
bool relativeEq |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
Definition at line 44 of file MeshTests.C.
Referenced by pointLess().
46 if (std::abs(
x) <
eps && std::abs(
y) <
eps)
49 double diff = std::abs(
x -
y);
52 double largest = (
y >
x) ?
y :
x;
53 return diff <= largest *
tol;
const std::vector< double > y
const std::vector< double > x
◆ TEST()
TEST |
( |
MeshTests |
, |
|
|
triRodCoordinates |
|
|
) |
| |
Definition at line 68 of file MeshTests.C.
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++)
88 msg <<
"point " << i + 1 <<
" differs: " << positions[i] <<
" != " << positions2[i] <<
"\n";
90 if (msg.str().size() > 0)
void triRodPositionsRef(std::vector< Point > &positions, Real nrings, Real pitch, Point center)
bool pointLess(const Point &a, const Point &b)
static const std::string pitch
static void rodPositions(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 ...
bool absolute_fuzzy_equals(const T &var1, const T2 &var2, const Real tol=TOLERANCE *TOLERANCE)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string center
◆ triRodPositionsRef()
void triRodPositionsRef |
( |
std::vector< Point > & |
positions, |
|
|
Real |
nrings, |
|
|
Real |
pitch, |
|
|
Point |
center |
|
) |
| |
Definition at line 20 of file MeshTests.C.
Referenced by TEST().
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++)
const std::vector< double > y
const std::vector< double > x
static const std::string pitch
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
static const std::string center
◆ eps
◆ tol