Whether fenics supports advanced matrix operations.For example, Creating a specified size fenics matrix and updating the value of the element. Calculating the fenics matrix eigenvalues and eigenvectors…
If fenics can not complete some matrix operations. Maybe i need extra package(numpy and …). I can convert fenics matrix to numpy array using M01.array(), but this approach will fail when the size of matrix is very large (error: memory leak). Is there any package to recommend?
Thank you for your reply!
I’m already learning PETSC basic the fenics 2019.1, but i am getting an error as follows:
import sys
import petsc4py
from fenics import *
petsc4py.init(sys.argv)
from petsc4py import PETSc
A = PETSc.Mat()
A.create(comm=PETSc.COMM_WORLD)
A.setSizes((5, 5))
A.setType(PETSc.Mat.Type.AIJ)
A[1, 1] = 999
A.assemblyBegin()
A.assemblyEnd()
print(A.getValues(1, 1))
error:
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=59
:
system msg for write_line failure : Bad file descriptor
Error in system call pthread_mutex_destroy: Device or resource busy
src/mpi/init/initthread.c:284
When I run the same code in another python environment(no fenics), there is no error.
Did you add other libraries after creating the conda environment? If so, please create a further one and keep it clean of anything else, and confirm if the code works or not.
Thank you for your reply!
The code can work after i installed feics in a new conda environment. The above error may be caused by me installing some extra python package. Now I wonder what I should pay attention to when I install the extra package (eg gmsh, meshio, and etc …)