[firedrake] problems with importing a mesh

Francis Poulin fpoulin at uwaterloo.ca
Thu Nov 2 21:52:25 GMT 2017


Thanks for the help Miklos.


I am not sure if I understand this completely but I have done a couple of things.  One problem was that I had the first and last point as the same but I have since removed the last point.


1) For the case of line this seemed to do the trick and I can now import this into firedrake, which I am happy about.


2) For splines, I have also removed the point (updated code below) and when I look at it using gmsh I see that some points aren't actually on the boundary.  This does seem odd but I am not sure how to fix it.   Should I use a different kind of spline?


Sorry for not better understanding gmsh.



element_size = 1000000;
// Printing points from 1 to 5.
Point(1) = {-0.000000, -0.000000, 0, element_size};
Point(2) = {4275156.460308, 542789.171194, 0, element_size};
Point(3) = {2980231.171904, 4007988.825894, 0, element_size};
Point(4) = {507429.795284, 3586291.304193, 0, element_size};
Point(5) = {-1702226.201816, 1330470.794133, 0, element_size};


// Printing Spline points 1 to 5.
Spline(1) = {1,2,3};
Spline(2) = {3,4,5,1};


// Printing line loop from spline 1 to 2
Line Loops(1) = {1,2};


Plane Surface(1) = {1};





------------------
Francis Poulin
Associate Dean, Undergraduate Studies
Associate Professor
Department of Applied Mathematics
University of Waterloo

email:           fpoulin at uwaterloo.ca
Web:            https://uwaterloo.ca/poulin-research-group/
Telephone:  +1 519 888 4567 x32637

________________________________
From: firedrake-bounces at imperial.ac.uk <firedrake-bounces at imperial.ac.uk> on behalf of Homolya, Miklós <m.homolya14 at imperial.ac.uk>
Sent: Thursday, November 2, 2017 4:00:15 PM
To: firedrake
Subject: Re: [firedrake] problems with importing a mesh


So it looks like some of the points -- e.g., Point 4, 5, and 6 -- are only used as support points to the spline, they don't belong to any cell, yet they are generated into the mesh.

________________________________
From: firedrake-bounces at imperial.ac.uk <firedrake-bounces at imperial.ac.uk> on behalf of Francis Poulin <fpoulin at uwaterloo.ca>
Sent: 02 November 2017 19:50:24
To: firedrake
Subject: Re: [firedrake] problems with importing a mesh


Thank you.


This is the .geo file that I am using is copied below.  First I tried splines and that seemed to have a line that goes outside of the domain whereas I have now switched to lines.  It's a very, very simple set of coastlines but if this works I can do more complicated coastlines.


Unfortunately, when I try to compile it I do get a warning about orienting normals.  The .msh file looks okay but clearly there is something not quite right.  But it still does not important in firedrake though.




fpoulin at domlt32:~/Research/2016-Christine/OceanBasins$ gmsh -2 test3.geo
Info    : Running 'gmsh -2 test3.geo' [Gmsh 2.10.1, 1 node, max. 1 thread]
Info    : Started on Thu Nov  2 15:49:09 2017
Info    : Reading 'test3.geo'...
Info    : Done reading 'test3.geo'
Info    : Meshing 1D...
Info    : Meshing curve 1 (Line)
Info    : Meshing curve 2 (Line)
Info    : Done meshing 1D (0.004 s)
Info    : Meshing 2D...
Info    : Meshing surface 1 (Plane, Delaunay)
Info    : Done meshing 2D (0.00479794 s)
Warning : Could not orient normal of surface 1
Info    : 110 vertices 216 elements
Warning : ------------------------------
Warning : Mesh generation error summary
Warning :     1 warning
Warning :     0 errors
Warning : Check the full log for details
Warning : ------------------------------
Info    : Writing 'test3.msh'...
Info    : Done writing 'test3.msh'
Info    : Stopped on Thu Nov  2 15:49:09 2017






element_size = 500000;
// Printing points from 1 to 6.
Point(1) = {-0.000000, -0.000000, 0, element_size};
Point(2) = {4275156.460308, 542789.171194, 0, element_size};
Point(3) = {2980231.171904, 4007988.825894, 0, element_size};
Point(4) = {507429.795284, 3586291.304193, 0, element_size};
Point(5) = {-1702226.201816, 1330470.794133, 0, element_size};
Point(6) = {-0.000000, -0.000000, 0, element_size};


// Printing Spline points 1 to 6.
Line(1) = {1,2,3};
Line(2) = {3,4,5,6,1};


// Printing line loop from spline 1 to 2
Line Loops(1) = {1,2};


Plane Surface(1) = {1};





------------------
Francis Poulin
Associate Dean, Undergraduate Studies
Associate Professor
Department of Applied Mathematics
University of Waterloo

email:           fpoulin at uwaterloo.ca
Web:            https://uwaterloo.ca/poulin-research-group/
Telephone:  +1 519 888 4567 x32637

________________________________
From: firedrake-bounces at imperial.ac.uk <firedrake-bounces at imperial.ac.uk> on behalf of Homolya, Miklós <m.homolya14 at imperial.ac.uk>
Sent: Thursday, November 2, 2017 3:42:08 PM
To: firedrake
Subject: Re: [firedrake] problems with importing a mesh


It says that your generated mesh has some vertices, edges, or else that does not belong to any cell. I suggest you have a look at the generated mesh to see if you can spot such an artifact, and then figure out how to drive gmsh to not have such a thing.

________________________________
From: firedrake-bounces at imperial.ac.uk <firedrake-bounces at imperial.ac.uk> on behalf of Francis Poulin <fpoulin at uwaterloo.ca>
Sent: 02 November 2017 19:38:34
To: firedrake
Subject: [firedrake] problems with importing a mesh


Hello,


I have created a mesh of an oceanic basin that I have triangulated with gmsh.  Finally!  I am very excited to solve for the wind-driven gyre solutions with this new mesh (as I discussed back in March at the workshop), unfortunately, when I try to import the mesh I get the following:


mesh = Mesh("test3.msh")


ValueError: Provided mesh has some entities not reachable by traversing cells (maybe rogue vertices?)



Any ideas as to what I might have done wrong and how I can fix this?


Cheers, Francis


------------------
Francis Poulin
Associate Dean, Undergraduate Studies
Associate Professor
Department of Applied Mathematics
University of Waterloo

email:           fpoulin at uwaterloo.ca
Web:            https://uwaterloo.ca/poulin-research-group/
Telephone:  +1 519 888 4567 x32637

-------------- next part --------------
HTML attachment scrubbed and removed


More information about the firedrake mailing list