<div dir="ltr"><div><div><div><div>Dear Preety, <br><br></div>You need to write a Matlab script to import your mesh. This task is quite simple, for instance:<br><br>% Formats<br>fstring = '%s';<br>finteger = '%d';<br>fnodes = '%d %f %f %f';<br>felems = '%f %f %f %f %f %f %f %f';<br>% Open file<br>Idfile = fopen(mesh_file,'r');<br>% Read 4 lines (Header)<br>n = 4; textscan(Idfile,fstring,n,'Delimiter','\n');<br>% Read number of subdomains<br>n = 1; input = textscan(Idfile,finteger,n,'Delimiter','\n');<br>nsubdomains = input{1}(1);<br>% Read 2 + nsubdomains lines<br>n = 2 + nsubdomains; textscan(Idfile,fstring,n,'Delimiter','\n');<br>% Read number of nodes<br>n = 1; input = textscan(Idfile,finteger,n,'Delimiter','\n');<br>nNodes = input{1}(1);<br>% Read spatial positions of the nodes<br>n = nNodes; input = textscan(Idfile,fnodes,n,'Delimiter','\n');<br>nodes = transpose(horzcat(input{2},input{3},input{4}));<br>% Read 2 lines<br>n = 2; input = textscan(Idfile,fstring,n,'Delimiter', '\n');<br>% Read number of elements<br>n = 1; input = textscan(Idfile,finteger,n,'Delimiter','\n');<br>nElems = input{1}(1);<br>% Read nodal/elements connectivity<br>n = nElems; input = textscan(Idfile,felems,n,'Delimiter','\n');<br>elemsN = transpose(horzcat(input{6},input{7},input{8}));<br>% Read physical groups<br>phy_groups = input{4};<br>fclose(Idfile);<br><br><br></div>Otherwise, you can use the python parser by José A. Abell (<a href="https://github.com/jaabell/gmshtranslator">https://github.com/jaabell/gmshtranslator</a>)<br><br></div>Best regards<br><br></div>O.<br><div><div><div><br><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 21, 2018 at 5:41 PM, <a href="mailto:preetyobi@gmail.com">preetyobi@gmail.com</a> <span dir="ltr"><<a href="mailto:preetyobi@gmail.com" target="_blank">preetyobi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
I have created a 2D mesh in gmsh but able to understand how it is providing the elements connectivity also if possible provide me help regarding how to read this file in mathlab.<br>
<br>
Thank you<br>
Preety<br>
<br>
Send from my vivo smart phone<br>
______________________________<wbr>_________________<br>
gmsh mailing list<br>
<a href="mailto:gmsh@onelab.info">gmsh@onelab.info</a><br>
<a href="http://onelab.info/mailman/listinfo/gmsh" rel="noreferrer" target="_blank">http://onelab.info/mailman/<wbr>listinfo/gmsh</a><br>
</blockquote></div><br></div>