Basix | basix.ElementFamily.HHJ ↓ Show Basix examples ↓↑ Hide Basix examples ↑Before running this example, you must install Basix: pip3 install git+https://github.com/FEniCS/basix This element can then be created with the following lines of Python: import basix
# Create Hellan-Herrmann-Johnson degree 0 on a triangle element = basix.create_element(basix.ElementFamily.HHJ, basix.CellType.triangle, 0)
# Create Hellan-Herrmann-Johnson degree 1 on a triangle element = basix.create_element(basix.ElementFamily.HHJ, basix.CellType.triangle, 1)
# Create Hellan-Herrmann-Johnson degree 2 on a triangle element = basix.create_element(basix.ElementFamily.HHJ, basix.CellType.triangle, 2)
# Create Hellan-Herrmann-Johnson degree 0 on a tetrahedron element = basix.create_element(basix.ElementFamily.HHJ, basix.CellType.tetrahedron, 0)
# Create Hellan-Herrmann-Johnson degree 1 on a tetrahedron element = basix.create_element(basix.ElementFamily.HHJ, basix.CellType.tetrahedron, 1)
# Create Hellan-Herrmann-Johnson degree 2 on a tetrahedron element = basix.create_element(basix.ElementFamily.HHJ, basix.CellType.tetrahedron, 2) This implementation is correct for all the examples below. |
Basix.UFL | basix.ElementFamily.HHJ ↓ Show Basix.UFL examples ↓↑ Hide Basix.UFL examples ↑Before running this example, you must install Basix.UFL: pip3 install git+https://github.com/FEniCS/basix fenics-ufl This element can then be created with the following lines of Python: import basix import basix.ufl
# Create Hellan-Herrmann-Johnson degree 0 on a triangle element = basix.ufl.element(basix.ElementFamily.HHJ, basix.CellType.triangle, 0)
# Create Hellan-Herrmann-Johnson degree 1 on a triangle element = basix.ufl.element(basix.ElementFamily.HHJ, basix.CellType.triangle, 1)
# Create Hellan-Herrmann-Johnson degree 2 on a triangle element = basix.ufl.element(basix.ElementFamily.HHJ, basix.CellType.triangle, 2)
# Create Hellan-Herrmann-Johnson degree 0 on a tetrahedron element = basix.ufl.element(basix.ElementFamily.HHJ, basix.CellType.tetrahedron, 0)
# Create Hellan-Herrmann-Johnson degree 1 on a tetrahedron element = basix.ufl.element(basix.ElementFamily.HHJ, basix.CellType.tetrahedron, 1)
# Create Hellan-Herrmann-Johnson degree 2 on a tetrahedron element = basix.ufl.element(basix.ElementFamily.HHJ, basix.CellType.tetrahedron, 2) This implementation is correct for all the examples below. |
FIAT | FIAT.HellanHerrmannJohnson ↓ 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 Hellan-Herrmann-Johnson degree 0 element = FIAT.HellanHerrmannJohnson(FIAT.ufc_cell("triangle"), 0)
# Create Hellan-Herrmann-Johnson degree 1 element = FIAT.HellanHerrmannJohnson(FIAT.ufc_cell("triangle"), 1)
# Create Hellan-Herrmann-Johnson degree 2 element = FIAT.HellanHerrmannJohnson(FIAT.ufc_cell("triangle"), 2)
# Create Hellan-Herrmann-Johnson degree 0 element = FIAT.HellanHerrmannJohnson(FIAT.ufc_cell("tetrahedron"), 0)
# Create Hellan-Herrmann-Johnson degree 1 element = FIAT.HellanHerrmannJohnson(FIAT.ufc_cell("tetrahedron"), 1)
# Create Hellan-Herrmann-Johnson degree 2 element = FIAT.HellanHerrmannJohnson(FIAT.ufc_cell("tetrahedron"), 2) This implementation is correct for all the examples below. |
Symfem | "HHJ" ↓ 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 Hellan-Herrmann-Johnson degree 0 on a triangle element = symfem.create_element("triangle", "HHJ", 0)
# Create Hellan-Herrmann-Johnson degree 1 on a triangle element = symfem.create_element("triangle", "HHJ", 1)
# Create Hellan-Herrmann-Johnson degree 2 on a triangle element = symfem.create_element("triangle", "HHJ", 2)
# Create Hellan-Herrmann-Johnson degree 0 on a tetrahedron element = symfem.create_element("tetrahedron", "HHJ", 0)
# Create Hellan-Herrmann-Johnson degree 1 on a tetrahedron element = symfem.create_element("tetrahedron", "HHJ", 1)
# Create Hellan-Herrmann-Johnson degree 2 on a tetrahedron element = symfem.create_element("tetrahedron", "HHJ", 2) This implementation is used to compute the examples below and verify other implementations. |
(legacy) UFL | "HHJ" ↓ 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 Hellan-Herrmann-Johnson degree 0 on a triangle element = ufl_legacy.FiniteElement("HHJ", "triangle", 0)
# Create Hellan-Herrmann-Johnson degree 1 on a triangle element = ufl_legacy.FiniteElement("HHJ", "triangle", 1)
# Create Hellan-Herrmann-Johnson degree 2 on a triangle element = ufl_legacy.FiniteElement("HHJ", "triangle", 2) |