[aspect-devel] Aspect logical operators

FELIPE ORELLANA ROVIROSA f_orellana at berkeley.edu
Tue Jan 3 23:06:25 PST 2017


 Hi Wolfgang,

   Thanks for replying.

    Now that you specify your point of view, I realize that this is a broad
problem concerning logic and physics.

    What you wrote is essentially true, but I think you are missing some
possible cases.

     As a note: Several codes use simple IF statements without ELSE (just
to do something in a weird case, or so..), but this all depends on how one
builds the program.

    I am trying to use a conditional statement to specify the value of a
variable (using an IF over the coordinates to specify a Boundary Condition,
say x<=0), but otherwise, when the condition is not true (for example
inside the domain) not to specify anything (cause there Stokes' fluid
equations are solved).

   What should I do in that case for the ELSE?   -1,..Nan..?

 I have tried and tested, but I am not getting physically reasonable
outcomes.

Felipe

On Tue, Jan 3, 2017 at 4:41 PM, Wolfgang Bangerth <bangerth at tamu.edu> wrote:

> 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/
>
> _______________________________________________
> Aspect-devel mailing list
> Aspect-devel at geodynamics.org
> http://lists.geodynamics.org/cgi-bin/mailman/listinfo/aspect-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/aspect-devel/attachments/20170103/bf8db5ce/attachment.html>


More information about the Aspect-devel mailing list