[petsc-users] Pre-check before each line search function evaluation

Alexander Lindsay alexlindsay239 at gmail.com
Thu Nov 30 15:22:44 CST 2023


If someone passes me just L, where L represents the "global" degrees of
freedom, in this case they represent unknowns on the trace of the mesh,
this is insufficient information for me to evaluate my function. Because in
truth my degrees of freedom are the sum of the trace unknowns (the unknowns
in the global solution vector) and the eliminated unknowns which are
entirely local to each element. So I will say my dofs are L + U.

I start with some initial guess L0 and U0. I perform a finite element
assembly procedure on each element which gives me things like K_LL, K_UL,
K_LU, K_UU, F_U, and F_L. I can do some math:

K_LL = -K_LU * K_UU^-1 * K_UL + K_LL
F_L = -K_LU * K_UU^-1 * F_U + F_L

And then I feed K_LL and F_L into the global system matrix and vector
respectively. I do something (like a linear solve) which gives me an
increment to L, I'll call it dL. I loop back through and do a finite
element assembly again using **L0 and U0** (or one could in theory save off
the previous assemblies) to once again obtain the same K_LL, K_UL, K_LU,
K_UU, F_U, F_L. And now I can compute the increment for U, dU, according to

dU = K_UU^-1 * (-F_U - K_UL * dL)

Armed now with both dL and dU, I am ready to perform a new residual
evaluation with (L0 + dL, U0 + dU) = (L1, U1).

The key part is that I cannot get U1 (or more generally an arbitrary U)
just given L1 (or more generally an arbitrary L). In order to get U1, I
must know both L0 and dL (and U0 of course). This is because at its core U
is not some auxiliary vector; it represents true degrees of freedom.

On Thu, Nov 30, 2023 at 12:32 PM Barry Smith <bsmith at petsc.dev> wrote:

>
>   Why is this all not part of the function evaluation?
>
>
> > On Nov 30, 2023, at 3:25 PM, Alexander Lindsay <alexlindsay239 at gmail.com>
> wrote:
> >
> > Hi I'm looking at the sources, and I believe the answer is no, but is
> there a dedicated callback that is akin to SNESLineSearchPrecheck but is
> called before *each* function evaluation in a line search method? I am
> using a Hybridized Discontinuous Galerkin method in which most of the
> degrees of freedom are eliminated from the global system. However, an
> accurate function evaluation requires that an update to the "global" dofs
> also trigger an update to the eliminated dofs.
> >
> > I can almost certainly do this manually but I believe it would be more
> prone to error than a dedicated callback.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20231130/fa4d83a2/attachment.html>


More information about the petsc-users mailing list