https://mooseframework.inl.gov
Functions
TestTHMUtils.C File Reference

Go to the source code of this file.

Functions

 TEST (NumericsTest, computeOrthogonalDirections_x_aligned)
 
 TEST (NumericsTest, computeOrthogonalDirections_skew)
 

Function Documentation

◆ TEST() [1/2]

TEST ( NumericsTest  ,
computeOrthogonalDirections_x_aligned   
)

Definition at line 16 of file TestTHMUtils.C.

17 {
18  const RealVectorValue n(-2, 0, 0);
19  RealVectorValue t1, t2;
21 
22  EXPECT_TRUE(MooseUtils::absoluteFuzzyEqual(t1.norm(), 1));
23  EXPECT_TRUE(MooseUtils::absoluteFuzzyEqual(t2.norm(), 1));
24  EXPECT_TRUE(MooseUtils::absoluteFuzzyEqual(t1 * n, 0));
25  EXPECT_TRUE(MooseUtils::absoluteFuzzyEqual(t2 * n, 0));
26  EXPECT_TRUE(MooseUtils::absoluteFuzzyEqual(t1 * t2, 0));
27 }
auto norm() const -> decltype(std::norm(Real()))
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
void computeOrthogonalDirections(const RealVectorValue &n_unnormalized, RealVectorValue &t1, RealVectorValue &t2)
Computes two unit vectors orthogonal to the given vector.
Definition: THMUtils.C:22

◆ TEST() [2/2]

TEST ( NumericsTest  ,
computeOrthogonalDirections_skew   
)

Definition at line 29 of file TestTHMUtils.C.

30 {
31  const RealVectorValue n(1, 2, 3);
32  RealVectorValue t1, t2;
34 
35  EXPECT_TRUE(MooseUtils::absoluteFuzzyEqual(t1.norm(), 1));
36  EXPECT_TRUE(MooseUtils::absoluteFuzzyEqual(t2.norm(), 1));
37  EXPECT_TRUE(MooseUtils::absoluteFuzzyEqual(t1 * n, 0));
38  EXPECT_TRUE(MooseUtils::absoluteFuzzyEqual(t2 * n, 0));
39  EXPECT_TRUE(MooseUtils::absoluteFuzzyEqual(t1 * t2, 0));
40 }
auto norm() const -> decltype(std::norm(Real()))
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
void computeOrthogonalDirections(const RealVectorValue &n_unnormalized, RealVectorValue &t1, RealVectorValue &t2)
Computes two unit vectors orthogonal to the given vector.
Definition: THMUtils.C:22