← Back to team overview

dolfin team mailing list archive

Re: ConstantFunction

 

On Tue, Oct 28, 2008 at 10:53:01AM +0000, Garth N. Wells wrote:
> I started looking at ConstantFunction, and if we keep the old interface 
> and let ConstantFunction inherit from Function, it will involve quite a 
> lot of code for something rather simple because on the basis of the cell 
> type and the rank of the constant, an element needs to be chosen. To 
> keep ConstantFunction simple, is it reasonable that a ConstantFunction 
> require a FunctionSpace in its constructor? FFC is already generating 
> this since it treats constant functions as DG0 elements. This way the 
> ConstantFunction code will be really simple.
> 
> Garth

Locally, DG is always a subspace of whatever element space we have so
the interpolation of anything constant will be exact, and thus the
interpolation of something constant into whatever element space we
have will be exactly equal to the interpolation into DG.

So it is no limitation to assume that constant functions are always DG
functions. This means we don't need the FunctionSpace argument, but we
need to precompile some DG elements.

The problem may be if someone wants a DG element which is not
precompiled, like some strange vector/tensor-valued constant.

-- 
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References