Skip to content

Commit

Permalink
Merge branch 'main' into jhale/bump-version
Browse files Browse the repository at this point in the history
  • Loading branch information
garth-wells authored Jul 12, 2023
2 parents 850e6fc + ebfb2df commit 116bd27
Show file tree
Hide file tree
Showing 8 changed files with 471 additions and 232 deletions.
1 change: 0 additions & 1 deletion .github/workflows/fenicsx-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
with:
path: ./ffcx
repository: FEniCS/ffcx
ref: main
- name: Install FFCx
run: |
cd ffcx
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Installation instructions
=========================

To install UFL, download the source code from the
`UFL Bitbucket repository
<https://bitbucket.org/fenics-project/ufl>`__,
`UFL GitHub repository
<https://github.com/FEniCS/ufl>`__,
and run the following command:

.. code-block:: console
Expand Down
61 changes: 61 additions & 0 deletions test/test_cell.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import ufl
import pytest


def test_interval():
cell = ufl.interval
assert cell.num_vertices() == 2
assert cell.num_edges() == 1
assert cell.num_faces() == 0


def test_triangle():
cell = ufl.triangle
assert cell.num_vertices() == 3
assert cell.num_edges() == 3
assert cell.num_faces() == 1


def test_quadrilateral():
cell = ufl.quadrilateral
assert cell.num_vertices() == 4
assert cell.num_edges() == 4
assert cell.num_faces() == 1


def test_tetrahedron():
cell = ufl.tetrahedron
assert cell.num_vertices() == 4
assert cell.num_edges() == 6
assert cell.num_faces() == 4


def test_hexahedron():
cell = ufl.hexahedron
assert cell.num_vertices() == 8
assert cell.num_edges() == 12
assert cell.num_faces() == 6



@pytest.mark.parametrize("cell", [ufl.interval])
def test_cells_1d(cell):
assert cell.num_facets() == cell.num_vertices()
assert cell.num_ridges() == 0
assert cell.num_peaks() == 0


@pytest.mark.parametrize("cell", [ufl.triangle, ufl.quadrilateral])
def test_cells_2d(cell):
assert cell.num_facets() == cell.num_edges()
assert cell.num_ridges() == cell.num_vertices()
assert cell.num_peaks() == 0


@pytest.mark.parametrize("cell", [ufl.tetrahedron, ufl.hexahedron, ufl.prism, ufl.pyramid])
def test_cells_2d(cell):
assert cell.num_facets() == cell.num_faces()
assert cell.num_ridges() == cell.num_edges()
assert cell.num_peaks() == cell.num_vertices()


2 changes: 1 addition & 1 deletion ufl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
The development version can be found in the repository at
https://www.bitbucket.org/fenics-project/ufl
https://github.com/FEniCS/ufl
A very brief overview of the language contents follows:
Expand Down
Loading

0 comments on commit 116bd27

Please sign in to comment.