8 return coords_.col(1) * local +
coords_.col(0) * (1 - local.array()).matrix();
12 return (
coords_.col(1) -
coords_.col(0)).replicate(1, local.cols());
16 const Eigen::MatrixXd& local)
const {
20 .replicate(1, local.cols());
24 .replicate(1, local.cols());
28 const Eigen::MatrixXd& local)
const {
29 return Eigen::VectorXd::Constant(local.cols(),
35 LF_ASSERT_MSG(i == 0,
"i is out of bounds.");
36 return std::make_unique<SegmentO1>(
coords_);
39 LF_ASSERT_MSG(i >= 0 && i < 2,
"i is out of bounds.");
40 return std::make_unique<Point>(
coords_.col(i));
42 LF_VERIFY_MSG(
false,
"codim is out of bounds.");
50 LF_VERIFY_MSG((codim < 2),
"Illegal codim = " << codim);
53 const double h_lattice = 1.0 /
static_cast<double>(ref_pat.
LatticeConst());
55 std::vector<std::unique_ptr<Geometry>> child_geo_uptrs{};
58 std::vector<Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic>>
61 const int no_children = base::narrow<int>(child_polygons.size());
64 "no_children = " << no_children <<
" <-> " << ref_pat.
NumChildren(codim));
66 for (
int i = 0; i < no_children; i++) {
70 LF_VERIFY_MSG(child_polygons[i].rows() == 1,
71 "child_polygons[l].rows() = " << child_polygons[i].rows());
72 LF_VERIFY_MSG(child_polygons[i].cols() == (2 - codim),
73 "child_polygons[l].cols() = " << child_polygons[i].cols());
75 const Eigen::MatrixXd child_geo(
76 Global(h_lattice * child_polygons[i].cast<double>()));
80 child_geo_uptrs.push_back(std::make_unique<SegmentO1>(child_geo));
84 child_geo_uptrs.push_back(std::make_unique<Point>(child_geo));
88 LF_VERIFY_MSG(
false,
"codim out of bounds.");
91 return child_geo_uptrs;
static constexpr RefEl kSegment()
Returns the (1-dimensional) reference segment.
std::string ToString() const
Return a string representation of this Reference element.
Abstract interface class for encoding topological local refinement
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
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
lf::base::RefEl RefEl() const
Returns topological type of entity for which the current object is set up.
Eigen::MatrixXd Jacobian(const Eigen::MatrixXd &local) const override
Evaluate the jacobian of the mapping simultaneously at numPoints points.
Eigen::MatrixXd JacobianInverseGramian(const Eigen::MatrixXd &local) const override
Evaluate the Jacobian * Inverse Gramian ( ) simultaneously at numPoints.
std::unique_ptr< Geometry > SubGeometry(dim_t codim, dim_t i) const override
Construct a new Geometry() object that describes the geometry of the i-th sub-entity with codimension...
Eigen::VectorXd IntegrationElement(const Eigen::MatrixXd &local) const override
The integration element (factor appearing in integral transformation formula, see below) at number of...
Eigen::Matrix< double, Eigen::Dynamic, 2 > coords_
dim_t DimGlobal() const override
Dimension of the image of this mapping.
Eigen::MatrixXd Global(const Eigen::MatrixXd &local) const override
Map a number of points in local coordinates into the global coordinate system.
std::vector< std::unique_ptr< Geometry > > ChildGeometry(const RefinementPattern &ref_pat, base::dim_t codim) const override
Generate geometry objects for child entities created in the course of refinement.
unsigned int dim_t
type for dimensions and co-dimensions and numbers derived from them
Defines the Geometry interface and provides a number of classes that implement this interface + addit...