[aspect-devel] Aspect logical operators

FELIPE ORELLANA ROVIROSA f_orellana at berkeley.edu
Wed Jan 4 13:01:30 PST 2017


Hi Wolfgang,

  Thanks for replying.

   I used an IF for the boundary conditions using the coordinates x<=0 ||
x>=1e6 || z>=5e5, and had set the ELSE value to 0, which under the logic of
the IF would have meant 0 velocity_x inside the domain. It worked well !!!
the attached plot looks just as I wanted the system to behave in this case.

   Somehow Aspect knows that even if the velocity is set to 0 inside the
domain on the subsection Boundary velocity model, it has to be discarded,
as inside the domain the Stokes eqs. are solved.

  Anyways I think it is a good practice to use a 'very wrong' value (like
-1e99) in case we wanna catch a bug.

thanks,

Felipe

On Wed, Jan 4, 2017 at 5:29 AM, Wolfgang Bangerth <bangerth at tamu.edu> wrote:

> On 01/04/2017 12:06 AM, FELIPE ORELLANA ROVIROSA wrote:
>
>>
>>     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..?
>>
>
> If I need to specify a value that I know should not be used, I try to use
> something that is *so wrong* that I will immediately know if it happens to
> be used anywhere (although I *believed* that it would not be used).
>
> NaN is a good candidate in those cases, but I'm not sure that you can
> specify it in the formula parser. -1e100 is also a good candidate.
>
>
>  I have tried and tested, but I am not getting physically reasonable
>> outcomes.
>>
>
> But that must not have anything to do with the other problem above since
> you say that whatever happens in the ELSE branch should not matter.
>
>
> 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/20170104/bedd249d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s1.jpg
Type: image/jpeg
Size: 197978 bytes
Desc: not available
URL: <http://lists.geodynamics.org/pipermail/aspect-devel/attachments/20170104/bedd249d/attachment-0001.jpg>


More information about the Aspect-devel mailing list