Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Preconditioners for Maxwells Equation

More
3 years 11 months ago #2664 by Elsakori
Hello,

I am using NGSolve to solve Maxwell’s equations in time-harmonic form.
The problem that I work on is B=curl(u) * curl(v)+beta*u*v. I use the first order Nedelec space V for the approximate solution and use an auxiliary subspace W of the Nedelec space (W =span {second order face basis+third order volume basis) for computing the error function ‘’ e’’.

I print the condition numbers of the stiffness matrices on V and W. The code produce results for beta>0 and for small negative values of beta, e.g. {-10^(-4), -10^(-2) ,-10}, but with big negative values of beta like -10^(2) or -10^(4) the code gives the error

Eigensystem: Preconditioner negative
Traceback (most recent call last):
File "<string>", line 195, in <module>
File "<string>", line 127, in SolveBVP
ValueError: max() arg is an empty sequence

I am not quite familiar with using Preconditioners, I tried using different types of them but still have the same error. I am not sure which type of them work fine with my problem.

I am grateful for any explanation or help.

Best,

Ahmed

Here is my python script.
More
3 years 11 months ago - 3 years 11 months ago #2672 by lkogler
Hello Ahmed,

The function "Eigenvalues_Preconditioner" computes Eigenvalues of the the generalized EVP
[tex]
A x = \lambda C x
[/tex]
For SPD (or hermitian) matrices A and C.

When beta is positive (or not too negative), your matrix is SPD. When it is not, it also has negative eigenvalues, and Eigenvalues_Preconditioner does not work. This does not say anything about how good those preconditioners are, just that you cannot use Eigenvalues_Preconditioner to get the Eigenvalues.

NGSolve has the "ArnoldiSolver" to solve such problems, but afaik both matrices A and C have to be given as sparse matrices, which is not the case if C is (the inverse of) a preconditioner. Besides that I do not know if there is a built-in solver that can compute these Eigenvalues.

For large, negative lambda, I am not sure which preconditioners work well.

I believe "bddc" works if your mesh is fine enough, but will have to invert a relatively large problem directly.

"multigrid" should work as long as the coarsest mesh is fine enough, in which case it also requires you to solve a relatively large problem directly.



Best,
Lukas
Last edit: 3 years 11 months ago by lkogler.
Time to create page: 0.113 seconds