Skip to content

Commit

Permalink
trivial errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dham committed Apr 29, 2019
1 parent 11f97a6 commit be04e50
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions FIAT/discontinuous_pc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
UFCTriangle,
UFCTetrahedron,
make_affine_mapping)
from FIAT.P0 import P0Dual
import numpy as np

hypercube_simplex_map = {Point(): Point(),
Expand Down
24 changes: 12 additions & 12 deletions FIAT/serendipity.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ def v_lambda_0(dim, dx, dy, dz):
def e_lambda_0(i, dim, dx, dy, dz, x_mid, y_mid, z_mid):

if dim == 2:
EL = tuple([-leg(j, y_mid) * dy[0] * dy[1] * a for a in dx for j in range(i-1)]
+ [-leg(j, x_mid) * dx[0] * dx[1] * b for b in dy for j in range(i-1)])
EL = tuple([-leg(j, y_mid) * dy[0] * dy[1] * a for a in dx for j in range(i-1)] +
[-leg(j, x_mid) * dx[0] * dx[1] * b for b in dy for j in range(i-1)])
else:
EL = tuple([-leg(j, x_mid) * dx[0] * dx[1] * b * c for b in dy for c in dz for j in range(i-1)]
+ [-leg(j, y_mid) * dy[0] * dy[1] * a * c for c in dz for a in dx for j in range(i-1)]
+ [-leg(j, z_mid) * dz[0] * dz[1] * a * b for a in dx for b in dy for j in range(i-1)])
EL = tuple([-leg(j, x_mid) * dx[0] * dx[1] * b * c for b in dy for c in dz for j in range(i-1)] +
[-leg(j, y_mid) * dy[0] * dy[1] * a * c for c in dz for a in dx for j in range(i-1)] +
[-leg(j, z_mid) * dz[0] * dz[1] * a * b for a in dx for b in dy for j in range(i-1)])

return EL

Expand All @@ -210,11 +210,11 @@ def f_lambda_0(i, dim, dx, dy, dz, x_mid, y_mid, z_mid):
for k in range(4, i + 1) for j in range(k-3)])
else:
FL = tuple([leg(j, x_mid) * leg(k-4-j, y_mid) * dx[0] * dx[1] * dy[0] * dy[1] * c
for k in range(4, i + 1) for j in range(i-3) for c in dz]
+ [leg(j, z_mid) * leg(k-4-j, x_mid) * dx[0] * dx[1] * dz[0] * dz[1] * b
for k in range(4, i + 1) for j in range(i-3) for b in dy]
+ [leg(j, y_mid) * leg(k-4-j, z_mid) * dy[0] * dy[1] * dz[0] * dz[1] * a
for k in range(4, i + 1) for j in range(i-3) for a in dx])
for k in range(4, i + 1) for j in range(i-3) for c in dz] +
[leg(j, z_mid) * leg(k-4-j, x_mid) * dx[0] * dx[1] * dz[0] * dz[1] * b
for k in range(4, i + 1) for j in range(i-3) for b in dy] +
[leg(j, y_mid) * leg(k-4-j, z_mid) * dy[0] * dy[1] * dz[0] * dz[1] * a
for k in range(4, i + 1) for j in range(i-3) for a in dx])

return FL

Expand All @@ -223,8 +223,8 @@ def i_lambda_0(i, dx, dy, dz, x_mid, y_mid, z_mid):

assert i >= 6, 'invalid value for i'

IL = tuple([-leg(l-6-j, x_mid) * leg(j-k, y_mid) * leg(k, z_mid)
* dx[0] * dx[1] * dy[0] * dy[1] * dz[0] * dz[1]
IL = tuple([-leg(l-6-j, x_mid) * leg(j-k, y_mid) * leg(k, z_mid) *
dx[0] * dx[1] * dy[0] * dy[1] * dz[0] * dz[1]
for l in range(6, i + 1) for j in range(i-5) for k in range(j+1)])

return IL

0 comments on commit be04e50

Please sign in to comment.