<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"Trebuchet MS";
panose-1:2 11 6 3 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Gilles,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">you can evaluate the value at a specified point in a PostOperation like this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Print[ u, OnPoint {xp, yp, zp} , File "MyResult" , Format SimpleTable];<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">You can also find the min/max value and/or the corresponding coordinates and store them<o:p></o:p></span></p>
<p class="MsoNormal" style="layout-grid-mode:char;text-autospace:none"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">in a register for later use in another PostProcessing (search in the manual for StoreMinInRegister
<o:p></o:p></span></p>
<p class="MsoNormal" style="layout-grid-mode:char;text-autospace:none"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">and StoreMinXinRegister):<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Print[ u, OnElementsOf TotalDomain, StoreMaxInRegister 1, Format SimpleTable, File "Result_Dummy.txt"];<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">There are various examples in the folder benchmarks in the source code showing the usage<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">of registers and how to print number results directly in Gmsh’s sidebar.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Michael<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="DE" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="DE" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> getdp [mailto:getdp-bounces@ace20.montefiore.ulg.ac.be]
<b>On Behalf Of </b>gilles quemener<br>
<b>Sent:</b> Monday, May 23, 2016 2:30 PM<br>
<b>To:</b> getdp@onelab.info<br>
<b>Subject:</b> [Getdp] Evaluate a scalar field at some points, print values on terminal and use them in PostOperation<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">Hi,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">Currently I am trying to evaluate a scalar field solution at some given points<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">and to evaluate the min and max of this scalar field. Once this is done I would
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">like to print these quantities on the terminal window as well as to use them for<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">further PostOperation.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">Assume GetDP has solved my problem and is able to compute scalar fieldsu<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">and utotm as described in the GetDP script below.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">How can I get the following quantities at Point {xp, yp, zp}:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">u1 = u(xp, yp, zp)
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">u2 = utotm(xp, yp, zp)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">and:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">umin = min(u) over a region<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">umax = max(u) over a region<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">utotmmin = min(utotm) over a region<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">utotmmax = max(utotm) over a region<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">I have tried several syntaxes for the different quantities above, but none passed the parsing phase w/o error.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">Therefore if someone has clues or a solution, it would be very helpful !<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066">//Post Processing</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066">//===============</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
<br>
</span><span style="font-family:"Courier New";color:#000066">PostProcessing{</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> {Name CubicCavity; NameOfFormulation CubicCavity;</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> Quantity{</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> {Name u; Value {Local{[{u}]; In TotalDomain; Jacobian JVol;}}}</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> {Name utotm; Value {Local{[{u}-scalpot[]]; In TotalDomain; Jacobian JVol;}}}</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> }</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> }</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066">}</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
<br>
</span><span style="font-family:"Courier New";color:#000066">//Post Operation</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066">//==============</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
<br>
</span><span style="font-family:"Courier New";color:#000066">PostOperation{</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> {Name Map_u; NameOfPostProcessing CubicCavity;</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> Operation{</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> Print [ u, OnElementsOf GammaInner, File "uIIsur_3D.pos" ];// works !</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> Print [ utotm, OnElementsOf GammaInner, File "uIImuI_3D.pos" ];// works !</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> Print [ utotm, OnElementsOf GammaInner, Iso {0.65}, Sort Position, Format SimpleTable, File "out.txt" ];// works !</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> // Note: Be carefull, in order to visualize the .pos file below in Gmsh, it does not work w/ option "Iso-values"</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> // even if it is a single iso-contour/iso-value, I have to use option "Continuous Map" (?!?!)</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> Print [ utotm, OnElementsOf GammaInner, Iso {0.65}, Format Gmsh, File "toto.pos" ];// works !</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> // How to print the value of scalar field u or utotm at a specific point (e.g. (0,0,1.3)) on terminal ?</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> Printf [ "U=%g", u(0, 0, 1.3) ];</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> Printf [ "Utotm=%g", utotm(0, 0, 1.3) ];</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> // How to get min and max values on some region and use them in other PostOperation ?<br>
<br>
</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> umin = Min(u[]) OnElementsOf GammaInner;<br>
umax = Max(u[]) OnElementsOf GammaInner;<br>
<br>
</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> N = 10;</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> du = (umax - umin) / N;</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> For i In (1, N)</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> uval = umin + (i - 0.5) * du;<br>
<br>
</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> Print[ utotm, OnElementsOf GammaInner, Iso { uval }, Sort Position, Format SimpleTable, File >> "out.txt" ];</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> EndFor</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#000066"> }</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066"> }</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><br>
</span><span style="font-family:"Courier New";color:#000066">}</span><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">Thanks a lot for any help,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> Gilles
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p> </o:p></span></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>