This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Crash when attempting to plot vector valued function

0 votes

Hi,

I'm currently trying to compute a numerical solution for the elastic catenary problem (see H. Max Irvine, Cable Structures, Chap.1) which describes the geometry of a hanging elastic cable fastened on both extremities, using FEniCS.

I'm studying the case in which the first anchor is in position (0,0,0) (Cartesian space coordinates) and the second in (3.0,4.0,14.0) and I have a perfectly running code (returned data corresponds to analytic solution), that returns the position of each points of the cable in each subdivision point, stored as a vector valued function called "r".

Now I'd like to do some post-processing, and particularly I'd like to plot the normal vector to the cable, which should be in the case of a biregular arc the normalized second derivative of the displacement, represented by r. Here is the code I have trouble with:

Dr=r.dx(0) #first derivative of the displacement
DrP=project(Dr,V) #projection to V=VectorFunctionSpace(mesh, "Lagrange", degree=degree, dim=3)
DDr=DrP.dx(0) #second derivative of the displacement
C=DDr*(1/sqrt(dot(DDr,DDr))) #Normal vector
CP=project(C,V) #projection to V

This solution works without problem and the CP output is a vector valued function that I should be able to plot using the mode "glyphs" of the plot command as it is done here: FEniCS tutorial, Fundamentals (see the Computing Derivative section).
So I try to plot CP:

plot(CP,mode="glyphs")

But when I run the code the computation stops without displaying any plot window or error. It looks like the Python console crashes. Has anyone already experienced such a problem? At the time, I'm wondering if the problem comes from the hardware I'm using but I'm a beginner in FEniCS and Finite Elements methods so my implementation may be clumsy...

Thanks for the answers,

Best regards,

Mathieu F.

asked Apr 29, 2015 by MathieuFV FEniCS User (1,490 points)
...