On Thu, May 22, 2008 at 12:42 AM, Anders Logg <[EMAIL PROTECTED]> wrote: > On Tue, May 20, 2008 at 09:43:54PM +0200, Evan Lezar wrote: >> Hi there >> >> As an initial attempt, I am trying to use fenics to compute the resonant >> modes of a rectangular waveguide - and as such I need to solve an >> eigenvalue problem of the form [A]x = lambda[B]x where x represents a >> vector of coefficients of the basis functions used to calculate the >> entries of the stiffness ([A]) and mass ([B]) matrices. >> >> It is easy to assemble the matrices, and I have solved the eigenvalue >> problem using eigs() ... but now I have the calculated coefficients and >> I would like to plot the weighted sum of the basis functions (the finite >> element solution). >> >> Any help on the matter would be much appreciated. >> >> Thanks >> Evan > > Are you doing this in Python or C++? > > If x is the vector, then you can do > > Function u(mesh, x, a); > > where a is the form in C++. > > In Python, you need to do > > Function u(element, mesh, x); > > where element is the FiniteElement you have used for the trial space. > > To plot the solution, just do > > plot(u); > > -- > Anders > _______________________________________________ > DOLFIN-dev mailing list > [email protected] > http://www.fenics.org/mailman/listinfo/dolfin-dev >
Thanks for the reply - something is happening now at least :) Now that I have the function - how do I specify at which coordinates it should be plotted? At the moment, there are a couple of vectors being plotted, but I would like a higher density. Also, is there a way to plot the mesh as well as the function in viper? Thanks Evan -- visit http://randomestrandom.blogspot.com _______________________________________________ DOLFIN-dev mailing list [email protected] http://www.fenics.org/mailman/listinfo/dolfin-dev
