Skip to content

Commit 482741c

Browse files
authored
Add iso element on hexahedron (#684)
* Added iso element on hexahedron * update README * avoid segfaults * fixes
1 parent f3fed3d commit 482741c

File tree

6 files changed

+405
-14
lines changed

6 files changed

+405
-14
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ The following elements are supported on a hexahedron:
151151
- [Bubble](https://defelement.com/elements/bubble.html)
152152
- [DPC](https://defelement.com/elements/dpc.html)
153153
- [Serendipity](https://defelement.com/elements/serendipity.html)
154+
- [iso](https://defelement.com/elements/p1-iso-p2.html)
154155

155156

156157
### Prism

cpp/basix/e-lagrange.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ create_d_iso(cell::type celltype, int degree, element::lagrange_variant variant,
851851
_M(i, 0, i, 0) = 1.0;
852852

853853
return FiniteElement(
854-
element::family::P, celltype, polyset::type::macroedge, degree, {},
854+
element::family::iso, celltype, polyset::type::macroedge, degree, {},
855855
impl::mdspan_t<const T, 2>(math::eye<T>(ndofs).data(), ndofs, ndofs),
856856
impl::to_mdspan(x), impl::to_mdspan(M), 0, maps::type::identity,
857857
sobolev::space::L2, true, degree, degree, variant,
@@ -1434,10 +1434,11 @@ FiniteElement<T> basix::element::create_iso(cell::type celltype, int degree,
14341434
lagrange_variant variant,
14351435
bool discontinuous)
14361436
{
1437-
if (celltype != cell::type::interval && celltype != cell::type::quadrilateral)
1437+
if (celltype != cell::type::interval && celltype != cell::type::quadrilateral
1438+
&& celltype != cell::type::hexahedron)
14381439
{
14391440
throw std::runtime_error("Can currently only create iso elements on "
1440-
"intervals and quadrilaterals");
1441+
"intervals, quadrilaterals, and hexahedra");
14411442
}
14421443

14431444
if (variant == lagrange_variant::unset)
@@ -1575,7 +1576,7 @@ FiniteElement<T> basix::element::create_iso(cell::type celltype, int degree,
15751576
auto tensor_factors
15761577
= create_tensor_product_factors<T>(celltype, degree, variant);
15771578
return FiniteElement<T>(
1578-
family::P, celltype, polyset::type::macroedge, degree, {},
1579+
family::iso, celltype, polyset::type::macroedge, degree, {},
15791580
impl::mdspan_t<T, 2>(math::eye<T>(ndofs).data(), ndofs, ndofs), xview,
15801581
Mview, 0, maps::type::identity, space, discontinuous, degree, degree,
15811582
variant, dpc_variant::unset, tensor_factors);

0 commit comments

Comments
 (0)