<div dir="ltr"><div>Yes, the stresses belong in the $ElementData section for sure. <br></div><div>I think to correctly display it, you'll need to create rows of element data with 10 entries - 1 for the element number and 9 for the stress tensor values:</div><div><br></div><div>1 sigx sigxy sigxz sigxy sigy sigyz sigxz sigyz sigz <br></div><div><br></div><div>I don't know if copying and pasting this pattern in ElementData will work without some tweaks... (there is an InterpolationScheme section that I don't quite understand). If it were me, I would add the data using the gmsh API and it will handle the output format how it likes. <br></div><div><br></div><div>Sincerely,</div><div>Max<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 30, 2019 at 2:42 PM Gaetano Camarda <<a href="mailto:gaetano_18@live.it">gaetano_18@live.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div>
<div style="direction:ltr">
<div>Thanks for your help, but I think I have not understood well. </div>
<div style="direction:ltr">I have a mesh all brick (8 nodes) and my stress field matrix is composed this way:</div>
<div style="direction:ltr">1 sigx sigy sigz sigxy sigyz sigxz</div>
<div style="direction:ltr">   ...     ....    .....    .....    ......    .....</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">In each row is express the stress state of the element, I think I have to copy this matrix into .msh file as $ElementData, but I do not unsterstand well the input format, is that right this way? </div>
<div style="direction:ltr"><br>
</div>
<div><br>
</div>
<div class="gmail-m_7401127588440216567ms-outlook-ios-signature">
<div style="direction:ltr"><a href="https://aka.ms/qtex0l" target="_blank">Outlook</a> per iOS</div>
</div>
</div>
<div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_7401127588440216567divRplyFwdMsg" dir="dir="ltr""><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>Da:</b> Max Orok <<a href="mailto:morok@mevex.com" target="_blank">morok@mevex.com</a>><br>
<b>Inviato:</b> martedì, gennaio 29, 2019 7:14 PM<br>
<b>A:</b> Gaetano Camarda<br>
<b>Cc:</b> <a href="mailto:gmsh@onelab.info" target="_blank">gmsh@onelab.info</a><br>
<b>Oggetto:</b> Re: [Gmsh] Post-processing stress field
<div> </div>
</font></div>

<div dir="ltr">
<div dir="ltr">
<div>Hello Gaetano, <br>
</div>
<div><br>
</div>
<div>Here is a short program to plot 3x3 tensor data using the C++ gmsh API (it shouldn't be too hard to port to Python or Julia if you're more comfortable there). It only plots data for one element, but can be extended for your case.<br>
</div>
<div><br>
</div>
<div>The "addModelData" call is expecting a vector of vectors with 9 entries each for this case.<br>
</div>
<div>
<div>I think the vector ordering corresponding to the matrix is like this: <br>
</div>
<div>[elt11, elt12, elt13, elt21, elt22, ...] <br>
</div>
<div><br>
</div>
<div>I assume the stress matrix is symmetric and so only has 6 unique entries.</div>
</div>
<div>Therefore your vector entries will look like [x xy xz xy y yz xz yz z]<br>
</div>
<div>The tricky part will be importing the data in a sensible way.  <br>
</div>
<div><br>
</div>
<div>Perhaps you could parse a CSV using python and add entries to the data vector in a loop?</div>
<div>Please find attached the program as well as example input mesh and output mesh files.<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div><img alt="image.png" src="cid:168a0f32ec7cb971f161" width="474" height="241"></div>
<div><br>
</div>
<div>Sincerely,</div>
<div>Max<br>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Jan 29, 2019 at 11:24 AM Gaetano Camarda <<a href="mailto:gaetano_18@live.it" target="_blank">gaetano_18@live.it</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="IT">
<div class="gmail-m_7401127588440216567gmail-m_4957269514431204830WordSection1">
<p class="MsoNormal">Hello everyone,</p>
<p class="MsoNormal">I’m having some difficult on post processing a mesh I created.</p>
<p class="MsoNormal">I create a mesh on Gmsh all Hexa (so a brick with 8 nodes), i use this mesh and import it on Matlab,</p>
<p class="MsoNormal">there i run some analisys and find the stress matrix:</p>
<p class="MsoNormal">[sigx sigy sigz sigxy sigyz sigxz]</p>
<p class="MsoNormal">…..    …..    …..   …..    …..    …..</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Now I would like to visualize the stress field on Gmsh, but I do not find any way to do so, I can export the matrix,</p>
<p class="MsoNormal">I tried to generete a *.pos file, but I didn’t find a solution.</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Inviato da <a href="https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=02%7C01%7C%7Cca31cd7089a2464649bc08d68615abee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636843824966724800&sdata=B9ULg21XHyAFBAd6yWI8Wsc%2B9fTHxhibsTu5e1UtiUM%3D&reserved=0" target="_blank">
Posta</a> per Windows 10</p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
_______________________________________________<br>
gmsh mailing list<br>
<a href="mailto:gmsh@onelab.info" target="_blank">gmsh@onelab.info</a><br>
<a href="https://eur04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fonelab.info%2Fmailman%2Flistinfo%2Fgmsh&data=02%7C01%7C%7Cca31cd7089a2464649bc08d68615abee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636843824966734804&sdata=x5CcVoLrp3YNu69ZWMj3fvkDM1zD5CNYD4soeJ25tfo%3D&reserved=0" rel="noreferrer" target="_blank">http://onelab.info/mailman/listinfo/gmsh</a><br>
</blockquote>
</div>
<br clear="all">
<br>
-- <br>
<div dir="ltr" class="gmail-m_7401127588440216567gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>Max Orok</div>
<div>Contractor<br>
</div>
</div>
<div dir="ltr"><a href="https://eur04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mevex.com&data=02%7C01%7C%7Cca31cd7089a2464649bc08d68615abee%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636843824966734804&sdata=9Qnyosr1z%2BWkN%2FpOeuE8LZewBbv0q0WUfPa92IL3m9M%3D&reserved=0" target="_blank">www.mevex.com</a><br>
<br>
<img width="164" height="42"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Max Orok</div><div>Contractor<br></div></div><div dir="ltr"><a href="http://www.mevex.com" target="_blank">www.mevex.com</a><br><br><img src="https://docs.google.com/uc?export=download&id=1fHTIiW4OMUjQr1iOkspQ7wiEsxunoOs0&revid=0B6x5w-5zVaEjSkpwbm5oY29jbG1XMzJoYldXTmJpNGFtb3dVPQ" width="164" height="42"><br></div></div></div></div></div></div>