[Gmsh] Using ElementData from external file

Max Orok morok at mevex.com
Sun Apr 28 20:30:33 CEST 2019


Hi Raavi,

You can use the python API for this. Here is a short script that combines
two files and creates a third from their combined element data, aka
post-processing views.

Sincerely,
Max


On Sat, Apr 27, 2019 at 12:12 PM Raavi M. Mohindar Rao <
raavi.mohindar.rao at gmail.com> wrote:

> Hello all,
>
> I am looking a way to include $ElementData from external file.
>
> In test.msh,
>
> $Elements
> 668
> 1 2 2 1 43 131 121 174
> ...
> 668 2 2 2 52 334 335 77
> $EndElements
> $ElementData            // Need a way to include this $ElementData from
> external file
> 1
> "M"
> 1
> 0.0
> 3
> 0
> 3
> 170
> 1    252.161    0    0
> ....
> 170    131.153    0    0
> $EndElementData
>
> Regards,
>
> Raavi
>
>
> _______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh
>


-- 
Max Orok
Contractor
www.mevex.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190428/a05fcc57/attachment-0001.html>
-------------- next part --------------
# combine element data sections of two msh files
# assuming they have the same elements

# mxo 2019

import gmsh

# spin up gmsh
gmsh.initialize()

# open the two files at the same time
gmsh.open("first-data.msh")
gmsh.open("second-data.msh")

# getTags will have both sets of view tags
for tag in gmsh.view.getTags():
    # print tag
    gmsh.view.write(tag, "combined.msh", True) # True == append to existing file

# end gmsh actions
gmsh.finalize()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: combined.msh
Type: application/octet-stream
Size: 106552 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190428/a05fcc57/attachment-0003.msh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: first-data.msh
Type: application/octet-stream
Size: 53276 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190428/a05fcc57/attachment-0004.msh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: second-data.msh
Type: application/octet-stream
Size: 53276 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20190428/a05fcc57/attachment-0005.msh>


More information about the gmsh mailing list