Skip to content

Commit

Permalink
Merge branch 'fenics_master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew McRae committed Jul 16, 2015
2 parents 40add7b + a1430d4 commit 15fe85b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion FIAT/expansions.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ def tabulate_derivatives(self, n, pts):
tetrahedron expansions."""
ref_pts = numpy.array([self.mapping(pt) for pt in pts])
psitilde_as_derivs = jacobi.eval_jacobi_deriv_batch(0, 0, n, ref_pts)


# Jacobi polynomials defined on [-1, 1], first derivatives need scaling
psitilde_as_derivs *= 2.0/self.ref_el.volume()

results = numpy.zeros((n+1, len(pts)), "d")
for k in range(0, n + 1):
results[k, :] = psitilde_as_derivs[k, :] * numpy.sqrt(k + 0.5)
Expand Down
2 changes: 1 addition & 1 deletion FIAT/jacobi.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def eval_jacobi_deriv_batch(a, b, n, xs):
else:
results[1:,:] = eval_jacobi_batch(a+1, b+1, n-1, xs)
for j in range(1, n+1):
results[j,:] *= (a+b+j+1)
results[j,:] *= 0.5*(a+b+j+1)
return results


12 changes: 10 additions & 2 deletions FIAT/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from FIAT.discontinuous_lagrange import DiscontinuousLagrange
from FIAT.reference_element import ufc_simplex
from FIAT.functional import PointEvaluation
from FIAT.polynomial_set import mis

# Tolerance for geometry identifications
epsilon = 1.e-8
Expand Down Expand Up @@ -193,8 +194,15 @@ def tabulate(self, order, points):
"""Return tabulated values of derivatives up to given order of
basis functions at given points."""

# Standard derivatives don't make sense
assert (order == 0), "Don't know how to do derivatives"
# Standard derivatives don't make sense, but return zero
# because mixed elements compute all derivatives at once
if (order > 0):
values = {}
sdim = self.space_dimension()
alphas = mis(self.cell.get_spatial_dimension(), order)
for alpha in alphas:
values[alpha] = numpy.zeros(shape=(sdim, len(points)))
return values

# Identify which facet (if any) these points are on:
vertices = self.cell.vertices
Expand Down

0 comments on commit 15fe85b

Please sign in to comment.