Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic method for enabling SMP for AD #13411

Closed
aeslaughter opened this issue May 14, 2019 · 8 comments
Closed

Automatic method for enabling SMP for AD #13411

aeslaughter opened this issue May 14, 2019 · 8 comments
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.

Comments

@aeslaughter
Copy link
Contributor

Reason

When AD objects are used you need to have the following in the input file, but this isn't intuitive.

[Preconditioning]
  [smp]
    type = SMP
    full = true
  []
[]

[Executioner]
  type = Steady 
  solve_type = NEWTON
[]

Design

I propose the following that will automatically add the correct Preconditioning if it is not provided.

[Executioner]
  type = Steady 
  solve_type = AD_NEWTON
[]

Impact

This will make using MOOSE with AD easier and less prone to errors.

@aeslaughter aeslaughter added T: task An enhancement to the software. P: normal A defect affecting operation with a low possibility of significantly affects. labels May 14, 2019
@aeslaughter
Copy link
Contributor Author

@idaholab/moose-team Are people OK with this or have a better idea?

@lindsayad
Copy link
Member

I personally think that any time a user specifies solve_type = NEWTON, the default behavior should be to add SMP with full = true regardless of whether AD is being used or not. However the Jacobian is being computed, NEWTON requires a complete (and accurate) Jacobian in order to be successful

@fdkong
Copy link
Contributor

fdkong commented May 14, 2019

I kind of agree with @lindsayad. If we use NEWTON, we should trigger ``full=true" by default. But I think we also should reserve an option so that users can turn it off if they want. For example, if the equation is very simple, we do not need to form the world.

aeslaughter added a commit to aeslaughter/moose that referenced this issue May 14, 2019
aeslaughter added a commit to aeslaughter/moose that referenced this issue May 14, 2019
@tophmatthews
Copy link
Contributor

If I remember correctly...NEWTON isn't really explicitly newton right? I've used it in the past with a close enough jacobian. Also, a full SMP is used sometimes with PJFNK. How about

[Executioner]
  type = Steady 
  solve_type = PJFNK/NEWTON
  SMP = none/partial/full
[]

@rwcarlsen
Copy link
Contributor

rwcarlsen commented May 14, 2019

I'm with @fdkong and @lindsayad. I have been converting a bunch of stuff to AD and it is really easy to forget to set solve_type=NEWTON along with a full=true SMP preconditioner in input files. I frequently forget to set one or more of those things.

@rwcarlsen
Copy link
Contributor

To be clear - solve_type=AD_NEWTON would be an improvement over the status quo, but I'd still might forget to update files to use that that already have solve_type=NEWTON.

@lindsayad
Copy link
Member

If I remember correctly...NEWTON isn't really explicitly newton right?

It depends on whether you're using a line search or not. If you're using line_search = basic (which really means no line search), then you are conducting pure Newton. If you're using a line search (e.g. a globalization strategy), then yes in terms of jargon, you're using a Quasi-Newton method.

I've used it in the past with a close enough jacobian

You can definitely achieve convergence with a non-perfect Jacobian using Newton (or Quasi-newton), but you'll be pretty unlikely to achieve a quadratic convergence rate at any point in the non-linear solve.

[Executioner]
type = Steady
solve_type = PJFNK/NEWTON
SMP = none/partial/full
[]

I'm not quite sure what you mean here.

@tophmatthews
Copy link
Contributor

Thanks for the replies @lindsayad. I was suggesting having an SMP input parameter as an enum with options none, partial, full, similar to how the solve_type is an enum. You can even throw a warning if solve_type=NEWTON without SMP=full which should fail tests, but allow you to set it to none if you wish.

aeslaughter added a commit to aeslaughter/moose that referenced this issue May 16, 2019
aeslaughter added a commit to aeslaughter/moose that referenced this issue May 17, 2019
aeslaughter added a commit to aeslaughter/moose that referenced this issue May 17, 2019
aeslaughter added a commit to aeslaughter/moose that referenced this issue May 17, 2019
aeslaughter added a commit to aeslaughter/moose that referenced this issue May 17, 2019
aeslaughter added a commit to aeslaughter/moose that referenced this issue May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.
Projects
None yet
Development

No branches or pull requests

6 participants