← Back to team overview

ffc team mailing list archive

Re: vertexeval function

 

On Mon, May 29, 2006 at 07:10:23PM +0200, Garth N. Wells wrote:
> For evaluating functions at vertxes, FFC writes a function
> 
> void vertexeval(real values[], unsigned int vertex, const real x[],
> const Mesh& mesh) const
> 
> Would there be a problem in changing "const real x[]" to "const
> GenericVector x"? This would make it easier to represent a function
> using different vector data structures.
> 
> Garth

The problem would be that vertexeval() would then need to call
GenericMatrix::operator() (uint i) which is slow for PETScSparseMatrix.

But perhaps calling PETScSparseMatrix::array() is just as slow?

vertexeval() is just a temporary fix for Lagrange elements. Somehow,
we need to compute the values at all vertices so we can write the
solution to file. What we should really do would be to compute the
projection onto piecewise linears and then just pick the values.

Maybe we could always generate code for the projection onto piecewise
linears when a form is compiled in FFC? If U is in V' and V is the
space of piecewise linears, then we need to compute the projection
W of U onto V:

    int v W dx = int v U dx for all v in V

On matrix form, we have

    MW = b

where b represents the right-hand side int U v dx.

The mass matrix M is already computed by default in DOLFIN so we don't
need to generate it. We only need to generate the linear form v*U*dx.

Then we could remove vertexeval.

/Anders



Follow ups

References