[Libmesh-devel] sparse matrix multiply

 [Libmesh-devel] sparse matrix multiply From: Wout Ruijter - 2007-09-15 16:51:09 ```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 matrix-vector multiply (petsc probably has that) to sparsematrix. It is obviously inefficient storage-wise 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 ```

 [Libmesh-devel] sparse matrix multiply From: Wout Ruijter - 2007-09-15 16:51:09 ```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 matrix-vector multiply (petsc probably has that) to sparsematrix. It is obviously inefficient storage-wise 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 ```
 [Libmesh-devel] sparse matrix multiply From: John Peterson - 2007-09-17 03:23:27 ```There already is a matrix-vector 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 matrix-vector multiply (petsc probably has > that) to sparsematrix. > It is obviously inefficient storage-wise 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 ```