Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

网格转化问题 #560

Open
lalala753 opened this issue Dec 17, 2023 · 2 comments
Open

网格转化问题 #560

lalala753 opened this issue Dec 17, 2023 · 2 comments

Comments

@lalala753
Copy link

lalala753 commented Dec 17, 2023

魏老师您好 我用fealpy做四边形网格剖分的测试

from fealpy.mesh.quadrangle_mesh import QuadrangleMesh
from fealpy.mesh import PolygonMesh

box = [0, 1, 0, 1]
mesh = QuadrangleMesh.from_box(box, nx=Nxy, ny=Nxy)
node = mesh.node
cell = mesh.ds.cell
mesh = PolygonMesh(node, cell)

会报错, 我检查源码
.\fealpy\fealpy\mesh\polygon_mesh.py
第27行的
elif isinstance(cell, np.ndarray) == 2:
是错的 这句话会返回一个布尔类型的数据 把2改成1才能得到想要的网格结果

@weihuayi
Copy link
Owner

是的,这里有一个 bug,已经修正。

import matplotlib.pyplot as plt
from fealpy.mesh import QuadrangleMesh
from fealpy.mesh import PolygonMesh

box = [0, 1, 0, 1]
mesh = QuadrangleMesh.from_box(box, nx=10, ny=10)
node = mesh.entity('node')
cell = mesh.entity('cell')
mesh = PolygonMesh(node, cell)

mesh.add_plot(plt)
plt.show()

image

@weihuayi
Copy link
Owner

@lalala753 请用更规范的接口调用 FEALPy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants