WarpX icon indicating copy to clipboard operation
WarpX copied to clipboard

New Implicit Solver interface with options to select Picard or Newton (JFNK) for the nonlinear solver.

Open JustinRayAngus opened this issue 11 months ago • 5 comments

There are two new folders: Source/FieldSolver/ImplicitSolvers/ and Source/NonlinearSolvers/. All of the containers needed by the implicit time solver and corresponding nonlinear/linear solvers are now owned by the Implicit Solver and nonlinear/ linear solver class rather than by WarpX. WarpX owns a pointer to ImplicitSolver class object. The base functions in the implicit solver class are those needed to interact with WarpX ( such as OneStep ) and with the nonlinear/linear solvers. The current choices for implicit time solvers are SemiImplicitEM and ThetaImplicitEM. The current nonlinear solver choices are Picard and Newton. The Newton solver is coupled to AMReX_GMRES for solving the linear system needed to obtain the Newton step at each Newton iteration in the standard JFNK method. Both the semi-implicit and theta-implicit algorithms can use particle-suppressed (PS)-JFNK for the nonlinear solver. However, it is not yet setup to use mass matrices or preconditioning, and thus it is not yet efficient.

image002

JustinRayAngus avatar Feb 29 '24 21:02 JustinRayAngus

Any suggestions on how to fix the HIP tests failures?

JustinRayAngus avatar Mar 04 '24 18:03 JustinRayAngus

HIP compilation is fixed.

WeiqunZhang avatar Mar 05 '24 21:03 WeiqunZhang

It looks like something went wrong with merging in development. The commit list above is showing previously merged PRs. Similarly, the "Files Changed" is also showing the changes from those other PRs.

dpgrote avatar Mar 15 '24 16:03 dpgrote

Thanks a lot, @JustinRayAngus!

I am currently trying out your PR and while I am reading up on the new input options I found that the docs may be a bit outdated :)

The options implicit_evolve.<...>, picard.<stuff>, and newton.<stuff> that are used in the Examples/Tests/Implicit/inputs_vandb_jfnk_2d are not yet documented, it seems. :)

n01r avatar Apr 11 '24 00:04 n01r

Thanks a lot, @JustinRayAngus!

I am currently trying out your PR and while I am reading up on the new input options I found that the docs may be a bit outdated :)

The options implicit_evolve.<...>, picard.<stuff>, and newton.<stuff> that are used in the Examples/Tests/Implicit/inputs_vandb_jfnk_2d are not yet documented, it seems. :)

Thanks for the feedback. I have partially updated the docs, but I decided it best to wait until the PR was closer to its final form before I did a full update. I figured input parameter names could still change a bit based on reviewer feedback.

Glad someone is trying it out. Feel free to reach out to me if you want to discuss.

JustinRayAngus avatar Apr 11 '24 01:04 JustinRayAngus

@JustinRayAngus Sorry for the delay in reviewing this PR. I am finally giving it a finally round of review. In our discussions, I think that we considered moving some of the code that is duplicated in the classes ThetaImplicitEM and SemiImplicitEM to the parent class ImplicitSolver. Any opinion on this?

RemiLehe avatar May 29 '24 20:05 RemiLehe

@JustinRayAngus Sorry for the delay in reviewing this PR. I am finally giving it a finally round of review. In our discussions, I think that we considered moving some of the code that is duplicated in the classes ThetaImplicitEM and SemiImplicitEM to the parent class ImplicitSolver. Any opinion on this?

I believe this has been done. Let me know if it looks like anything else should be moved.

JustinRayAngus avatar May 30 '24 18:05 JustinRayAngus

Thanks a lot for this PR!!

RemiLehe avatar Jun 02 '24 14:06 RemiLehe