LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
refinement_pattern.cc
1/***************************************************************************
2 * LehrFEM++ - A simple C++ finite element libray for teaching
3 * Developed from 2018 at the Seminar of Applied Mathematics of ETH Zurich,
4 * lead developers Dr. R. Casagrande and Prof. R. Hiptmair
5 ***************************************************************************/
6
15#include "refinement_pattern.h"
16
17namespace lf::geometry {
19 const Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic> &polygon) {
20 LF_ASSERT_MSG(polygon.rows() == 2, "Only planar polygons supported");
21 // A parallelogram must have four vertices
22 if (polygon.cols() != 4) {
23 return false;
24 }
25 return ((polygon * (Eigen::Vector4i() << 1, -1, 1, -1).finished())
26 .squaredNorm() == 0);
27}
28} // namespace lf::geometry
Defines the Geometry interface and provides a number of classes that implement this interface + addit...
Definition compose.h:13
bool isParallelogram(const Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic > &polygon)
Test whether a lattice polygon describes a logical parallelogram.