stripy
stripy copied to clipboard
import issue when using underworld
Hi guys, I run into an import issue and that bother me a while, would you help me check with that? if import underworld and stripy together, it will somehow get the wrong tri.simplices:
import underworld
from stripy import cartesian_meshes
minX, maxX, minY, maxY, dx, dy = 0.0, 3.0 ,0.0, 1.0, 0.015625 ,0.015625
extent_xy = [minX, maxX, minY, maxY]
tri = cartesian_meshes.square_mesh(extent_xy, dx,dy, random_scale=0.0, refinement_levels=0)
tri.simplices
The result is:
TRMESH - Fatal error!
The first 3 nodes are collinear.
Try reordering the data.
array([], shape=(0, 3), dtype=int64)
While import stripy alone, the tri.simplices are correct as:
array([[ 0, 12544, 11005],
[ 0, 11005, 193],
[ 1, 12543, 11470],
...,
[12096, 12434, 12433],
[12209, 12398, 12397],
[12260, 12419, 12418]])
Are there any function conflicts there in underworld and stripy or? Thanks in advance.
This is a stripy / underworld issue. Underworld 2.11 Stripy latest as of 8/11/2021
Here is the link that how to install them, using conda to install stripy and compile the underworld from source code in the env.
https://github.com/underworldcode/underworld2/issues/587
update: tried reinstalling stripy with 2 verisons.
- stripy1.2.2 by $ python3 -m pip install stripy
- stripy2.0.2 by $ conda install -c underworldcode stripy
Still have the same issue.
update: tried reinstalling stripy from source code (version 2.05b2), still have the same issue
Just to help us figure out what is going on, can you try with a non-zero value of the random scale parameter. Also, if you look at the documentation, you can access the underlying triangulation routines and have a bit more control on what is happening with stripy. https://underworldcode.github.io/stripy/2.1.0b1/SphericalMeshing/CartesianTriangulations/Ex1-Cartesian-Triangulations.html That would allow you to permute the points in response to this error and we can most certainly determine whether the error is some sort of bug in the loading of libraries. L Prof Louis ***@***.***(m) +61 4 0333 1413(us) +1 505 349 ***@***.*** From: Neng Lu ***@***.***>Date: Monday, 8 November 2021 at 11:25 amTo: underworldcode/stripy ***@***.***>Cc: Subscribed ***@***.***>Subject: [underworldcode/stripy] import issue when using underworld (Issue #98)Hi guys,I run into an import issue and that bother me a while, would you help me check with that?if import underworld and stripy together, it will somehow get the wrong tri.simplices:import underworldfrom stripy import cartesian_meshesminX, maxX, minY, maxY, dx, dy = 0.0, 3.0 ,0.0, 1.0, 0.015625 ,0.015625extent_xy = [minX, maxX, minY, maxY]tri = cartesian_meshes.square_mesh(extent_xy, dx,dy, random_scale=0.0, refinement_levels=0)tri.simplicesThe result is:TRMESH - Fatal error! The first 3 nodes are collinear. Try reordering the data.array([], shape=(0, 3), dtype=int64)While import stripy alone, the tri.simplices are correct as:array([[ 0, 12544, 11005], [ 0, 11005, 193], [ 1, 12543, 11470], ..., [12096, 12434, 12433], [12209, 12398, 12397], [12260, 12419, 12418]])Are there any function conflicts there in underworld and stripy or? Thanks in advance.—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.
Hi Louis, Thanks for the reply. I tried several sets of parameters and it all get the same issue. and when using function stripy.Triangulation directly as in the example also has the issue. It will get the right result when importing stripy alone, and get the error when importing stripy after underworld:
sTRMESH - Fatal error!
The first 3 nodes are collinear.
Try reordering the data.
It's more likely the dynamic libraries issue like Romain mentioned.
Using python3.9 and trying:
pip install stripy
I get the following error:
Error: Rank mismatch in argument ‘lcc’ at (1) (rank-1 and scalar)
src/srfpack.f:7391:37:
7391 | CALL intrc1(xs(i),ys(i),ncc,lcc,n,x,y,zdata,lst,lptr,lend,
| 1
Error: Rank mismatch in argument ‘lcc’ at (1) (rank-1 and scalar)
Using gfortran 11.2.0.
This is a stripy issue. I'll look into updating it.