← Back to team overview

dolfin team mailing list archive

Re: Visualizing basis functions

 

On Sun, Aug 10, 2008 at 03:54:25PM +0200, Evan Lezar wrote:
> Hi there
> 
> After some time away I have once again been able to try and get do grips with
> dolfin.  By a bit of a round about way I was able to solve a magnetic-field
> based eigenvalue problem giving me the cutoff wavenumbers for a square
> waveguide structure - it is still, however, a work in progress.
> 
> One question I do have is regarding the visualization of the results I have
> obtained.  To this end I have two questions - the first is simply the
> visualization of the basis functions (vector Nedelec) themselves (see the
> attached image taken from Finite Element Method for Electromagnetics by Volakis
> et al) - how could this be achieved in dolfin?  Put another way - how can I set
> the coefficient for a single basis function equal to 1 and zero the rest and
> display the result?

Marie Rognes has code for doing just this (plotbases.py in the
bdm-2007 repository). I don't want to post it myself, but I imagine
she would be willing to post the code. Marie?

> Then the second question builds on this.  If I have the coefficients associated
> with all the basis functions in a system, how would I set up a function to
> calculate the weighted sum of the vector basis functions anywhere in the mesh? 
> 
> I am using pydolfin.
> 
> If anything is unclear, please contact me so that I can clarify matters.

If you have a Function u, you can just call u.eval() to evaluate it at
any point x. This will locate the cell to which x belongs and compute
the linear combination. Take a look at the demo in demo/function/python/.

-- 
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References