[issm-support] Issues with meshing..
Morlighem, Mathieu (334H-Affiliate)
Mathieu.Morlighem at jpl.nasa.gov
Wed Jan 2 02:02:42 PST 2013
Hi Derrick,
you can ignore bamg's warning (WARNING: mesh present but no geometry found. Reconstructing…), it is because you used triangle to generate the first mesh, which is totally fine. I don't see any error, you can go ahead and plot the mesh to check that it looks ok.
In the tutorial, we transpose "svin" because it comes from ncread, which is C oriented (reads the matrix line by line), whereas matlab is column-oriented, so the matrix needs to be transposed. If you use geotiffread, you don't need to transpose the matrix. You can check whether or not you need to transpose by checking the sizes of svin, x and y: svin should have as many lines as numel(y) and as many columns as numel(x).
Let us know if you have any other question
Best
Mathieu
--
Mathieu Morlighem
Assistant Project Scientist
Department of Earth System Science
University of California, Irvine
Croul Hall, Irvine, CA 92697-3100
(949) 824-1353 (UCI office)
(818) 354-4134 (JPL office)
(626) 429-5780 (cell)
Mathieu.Morlighem at uci.edu<mailto:Mathieu.Morlighem at uci.edu>
On Jan 2, 2013, at 9:18 AM, djl22 <djl22 at psu.edu<mailto:djl22 at psu.edu>> wrote:
Hi,
I ran through it again and still errors when running Interp...
here is the output from md.mesh (all commands up to and not including InterpFromGridToMesh):
Mesh:
Elements and vertices:
numberofelements : 2474 -- number of elements
numberofvertices : 1312 -- number of vertices
elements : (2474x3) -- index into (x,y,z), coordinates of the vertices
x : (1312x1) -- vertices x coordinate
y : (1312x1) -- vertices y coordinate
z : (1312x1) -- vertices z coordinate
edges : N/A -- edges of the 2d mesh (vertex1 vertex2 element1 element2)
numberofedges : 0 -- number of edges of the 2d mesh
Properties:
dimension : 2 -- mesh dimension (2d or 3d)
numberoflayers : 0 -- number of extrusion layers
vertexonbed : (1312x1) -- lower vertices flags list
elementonbed : (2474x1) -- lower elements flags list
vertexonsurface : (1312x1) -- upper vertices flags list
elementonsurface : (2474x1) -- upper elements flags list
uppervertex : N/A -- upper vertex list (NaN for vertex on the upper surface)
upperelements : N/A -- upper element list (NaN for element on the upper layer)
lowervertex : N/A -- lower vertex list (NaN for vertex on the lower surface)
lowerelements : N/A -- lower element list (NaN for element on the lower layer
vertexonboundary : (1312x1) -- vertices on the boundary of the domain flag list
segments : (148x3) -- edges on domain boundary (vertex1 vertex2 element)
segmentmarkers : (148x1) -- number associated to each segment
vertexconnectivity : (1312x26) -- list of vertices connected to vertex_i
elementconnectivity : (2474x3) -- list of vertices connected to element_i
average_vertex_conne...: 25 -- average number of vertices connected to one vertex
Extracted model:
extractedvertices : N/A -- vertices extracted from the model
extractedelements : N/A -- elements extracted from the model
Projection:
lat : N/A -- vertices latitude
long : N/A -- vertices longitude
hemisphere : N/A -- Indicate hemisphere 'n' or 's'
here is output from whos x y svin svint (svin=svelocity as I restarted the process again and just used svin instead of sveloity):
whos x y svin svint
Name Size Bytes Class Attributes
svin 5460x3010 131476800 double
svint 1312x1 10496 double
x 3010x1 24080 double
y 5460x1 43680 double
I then ran and got the following error message:
>> svint=InterpFromGridToMesh(x,y,svin',md.mesh.x,md.mesh.y,0);
Error message: x and y vectors length should be 1 or 0 more than data number of rows.Error using InterpFromGridToMesh
but if I ran run it as:
>> svint=InterpFromGridToMesh(x,y,svin,md.mesh.x,md.mesh.y,0);
it works:
>> md.mesh.numberofvertices
ans =
1312
>> size(svint,1)
ans =
1312
I than ran bamg and that is when it bombed:
>> md=bamg(md,'hmin',500,'hmax',3000,'field',svint,'err',5);
Anisotropic mesh adaptation
WARNING: mesh present but no geometry found. Reconstructing...
new number of triangles = 1746
Might there be an issue in the parameters I used in the bamg command? The intent was to re-mesh my domain with a minimum grid resolution of 500m and max of 3000m...I assumed what I executed would accomplish that....the resolution of the original imported surface velocity data is at 500m....
On 12/31/2012 5:18 PM, Larour, Eric (385J) wrote:
Derrick,
I ran your example and everything went fine. So the only thing right now
I can think
of is that your model is not in sync with svelint (i.e. svelint is not a
vertex based vector of
size (md.mesh.numberofvertices,1)). To check on that, could you send me
the results of the following?
md.mesh
whos x y svelocity svelint
Thanks!
Eric L.
On 12/31/12 1:53 PM, "Larour, Eric (385J)" <eric.larour at jpl.nasa.gov<mailto:eric.larour at jpl.nasa.gov>>
wrote:
Derrick,
I'm also puzzled as to why bang is giving you an error. I am right now
working
on reproducing the bug from your procedure document. Will keep you posted
as soon
as I find the bug. Should not be long.
For further reference, please include issm-support at issm.ess.uci.edu<mailto:issm-support at issm.ess.uci.edu> in
your reply
all, so other ISSM folks can also help you :)
Eric L.
On 12/31/12 12:17 AM, "djl22" <djl22 at psu.edu<mailto:djl22 at psu.edu>> wrote:
Hi,
I think I found a way through it. I tried working with the original
data, which provides surface velocity over the entire Greenland ice
sheet projected in polar stereographic. I used geotiffread to import the
GEOTIFF image. I used exptool to draw my domain as a sub-region
(Jakobshavn area) from the imported image and set the initial resolution
of my mesh at 2km (2000m). The output mesh looks about right. I then
extract the pixel center coordinates using the pixcenters command:
info=geotiffinfo(filename);From
[x,y] = pixcenters(info);
This gets my coordinates for pixel centers. I then have to flip my (y)
coordinates because the InterpFromGridToMesh command complains that the
values should be decreasing. After doing so I run the
InterpFromGridToMesh command and here things get odd. I notice that in
your examples the velx and vely variables in your Searise and jakobshavn
examples are entered in the InterpFromGridToMesh command as the
transpose of these variables, is this correct? (i.e.
vx=InterpFromGridToMesh(x1,y1,velx',md.mesh.x,md.mesh.y,0);).
If I enter my velocity grid as such then I get an error. if I enter
without the transpose the command seems to work, but then I get an odd
message when I use the output from the Interp command in the following
bamg command. I get:
Anisotropic mesh adaptation
Error message: 'field' should have 930 rowsError using BamgMesher
At this point I'm lost as to why its not working. When I attempted to
run your Searise example as indicated, I ended up with the same exact
error in running bamg (I ran the lines of code provided directly from
the example). I also go tthis error when I ran the Searise example:
Error message: Input parameter of class single not supported yetError
using InterpFromGridToMesh
when I ran
vx=InterpFromGridToMesh(x1,y1,velx',md.mesh.x,md.mesh.y,0);...in this
case I converted the input variables x1, y1 and velx, vely to double
(x1=double(x1), etc...) was this necessary to get it to work? The
command worked after doing this which means ISSM could not recognize the
data type "single" as oppose to "double"
at any rate, i'm now stuck at bamg where I'm attempting to use the
velocity i assume were interpolated to my initial mesh within my custom
domain to refine my initial mesh which would ideally create finer mesh
grids near the margins of Jakobshavn than outside of the margins....
Thanks so much for the assistance....
On 12/29/2012 3:04 AM, Larour, Eric (385J) wrote:
Dear Derrick,
I think the issue is that when you plotted your surface velocities in
matlab (before calling exptool
on it), you did not specify the x and y coordinates of your image.
Typically, in matlab, one does:
imagesc(velocity) where velocity is a matrix. This will get you
coordinates in scene coordinates.
For your example, what you need to do is:
imagesc(x,y,velocity),
where x=0:(xmax-xmin)/m:xmax and
y=0:(ymax-ymin)/n:ymax
and m,n is the size of the velocity matrix.
If you do this, you will recover from exptools the true vertex
coordinates.
Tell me how it goes!
Thanks!
Eric L.
On 12/28/12 11:58 PM, "Derrick Lampkin" <djl22 at psu.edu<mailto:djl22 at psu.edu>> wrote:
Greetings,
I recently attended the ISSM workshop and found it useful. I'm
attempting
to use the system to model a system in the Jakobshavn outlet basin. I
have been using your Jakobshavn example as a template. The exception
is
I'm using a base of surface velocity data derived from NSIDC (Joughin
data set). I have imported a surface velocity grid as GEOTIFF into
matlab
and I use the exptool to draw the outline of my domain on top of this
base map. The map is in the polar stereo graphic projection but when I
create the initial mesh using triangle at the nominal resolution of
the
data (500 m), the grid spacing was not nearly as dense as expected. I
inspected the domain file I created and the vertices coordinates are
in
scene coordinates (row/column) values and not the projected
coordinates ,
therefore the mesh spacing are not reasonable and do not correspond to
the specified resolution I indicate in the triangle command. How might
I
fix this issue?
Thanks
derrick j lampkin
__________________
research professor
institute of arctic and alpine research
university of colorado-boulder
__________________
email: djl22 at psu.edu<mailto:djl22 at psu.edu>
_______________________________________________
issm-support mailing list
issm-support at issm.ess.uci.edu<mailto:issm-support at issm.ess.uci.edu>
http://issm.ess.uci.edu/cgi-bin/mailman/listinfo/issm-support
--
derrick j lampkin
__________________
research professor
institute of arctic and alpine research
university of colorado-boulder
adjunct
department of geoscience
pennsylvania state university
__________________
email: djl22 at psu.edu<mailto:djl22 at psu.edu>
web: http://www.geosc.psu.edu/academic-faculty/lampkin-derrick
_______________________________________________
issm-support mailing list
issm-support at issm.ess.uci.edu<mailto:issm-support at issm.ess.uci.edu>
http://issm.ess.uci.edu/cgi-bin/mailman/listinfo/issm-support
--
derrick j lampkin
__________________
research professor
institute of arctic and alpine research
university of colorado-boulder
adjunct
department of geoscience
pennsylvania state university
__________________
email: djl22 at psu.edu<mailto:djl22 at psu.edu>
web: http://www.geosc.psu.edu/academic-faculty/lampkin-derrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://issm.ess.uci.edu/pipermail/issm-support/attachments/20130102/8be0580e/attachment-0001.html>
More information about the issm-support
mailing list