This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

assemble stiffness matrix of an integral kernel

+2 votes

I have an integral kernel operator term in my PDE.

$$\widetilde{K}\psi(x)= [\int (a(x')*\psi(x')) dx'] * c(x) = \epsilon * \psi(x)$$.

The stiffness matrix of this integral kernel operator is a dense matrix.

I can't find a way to do the matrix assembly on this term directly by FEniCS. Thus I want to write a subroutine to do the integral for the stiffness matrix of this operator separately.

My plan is:
1. use FEniCS to get the stiffness matrix for other terms of my PDE.
2. use my subroutine to get the stiffness matrix of this kernel opertor.
3. use "add" function of FEniCS Matrix function, to add 2 into 1.

I find the data structure of FEniCS Matrix is CSR, and it seems strange to use CSR for a dense matrix (It is takes even more space than a common matrix data structure). How do you think about it? Also I feel worried about the efficiency of step 3, will that be very time consuming?

asked Mar 18, 2014 by vincehouhou FEniCS Novice (540 points)

$$a(x),c(x)$$ are two known functions.

...