dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #08334
Re: Example setting Quadrature Elements in Dolfin
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').
Knowing this you might not even need to access the coordinates??
If you do, you can get the coordinates in the following way (there might be a
cleverer way?):
Create the relevant dof map from a given form containing the QuadratureElement
DofMap dof_map(a.form().create_dof_map(0), mesh);
and call the tabulate_coordinates() function.
Have a look in dolfin/dolfin/fem/DofMap.h and the header file that you generate
with FFC for the exact syntax.
Kristian
> many thanks
> 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)
> ----------------------------------------------------
>
>
>
Follow ups
References