Basix | basix.ElementFamily.serendipity, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced ↓ Show Basix examples ↓↑ Hide Basix examples ↑Before running this example, you must install Basix: pip3 install fenics-basix This element can then be created with the following lines of Python: import basix
# Create serendipity degree 1 on a interval element = basix.create_element(basix.ElementFamily.serendipity, basix.CellType.interval, 1, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced)
# Create serendipity degree 2 on a interval element = basix.create_element(basix.ElementFamily.serendipity, basix.CellType.interval, 2, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced)
# Create serendipity degree 3 on a interval element = basix.create_element(basix.ElementFamily.serendipity, basix.CellType.interval, 3, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced)
# Create serendipity degree 1 on a quadrilateral element = basix.create_element(basix.ElementFamily.serendipity, basix.CellType.quadrilateral, 1, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced)
# Create serendipity degree 2 on a quadrilateral element = basix.create_element(basix.ElementFamily.serendipity, basix.CellType.quadrilateral, 2, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced)
# Create serendipity degree 3 on a quadrilateral element = basix.create_element(basix.ElementFamily.serendipity, basix.CellType.quadrilateral, 3, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced) This implementation is correct for all the examples below. |
Basix.UFL | basix.ElementFamily.serendipity, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced ↓ Show Basix.UFL examples ↓↑ Hide Basix.UFL examples ↑Before running this example, you must install Basix.UFL: pip3 install fenics-basix fenics-ufl This element can then be created with the following lines of Python: import basix import basix.ufl
# Create serendipity degree 1 on a interval element = basix.ufl.element(basix.ElementFamily.serendipity, basix.CellType.interval, 1, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced)
# Create serendipity degree 2 on a interval element = basix.ufl.element(basix.ElementFamily.serendipity, basix.CellType.interval, 2, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced)
# Create serendipity degree 3 on a interval element = basix.ufl.element(basix.ElementFamily.serendipity, basix.CellType.interval, 3, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced)
# Create serendipity degree 1 on a quadrilateral element = basix.ufl.element(basix.ElementFamily.serendipity, basix.CellType.quadrilateral, 1, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced)
# Create serendipity degree 2 on a quadrilateral element = basix.ufl.element(basix.ElementFamily.serendipity, basix.CellType.quadrilateral, 2, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced)
# Create serendipity degree 3 on a quadrilateral element = basix.ufl.element(basix.ElementFamily.serendipity, basix.CellType.quadrilateral, 3, lagrange_variant=basix.LagrangeVariant.equispaced, dpc_variant=basix.DPCVariant.simplex_equispaced) This implementation is correct for all the examples below. |
FIAT | FIAT.Serendipity ↓ Show FIAT examples ↓↑ Hide FIAT examples ↑Before running this example, you must install FIAT: pip3 install git+https://github.com/firedrakeproject/fiat.git This element can then be created with the following lines of Python: import FIAT
# Create serendipity degree 1 element = FIAT.Serendipity(FIAT.ufc_cell("interval"), 1)
# Create serendipity degree 2 element = FIAT.Serendipity(FIAT.ufc_cell("interval"), 2)
# Create serendipity degree 3 element = FIAT.Serendipity(FIAT.ufc_cell("interval"), 3)
# Create serendipity degree 1 element = FIAT.Serendipity(FIAT.reference_element.UFCQuadrilateral(), 1)
# Create serendipity degree 2 element = FIAT.Serendipity(FIAT.reference_element.UFCQuadrilateral(), 2)
# Create serendipity degree 3 element = FIAT.Serendipity(FIAT.reference_element.UFCQuadrilateral(), 3) This implementation is correct for all the examples below. |
Symfem | "serendipity" ↓ Show Symfem examples ↓↑ Hide Symfem examples ↑Before running this example, you must install Symfem: pip3 install symfem This element can then be created with the following lines of Python: import symfem
# Create serendipity degree 1 on a interval element = symfem.create_element("interval", "serendipity", 1)
# Create serendipity degree 2 on a interval element = symfem.create_element("interval", "serendipity", 2)
# Create serendipity degree 3 on a interval element = symfem.create_element("interval", "serendipity", 3)
# Create serendipity degree 1 on a quadrilateral element = symfem.create_element("quadrilateral", "serendipity", 1)
# Create serendipity degree 2 on a quadrilateral element = symfem.create_element("quadrilateral", "serendipity", 2)
# Create serendipity degree 3 on a quadrilateral element = symfem.create_element("quadrilateral", "serendipity", 3) This implementation is used to compute the examples below and verify other implementations. |
(legacy) UFL | "S" ↓ Show (legacy) UFL examples ↓↑ Hide (legacy) UFL examples ↑Before running this example, you must install (legacy) UFL: pip3 install setuptools pip3 install fenics-ufl-legacy This element can then be created with the following lines of Python: import ufl_legacy
# Create serendipity degree 1 on a interval element = ufl_legacy.FiniteElement("S", "interval", 1)
# Create serendipity degree 2 on a interval element = ufl_legacy.FiniteElement("S", "interval", 2)
# Create serendipity degree 3 on a interval element = ufl_legacy.FiniteElement("S", "interval", 3)
# Create serendipity degree 1 on a quadrilateral element = ufl_legacy.FiniteElement("S", "quadrilateral", 1)
# Create serendipity degree 2 on a quadrilateral element = ufl_legacy.FiniteElement("S", "quadrilateral", 2)
# Create serendipity degree 3 on a quadrilateral element = ufl_legacy.FiniteElement("S", "quadrilateral", 3) |