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

Eigen kernel residual tagging is expected to include the eigenvalue #28984

Open
YaqiWang opened this issue Nov 1, 2024 · 6 comments
Open

Eigen kernel residual tagging is expected to include the eigenvalue #28984

YaqiWang opened this issue Nov 1, 2024 · 6 comments
Labels
C: Framework T: task An enhancement to the software.

Comments

@YaqiWang
Copy link
Contributor

YaqiWang commented Nov 1, 2024

Motivation

I need to evaluate residual into a tagged vector for an eigenvalue problem, which include contribution of non-eigen and eigen kernels. The global residual can be represented as Ax - Bx / k where x is the solution, k is the eigenvalue evaluated as a functional of x, which we denote it as |Bx|. A is the operation of non-eigen kernels and B is for eigen kernels. Thus, we would expect in a tagged residual vector, we have the 1/k factor in the eigen kernel contributions.

However, in our current implementation, Ax and Bx are always evaluated separately, when we do need the global residual, we combine the two vectors into one with |Bx|. For eigen kernel tagging, we do not have the factor included. Because in a tagging vector, we do not and do not want to have two vectors, we need to apply the factor inside TaggingInterface. One caveat in this case is that |Bx| must be made available during kernel evaluation, which is indeed the case when |Bx| is a postprocessor on linear, but not the case when |Bx| is for example the L2 norm of Bx.

Design

As described in the motivation, we need to improve TaggingInterface to handle the tagging differently for eigen kernels. We will need to detect whether a kernel is eigen kernel or not, if it is we do not apply the factor when it is tagged to the system Bx vector, otherwise apply the factor.

Impact

A capability has not been supported, thus will not create any impact to current applications.

@YaqiWang YaqiWang added the T: task An enhancement to the software. label Nov 1, 2024
YaqiWang added a commit to YaqiWang/moose that referenced this issue Nov 1, 2024
@lindsayad
Copy link
Member

I need to evaluate residual into a tagged vector

Why do you need to do this? The Newton residual casting of a generalized eigenvalue problem is just one solution algorithm. I think one could very reasonably argue the opposite of what you're arguing and say that it's weird to apply the eigenvalue factor to some vector tags and not to the eigen tag. It's inconsistent

@lindsayad
Copy link
Member

We do not call these tags "residual" tags. We call them "vector" tags. They will not always represent a residual

YaqiWang added a commit to YaqiWang/moose that referenced this issue Nov 1, 2024
@YaqiWang
Copy link
Contributor Author

YaqiWang commented Nov 1, 2024

Yes, in general it is a vector tag. But here I am only considering using those tagged vectors as an output of residual evaluation, so I call them residual vectors. Yes, residual is only used by the Newton algorithm possibly in SLEPc (and in a Richardson iterative solver in Griffin), however, its definition should be the left minus the right with eigenvalue scaling. Residual is used by Griffin for evaluating reactivity with perturbation.

YaqiWang added a commit to YaqiWang/moose that referenced this issue Nov 1, 2024
@lindsayad
Copy link
Member

Yes, residual is only used by the Newton algorithm possibly in SLEPc (and in a Richardson iterative solver in Griffin), however, its definition should be the left minus the right with eigenvalue scaling.

That is the definition of the nonlinear residual for a Newton eigen problem, I agree. However, it does not have to be the definition of a given vector tag. An eigen tag has always meant the (Bx) vector. If the eigen tag has been applied to a kernel, I don't see a strong argument yet to treat any other tags applied to the kernel differently

@lindsayad
Copy link
Member

In Griffin, can't you retrieve an (Ax) vector and (Bx) vector and perform the summation with coefficient scaling yourself?

YaqiWang added a commit to YaqiWang/moose that referenced this issue Nov 1, 2024
@YaqiWang
Copy link
Contributor Author

YaqiWang commented Nov 1, 2024

In Griffin, can't you retrieve an (Ax) vector and (Bx) vector and perform the summation with coefficient scaling yourself?

No because not all kernels tag to Ax or Bx vectors. To save memory, we only create one vector for tagging, which needs to have both non-eigen and eigen kernel contributions. I updated my PR, I think it looks better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework T: task An enhancement to the software.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants