<div dir="ltr"><div dir="ltr">On Thu, Nov 30, 2023 at 4:23 PM Alexander Lindsay <<a href="mailto:alexlindsay239@gmail.com">alexlindsay239@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">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.</div></div></blockquote><div><br></div><div>I want to try and reduce this to the simplest possible thing so that I can understand. We have some system which has two parts to the solution, L and U. If this problem is linear, we have</div><div><br></div><div> / A B \ / U \ = / f \</div><div> \ C D / \ L / \ g /</div><div><br></div><div>and we assume that A is easily invertible, so that</div><div><br></div><div> U + A^{-1} B L = f</div><div> U = f - A^{-1} B L</div><div><br></div><div> C U + D L = g</div><div> C (f - A^{-1} B L) + D L = g</div><div> (D - C A^{-1} B) L = g - C f</div><div><br></div><div>where I have reproduced the Schur complement derivation. Here, given any L, I can construct the corresponding U by inverting A. I know your system may be different, but if you are only solving for L,</div><div>it should have this property I think.</div><div><br></div><div>Thus, if the line search generates a new L, say L_1, I should be able to get U_1 by just plugging in. If this is not so, can you write out the equations so we can see why this is not true?</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>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:</div><div><br></div><div>K_LL = -K_LU * K_UU^-1 * K_UL + K_LL</div><div>F_L = -K_LU * K_UU^-1 * F_U + F_L</div><div><br></div><div>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</div><div><br></div><div>dU = K_UU^-1 * (-F_U - K_UL * dL)</div><div><br></div><div>Armed now with both dL and dU, I am ready to perform a new residual evaluation with (L0 + dL, U0 + dU) = (L1, U1). </div><div><br></div><div>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.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 30, 2023 at 12:32 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Why is this all not part of the function evaluation?<br>
<br>
<br>
> On Nov 30, 2023, at 3:25 PM, Alexander Lindsay <<a href="mailto:alexlindsay239@gmail.com" target="_blank">alexlindsay239@gmail.com</a>> wrote:<br>
> <br>
> 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.<br>
> <br>
> I can almost certainly do this manually but I believe it would be more prone to error than a dedicated callback.<br>
<br>
</blockquote></div></div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>