I'm trying to get into libMesh, so i tried to convert an existing project.

So far i could reproduce the lid driven cavity case for the Stokes
equations like in
example examples/systems_of_equations/systems_of_equations_ex1.

Now i'm trying to build a mass matrix so i can solve the generalized
eigenproblem in order to retrieve the physical eigenvalues in the following
domain:

build_square (mesh,
            16, 16,

            -1., 1.,

            -1., 1.,

            TRI6);

So the eigenvalues should be (rounded to int) [13, 23, 23, 32, 38, 41...].

My approach is that i add a matrix

system.add_matrix("mass");

in the assemble loop i add:

DenseMatrix<Number> Me;
Me.resize (n_dofs, n_dofs);

and to the integration parts:
Me(i,j) += JxW[qp]*(phi[i][qp]*phi[j][qp]);

then i close the matrices
system.get_matrix("mass").close();

and convert them to PETSc so i can use my own SLEPc object
Mat A = (static_cast<PetscMatrix<Number> *>(system.matrix))->mat();

Mat M = (static_cast<PetscMatrix<Number>
&>(system.get_matrix("mass"))).mat();

The problem is, the calculated eigenvalues are not the ones i expect (so
they're wrong).
This method worked for me for the poisson equation.
Do i miss something?

Oh and here is the commandline option string
./foo -st_type sinvert -st_target 10 -st_pc_type lu
-st_pc_factor_mat_solver_package mumps -eps_nev 10
------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to