On Tue, May 10, 2011 at 1:00 PM, Boyce Griffith <[email protected]> wrote: > > > On 5/10/11 11:33 AM, Omar Al-Abbasi wrote: >> Hi everyone, >> >> I am trying to define the boundary conditions in a way which I am more >> familiar with. I have only one type of BC which is Drichilet and I am doing >> that simply by making indices that are on the outer surface of the domain to >> be zero in the stiffness (k) and mass (m) matrix and 1 for the mass matrix >> if index i==j. >> >> Ok I am trying to do that, but I am facing a problem for the mass matrix >> when the index i==j, since I am using: >> matrix_B.add_matrix (Me, dof_indices); >> >> which will add several 1 to the diagonal terms in the matrix. > > I think that the easiest way to do this is to make two sweeps through > the mesh. In the first sweep, set the matrix elements without worrying > about boundary conditions. Once you have finished this initial > assembly, call SparseMatrix::close() to "flush" the matrix coefficients. > Then make a second sweep through the mesh and reset the appropriate > entries by calling SparseMatrix::set().
I think DenseMatrix::condense() is the appropriate way to handle this. We don't have an example which does this, but the interface is relatively straightforward, and is defined in include/numerics/dense_matrix_base.h. -- John ------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
