Basix | basix.ElementFamily.RT ↓ 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 Raviart-Thomas (Lagrange variant) degree 1 on a triangle element = basix.create_element(basix.ElementFamily.RT, basix.CellType.triangle, 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a triangle element = basix.create_element(basix.ElementFamily.RT, basix.CellType.triangle, 2)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a quadrilateral element = basix.create_element(basix.ElementFamily.RT, basix.CellType.quadrilateral, 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a quadrilateral element = basix.create_element(basix.ElementFamily.RT, basix.CellType.quadrilateral, 2)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a tetrahedron element = basix.create_element(basix.ElementFamily.RT, basix.CellType.tetrahedron, 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a tetrahedron element = basix.create_element(basix.ElementFamily.RT, basix.CellType.tetrahedron, 2)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a hexahedron element = basix.create_element(basix.ElementFamily.RT, basix.CellType.hexahedron, 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a hexahedron element = basix.create_element(basix.ElementFamily.RT, basix.CellType.hexahedron, 2)
# Create Raviart-Thomas (Legendre variant) degree 1 on a triangle element = basix.create_element(basix.ElementFamily.RT, basix.CellType.triangle, 1, lagrange_variant=basix.LagrangeVariant.legendre)
# Create Raviart-Thomas (Legendre variant) degree 2 on a triangle element = basix.create_element(basix.ElementFamily.RT, basix.CellType.triangle, 2, lagrange_variant=basix.LagrangeVariant.legendre)
# Create Raviart-Thomas (Legendre variant) degree 1 on a quadrilateral element = basix.create_element(basix.ElementFamily.RT, basix.CellType.quadrilateral, 1, lagrange_variant=basix.LagrangeVariant.legendre)
# Create Raviart-Thomas (Legendre variant) degree 2 on a quadrilateral element = basix.create_element(basix.ElementFamily.RT, basix.CellType.quadrilateral, 2, lagrange_variant=basix.LagrangeVariant.legendre)
# Create Raviart-Thomas (Legendre variant) degree 1 on a tetrahedron element = basix.create_element(basix.ElementFamily.RT, basix.CellType.tetrahedron, 1, lagrange_variant=basix.LagrangeVariant.legendre)
# Create Raviart-Thomas (Legendre variant) degree 2 on a tetrahedron element = basix.create_element(basix.ElementFamily.RT, basix.CellType.tetrahedron, 2, lagrange_variant=basix.LagrangeVariant.legendre)
# Create Raviart-Thomas (Legendre variant) degree 1 on a hexahedron element = basix.create_element(basix.ElementFamily.RT, basix.CellType.hexahedron, 1, lagrange_variant=basix.LagrangeVariant.legendre)
# Create Raviart-Thomas (Legendre variant) degree 2 on a hexahedron element = basix.create_element(basix.ElementFamily.RT, basix.CellType.hexahedron, 2, lagrange_variant=basix.LagrangeVariant.legendre) This implementation is correct for all the examples below. |
Basix.UFL | basix.ElementFamily.RT ↓ 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 Raviart-Thomas (Lagrange variant) degree 1 on a triangle element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.triangle, 1, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a triangle element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.triangle, 2, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a quadrilateral element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.quadrilateral, 1, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a quadrilateral element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.quadrilateral, 2, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a tetrahedron element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.tetrahedron, 1, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a tetrahedron element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.tetrahedron, 2, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a hexahedron element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.hexahedron, 1, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a hexahedron element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.hexahedron, 2, lagrange_variant=basix.LagrangeVariant.equispaced)
# Create Raviart-Thomas (Legendre variant) degree 1 on a triangle element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.triangle, 1)
# Create Raviart-Thomas (Legendre variant) degree 2 on a triangle element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.triangle, 2)
# Create Raviart-Thomas (Legendre variant) degree 1 on a quadrilateral element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.quadrilateral, 1)
# Create Raviart-Thomas (Legendre variant) degree 2 on a quadrilateral element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.quadrilateral, 2)
# Create Raviart-Thomas (Legendre variant) degree 1 on a tetrahedron element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.tetrahedron, 1)
# Create Raviart-Thomas (Legendre variant) degree 2 on a tetrahedron element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.tetrahedron, 2)
# Create Raviart-Thomas (Legendre variant) degree 1 on a hexahedron element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.hexahedron, 1)
# Create Raviart-Thomas (Legendre variant) degree 2 on a hexahedron element = basix.ufl.element(basix.ElementFamily.RT, basix.CellType.hexahedron, 2) This implementation is correct for all the examples below. |
Bempp | "RWG" ↓ Show Bempp examples ↓↑ Hide Bempp examples ↑Before running this example, you must install Bempp: pip3 install numba scipy meshio pip3 install bempp-cl This element can then be created with the following lines of Python: import bempp.api grid = bempp.api.shapes.regular_sphere(1)
# Create Raviart-Thomas degree 1 element = bempp.api.function_space(grid, "RWG", 0) |
FIAT | FIAT.RaviartThomas(..., 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 Raviart-Thomas (Legendre variant) degree 1 element = FIAT.RaviartThomas(FIAT.ufc_cell("triangle"), 1, variant="integral")
# Create Raviart-Thomas (Legendre variant) degree 2 element = FIAT.RaviartThomas(FIAT.ufc_cell("triangle"), 2, variant="integral")
# Create Raviart-Thomas (Legendre variant) degree 1 element = FIAT.RaviartThomas(FIAT.ufc_cell("tetrahedron"), 1, variant="integral")
# Create Raviart-Thomas (Legendre variant) degree 2 element = FIAT.RaviartThomas(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; quadrilateral,1,lagrange; quadrilateral,2,lagrange; tetrahedron,1,lagrange; tetrahedron,2,lagrange; hexahedron,1,lagrange; hexahedron,2,lagrange; quadrilateral,1,legendre; quadrilateral,2,legendre; hexahedron,1,legendre; hexahedron,2,legendre |
NDElement | Family.RaviartThomas ↓ Show NDElement examples ↓↑ Hide NDElement examples ↑Before running this example, you must install NDElement: pip3 install ndelement This element can then be created with the following lines of Python: from ndelement.ciarlet import Family, create_family from ndelement.reference_cell import ReferenceCellType
# Create Raviart-Thomas (Legendre variant) degree 1 on a triangle family = create_family(Family.RaviartThomas, 1) element = family.element(ReferenceCellType.Triangle)
# Create Raviart-Thomas (Legendre variant) degree 2 on a triangle family = create_family(Family.RaviartThomas, 2) element = family.element(ReferenceCellType.Triangle)
# Create Raviart-Thomas (Legendre variant) degree 1 on a quadrilateral family = create_family(Family.RaviartThomas, 1) element = family.element(ReferenceCellType.Quadrilateral)
# Create Raviart-Thomas (Legendre variant) degree 2 on a quadrilateral family = create_family(Family.RaviartThomas, 2) element = family.element(ReferenceCellType.Quadrilateral)
# Create Raviart-Thomas (Legendre variant) degree 1 on a tetrahedron family = create_family(Family.RaviartThomas, 1) element = family.element(ReferenceCellType.Tetrahedron)
# Create Raviart-Thomas (Legendre variant) degree 2 on a tetrahedron family = create_family(Family.RaviartThomas, 2) element = family.element(ReferenceCellType.Tetrahedron)
# Create Raviart-Thomas (Legendre variant) degree 1 on a hexahedron family = create_family(Family.RaviartThomas, 1) element = family.element(ReferenceCellType.Hexahedron)
# Create Raviart-Thomas (Legendre variant) degree 2 on a hexahedron family = create_family(Family.RaviartThomas, 2) element = family.element(ReferenceCellType.Hexahedron) This implementation is correct for all the examples below that it supports. Correct: triangle,1,legendre; triangle,2,legendre; quadrilateral,1,legendre; quadrilateral,2,legendre; tetrahedron,1,legendre; tetrahedron,2,legendre; hexahedron,1,legendre; hexahedron,2,legendre Not implemented: triangle,1,lagrange; triangle,2,lagrange; quadrilateral,1,lagrange; quadrilateral,2,lagrange; tetrahedron,1,lagrange; tetrahedron,2,lagrange; hexahedron,1,lagrange; hexahedron,2,lagrange |
Symfem | "N1div", variant="legendre" (triangle, Legendre; tetrahedron, Legendre)
"Qdiv", variant="legendre" (quadrilateral, Legendre; hexahedron, Legendre)
"N1div" (triangle, Lagrange; tetrahedron, Lagrange)
"Qdiv" (quadrilateral, Lagrange; hexahedron, 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 Raviart-Thomas (Lagrange variant) degree 1 on a triangle element = symfem.create_element("triangle", "N1div", 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a triangle element = symfem.create_element("triangle", "N1div", 2)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a quadrilateral element = symfem.create_element("quadrilateral", "Qdiv", 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a quadrilateral element = symfem.create_element("quadrilateral", "Qdiv", 2)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a tetrahedron element = symfem.create_element("tetrahedron", "N1div", 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a tetrahedron element = symfem.create_element("tetrahedron", "N1div", 2)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a hexahedron element = symfem.create_element("hexahedron", "Qdiv", 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a hexahedron element = symfem.create_element("hexahedron", "Qdiv", 2)
# Create Raviart-Thomas (Legendre variant) degree 1 on a triangle element = symfem.create_element("triangle", "N1div", 1, variant="legendre")
# Create Raviart-Thomas (Legendre variant) degree 2 on a triangle element = symfem.create_element("triangle", "N1div", 2, variant="legendre")
# Create Raviart-Thomas (Legendre variant) degree 1 on a quadrilateral element = symfem.create_element("quadrilateral", "Qdiv", 1, variant="legendre")
# Create Raviart-Thomas (Legendre variant) degree 2 on a quadrilateral element = symfem.create_element("quadrilateral", "Qdiv", 2, variant="legendre")
# Create Raviart-Thomas (Legendre variant) degree 1 on a tetrahedron element = symfem.create_element("tetrahedron", "N1div", 1, variant="legendre")
# Create Raviart-Thomas (Legendre variant) degree 2 on a tetrahedron element = symfem.create_element("tetrahedron", "N1div", 2, variant="legendre")
# Create Raviart-Thomas (Legendre variant) degree 1 on a hexahedron element = symfem.create_element("hexahedron", "Qdiv", 1, variant="legendre")
# Create Raviart-Thomas (Legendre variant) degree 2 on a hexahedron element = symfem.create_element("hexahedron", "Qdiv", 2, variant="legendre") This implementation is used to compute the examples below and verify other implementations. |
(legacy) UFL | "RT" (triangle, Lagrange; tetrahedron, Lagrange)
"RTCF" (quadrilateral, Lagrange)
"NCF" (hexahedron, Lagrange) ↓ 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 Raviart-Thomas (Lagrange variant) degree 1 on a triangle element = ufl_legacy.FiniteElement("RT", "triangle", 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a triangle element = ufl_legacy.FiniteElement("RT", "triangle", 2)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a quadrilateral element = ufl_legacy.FiniteElement("RTCF", "quadrilateral", 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a quadrilateral element = ufl_legacy.FiniteElement("RTCF", "quadrilateral", 2)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a tetrahedron element = ufl_legacy.FiniteElement("RT", "tetrahedron", 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a tetrahedron element = ufl_legacy.FiniteElement("RT", "tetrahedron", 2)
# Create Raviart-Thomas (Lagrange variant) degree 1 on a hexahedron element = ufl_legacy.FiniteElement("NCF", "hexahedron", 1)
# Create Raviart-Thomas (Lagrange variant) degree 2 on a hexahedron element = ufl_legacy.FiniteElement("NCF", "hexahedron", 2) |