SCOREC / mumfim

MuMFiM: Multiscale Modeling of Fibrous Materials
BSD 3-Clause "New" or "Revised" License
4 stars 4 forks source link

PETSc SNES solver #7

Open jacobmerson opened 2 years ago

jacobmerson commented 2 years ago

It would be helpful to be able to test various types of nonlinear solvers at the macro scale. Various options such as PETSc/SNES, Trillinos/Nox/LOCA, and LLNL/Sundials are available. Each of these options follows the same general trend of providing the package a function to compute the Jacobian and residual. Since we currently make sue of PETSc through a "LAS" wrapper in AMSI it is sensible to start by working with either Sundials or PETSc since they work with PETSc vectors.

To keep the additional dependencies to a minimum, we will start by performing the refactoring necessary to work with PETSc/SNES and if we face limitations, we can explore the use of Sundials or Nox further.

In the current implementation, the Jacobian and residual are computed using the same integration and assembly routines. I need to understand if these can be decoupled and how to compute the residuals/tangent stiffness directly from a PETSc vector of displacements.

Current thinking is that we:

  1. update current coordinates field on mesh
  2. run field integration routine

I suspect this may be helpful for resolving #4

jacobmerson commented 2 years ago
  1. Code here gets converted to SNES calls. https://github.com/SCOREC/mumfim/blob/63f9c925d41d683c0cb80a93af40736a376c66dd/src/mumfim/macroscale/TissueAnalysis.cc#L143
  2. Material integrators get updated to compute residual and Jacobian (tangent stiffness) independently

If we compute Jacobian independently, we need to confirm that the dirichlet BCs are still set correctly.