- edited description
Basis derivative tabulation is broken in 1D
Here is a small test that shows that 'master' disagrees with FIAT 0.9.9 and with common sense:
import numpy
from FIAT.polynomial_set import mis
from FIAT.reference_element import default_simplex
from FIAT.quadrature import make_quadrature
order = 1
quadrature = make_quadrature(default_simplex(1), order)
from FIAT.lagrange import Lagrange
degree = 1
element = Lagrange(default_simplex(1), degree)
vertices = [n.get_point_dict().keys()[0] for n in element.dual.get_nodes()]
quadpts = numpy.array(quadrature.get_points(), dtype=numpy.float64)
quadwts = numpy.array(quadrature.get_weights(), dtype=numpy.float64)
numQuadPts = len(quadpts)
evals = element.get_nodal_basis().tabulate(quadrature.get_points(), 1)
basis = numpy.array(evals[mis(1, 0)[0]], dtype=numpy.float64).transpose()
numBasis = element.get_nodal_basis().get_num_members()
basisDeriv = numpy.array([evals[alpha] for alpha in mis(1, 1)],
dtype=numpy.float64).transpose()
print "order: %d" % order
print "degree: %d" % degree
print "numQuadPts: %d" % numQuadPts
print "basis:"
print basis
print "basisDeriv:"
print basisDeriv
Comments (13)
-
-
It's 1954571d098483d4de90629463480a25e9afa134. We need to get regression tests running.
-
I believe @knepley is correct here. Do you agree @martinal, @meg so that we can just revert this change before release?
-
Was this caused by confusion around what is the reference element in 1D, i.e. FIAT (-1, 1) and UFC (0, 1)?
-
I'm not at all intimately familiar with FIAT.
If I understand the situation correctly, in the commit you mentioned above the derivatives were scaled by 0.5 probably to "fix" some issue another place, probably failing regression tests in FFC.
I'm guessing it's related to the difference between FIAT and FFC/UFC reference cells [-1,+1] vs [0,1]. If this is correct, just reverting the above commit will show up as wrong results somewhere else (e.g. ffc or dolfin tests) and a followup fix will be needed somewhere.
-
Yes, Martin, it compensates with something else. I'll try bisecting FFC later to find the regression there.
-
Supposed fix in
jan/fix-issue-9
and innext
. -
@blechta Would it be a lot of work to add a simple py.test framework to FIAT? This example could go in as a test.
-
Adding a py.test framework is trivial, the work is writing useful tests.
-
Agree with Martin.
I have pushed to
jan/fix-issue-9
-
Fixed by f490794. Testing system changes will be merged after release.
-
- changed status to resolved
-
reporter Thanks! Matt
- Log in to comment
Format MWE to make it readable