Subject: [FIAT-dev] Added trace_tabulate_jet to ScalarPolynomialSet. [...]

From: [email-masked]
Date: Mon, 01 May 2006 16:28:45 +0200

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

---

From: "Garth N. Wells" <[email-masked]>
Date: Mon, 01 May 2006 17:01:50 +0200

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, [email-masked] wrote:
> _______________________________________________
> FIAT-dev mailing list
> [email-masked]
> http://www.fenics.org/cgi-bin/mailman/listinfo/fiat-dev

---

From: "Robert C. Kirby" <[email-masked]>
Date: Mon, 1 May 2006 10:12:09 -0500

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.

---

From: "Garth N. Wells" <[email-masked]>
Date: Mon, 01 May 2006 17:27:38 +0200

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

---

From: "Robert C. Kirby" <[email-masked]>
Date: Mon, 1 May 2006 10:30:00 -0500

Something like this should work if added to VectorPolynomialSet.
I will put it in.

---

From: "Robert C. Kirby" <[email-masked]>
Date: Mon, 1 May 2006 10:32:21 -0500

Come to think of it, you probably want something a little different,  
since this gives you a vector of scalar-jets.  You want to do  
something like index-swizzling so that for each multiindex, for each  
order, you get the vector.

---

From: "Robert C. Kirby" <[email-masked]>
Date: Mon, 1 May 2006 10:34:09 -0500

Come to think of it, the way you suggest actually follows what's in  
there for tabulate_jet.  I'll just push your contribution.

Rob