From 3991121e59f1db1f1bcb4d91eb3fe72719630ea6 Mon Sep 17 00:00:00 2001 From: Colin Cotter Date: Tue, 28 Jul 2015 13:58:43 +0100 Subject: [PATCH 1/2] enable Taylor elements in UFL. --- test/test_elements.py | 5 ++++- ufl/finiteelement/elementlist.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_elements.py b/test/test_elements.py index edfc87fc8..0f11098c4 100755 --- a/test/test_elements.py +++ b/test/test_elements.py @@ -18,7 +18,10 @@ def test_scalar_galerkin(): element = FiniteElement(family, cell, p) assert element.value_shape() == () assert element == eval(repr(element)) - + for p in range(1, 10): + for family in ("TDG", "Discontinuous Taylor"): + element = FiniteElement(family, interval, p) + assert element.value_shape() == () def test_vector_galerkin(): for cell in all_cells: diff --git a/ufl/finiteelement/elementlist.py b/ufl/finiteelement/elementlist.py index 083a1d24f..1a49851b7 100644 --- a/ufl/finiteelement/elementlist.py +++ b/ufl/finiteelement/elementlist.py @@ -94,6 +94,7 @@ def show_elements(): register_element("Lagrange", "CG", 0, H1, "identity", (1, None), any_cell + ("OuterProductCell",)) # "P", "Q" register_element("Brezzi-Douglas-Marini", "BDM", 1, HDiv, "contravariant Piola", (1, None), simplices[1:]) # "BDMF" (2d), "N2F" (3d) register_element("Discontinuous Lagrange", "DG", 0, L2, "identity", (0, None), any_cell + ("OuterProductCell",)) # "DP", "DQ" +register_element("Discontinuous Taylor", "TDG", 0, L2, "identity", (0, None), any_cell + ("OuterProductCell",)) register_element("Nedelec 1st kind H(curl)", "N1curl", 1, HCurl, "covariant Piola", (1, None), simplices[1:]) # "RTE" (2d), "N1E" (3d) register_element("Nedelec 2nd kind H(curl)", "N2curl", 1, HCurl, "covariant Piola", (1, None), simplices[1:]) # "BDME" (2d), "N2E" (3d) register_element("Raviart-Thomas", "RT", 1, HDiv, "contravariant Piola", (1, None), simplices[1:]) # "RTF" (2d), "N1F" (3d) From 2ff6e67fba7150bf428ff944a1696db4eb4971a1 Mon Sep 17 00:00:00 2001 From: Colin Cotter Date: Mon, 17 Aug 2015 10:08:12 +0100 Subject: [PATCH 2/2] TDG for intervals only. --- ufl/finiteelement/elementlist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ufl/finiteelement/elementlist.py b/ufl/finiteelement/elementlist.py index 1a49851b7..36685ceb2 100644 --- a/ufl/finiteelement/elementlist.py +++ b/ufl/finiteelement/elementlist.py @@ -94,7 +94,7 @@ def show_elements(): register_element("Lagrange", "CG", 0, H1, "identity", (1, None), any_cell + ("OuterProductCell",)) # "P", "Q" register_element("Brezzi-Douglas-Marini", "BDM", 1, HDiv, "contravariant Piola", (1, None), simplices[1:]) # "BDMF" (2d), "N2F" (3d) register_element("Discontinuous Lagrange", "DG", 0, L2, "identity", (0, None), any_cell + ("OuterProductCell",)) # "DP", "DQ" -register_element("Discontinuous Taylor", "TDG", 0, L2, "identity", (0, None), any_cell + ("OuterProductCell",)) +register_element("Discontinuous Taylor", "TDG", 0, L2, "identity", (0, None), ("interval",)) register_element("Nedelec 1st kind H(curl)", "N1curl", 1, HCurl, "covariant Piola", (1, None), simplices[1:]) # "RTE" (2d), "N1E" (3d) register_element("Nedelec 2nd kind H(curl)", "N2curl", 1, HCurl, "covariant Piola", (1, None), simplices[1:]) # "BDME" (2d), "N2E" (3d) register_element("Raviart-Thomas", "RT", 1, HDiv, "contravariant Piola", (1, None), simplices[1:]) # "RTF" (2d), "N1F" (3d)