[Gmsh] Post-processing stress field

Gaetano Camarda gaetano_18 at live.it
Wed Jan 30 20:42:56 CET 2019


Thanks for your help, but I think I have not understood well.
I have a mesh all brick (8 nodes) and my stress field matrix is composed this way:
1 sigx sigy sigz sigxy sigyz sigxz
   ...     ....    .....    .....    ......    .....

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?


Outlook<https://aka.ms/qtex0l> per iOS
________________________________
Da: Max Orok <morok at mevex.com>
Inviato: martedì, gennaio 29, 2019 7:14 PM
A: Gaetano Camarda
Cc: gmsh at onelab.info
Oggetto: Re: [Gmsh] Post-processing stress field

Hello Gaetano,

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.

The "addModelData" call is expecting a vector of vectors with 9 entries each for this case.
I think the vector ordering corresponding to the matrix is like this:
[elt11, elt12, elt13, elt21, elt22, ...]

I assume the stress matrix is symmetric and so only has 6 unique entries.
Therefore your vector entries will look like [x xy xz xy y yz xz yz z]
The tricky part will be importing the data in a sensible way.

Perhaps you could parse a CSV using python and add entries to the data vector in a loop?
Please find attached the program as well as example input mesh and output mesh files.



[image.png]

Sincerely,
Max

On Tue, Jan 29, 2019 at 11:24 AM Gaetano Camarda <gaetano_18 at live.it<mailto:gaetano_18 at live.it>> wrote:
Hello everyone,
I’m having some difficult on post processing a mesh I created.
I create a mesh on Gmsh all Hexa (so a brick with 8 nodes), i use this mesh and import it on Matlab,
there i run some analisys and find the stress matrix:
[sigx sigy sigz sigxy sigyz sigxz]
…..    …..    …..   …..    …..    …..

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,
I tried to generete a *.pos file, but I didn’t find a solution.

Inviato da Posta<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> per Windows 10

_______________________________________________
gmsh mailing list
gmsh at onelab.info<mailto:gmsh at onelab.info>
http://onelab.info/mailman/listinfo/gmsh<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>


--
Max Orok
Contractor
www.mevex.com<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>

[https://docs.google.com/uc?export=download&id=1fHTIiW4OMUjQr1iOkspQ7wiEsxunoOs0&revid=0B6x5w-5zVaEjSkpwbm5oY29jbG1XMzJoYldXTmJpNGFtb3dVPQ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0012.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0013.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0014.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0015.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0016.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0017.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0018.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0019.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0020.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0021.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0022.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: image.png
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/671882b8/attachment-0023.png>


More information about the gmsh mailing list