Basix | basix.ElementFamily.N2E ↓ 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 Nedelec (second kind) (Lagrange variant) degree 1 on a triangle element = basix.create_element(basix.ElementFamily.N2E, basix.CellType.triangle, 1)
# Create Nedelec (second kind) (Lagrange variant) degree 2 on a triangle element = basix.create_element(basix.ElementFamily.N2E, basix.CellType.triangle, 2)
# Create Nedelec (second kind) (Lagrange variant) degree 1 on a tetrahedron element = basix.create_element(basix.ElementFamily.N2E, basix.CellType.tetrahedron, 1)
# Create Nedelec (second kind) (Lagrange variant) degree 2 on a tetrahedron element = basix.create_element(basix.ElementFamily.N2E, basix.CellType.tetrahedron, 2)
# Create Nedelec (second kind) (Legendre variant) degree 1 on a triangle element = basix.create_element(basix.ElementFamily.N2E, basix.CellType.triangle, 1, lagrange_variant=basix.LagrangeVariant.legendre)
# Create Nedelec (second kind) (Legendre variant) degree 2 on a triangle element = basix.create_element(basix.ElementFamily.N2E, basix.CellType.triangle, 2, lagrange_variant=basix.LagrangeVariant.legendre)
# Create Nedelec (second kind) (Legendre variant) degree 1 on a tetrahedron element = basix.create_element(basix.ElementFamily.N2E, basix.CellType.tetrahedron, 1, lagrange_variant=basix.LagrangeVariant.legendre)
# Create Nedelec (second kind) (Legendre variant) degree 2 on a tetrahedron element = basix.create_element(basix.ElementFamily.N2E, basix.CellType.tetrahedron, 2, lagrange_variant=basix.LagrangeVariant.legendre) This implementation is correct for all the examples below. |
Basix.UFL | basix.ElementFamily.N2E ↓ 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 Nedelec (second kind) (Lagrange variant) degree 1 on a triangle element = basix.ufl.element(basix.ElementFamily.N2E, basix.CellType.triangle, 1, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Nedelec (second kind) (Lagrange variant) degree 2 on a triangle element = basix.ufl.element(basix.ElementFamily.N2E, basix.CellType.triangle, 2, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Nedelec (second kind) (Lagrange variant) degree 1 on a tetrahedron element = basix.ufl.element(basix.ElementFamily.N2E, basix.CellType.tetrahedron, 1, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Nedelec (second kind) (Lagrange variant) degree 2 on a tetrahedron element = basix.ufl.element(basix.ElementFamily.N2E, basix.CellType.tetrahedron, 2, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Nedelec (second kind) (Legendre variant) degree 1 on a triangle element = basix.ufl.element(basix.ElementFamily.N2E, basix.CellType.triangle, 1)
# Create Nedelec (second kind) (Legendre variant) degree 2 on a triangle element = basix.ufl.element(basix.ElementFamily.N2E, basix.CellType.triangle, 2)
# Create Nedelec (second kind) (Legendre variant) degree 1 on a tetrahedron element = basix.ufl.element(basix.ElementFamily.N2E, basix.CellType.tetrahedron, 1)
# Create Nedelec (second kind) (Legendre variant) degree 2 on a tetrahedron element = basix.ufl.element(basix.ElementFamily.N2E, basix.CellType.tetrahedron, 2) This implementation is correct for all the examples below. |
FIAT | FIAT.NedelecSecondKind(..., variant="integral") ↓ 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 Nedelec (second kind) (Legendre variant) degree 1 element = FIAT.NedelecSecondKind(FIAT.ufc_cell("triangle"), 1, variant="integral")
# Create Nedelec (second kind) (Legendre variant) degree 2 element = FIAT.NedelecSecondKind(FIAT.ufc_cell("triangle"), 2, variant="integral")
# Create Nedelec (second kind) (Legendre variant) degree 1 element = FIAT.NedelecSecondKind(FIAT.ufc_cell("tetrahedron"), 1, variant="integral")
# Create Nedelec (second kind) (Legendre variant) degree 2 element = FIAT.NedelecSecondKind(FIAT.ufc_cell("tetrahedron"), 2, variant="integral") This implementation is correct for all the examples below that it supports. Correct: triangle,1,legendre; triangle,2,legendre; tetrahedron,1,legendre; tetrahedron,2,legendre Not implemented: triangle,1,lagrange; triangle,2,lagrange; tetrahedron,1,lagrange; tetrahedron,2,lagrange |
Symfem | "N2curl", variant="legendre" (Legendre)
"N2curl" (Lagrange) ↓ 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 Nedelec (second kind) (Lagrange variant) degree 1 on a triangle element = symfem.create_element("triangle", "N2curl", 1)
# Create Nedelec (second kind) (Lagrange variant) degree 2 on a triangle element = symfem.create_element("triangle", "N2curl", 2)
# Create Nedelec (second kind) (Lagrange variant) degree 1 on a tetrahedron element = symfem.create_element("tetrahedron", "N2curl", 1)
# Create Nedelec (second kind) (Lagrange variant) degree 2 on a tetrahedron element = symfem.create_element("tetrahedron", "N2curl", 2)
# Create Nedelec (second kind) (Legendre variant) degree 1 on a triangle element = symfem.create_element("triangle", "N2curl", 1, variant="legendre")
# Create Nedelec (second kind) (Legendre variant) degree 2 on a triangle element = symfem.create_element("triangle", "N2curl", 2, variant="legendre")
# Create Nedelec (second kind) (Legendre variant) degree 1 on a tetrahedron element = symfem.create_element("tetrahedron", "N2curl", 1, variant="legendre")
# Create Nedelec (second kind) (Legendre variant) degree 2 on a tetrahedron element = symfem.create_element("tetrahedron", "N2curl", 2, variant="legendre") This implementation is used to compute the examples below and verify other implementations. |
(legacy) UFL | "N2curl" ↓ 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 Nedelec (second kind) (Lagrange variant) degree 1 on a triangle element = ufl_legacy.FiniteElement("N2curl", "triangle", 1)
# Create Nedelec (second kind) (Lagrange variant) degree 2 on a triangle element = ufl_legacy.FiniteElement("N2curl", "triangle", 2)
# Create Nedelec (second kind) (Lagrange variant) degree 1 on a tetrahedron element = ufl_legacy.FiniteElement("N2curl", "tetrahedron", 1)
# Create Nedelec (second kind) (Lagrange variant) degree 2 on a tetrahedron element = ufl_legacy.FiniteElement("N2curl", "tetrahedron", 2) |