Skip to content

Conversation

@chrisrichardson
Copy link
Contributor

No description provided.

@jhale
Copy link
Member

jhale commented Sep 20, 2025

On a related note, where are we with providing the things needed to interface with SNES from C++?

@chrisrichardson chrisrichardson marked this pull request as ready for review September 22, 2025 09:10
VecGhostUpdateBegin(x, INSERT_VALUES, SCATTER_FORWARD);
VecGhostUpdateEnd(x, INSERT_VALUES, SCATTER_FORWARD);
PetscReal residual = 0;
VecNorm(r, NORM_2, &residual);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use NORM_INFINITY for residual norms instead (as a naive fix)? I always struggle that NORM_2 grows with numbers of elements so for a finer mesh you'll violate atol very soon.

Btw. are C++ demos run in CI? Could not find the job.

Copy link
Contributor

Choose a reason for hiding this comment

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

Btw. are C++ demos run in CI? Could not find the job.

https://github.com/FEniCS/dolfinx/blob/main/.github/workflows/ccpp.yml#L230 - CI step has a confusing name.

@jorgensd
Copy link
Member

Is the long term plan to remove the DOLFINx C++ Newton solver, in favor of another solver (like SNES)? If we plan to remove it, I think we need to give some deprecation notice to the C++ users + an alternative that is not copying solver logic across multiple user files.

@jhale
Copy link
Member

jhale commented Sep 26, 2025

Yes, the plan is to remove NewtonSolver and provide some tooling/examples to help people interface SNES from C++. However, I've never done it myself, so I have no idea where to even begin.

@chrisrichardson
Copy link
Contributor Author

I think that the example here is sufficiently simple that reproducing the logic of NewtonSolver (and simplifying) is OK (only adds 70 lines of code).
We could add a deprecation message to NewtonSolver at the same time. I am not sure of the best sequencing for this. I don't think I want to add a SNES interface in this PR.

@jhale
Copy link
Member

jhale commented Oct 6, 2025

Could you add that deprecated message so we can get this merged for 0.10?

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.

5 participants