LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
check_geometry_orientation.cc
1#include "check_geometry_orientation.h"
2
3#include <gtest/gtest.h>
4
5namespace lf::mesh::test_utils {
7 using dim_t = base::RefEl::dim_t;
8 auto zero = Eigen::VectorXd::Zero(0);
9 for (dim_t i = 0; i < e.RefEl().NumNodes(); ++i) {
10 base::RefEl ref_el = e.RefEl();
11 Eigen::VectorXd coorda = e.Geometry()->Global(ref_el.NodeCoords().col(i));
12 Eigen::VectorXd coordb =
13 e.SubEntities(ref_el.Dimension())[i]->Geometry()->Global(zero);
14 for (dim_t j = 0; j < coorda.rows(); ++j) {
15 EXPECT_EQ(coorda(j), coordb(j)) << "a(" << j << ") != b(" << j << ")";
16 }
17 }
18}
19} // namespace lf::mesh::test_utils
Represents a reference element with all its properties.
Definition ref_el.h:109
unsigned int dim_t
Definition ref_el.h:132
const Eigen::MatrixXd & NodeCoords() const
Get the coordinates of the nodes of this reference element.
Definition ref_el.h:241
constexpr dim_t Dimension() const
Return the dimension of this reference element.
Definition ref_el.h:204
virtual Eigen::MatrixXd Global(const Eigen::MatrixXd &local) const =0
Map a number of points in local coordinates into the global coordinate system.
Interface class representing a topological entity in a cellular complex
Definition entity.h:42
virtual std::span< const Entity *const > SubEntities(unsigned rel_codim) const =0
Return all sub entities of this entity that have the given codimension (w.r.t. this entity!...
virtual const geometry::Geometry * Geometry() const =0
Describes the geometry of this entity.
virtual base::RefEl RefEl() const =0
Describes the reference element type of this entity.
Utilities for testing sanity of mesh data structures and tests involving meshes.
void checkGeometryOrientation(const Entity &e)
Makes sure that the coordinates of the nodes obtained through e.SubEntities()[i].Geometry() match the...