FEM representation in Firedrake and mass matrix #3934
Replies: 1 comment 3 replies
-
Hi Maxime, In response to 1, the way our object structure works, the finite element basis is represented by a FunctionSpace object (for technical reasons the actual class you usually see is a WithGeometry, but that's an internal detail). The FunctionSpace holds a reference to the mesh and to the finite element in reference coordinates. By combining these it has enough information to compute quantities such as integrals over the domain. A Function then stores a vector of coefficients and a reference to the FunctionSpace. It therefore has access to both the An Argument (a TestFunction or TrialFunction) is effectively just a reference to the FunctionSpace combined with the information about whether this is the number 0 or number 1 argument. This is used to determine which are the rows and which are the columns when a bilinear form is assembled into a matrix, for example. In response to number 2, |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, i had some question about the finite element representation in Firedrake and mass matrix,
let supose we hame a continuous field represented with the finite element method u = Ui Phi, with Ui the coefficient and Phi the basis function,
When we declare u = Function(Q), with Q a given function space, u store only the Ui ?
Equally, v= TestFunction(Q), v store only the Phi ?
Also, when we get the gradient by adjoint method ,
with J given cost function
Jhat = ReducedFunctional(J)
param =minimize(Jhat)
grad = Jhat.derivative()
we can effectively check that the directional gradient with respect to a direction d is consistent by finite difference :
grad_id_i = ( J(param + eps d) - J(param - eps d) )/2eps,
does the gradient contains the mass matrix ? because when i do grad_id_i its like the standart euclidean scalar product so i wonder how and where is considered the mass matrix Mij = PhiPhj
thanks for your answers!
Beta Was this translation helpful? Give feedback.
All reactions