# Eliminate degrees of freedom using periodic fespace

**URL:** <https://community.freefem.org/t/eliminate-degrees-of-freedom-using-periodic-fespace/4238>\
**Category:** General Discussion\
**Created:** [March 9, 2026, 11:45am UTC](https://community.freefem.org/t/eliminate-degrees-of-freedom-using-periodic-fespace/4238 "2026-03-09T11:45:18Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [March 10, 2026, 5:32pm UTC](https://community.freefem.org/t/eliminate-degrees-of-freedom-using-periodic-fespace/4238/9 "2026-03-10T17:32:55Z")

</div>

You should use the array of dofs instead of the finite element functions. I think it is not possible to do it with `EigenValue()`. However it is possible if you use `EPSSolve()` with PETSc. Then instead of `vector=` you put `array=`.  
There is an example in

> [@Generalized eigenvalue problem solving with Lagrange multipliers with EPSSOLVE](https://community.freefem.org/t/generalized-eigenvalue-problem-solving-with-lagrange-multipliers-with-epssolve/3650):
>
> Hello, I am facing a problem with a generalized eigenvalues problem using EPSSolve in FreeFEM. I want to solve a variational formulation with constraints, which I handle using Lagrange multipliers. This leads to a matrix problem of the form AX = \lambda BX. (B has some lines of zeros but it shouldn’t be a problem to solve this matricial equation) I can solve this problem in MATLAB, but I cannot get it to work with the EPSSOLVE function in FreeFEM. If I specify the parameters for EPSSOLVE as s…

For the case of composite spaces, you can do as  
`real[int,int] Vectab(ndof,nev);`  
then you put `array=Vectab` in `EPSSolve()`.  
Finally you define

```auto
Rh [uu1,uu2];
Lh [aa1,aa2];
for (int i=0;i<nev;i++){
 [uu1[],aa1[]]=Vectab(:,i);
 //here you can use the eigenvector [uu1,uu2] as you like
 //the Lagrange multiplier [aa1,aa2] is useless
}

```

There is also this example

> [@Fascinating theoretical challenge: Simulating EM eigenmodes in a tetrahedron](https://community.freefem.org/t/fascinating-theoretical-challenge-simulating-em-eigenmodes-in-a-tetrahedron/4049/10):
>
> Dear Frodo, I have written a version with Laplacian and boundary condition E\times n =0 [EMtet.edp](https://community.freefem.org/uploads/short-url/AobXDpCZsR0nsGFhn5FxXqcv0sg.edp) (7.8 KB) I get for the 10 first eigenvalues 78.88776433 79.02651853 79.02651853 153.9973688 163.2695866 163.7718604 163.7718604 174.020952 175.1561748 197.8465549 It seems that there is a first eigenvalue with triple multiplicity, then an eigenvalue 154 (your fundamental mode ?), then again an eigenvalue with triple multiplicity. You have to run the code EMtet.edp to plot (buil…

---

_[View the full topic](https://community.freefem.org/t/eliminate-degrees-of-freedom-using-periodic-fespace/4238)._
