From: Omar AlAbbasi <omabbasi@gm...>  20110510 15:33:17

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 know that I am applying my BC in a very poor way, I was trying to imitate one of the example to my purpose and this what I am doing: for (unsigned int side=0; side<elem>n_sides(); side++){ if (elem>neighbor(side) == NULL) { const std::vector<std::vector<Real> >& phi_face = fe_face>get_phi(); const std::vector<Real>& JxW_face = fe_face>get_JxW(); const std::vector<Point >& qface_point = fe_face>get_xyz(); // Compute the shape function values on the element // face. fe_face>reinit(elem, side); // Loop over the face quadrature points for integration. // for (unsigned int qp=0; qp<qface.n_points(); qp++) // { // Matrix contribution of the L2 projection. for (unsigned int i=0; i<phi_face.size(); i++){ for (unsigned int j=0; j<phi_face.size(); j++){ Ke(i,j) = 0.; if (i==j){Me(i,j) = 1.;} else {Me(i,j) = 0.;} } // } // end face quadrature point loop } // end if (elem>neighbor(side) == NULL) } // end boundary condition section } matrix_A.add_matrix (Ke, dof_indices); matrix_B.add_matrix (Me, dof_indices); Appreciate if someone can find me a way the will make the diagonal terms of the surface of mass matrix to be equal 1. And if someone has better suggestion than the miss that I am doing in ( for (unsigned int i=0; i<phi_face.size(); i++){ for (unsigned int j=0; j<phi_face.size(); j++){ ......) I will appreciate that too. Thanks in advance, Omar 