Skip to content

Conversation

@hugary1995
Copy link
Contributor

Using std::optional to avoid breaking API.
This is needed in moose element subdomain modifier where we need to project a function onto a subset of the mesh.

@hugary1995 hugary1995 marked this pull request as draft October 2, 2025 21:42
@hugary1995
Copy link
Contributor Author

I will add some tests later. @roystgnr please let me know if this looks okay to you before I go too far.

@roystgnr
Copy link
Member

roystgnr commented Oct 8, 2025

Sorry I missed the comment here!

Definitely we want to add this feature.

I'd have made the range argument a pointer with a nullptr default, but out of force of habit rather than because it's a good idea, and I'm happy with std::optional here. Someone correct me if I'm wrong, but best practices now is to use std::optional for any object that's lightweight enough to not worry about copying, right? (and probably also for heavyweight objects, eventually, when C++26 adds optional<T&> support?) Our ranges are currently like 48 bytes, so the copies should be fine.

@ChengHauYang ChengHauYang force-pushed the project_vector_range branch 2 times, most recently from c499d82 to 644101b Compare January 15, 2026 14:54
@ChengHauYang
Copy link
Member

Dear @roystgnr,

I added one test case and modified it to support project_solution with elem_ranges as well.
Could you please review it and assist us in activating the CI?

Thanks!

@ChengHauYang
Copy link
Member

ChengHauYang commented Jan 16, 2026

Dear @roystgnr,

We tried to support libMesh project_vector and project_solution with target variables as well.
And, I modified the test to test this as well.
If you are available and have a chance, could you please review it and help us mark this PR as "ready for review"?

Thanks for your time!

@roystgnr roystgnr marked this pull request as ready for review January 20, 2026 20:36
@ChengHauYang
Copy link
Member

It appears that https://civet.inl.gov/repo/8/ does not recognize this PR, so as @roystgnr suggested, we plan to close this PR and open a new PR (#4368).

@roystgnr roystgnr closed this Jan 21, 2026
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