Skip to content

Commit 6ca0eff

Browse files
authored
Merge pull request #5 from nate-sime/nate/gh-actions
github actions for automated testing
2 parents b297cfe + d59a394 commit 6ca0eff

File tree

4 files changed

+38
-13
lines changed

4 files changed

+38
-13
lines changed

.github/workflows/run_tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: dolfin_dg unit tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
Run-Tests-dolfinx:
10+
runs-on: ubuntu-latest
11+
container: dolfinx/dolfinx:nightly
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Run unit tests
16+
run: python3 -m pytest test/unitx
17+
18+
Run-Tests-dolfin:
19+
runs-on: ubuntu-latest
20+
container: quay.io/natesime/dolfin_dg:master
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Install dependencies
25+
run: python3 -m pip install packaging
26+
27+
- name: Run unit tests
28+
run: python3 -m pytest test/unit

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# dolfin_dg
22

3+
![unit tests badge](https://github.com/nate-sime/dolfin_dg/actions/workflows/run_tests.yml/badge.svg
4+
)
5+
36
`dolfin_dg` provides utility functions for the automatic generation of nonlinear
47
DG FEM formulations using [UFL](https://github.com/FEniCS/ufl).
58

@@ -68,18 +71,10 @@ nonlinear problems in geodynamics*
6871
project](https://www.firedrakeproject.org/)
6972

7073

71-
## Automated testing
72-
73-
[![Pipelines Build Status](https://img.shields.io/bitbucket/pipelines/nate-sime/dolfin_dg)](https://bitbucket.org/nate-sime/dolfin_dg/addon/pipelines/home)
74-
75-
Unit tests are provided in ``test/unit/test_*.py``.
76-
77-
7874
## Installation
7975

8076
#### Docker image
8177

82-
8378
![](https://quay.io/repository/natesime/dolfin_dg/status)
8479

8580
Follow the instructions for installing https://fenicsproject.org/download/. A

dolfin_dg/dg_form.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
apply_dg_operators, avg, tensor_jump, jump, tangent_jump)
99
from dolfin_dg import normal_proj, tangential_proj, \
1010
hyper_tensor_product, hyper_tensor_T_product, dg_outer
11+
import dolfin_dg
1112

1213

1314
def _get_terminal_operand_coefficient(u):
@@ -353,13 +354,13 @@ def exterior_residual(self, u_gamma, dExt):
353354
curl_u, curl_v = curl(u), curl(v)
354355
sigma, n = self.sigma, self.n
355356

356-
residual = - inner(dg_cross(n, u - u_gamma),
357+
residual = - inner(dolfin_dg.math.dg_cross(n, u - u_gamma),
357358
hyper_tensor_T_product(G, curl_v)) * dExt \
358-
- inner(dg_cross(n, v),
359+
- inner(dolfin_dg.math.dg_cross(n, v),
359360
hyper_tensor_product(G, curl_u)) * dExt \
360361
+ sigma * inner(
361-
hyper_tensor_product(G, dg_cross(n, u - u_gamma)),
362-
dg_cross(n, v)) * dExt
362+
hyper_tensor_product(G, dolfin_dg.math.dg_cross(n, u - u_gamma)),
363+
dolfin_dg.math.dg_cross(n, v)) * dExt
363364
return residual
364365

365366
def exterior_residual_on_interior(self, u_gamma, dExt):

dolfin_dg/dg_ufl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ def tensor_jump(self, o):
175175
def tangent_jump(self, o):
176176
n = o.ufl_operands[1]
177177
v = apply_jump_lowering(o.ufl_operands[0])
178-
return dg_cross(n("+"), v("+")) + dg_cross(n("-"), v("-"))
178+
return dolfin_dg.math.dg_cross(n("+"), v("+")) \
179+
+ dolfin_dg.math.dg_cross(n("-"), v("-"))
179180

180181

181182
def apply_dg_operators(expression):

0 commit comments

Comments
 (0)