getfem-users
[Top][All Lists]

## [Getfem-users] Implementing a Laplacian Eigenvalue problem

 From: Marianne Petersen Subject: [Getfem-users] Implementing a Laplacian Eigenvalue problem Date: Thu, 5 Mar 2015 08:47:21 +0100

Dear community,

I am trying to implement the following problem Laplacian eigenvalue problem:
\int Grad(<f,u>) dA = \lambda \int u*f dA
with Dirichlet boundary conditions and a Neumann condition.
Since this problem is observed on a mesh with n Triangles The equation is to be solved on every triangle and the corresponding fem.

Is my idea of using the following _expression_ for the lhs correct?
getfem::mesh mymesh;

// finite element method
getfem::mesh_fem mf(mymesh);
getfem::pfem pf = getfem::fem_descriptor("FEM_PK(2,1)");
mf.set_finite_element(mymesh.convex_index(), pf);

// integration method
getfem::mesh_im intm(mymesh);
getfem::pintegration_method ppi = getfem::int_method_descriptor("IM_TRIANGLE(7)");
intm.set_integration_method(ppi);

getfem::ga_workspace workspace;
getfem::size_type nbdof = mf.nb_dof();
getfem::base_vector U(nbdof);

// left hand side: A
getfem::base_vector skalprod(nbdof);
workspace.set_assembled_vector(skalprod);
workspace.assembly(0);

workspace.clear_expressions();

getfem::model_real_sparse_matrix A(nbdof, nbdof);
workspace.set_assembled_matrix(A);
workspace.assembly(2);

I am really unsure about how to implement this problem.
Do you have an idea? Or should I use the "bricks"? Although I am not sure either if this would work..

How can I make sure that the problem is for real implemented on each trinagle of the mesh?