[Gmsh] Question about gmsh

Christophe Geuzaine cgeuzaine at ulg.ac.be
Thu Nov 3 18:47:52 CET 2016


> On 3 Nov 2016, at 02:01, Mayank Jog <mayankjog at gmail.com> wrote:
> 
> Hello Jeremy and Christophe, 
> Thanks for the help! 
> 
> Jeremy: 
> 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). 
> 
> 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. 
> I'm new to handling mesh data....does that sound like a fair approximation? 
> 
> Christophe: 
> 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. 
> 

You should change the points (X0, Y0, ...) to match your geometry... Interactively, use Tools->Plugins->CutBox.

> ,
> Mayank 
> 
> 
> 
> <Fig1.png>
> 
> 
> <Fig2.png>
> 
> 
> 
> 
>  
> 
> 
> On Wed, Nov 2, 2016 at 5:24 AM, Christophe Geuzaine <cgeuzaine at ulg.ac.be> wrote:
> 
> > On 22 Oct 2016, at 04:09, Mayank Jog <mayankjog at gmail.com> wrote:
> >
> > Hello,
> > I have been using "simnibs" software which uses gmsh to calculate electric fields over a 3D mesh/geometry (human head).
> > It outputs a final .msh file, that contains the electric field information, and can be viewed using gmsh.
> >
> > My issue is, I want to convert this file to a list where each line =
> > [coord location, electric field value ] How do I go about doing it?
> >
> > The ultimate goal is to regrid this data onto a regular cartesian grid to do some funky postprocessing (fourier transforms, followed by funky stuff).
> 
> Here's an example:
> 
> Merge "tutorial/view3.pos";
> Plugin(CutBox).X0=0;
> Plugin(CutBox).Y0=0;
> Plugin(CutBox).Z0=0;
> Plugin(CutBox).X1=1;
> Plugin(CutBox).Y1=0;
> Plugin(CutBox).Z1=0;
> Plugin(CutBox).X2=0;
> Plugin(CutBox).Y2=1;
> Plugin(CutBox).Z2=0;
> Plugin(CutBox).X3=0;
> Plugin(CutBox).Y3=0;
> Plugin(CutBox).Z3=1;
> Plugin(CutBox).NumPointsU=20;
> Plugin(CutBox).NumPointsV=20;
> Plugin(CutBox).NumPointsW=20;
> Plugin(CutBox).ConnectPoints=0;
> Plugin(CutBox).Boundary=0;
> Plugin(CutBox).View=0;
> Plugin(CutBox).Run;
> Save View[1] "points.txt";
> 
> 
> 
> 
> > 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
> >
> > Thank you!
> > Mayank
> >
> > ** "Post processing Generic txt" option in "save as" in gmsh
> > _______________________________________________
> > gmsh mailing list
> > gmsh at onelab.info
> > http://onelab.info/mailman/listinfo/gmsh
> 
> --
> Prof. Christophe Geuzaine
> University of Liege, Electrical Engineering and Computer Science
> http://www.montefiore.ulg.ac.be/~geuzaine
> 
> Free software: http://gmsh.info | http://getdp.info | http://onelab.info
> 
> 
> _______________________________________________
> gmsh mailing list
> gmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh

-- 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science 
http://www.montefiore.ulg.ac.be/~geuzaine

Free software: http://gmsh.info | http://getdp.info | http://onelab.info




More information about the gmsh mailing list