<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
Dear all,<br>
<br>
I have defined a scalar function in 2D that depends on spatial
variables x and y, for example<br>
Function{<br>
F[] =X[]^2 + Y[]^2 ; <br>
}<br>
<b>Is there a way to compute its gradient in getdp?</b> (I know I
can do this analytically but eventually I would get <br>
more complex expressions and it would be great to have a way to
automatically do that)<br>
As far as I understand, the Grad/d syntax only works for discretized
quantities <br>
represented between braces <code>{}</code><br>
This is with the aim to use Grad F in the weak formulation at some
point. <br>
Could this be done during the postprocessing/postoperation steps?<br>
<br>
Some thoughts at the minute:<br>
- export F[X,Y] to a .pos file, compute the gradient using gmsh
plugin, write back to a .pos file <br>
and load it in getdp using gmshread. <br>
- do the same thing described here:
<a class="moz-txt-link-freetext" href="http://onelab.info/wiki/Tutorial/Coupled_problems">http://onelab.info/wiki/Tutorial/Coupled_problems</a><br>
i.e. solve a dummy auxiliary problem to copy F into a field
F_aux and then use {Grad F_aux} <br>
to postprocess the gradient<br>
<br>
Both ideas look really hacky and I wonder if there is a simpler
solution. <br>
Having read the doc and the forums I cannot find a way to do this, I
must be missing something.<br>
Finally, I also spotted this in the changelog:<br>
<pre class="verbatim">2.5.0 (March 12, 2015): added option to embed Octave and Python interpreters;
<b>extended "Field" functions with gradient;</b></pre>
I think this might be helping but I there is no other mention of
this in the doc.<br>
<br>
Thanks in advance for your help.<br>
<br>
Best,<br>
<br>
Ben<br>
<br>
--------------------<br>
<h1 style="white-space:nowrap; font-size:18px; color:#9e5b5b;
line-height:1; margin:0 0 8px 0"> BENJAMIN VIAL</h1>
<h4 style="white-space:nowrap; font-size:14px; color:#333;
line-height:1; margin:0 0 8px 0; font-weight:800"> Postdoctoral
research assistant</h4>
<h4 style="white-space:nowrap; font-size:14px; color:#333;
line-height:1; margin:0 0 8px 0; font-weight:400"> <a
href="http://antennas.eecs.qmul.ac.uk/"
style="white-space:nowrap; text-decoration:none; color:#333">Antennas
& Electromagnetics research group</a></h4>
<h4 style="white-space:nowrap; font-size:14px; color:#333;
line-height:1; margin:0 0 8px 0; font-weight:400"> <a
href="http://www.qmul.ac.uk/" style="white-space:nowrap;
text-decoration:none; color:#333">Queen Mary, University of
London</a></h4>
<h6 style="white-space:nowrap; font-size:14px; color:#999;
line-height:1; margin:0; font-weight:400"> <a
href="mailto:b.vial@qmul.ac.uk" style="white-space:nowrap;
text-decoration:none; color:#999">b.vial@qmul.ac.uk</a> | <span
style="white-space:nowrap; text-decoration:none!important;
color:#999!important"> +44 784 00 29 744</span> | <a
href="https://benjaminvial.org/" style="white-space:nowrap;
text-decoration:none; color:#999"> benjaminvial.org</a> </h6>
<br>
</body>
</html>