Subject: [FEniCS-users] (no subject)

From: phil marinier <[email-masked]>
Date: Tue, 11 Aug 2009 09:44:16 -0400

I am writing a project in C++, but we decided that it isn't possible to be generic enough using that language and I am going to translate it into python. My main problem was finding the gradients. I had writen my own gradient function in C++, but it was very mesh specific. I assured my supervising prof that I could find gradients in python very easily as I had done it before. 
What I had done before was plot(grad(u)), this no longer works for me. Is this because of a change in the package? This is what I get:

>>> plot(grad(Phi))
Object cannot be plotted directly, projecting to piecewise linears.
RuntimeError: Don't know how to plot given object and projection failed: grad(<Function in <Function space of dimension 1089 (<CG1 on a <triangle of degree 1>>)>>)

This is exaclty the same way that I had done this before. 

My final goal is to get the gradients normal to a boundary, in 2d for the moment, but later in 3d. So if I have a 2d domain defined on the x-y plane, my gradient at the edge would be a combination of the x and y components of the gradient function. 

Any help would be appreciated

Phil