#include "gtest/gtest.h"
#include <Eigen/Geometry>
TEST(Domains, NormalTest3D) {
Eigen::Matrix<double, 3, 2> J;
J.col(1) =
Vec3d(0.5, 0.5, 0);
J.col(0) =
Vec3d(1, 0.5, 0);
Vec3d normal = -J.col(0).cross(J.col(1));
normal.normalize();
EXPECT_LT((normal - normal2).norm(), 1e-15);
}
TEST(Domains, NormalTest1Dto3D) {
Eigen::Matrix<double, 3, 1> J;
J.col(0) =
Vec3d(0.5, 0.5, 0);
EXPECT_LT(std::abs(normal.dot(J.col(0))), 1e-15);
}
TEST(Domains, NormalTest2D) {
Eigen::Matrix<double, 2, 1> J;
J << 0.1, 2.3;
Vec2d normal(J(1), -J(0)); normal.normalize();
EXPECT_LT((normal - normal2).norm(), 1e-15);
}
}