← Back to team overview

ufl team mailing list archive

Re: conditionals

 


Kristian Oelgaard wrote:
> 
> 
> On 30 January 2010 11:56, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>> In the UFL manual, there is a section on 'conditionals' (sec 2.11) but
>> I'm unsure of the what the intention is. Is the idea that they can be
>> used in forms? It would be really useful if I could do something like:
>>
>>  un   = dot(u, n)
>>  cond = lt(un, 0.0)
>>
>> and use 'cond' (= 0 or 1) in a form.
> 
> As I recall it, we (you and I) thought it would be nice to have
> conditionals so we could use it to determine if a facet was an outflow
> facet or not at runtime in the generated C++ code. I think the idea was
> to simply translate the conditionals in a form into
> 
> if ( condition )
> {
>  do something
> } 
> blocks in the generated code.
> However, due to other improvements in the UFL language we can now
> determine the outflow facets in a more elegant way, in my opinion, 

The problem is that it doesn't generalise well to time-dependent
problems. I would like to a function that can return the sign of a function.

Garth

> so we
> didn't look further into the conditionals. That being said, there might
> be other cases where it will still be useful.
> 
> Kristian
>> Garth
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~ufl
>> Post to     : ufl@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~ufl
>> More help   : https://help.launchpad.net/ListHelp
>>
> 





Follow ups

References