LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
segment.cc
1
9#include "segment.h"
10
11#include "point.h"
12
13namespace lf::mesh::hybrid2d {
14std::span<const Entity* const> Segment::SubEntities(unsigned rel_codim) const {
15 // An impressive way to do double dereferencing!
16 auto l = [&](auto i) -> const mesh::Entity& { return **i; };
17 if (rel_codim == 1) {
18 return {reinterpret_cast<const Entity* const*>(nodes_.data()), 2};
19 }
20 // If the segment itself is requested return reference to itself
21 if (rel_codim == 0) {
22 return {&this_, 1};
23 }
24 LF_VERIFY_MSG(false, "Segment: rel_codim out of range");
25}
26} // namespace lf::mesh::hybrid2d
Interface class representing a topological entity in a cellular complex
Definition entity.h:42
std::span< const Entity *const > SubEntities(unsigned rel_codim) const override
Access to all subentities selected by relative co-dimension.
Definition segment.cc:14
std::array< const Point *, 2 > nodes_
Definition segment.h:118
An alternative implementation of a hybrid2d mesh manager that uses Pointers to store sub-entity relat...
Definition hybrid2d.h:11