I am currently trying to understand what the assemble_matrix() and assemble() functions do. I know they convert a bilinear form into a matrix but I cannot find any info on how they perform such transformation mathematically or its implementation. Does anyone know where I could find this ?

In the section â€śA complete variationnal formâ€ť, when you define each of the functions as the linear combinations of the basis functions, what are these basis functions for FenicsX ? Also I donâ€™t understand what the M_K matrix is and its purpose, is it the same a taking the values of the bilinear forms applied to the functions of the basis ?