[aspect-devel] Aspect logical operators

Wolfgang Bangerth bangerth at tamu.edu
Tue Jan 3 16:41:51 PST 2017


On 01/03/2017 12:33 PM, FELIPE ORELLANA ROVIROSA wrote:
>
>        I wonder about Aspect logical operators. I have browsed on the handbook
> at no avail. I would like to know if the Aspect's IF statement always requires
> an ELSE type of assignment.
>
>     All the IF statements I read have the structure IF(condition, value,
> othervalue)
>
>      where 'othervalue' is the value that must be assigned when the
> 'condition' is not fulfilled, typically on the complement of the domain.
>
>    Isn't it possible to have a simpler IF(cond, value)?
>
>    This latter would be a lot more useful, as one could assign values wherever
> needed, and also construct the now-built-in IF easily using two of these
> simpler IFs.
>
>   If I just want/know the value when the condition is fulfilled, what should I
> do otherwise (else)..? assign 0..-1 ??..

Well, a condition only makes sense if it is false sometimes, right? Because if 
it is always true, then you can just take the THEN value and the ELSE value is 
not needed. On the other hand, if the condition is sometimes false, then what 
value would you use in your case? Say, if you want to use the expression for 
the initial temperature, you do need to provide a temperature one way or the 
other -- you can't just say "don't assign any temperature here at all".

Or maybe I misunderstand. In what conditions would you use your construct 
without an ELSE value?

Best
  W.

-- 
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bangerth at colostate.edu
                            www: http://www.math.colostate.edu/~bangerth/



More information about the Aspect-devel mailing list