[Gmsh] Post-processing stress field

Max Orok morok at mevex.com
Wed Jan 30 23:58:33 CET 2019


Yes, the stresses belong in the $ElementData section for sure.
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:

1 sigx sigxy sigxz sigxy sigy sigyz sigxz sigyz sigz

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.

Sincerely,
Max


On Wed, Jan 30, 2019 at 2:42 PM Gaetano Camarda <gaetano_18 at live.it> wrote:

> 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: image.png]
>
> Sincerely,
> Max
>
> On Tue, Jan 29, 2019 at 11:24 AM Gaetano Camarda <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
>> 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>
>
>
>

-- 
Max Orok
Contractor
www.mevex.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/80e29b8c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 51392 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190130/80e29b8c/attachment-0001.png>


More information about the gmsh mailing list