I’m dealing with teh advection equation, and in that context I need some clarification as to how the Inverse(fes_space.FreeDofs()) interacts with the Set() method. Essentially, if I create some inverse matrix as such:
mstar_r.Assemble()
inv_r = mstar_r.mat.Inverse(R.FreeDofs())
And then update the time dependent boundary and right hand side as usual:
rho_h.Set(rho_ex, definedon=mesh.Boundaries(rhoBndStr))
res_r.data -= mstar_r.mat*rho_h.vec
Would be more correct to update rho_h with
rho_h.vec.data += inv_r*res_r.data
or
rho_h.vec.data = inv_r*res_r.data
The only difference is the usage of “+=” and “=”, and I am not sure how the application of “=” acts on the boundary dofs in comparison with “+=”. Does the fact that the inverse matrix is created with respect to the dirichlet boundaries, make it so the “=” operator doesn’t override the dirichlet boundary? Should I always use the “+=” operator when I’ve used Set() to update bounadries?
Thanks, and sorry if this is a bit rambly.