There already is a matrixvector multiply routine, however it is located in
the NumericVector class.
As far as making a copy of the stiffness matrix, I don't really think
this is really something necessary for the library, though someone can
probably convince me otherwise.
There is already an add_matrix() routine in the ImplicitSystem class, that
can probably be of use for this purpose.
J
Wout Ruijter writes:
> Dear developers,
>
> I was thinking about the following.
> When solving an elastostatics problem with penalty boundary conditions
> Ku=f
> you get u out by setting diag(K) to P and f to P*u, where P the penalty.
> This gives u but there doesn't seem to be an easy way to get out the
> reaction forces (which would be Ku but without the penalty).
>
> I propose to copy the unpenalized stiffness matrix (can already be
> done in System) and add a matrixvector multiply (petsc probably has
> that) to sparsematrix.
> It is obviously inefficient storagewise so it should be available
> only when called explicitly.
> It could be done by looping over all elements connected to a DOF for
> which the reaction force needs to be known and multiply the element
> stiffness, but that seems nastier since it would require recoding of
> the assembly function.
>
> Let me know there are any thoughts/ways of doing this.
> W
