<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div>PS: there are also some scripts here: <a href="https://gitlab.onelab.info/gmsh/gmsh/tree/master/utils/converters/matlab" class="">https://gitlab.onelab.info/gmsh/gmsh/tree/master/utils/converters/matlab</a><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 21 Feb 2018, at 19:16, Octavio Castillo Reyes <<a href="mailto:ocastilloreyes@gmail.com" class="">ocastilloreyes@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class="">Dear Preety, <br class=""><br class=""></div>You need to write a Matlab script to import your mesh. This task is quite simple, for instance:<br class=""><br class="">% Formats<br class="">fstring  = '%s';<br class="">finteger = '%d';<br class="">fnodes   = '%d %f %f %f';<br class="">felems   = '%f %f %f %f %f %f %f %f';<br class="">% Open file<br class="">Idfile = fopen(mesh_file,'r');<br class="">% Read 4 lines (Header)<br class="">n = 4; textscan(Idfile,fstring,n,'Delimiter','\n');<br class="">% Read number of subdomains<br class="">n = 1; input = textscan(Idfile,finteger,n,'Delimiter','\n');<br class="">nsubdomains = input{1}(1);<br class="">% Read 2 + nsubdomains lines<br class="">n = 2 + nsubdomains; textscan(Idfile,fstring,n,'Delimiter','\n');<br class="">% Read number of nodes<br class="">n = 1; input = textscan(Idfile,finteger,n,'Delimiter','\n');<br class="">nNodes = input{1}(1);<br class="">% Read spatial positions of the nodes<br class="">n = nNodes; input = textscan(Idfile,fnodes,n,'Delimiter','\n');<br class="">nodes = transpose(horzcat(input{2},input{3},input{4}));<br class="">% Read 2 lines<br class="">n = 2; input = textscan(Idfile,fstring,n,'Delimiter', '\n');<br class="">% Read number of elements<br class="">n = 1; input = textscan(Idfile,finteger,n,'Delimiter','\n');<br class="">nElems = input{1}(1);<br class="">% Read nodal/elements connectivity<br class="">n = nElems; input = textscan(Idfile,felems,n,'Delimiter','\n');<br class="">elemsN = transpose(horzcat(input{6},input{7},input{8}));<br class="">% Read physical groups<br class="">phy_groups = input{4};<br class="">fclose(Idfile);<br class=""><br class=""><br class=""></div>Otherwise, you can use the python parser by José A. Abell (<a href="https://github.com/jaabell/gmshtranslator" class="">https://github.com/jaabell/gmshtranslator</a>)<br class=""><br class=""></div>Best regards<br class=""><br class=""></div>O.<br class=""><div class=""><div class=""><div class=""><br class=""><br class=""></div></div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Feb 21, 2018 at 5:41 PM, <a href="mailto:preetyobi@gmail.com" class="">preetyobi@gmail.com</a> <span dir="ltr" class=""><<a href="mailto:preetyobi@gmail.com" target="_blank" class="">preetyobi@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br class="">
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 class="">
<br class="">
Thank you<br class="">
Preety<br class="">
<br class="">
Send from my vivo smart phone<br class="">
______________________________<wbr class="">_________________<br class="">
gmsh mailing list<br class="">
<a href="mailto:gmsh@onelab.info" class="">gmsh@onelab.info</a><br class="">
<a href="http://onelab.info/mailman/listinfo/gmsh" rel="noreferrer" target="_blank" class="">http://onelab.info/mailman/<wbr class="">listinfo/gmsh</a><br class="">
</blockquote></div><br class=""></div>
_______________________________________________<br class="">gmsh mailing list<br class=""><a href="mailto:gmsh@onelab.info" class="">gmsh@onelab.info</a><br class="">http://onelab.info/mailman/listinfo/gmsh<br class=""></div></blockquote></div><br class=""><div class="">
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">— </div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Prof. Christophe Geuzaine<br class="">University of Liege, Electrical Engineering and Computer Science <br class=""><a href="http://www.montefiore.ulg.ac.be/~geuzaine" class="">http://www.montefiore.ulg.ac.be/~geuzaine</a><br class=""><br class="">Free software: http://gmsh.info | http://getdp.info | http://onelab.info</div></div>
</div>
<br class=""></body></html>