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

New issue in CrouzeixRaviartFiniteElementSpace #177

Open
xieweidc opened this issue Apr 17, 2023 · 2 comments
Open

New issue in CrouzeixRaviartFiniteElementSpace #177

xieweidc opened this issue Apr 17, 2023 · 2 comments

Comments

@xieweidc
Copy link
Contributor

在运行 example/PoissonCRWithDirichletBC_example.py 时,遇到两个问题,

(1)

这个解法器实际上并没有在程序中用到。

(2) 注释掉 pyamg 以后,报错如下:

The 0-th computation:
Traceback (most recent call last):

  File "C:\Users\19649\Desktop\fealpy\example\PoissonCRWithDirichletBC_example.py", line 63, in <module>
    uh = space.function()

  File "c:\users\19649\desktop\fealpy\fealpy\functionspace\CrouzeixRaviartFiniteElementSpace.py", line 369, in function
    f = Function(self, dim=dim, array=array, coordtype='barycentric')

  File "c:\users\19649\desktop\fealpy\fealpy\functionspace\Function.py", line 21, in __new__
    self = space.array(dim=dim, dtype=dtype).view(cls)

TypeError: array() got an unexpected keyword argument 'dtype'

这里的问题应该是 CrouzeixRaviartFiniteElementSpacearray 函数没有给出相应的 dtype 参数。

(3) 在修正以上问题以后,程序仍然有如下报错信息:

The 0-th computation:
Traceback (most recent call last):

  File "C:\Users\19649\Desktop\fealpy\example\PoissonCRWithDirichletBC_example.py", line 64, in <module>
    A = space.stiff_matrix()

  File "c:\users\19649\desktop\fealpy\fealpy\functionspace\CrouzeixRaviartFiniteElementSpace.py", line 251, in stiff_matrix
    A = csr_matrix((A.flat, (I.flat, J.flat)), shape=(gdof, gdof))

  File "C:\Users\19649\anaconda3\lib\site-packages\scipy\sparse\_compressed.py", line 53, in __init__
    self._coo_container(arg1, shape=shape, dtype=dtype)

  File "C:\Users\19649\anaconda3\lib\site-packages\scipy\sparse\_coo.py", line 196, in __init__
    self._check()

  File "C:\Users\19649\anaconda3\lib\site-packages\scipy\sparse\_coo.py", line 283, in _check
    raise ValueError('row index exceeds matrix dimensions')

ValueError: row index exceeds matrix dimensions

由于 CR 元还没学习完全,所以暂时不知道是哪一步导致了索引超出矩阵维数。

@weihuayi
Copy link
Owner

我这两天找时间调试一下程序

@xieweidc
Copy link
Contributor Author

我这两天找时间调试一下程序

好的,感谢老师

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