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

Fix a bunch of small errors. #1301

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

tupek2
Copy link
Collaborator

@tupek2 tupek2 commented Dec 20, 2024

Petsc was printing lots of errors. This makes it a bit more quiet. Also, a possible indexing error is fixed if no leftmost eigenvectors are asked for.

@tupek2
Copy link
Collaborator Author

tupek2 commented Dec 20, 2024

/style

@tupek2 tupek2 requested a review from btalamini December 20, 2024 23:02
mfem::out << "Energy using subspace solver from: " << base_energy << ", to: " << subspace_energy << " / "
<< energy_change << ". Min eig: " << leftvals[0] << std::endl;
<< energy_change << ". Min eig: " << leftval << std::endl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the minimum eigenvalue estimate will be reported as 1.0 when no min eigenvalues estimates have been requested. I'm fine with this for now, since it's really an inconsistent request from the user, but it is misleading. An option to consider is to check if leftvals.size() == 0 once at the beginning of the step and echo a warning saying that the min eigenvalue will be reported as 1.0 in this case.

Comment on lines +19 to +25
DenseMat(const DenseMat& a)
{
MatDuplicate(a.A, MAT_COPY_VALUES, &A);
MatCopy(a.A, A, SAME_NONZERO_PATTERN);
MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY);
MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've done the testing, so I trust you on this. If you actually wanted me to double check, let me know. Otherwise mark as resolved.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assembly are definitely needed. The Copy, maybe not. But I'm sick of trying to guess what PETSc is going to do, best be safe. It costs nothing in practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants