<div dir="ltr"><div><div><div><div><div><div><div><div><div>Hello Jeremy and Christophe, <br></div>Thanks for the help! <br></div><br></div>Jeremy: <br></div>The data is Current-density magnitude at nodes (attached Fig1.png). I need to recast this onto a uniformly-spaced 3D cartesian grid (nodes are non-uniformly spaced in 3D). <br></div><br>One hack I tried (please correct me :) ), was to export the .msh file as ascii, then interpolate the data at each element onto the regular cartesian grid. The coordinates of each element I set as the centroid of the nodes comprising the element. <br></div>I'm new to handling mesh data....does that sound like a fair approximation? <br><br></div>Christophe: <br></div>I tried what you suggested in the GUI. I didnt understand the first line (Merge "tutorial/view3.pos";) , but I carried out all the rest steps. I got a new "view", but it only had a couple of voxels. I'm enclosing Fig1.png which shows the data, and Fig2.png which shows what I get when I carried out the step. <br></div><div><br>,<br></div>Mayank <br><br><br><br><img src="cid:ii_15827b31f7b462e8" alt="Inline image 1" width="456" height="388"><br><br><br><img src="cid:ii_15827b346971408d" alt="Inline image 2" width="456" height="386"><br><br><br><div><div><div><br><div><br> <br><div><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 2, 2016 at 5:24 AM, Christophe Geuzaine <span dir="ltr"><<a href="mailto:cgeuzaine@ulg.ac.be" target="_blank">cgeuzaine@ulg.ac.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 22 Oct 2016, at 04:09, Mayank Jog <<a href="mailto:mayankjog@gmail.com">mayankjog@gmail.com</a>> wrote:<br>
><br>
> Hello,<br>
> I have been using "simnibs" software which uses gmsh to calculate electric fields over a 3D mesh/geometry (human head).<br>
> It outputs a final .msh file, that contains the electric field information, and can be viewed using gmsh.<br>
><br>
> My issue is, I want to convert this file to a list where each line =<br>
> [coord location, electric field value ] How do I go about doing it?<br>
><br>
> The ultimate goal is to regrid this data onto a regular cartesian grid to do some funky postprocessing (fourier transforms, followed by funky stuff).<br>
<br>
</span>Here's an example:<br>
<br>
Merge "tutorial/view3.pos";<br>
Plugin(CutBox).X0=0;<br>
Plugin(CutBox).Y0=0;<br>
Plugin(CutBox).Z0=0;<br>
Plugin(CutBox).X1=1;<br>
Plugin(CutBox).Y1=0;<br>
Plugin(CutBox).Z1=0;<br>
Plugin(CutBox).X2=0;<br>
Plugin(CutBox).Y2=1;<br>
Plugin(CutBox).Z2=0;<br>
Plugin(CutBox).X3=0;<br>
Plugin(CutBox).Y3=0;<br>
Plugin(CutBox).Z3=1;<br>
Plugin(CutBox).NumPointsU=20;<br>
Plugin(CutBox).NumPointsV=20;<br>
Plugin(CutBox).NumPointsW=20;<br>
Plugin(CutBox).ConnectPoints=<wbr>0;<br>
Plugin(CutBox).Boundary=0;<br>
Plugin(CutBox).View=0;<br>
Plugin(CutBox).Run;<br>
Save View[1] "points.txt";<br>
<span class="im HOEnZb"><br>
<br>
<br>
<br>
> I tried saving the .msh file as a .txt ** , and then reading it line by line.....I was thinking of replacing each triangular element with its centroid. However, I don't know how to proceed with other elements....please help me out<br>
><br>
> Thank you!<br>
> Mayank<br>
><br>
> ** "Post processing Generic txt" option in "save as" in gmsh<br>
</span><div class="HOEnZb"><div class="h5">> ______________________________<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>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Prof. Christophe Geuzaine<br>
University of Liege, Electrical Engineering and Computer Science<br>
<a href="http://www.montefiore.ulg.ac.be/~geuzaine" rel="noreferrer" target="_blank">http://www.montefiore.ulg.ac.<wbr>be/~geuzaine</a><br>
<br>
Free software: <a href="http://gmsh.info" rel="noreferrer" target="_blank">http://gmsh.info</a> | <a href="http://getdp.info" rel="noreferrer" target="_blank">http://getdp.info</a> | <a href="http://onelab.info" rel="noreferrer" target="_blank">http://onelab.info</a><br>
<br>
</font></span></blockquote></div><br></div>