LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
refinement_pattern.h
1
9#ifndef INCG3178e8d1e7bf4366bcb00cdb4ebbf5fb
10#define INCG3178e8d1e7bf4366bcb00cdb4ebbf5fb
11#include <utility>
12
13#include "lf/base/base.h"
14
15namespace lf::geometry {
16
34 protected:
39
40 public:
48 : ref_el_(std::move(ref_el)), lattice_const_(6) {}
49
57 : ref_el_(std::move(ref_el)), lattice_const_(lattice_const) {
58 // Lattice constant N should be a multiple of six in order to be able to
59 // define both the barycenter (lattice coordinates [N/3,N/3,N/3], and
60 // the midpoints of edges. (lattice coordinates e.g. [N/2,N/2,0]).
61 // Of course all lattice coordinates must be integers and must add up to N.
62 LF_VERIFY_MSG(lattice_const % 6 == 0,
63 "Lattice constant should be multiple of 6");
64 }
65
68 [[nodiscard]] lf::base::RefEl RefEl() const { return ref_el_; }
70 [[nodiscard]] lf::base::size_type LatticeConst() const {
71 return lattice_const_;
72 }
77 [[nodiscard]] virtual lf::base::size_type NumChildren(
78 lf::base::dim_t codim) const = 0;
109 [[nodiscard]] virtual std::vector<
110 Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic>>
112
113 virtual ~RefinementPattern() = default;
114
115 protected:
116 // TODO(craffael): make this a pure virtual base class
117 // NOLINTNEXTLINE
119 // NOLINTNEXTLINE
121};
122
133bool isParallelogram(
134 const Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic>& polygon);
135
136} // namespace lf::geometry
137
138#endif // INCG3178e8d1e7bf4366bcb00cdb4ebbf5fb
Represents a reference element with all its properties.
Definition ref_el.h:109
Abstract interface class for encoding topological local refinement
RefinementPattern & operator=(const RefinementPattern &)=default
virtual ~RefinementPattern()=default
lf::base::size_type LatticeConst() const
Provides information about lattice constant used.
virtual lf::base::size_type NumChildren(lf::base::dim_t codim) const =0
provide number of child entities of a given co-dimension to be created by refinement
RefinementPattern(RefinementPattern &&)=default
RefinementPattern(const RefinementPattern &)=default
virtual std::vector< Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic > > ChildPolygons(lf::base::dim_t codim) const =0
provide lattice reference coordinates of vertices of child polygons
RefinementPattern(lf::base::RefEl ref_el)
Constructor setting reference element = topological type of entity.
lf::base::RefEl RefEl() const
Returns topological type of entity for which the current object is set up.
RefinementPattern & operator=(RefinementPattern &&)=default
RefinementPattern(lf::base::RefEl ref_el, lf::base::size_type lattice_const)
Constructor fixing reference element and refinement resolution.
unsigned int size_type
general type for variables related to size of arrays
Definition types.h:20
unsigned int dim_t
type for dimensions and co-dimensions and numbers derived from them
Definition types.h:32
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.