-----Ursprüngliche Nachricht----- Von: firedrake-bounces@imperial.ac.uk [mailto:firedrake- bounces@imperial.ac.uk] Im Auftrag von Lawrence Mitchell Gesendet: 28 October 2015 14:46 An: firedrake@imperial.ac.uk Betreff: Re: [firedrake] Inverse of .dat.data
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 28/10/15 13:20, Buesing, Henrik wrote:
Dear all,
Ok. Maybe this is the way to go:
As before, I have a function temp(p,h), which shall return temperature dependent on pressure and enthalpy. I insert UFL representations of p and h into temp(,).
Then I'm doing a
p = assemble(p).dat.data[0] h = assemble(h).dat.data[1]
Now, I execute some operations on the arrays. In the end I want to have the UFL representation of temp (the same as what I inserted as p and h).
So how do I get the UFL representation back from the array?
I'm not sure I understand what you mean by get the UFL representation back. Can you explain what you're trying to achieve? I am guessing here, but I suppose you have a term in your equation which is either an unknown or has some known value, depending on an equation of state. I think you should be able to write this using "conditional" to select one or the other depending on the value of the equation of state (if you can represent it using UFL.
[Buesing, Henrik] At the moment I have a numpy array in the end. However I want a function back to be able to use UFL again, e.g. doing gradtemp = (temp('+') - temp('-'))/Delta_h_facet Yes, you can think of the routine as an EOS. I tried to use UFL, but in my EOS code I have int(). I do not know how to represent this in UFL (see my previous mail "UFL statement for python int()"). Also I have an array of values DATA_temp[getD-1], which I then want to access with a UFL function getD, which probably makes no sense... Henrik
Cheers,
Lawrence
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux)
iQEcBAEBAgAGBQJWMNGVAAoJECOc1kQ8PEYv1GkH/iM1vrp3HNtkQe/0p+hRGrLG FrugYKQaxyoSGVM+rIqcMKWMSB+emnL5MThOhFazi9b3GhwmgvrVvRIwG7zaOPzf UuwE7URITzfRibBnraWDo42QFD1fnnWRhks9Rg61YhuukR0o24LVqxkSALimBW6e VQ5l61/71t/1rLYS20zsCwaOFL4s7w8RcRofULyDMGWkgL4SYMkERONCjUZ6WKuR iOYmApMB22Gw3wV6xt624VLwXcU+xSb+F82wRx0GWL/DAAiKGAPNAaH4Sdw++qcy 96PVyert8vNXVdu9jGZ7XsAg+6FSv9sMVT98Cd2FehD28Y2bn1PrYp7XXk/dekI= =+m7j -----END PGP SIGNATURE-----
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake