[aspect-devel] Aspect logical operators

Rene Gassmoeller rene.gassmoeller at mailbox.org
Thu Jan 5 01:59:37 PST 2017


Hi Felipe,

from your description it looks like you are assigning a velocity
boundary condition via the function plugin, is this correct? In this
case ASPECT 'knows' not to apply the boundary condition to anything
inside the domain, because the function is not  evaluated (and the
corresponding constraint is not applied) for anything but the boundary.
Therefore, you do not need to manually exclude the interior of the
domain in your function, which makes writing the function much simpler.

Nice to know that your model is working now.

Best,

Rene



On 01/04/2017 10:01 PM, FELIPE ORELLANA ROVIROSA wrote:
> 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
> <mailto: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 <mailto:bangerth at colostate.edu>
>                                www:
>     http://www.math.colostate.edu/~bangerth/
>     <http://www.math.colostate.edu/%7Ebangerth/>
>
>     _______________________________________________
>     Aspect-devel mailing list
>     Aspect-devel at geodynamics.org <mailto:Aspect-devel at geodynamics.org>
>     http://lists.geodynamics.org/cgi-bin/mailman/listinfo/aspect-devel
>     <http://lists.geodynamics.org/cgi-bin/mailman/listinfo/aspect-devel>
>
>
>
>
> _______________________________________________
> 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/20170105/abb75107/attachment.html>


More information about the Aspect-devel mailing list