<html><body><div style="font-family: trebuchet ms,sans-serif; font-size: 12pt; color: #000066"><div>Hi Michael,<br><br>Thanks a lot for your answer, it helped me a bit but I still have some problems using registers.<br>In the GetDP, Gmsh and Onelab sources, I could not find any folder named "benchmarks".<br>However, I looked at the GetDP manual as well as at the different examples in the "models" </div><div>folder but still I could not figured out how to use registers in Print and Echo commands.<br>In the following code snippet you will find among other things I have tested what fails at parsing </div><div>time.<br><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;">//Post Operation</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;">//==============</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;">PostOperation{</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> {Name Map_u; NameOfPostProcessing CubicCavity;</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> Operation{</span><br><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> // Stores in register #1 the scalar potential value evaluated at point {0, 0, 0.5}:</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> Print [ utotm, OnPoint {0, 0, 0.5}, StoreInRegister 1, Format SimpleTable, File "Result_Dummy.txt" ]; // WORKS !!!</span><br><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> // Stores in register #2 the minimum value of the scalar potential over region GammaInner:</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> Print [ utotm, OnElementsOf GammaInner, StoreMinInRegister 2, Format SimpleTable, File "Result_Dummy.txt" ]; // WORKS !!!</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> Echo [ Sprintf("Min = %g", #1) ]; // FAILS !!!!</span><br><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> // Stores in register #3 the maximum value of the scalar potential over region GammaInner:</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> Print [ utotm, OnElementsOf GammaInner, StoreMaxInRegister 3, Format SimpleTable, File "Result_Dummy.txt" ]; // WORKS !!!</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> Echo [ Sprintf("Max = %g", #2) ]; // FAILS !!!!</span></div><div><br data-mce-bogus="1"></div><div> // Tentative to retrieve iso-contour points for the potential utotm = (utotmMin + utotmMax) / 2 :<br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> Print [ utotm, OnElementsOf GammaInner, Iso { 0.5 * (#2 + #3) }, Sort Position, Format SimpleTable, File "out1.txt" ]; // FAILS !!!!</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> Print [ utotm, OnElementsOf GammaInner, Iso { Evaluate[ 0.5 * (#2 + #3)] }, Sort Position, Format SimpleTable, File "out2.txt" ]; // FAILS !!!!</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> }</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;"> }</span><br><span data-mce-style="font-family: 'courier new',courier,monaco,monospace,sans-serif;" style="font-family: "courier new",courier,monaco,monospace,sans-serif;">}</span><br></div><div><br data-mce-bogus="1"></div><div>Thanks a lot for any help,<br></div><div><br data-mce-bogus="1"></div><div data-marker="__SIG_PRE__"><div> <span data-mce-style="font-family: 'trebuchet ms',sans-serif; color: #000080;" style="font-family: "trebuchet ms",sans-serif; color: rgb(0, 0, 128);"> Gilles<br></span></div></div><br><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De: </b>"michael asam" <michael.asam@infineon.com><br><b>À: </b>quemener@lpccaen.in2p3.fr<br><b>Cc: </b>getdp@geuz.org<br><b>Envoyé: </b>Mardi 24 Mai 2016 09:53:54<br><b>Objet: </b>RE: Evaluate a scalar field at some points, print values on terminal and use them in PostOperation<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">
<style><!--
@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;}
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>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Gilles,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </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:</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];</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </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</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
</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):</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"];</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </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</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.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cheers,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Michael</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="DE">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="DE"> 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</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">Hi,</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> </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</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
</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</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">further PostOperation.</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> </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</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.</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> </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}:</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">u1 = u(xp, yp, zp)
</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">u2 = utotm(xp, yp, zp)</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">and:</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">umin = min(u) over a region</span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">umax = max(u) over a region</span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">utotmmin = min(utotm) over a region</span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">utotmmax = max(utotm) over a region</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> </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.</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 !</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"></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"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> </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"></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"></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"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> </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"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> </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"></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"></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"></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"></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"></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"></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"></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"></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"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066">Thanks a lot for any help,</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> </span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> Gilles
</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> </span></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Trebuchet MS","sans-serif";color:#000066"> </span></p>
</div>
</div>
</div>
</div>
</div><br></blockquote></div></div></body></html>