Initial guess for iterative solver from "Restart File" - is it possible?

Numerical methods and mathematical models of Elmer
Post Reply
eugene
Posts: 9
Joined: 19 Sep 2020, 16:37
Antispam: Yes

Initial guess for iterative solver from "Restart File" - is it possible?

Post by eugene »

Hi,

Is it possible to provide an initial solution guess to an iterative solver in a steady-state equation? I’ve tried using “Output File” and “Restart File” on VectorHelmholtzWaveguide model. “Output File” is generated and then read in without errors when supplied as “Restart File”, but it seems to have no effect on the solver iterations.

While for this simple example it makes little difference, I have a more complex VectorHelmholtz problem that takes many iterations to converge. So I want to give an initial guess, derived for example from solution of a simplified problem.

Relevant code: I’ve added the following lines in the Simulation section of waveguide.sif. Am I doing it wrong? Any help would be greatly appreciated.

Code: Select all

  Output File = "res1.result"
  Output Global Variables = True
  Binary Output = False
  Restart File = "res1.result"
  Restart Position = 0
Attachments
waveguide.sif
(4.9 KiB) Downloaded 183 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Initial guess for iterative solver from "Restart File" - is it possible?

Post by raback »

Hi

It should have at least some effect. What if you try to do the restart and include "Exec Solver = never" for "Solver 1"?

If you have many frequencies and want to scan over them then running them within same simulation will enable better initial guesses automatically.

Piola transform might not have much effect if your elements are affine whereas quadratic appoximation may have (for time, memory and accuracy).

Generally, solving Helmholtz equation is still a difficult problem for linear solvers.

-Peter
eugene
Posts: 9
Joined: 19 Sep 2020, 16:37
Antispam: Yes

Re: Initial guess for iterative solver from "Restart File" - is it possible?

Post by eugene »

Thanks Peter,

I’ve tried that: When 'Exec Solver = Never' for Solver 1, it gives 'SolveLinearSystem: Solution trivially zero!' (both with 'Restart File' and without), and it is zero in the .result file. I've also tested it by replacing field numbers in the 'old' .result file with random numbers - the iterations are the same as without any Restart File. So I would say the Restart File is essentially ignored by VectorHelmholtz... Maybe there is a bug somewhere?

It’s not just the frequency stepping, I also want to try to change model parameters and extrapolate previous solution on to new refined meshes. Indeed, Helmholtz, especially on resonant structures, is a difficult one. That’s why I was hoping to feed the solver with a good initial guess, reckoning that good initial state is key to success in any numerical optimization problem.

I've tested Piola Transform - very little difference indeed. Quadratic Approximation actually takes longer on VectorHelmholtzWaveguide test (1320 iterations, compared to 128 without it)… Though that probably will depend on the Iterative Method and would need more testing.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Initial guess for iterative solver from "Restart File" - is it possible?

Post by raback »

Hi

The solution E lives in Hcurl space which cannot be visualized directly. Hence the saving of that field has been supressed. Unfortunately this affects also the Restart.

As a remedy add to the Solver section

Code: Select all

Variable Output = Logical True
Also you could just save the needed vectors, in Simulation section say

Code: Select all

Output Variable 1 = E re
Output Variable 2 = E im
Have fun!

-Peter
eugene
Posts: 9
Joined: 19 Sep 2020, 16:37
Antispam: Yes

Re: Initial guess for iterative solver from "Restart File" - is it possible?

Post by eugene »

That fixes it! Many thanks, Peter.
Post Reply