Skip to content

Export the spmatrix as scipy sparse matrix for scheme.assemble

Andreas Dedner requested to merge feature/exportSPMatrix into master

Make it possible to extract dof vectors and assembled matrices for different backends (fem,eigen,istl,petsc)

  • added a method as_* to the discrete function (as_numpyfor eigen/fem,as_istlfor istl andas_petscforpetsc`
  • scheme.assemble returns a scipy crs matrix for eigen/fem, an istl bcrs or a petsc matrix depending on backend used

To do: at the moment there is a method space.numpyFunction to generate a discrete function from a given numpy array. We need something similar for BVectors and Petsc::Vec storages. Possibly:

space.discreteFunction(vector,name)

and the correct version is used depending on the type of vector. Alternative, the vector has to match the storage provided by the space.

Edited by Andreas Dedner

Merge request reports

Loading