9#include "check_jacobian_inverse_gramian.h"
11#include <gtest/gtest.h>
18 const Eigen::MatrixXd &eval_points) {
19 const size_t num_points = eval_points.cols();
20 const size_t dim_local = geom.
DimLocal();
21 const size_t dim_global = geom.
DimGlobal();
23 Eigen::MatrixXd jacobians = geom.
Jacobian(eval_points);
26 EXPECT_EQ(jacInvGrams.rows(), dim_global)
27 <<
"JacobianInverseGramian has " << jacInvGrams.rows()
28 <<
" rows instead of " << dim_global;
29 EXPECT_EQ(jacInvGrams.cols(), num_points * dim_local)
30 <<
"JacobianInverseGramian has " << jacInvGrams.cols()
31 <<
" cols instead of " << num_points * dim_local;
33 for (
int j = 0; j < num_points; ++j) {
34 Eigen::MatrixXd jacInvGram =
35 jacInvGrams.block(0, j * dim_local, dim_global, dim_local);
36 Eigen::MatrixXd jacobian =
37 jacobians.block(0, j * dim_local, dim_global, dim_local);
39 EXPECT_TRUE(jacInvGram.isApprox(
40 jacobian * (jacobian.transpose() * jacobian).inverse()))
41 <<
"JacobianInverseGramian incorrect at point " << eval_points.col(j);
Interface class for shape information on a mesh cell in the spirit of parametric finite element metho...
virtual dim_t DimLocal() const =0
Dimension of the domain of this mapping.
virtual dim_t DimGlobal() const =0
Dimension of the image of this mapping.
virtual Eigen::MatrixXd JacobianInverseGramian(const Eigen::MatrixXd &local) const =0
Evaluate the Jacobian * Inverse Gramian ( ) simultaneously at numPoints.
virtual Eigen::MatrixXd Jacobian(const Eigen::MatrixXd &local) const =0
Evaluate the jacobian of the mapping simultaneously at numPoints points.
Defines the Geometry::test_utils module and provides a number of test functions to check geometry obj...
void checkJacobianInverseGramian(const lf::geometry::Geometry &geom, const Eigen::MatrixXd &eval_points)
Checks if JacobianInverseGramian() is implemented correctly assuming that Jacobian() is correct.