fealpy icon indicating copy to clipboard operation
fealpy copied to clipboard

example.TimeHarmonicFNAFEM_example运行问题

Open Geniuswangwei opened this issue 3 years ago • 4 comments

魏老师, 您好, 当我尝试运行example.TimeHarmonicFNAFEM_example时, 出现如下问题 这是一个自适应求解时谐方程的程序

optional arguments: -h, --help show this help message and exit --order ORDER 第一类 Nedlec 元的次数, 默认为 0! --size SIZE 初始网格的 x 和 y 方向剖分段数, 默认为 8 段 --maxit MAXIT 自适应迭代次数, 默认自适应迭代 40 次 --theta THETA 自适应迭代的 theta 参数, 默认为 0.3 程序参数为: Namespace(maxit=40, order=0, size=8, theta=0.2) run construct_matrix with time: 0.006584999999999952 run construct_matrix with time: 0.008317099999999966 Traceback (most recent call last): File "D:/pythonProject/main.py", line 264, in A, F = bc.apply(A, F, uh) File "D:\fealpy\fealpy\boundarycondition\BoundaryCondition.py", line 34, in apply isDDof = space.set_dirichlet_bc(gD, uh, threshold=threshold) File "D:\fealpy\fealpy\functionspace\FirstKindNedelecFiniteElementSpace2d.py", line 498, in set_dirichlet_bc val = g(ps, t) File "D:\fealpy\fealpy\functionspace\Function.py", line 32, in call return space.value(self, bc, index=index) File "D:\fealpy\fealpy\decorator\coordinates.py", line 20, in add_attribute return func(*args, **kwargs) File "D:\fealpy\fealpy\functionspace\FirstKindNedelecFiniteElementSpace2d.py", line 377, in value phi = self.basis(bc, index=index, barycenter=barycenter) File "D:\fealpy\fealpy\decorator\coordinates.py", line 20, in add_attribute return func(*args, **kwargs) File "D:\fealpy\fealpy\functionspace\FirstKindNedelecFiniteElementSpace2d.py", line 294, in basis ps = mesh.bc_to_point(bc, index=index) File "D:\fealpy\fealpy\mesh\TriangleMesh.py", line 987, in bc_to_point entity = self.entity(etype=TD)[index] IndexError: arrays used as indices must be of integer (or boolean) type

我尝试将index转为int型, 但依然无法解决此问题, 请教老师, 我该如何解决此问题.

Geniuswangwei avatar Aug 19 '21 13:08 Geniuswangwei

@Geniuswangwei 你把 FEALPy 更新一下, 就可以了。

weihuayi avatar Aug 19 '21 22:08 weihuayi

这里底层的接口调整了一下

weihuayi avatar Aug 19 '21 22:08 weihuayi

好的, 谢谢老师

Geniuswangwei avatar Aug 20 '21 00:08 Geniuswangwei

魏老师,您好,我想请问下在本例中,我应该如何获得数值解的图像?

Geniuswangwei avatar Aug 30 '21 09:08 Geniuswangwei