← Back to team overview

dolfin team mailing list archive

Re: ConstantFunctions have undefined value rank and dimension

 

Martin Sandve Alnæs wrote:
> I just added checks for valid Functions to the assembler, but this
> turned out to break some demos so I changed it to warnings.

This seems like helpful checks to make!

> 
> The reason is that Function(mesh, 0.0), which creates a ConstantFunction,
> is used for zero vector functions as well, which leaves the value shape
> of such a function undefined. This makes error checking impossible,
> which is not very nice.
> 
> In my opinion, the correct next step is to keep these warnings,
> and turn them into errors after "a while". We should either add
> support for ConstantFunctions with tensor shape (would be nice),
> or make the demos and apps use user-define functions.

Adding tensor shape to the existing concept of ConstantFunction seems
like the way to go. IMHO, the convenience if this over user defined
functions is too great to discard.

Would it not just amount to having ConstantFunction::rank() return the
proper value as determined by the mutable member size, instead of 0? (on
line 28 of ConstantFunction.cpp)

/Dag

> 
> --
> Martin
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References