Add Matrix to SymbolicBFI

Hello,

is there any possibility to add a constant Matrix to the Bilinear Form?

a = BilinearForm(fes)
a+= SymbolicBFI(weak_K(u,v))
a+= "const. Matrix from Numpy" #either here

a.Assemble()

a.mat += "const Matrix form Numpy" # or here (but does then a.AssembleLinearization() work later?)

The benefit would be that I can still use a.Apply, a.AssembleLinearization, etc… as I would with only considering the “analytical, continous” weak form of my problem.

Thanks for your help in advance!

One should be able to create a scipy sparse matrix like here:
https://docu.ngsolve.org/latest/i-tutorials/unit-2.10-dualbasis/dualbasis.html?highlight=scipy%20csr

and if copy=False argument is set, one should be able to manipulate the underlying c++ matrix. But not 100% sure if no copy is involved so please check!

Best
Christopher