← Back to team overview

dolfin team mailing list archive

Re: trace_tabulate

 

Perhaps you're right. I thought I had tested this. I will push the change.

Rob

On Apr 28, 2006, at 8:55 AM, Garth N. Wells wrote:

Hi Rob,

Should line 97 of polynomial.py  be

 xs_dim = map( shapes.pt_maps[ myshape ][ d ]( e ) , xs )

instead of

 xs_dim = map( shapes.pt_maps[ myshape ][ d ][ e ] , xs )?

When I make this change, the below test program works. Without making
the change, I get the "unsubscriptable object" error message (also
below).

Garth

# Test program
#
# Python modules
import sys

# FIAT modules
from FIAT.shapes import *
from FIAT.Lagrange import Lagrange
from FIAT.quadrature import *

q = make_quadrature(shapes.LINE, 1)
t = Lagrange(TRIANGLE, 1).function_space().trace_tabulate(1, 0,
q.get_points())
print t


Traceback (most recent call last):
  File "test.py", line 13, in ?
    t = Lagrange(TRIANGLE, 1).function_space().trace_tabulate(1, 0,
q.get_points())
  File "/usr/lib/python2.4/site-packages/FIAT/polynomial.py", line 97,
in trace_tabulate
    xs_dim = map( shapes.pt_maps[ myshape ][ d ][ e ] , xs )
TypeError: unsubscriptable object


On Thu, 2006-04-27 at 10:41 -0500, Robert C. Kirby wrote:
Garth,
I'm not sure why you get an unsubscriptable object, but
there are at least two problems in how you are using/understanding
the function.

1.) First, it's not necessarily a quadrature rule that you're
tabulating at, but any set of points.  This has no impact on your
problem.
2.) Second, you have to provide the one-dimensional points at which
to tabulate since you said "d=1".  So if you wanted the Gauss points
along edge number 1, you would compute the Gauss points on the
reference line (q=quadrature.make_quadrature(shapes.LINE,degree)),
and then call trace_tabulate( d , 1 , q.get_points() ).
Trace_tabulate maps the points on the reference line to the
appropriate edge.

Let me know if there is still a problem.

Rob

On Apr 27, 2006, at 10:14 AM, Garth N. Wells wrote:

Hi Rob,

I'm playing around with calling trace_tabulate from FFC. Before I
elaborate my problem, let me check that I'm on the right path with
trace_tabulate.

In a nutshell, does trace_tabulate return the basis functions on
edge/face e of dimension d (d=2->face, d=1->edge, etc) given a
quadrature scheme of dimension d for an element of dimension n? (e
and d
being the same as used in the trace_tabulate argument list).

When I try in FFC

junk = self.element.function_space().trace_tabulate(1, 1, points)

where
  self.element.function_space() is of type
FIAT.polynomial.ScalarPolynomialSet
and
  points = [(0.0)]

I get the error

  *** unsubscriptable object

Garth