[aspect-devel] building a temperature initial condition
Rene Gassmoeller
rene.gassmoeller at mailbox.org
Fri Feb 24 16:05:01 PST 2017
Hi Felipe,
While John is right that you can declare several components for a
function, I am not sure this will help in your specific case, because it
is impossible (as far as I know) to access one component from another
component (and the temperature plugin expects only a single component in
the function anyway). If your 'u' would be a complicated constant, you
could declare it as 'set Function constants = ...' and access it in your
function expression. Unfortunately it depends on x,y,z.
So you will probably need to duplicate it in every place of your
function (you can break lines, I think with '\'?). If you feel the
function is still to unreadable, you have likely crossed the line, where
a plugin is more appropriate then a complicated function expression.
Though from experience where this line is is different for every user (I
have seen seven line function expressions with multiple if-else
statements and trigonometric functions, while I switch to writing a new
plugin as soon as I need more than two lines).
Best,
Rene
On 02/24/2017 02:31 PM, John Naliboff wrote:
> Hi Felipe,
>
> deal.II can certainly handle multiple expressions for a given function
> (https://www.dealii.org/8.4.0/doxygen/deal.II/classFunctionParser.html).
> I think some of the particle routines in ASPECT also allow for
> multiple expressions?
>
> However, if you plan on writing a moderately complicated expression(s)
> perhaps a plugin is more suitable?
>
> Cheers,
> John
> *************************************************
> John Naliboff
> Assistant Project Scientist, CIG
> Earth & Planetary Sciences Dept., UC Davis
> On 02/24/2017 10:56 AM, FELIPE ORELLANA ROVIROSA wrote:
>>
>> Hi all,
>>
>> I wonder whether it is possible to build up a Temperature
>> function using several variables. I am working on an initial
>> condition for Temperature (Function expression)
>>
>> I am trying to implement something like this
>>
>> u = u(x,y,z...)
>>
>> T = f1(u) + f2(u) + f3(u) + ...
>>
>>
>> In this case, the predefinition of u allows me to save writing.
>> Otherwise I would need to write the 'long' expression of u on the
>> Function expression for T several times..
>>
>> somehow, can the Function expression, or that part of the code,
>> have more than one function, and do composition of functions ?
>>
>> Is this possible?
>>
>> Felipe
>>
>>
>> _______________________________________________
>> Aspect-devel mailing list
>> Aspect-devel at geodynamics.org
>> 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/20170224/4c9f9419/attachment.html>
More information about the Aspect-devel
mailing list