← Back to team overview

dolfin team mailing list archive

Re: Example setting Quadrature Elements in Dolfin

 


On Jun 21, 2008, at 9:50 AM, Kristian Oelgaard wrote:

Quoting mspieg <mspieg@xxxxxxxxxxxxxxxxx>:

Hi all,
     does anyone have an example  of how to access the coordinates
and set the Dofs (quadrature points) for a user defined Function
defined with a Quadrature element?  From what I can glean from the
documentation, this should be possible, but I can't quite figure out
how to do it.

To set the values of you user defined function, just overload the eval()
function like you would for a function defined on a 'normal' element.
When the function is being integrated in the form it will be evaluated at quadrature points, meaning that whatever coordinates are entering eval() (the x
argument) will be the location of the quadrature point (the 'dof').


Thanks Kristian,

I figured out how to do this and it all works...the only issue is that this function is a source term in a time-dependent non-linear solve that is rather expensive to compute. Right now it is being evaluated every time the residual vector is being assembled, but really only needs to be calculated once per time step.

I'm curious to know if there is a straightforward way to evaluate it once (at the quadrature points), outside of the form assembly, and then just pass the tabulated function to the form within the non- linear solve. (I'm getting excellent quadratic convergence in the newton solve, but this would speed things up by about a factor of 3-4).

All help greatly appreciated
cheers
marc



----------------------------------------------------
Marc Spiegelman
Lamont-Doherty Earth Observatory
Dept. of Applied Physics/Applied Math
Columbia University
http://www.ldeo.columbia.edu/~mspieg
tel: 845 704 2323 (SkypeIn)
----------------------------------------------------





----------------------------------------------------
Marc Spiegelman
Lamont-Doherty Earth Observatory
Dept. of Applied Physics/Applied Math
Columbia University
http://www.ldeo.columbia.edu/~mspieg
tel: 845 704 2323 (SkypeIn)
----------------------------------------------------



Follow ups

References