This is my first foray into Python, so I don't really understand the
finer points. Drawing on the function existing tabulate_jet in the
class
VectorPolynomialSet, should a function trace_tabulate_jet in
VectorPolynomialSet look like (?)
def trace_tabulate_jet( self , d , e , order , xs ):
myshape = self.domain_shape()
xs_dim = map( shapes.pt_maps[ myshape ][ d ]( e ) , xs )
return [ self.select_vector_component( i ).tabulate_jet( order ,
xs_dim ) \
for i in range(self.tensor_shape()[0]) ]
I'd really like to have something that does this because I've added
functionality to FFC to handle boundary integrals and it relies on
having such a function to work with both scalar and vector
polynomials.
Garth
On Mon, 2006-05-01 at 10:12 -0500, Robert C. Kirby wrote:
It works because you applied it to an instance of a subclass that
supports tabulate_jet. Dynamic binding in Python hides some of these
issues (it wouldn't compile in C++). To do the vector-valued case,
you need to do it to every component of the vectors. It's a similar
function, but trickier.
On May 1, 2006, at 10:01 AM, Garth N. Wells wrote:
Rob,
Is it just a question of adding a similar function to the class
VectorPolynomialSet as below? When I do this, the output looks
reasonable.
Garth
--- polynomial.py 1 May 2006 14:28:43 -0000 1.8
+++ polynomial.py 1 May 2006 14:56:33 -0000
@@ -283,6 +283,12 @@
for i in range(self.tensor_shape()[0]) ]
+ def trace_tabulate_jet( self , d , e , order , xs ):
+ myshape = self.domain_shape()
+ xs_dim = map( shapes.pt_maps[ myshape ][ d ]( e ) , xs )
+ return self.tabulate_jet( order, xs_dim )
+
+
# The code for TensorPolynomialSet will look just like
VectorPolynomialSet
# except that we will flatten all of the coefficients to make them
# look like vectors instead of tensors.
On Mon, 2006-05-01 at 16:28 +0200, fiat@xxxxxxxxxx wrote:
Commit from kirby (2006-05-01 16:28 CEST)
-----------------
Added trace_tabulate_jet to ScalarPolynomialSet.
Patch thanks to Garth.
Only problem is that tabulate_jet is undefined on the
AbstractPolynomialSet (in the patch), so I
moved it to ScalarPolynomialSet. It's not hard to generalize the
jet to vector-valued spaces, but gives for a large number of
indices. Perhaps in the future...
fiat FIAT/polynomial.py 1.8
_______________________________________________
FIAT-dev mailing list
FIAT-dev@xxxxxxxxxx
http://www.fenics.org/cgi-bin/mailman/listinfo/fiat-dev
_______________________________________________
FIAT-dev mailing list
FIAT-dev@xxxxxxxxxx
http://www.fenics.org/cgi-bin/mailman/listinfo/fiat-dev