Skip to content

Debug meshFields backend to fit 1.0.0 API - #346

Open
Sichao25 wants to merge 6 commits into
SCOREC:developfrom
Sichao25:yus/meshFields
Open

Debug meshFields backend to fit 1.0.0 API#346
Sichao25 wants to merge 6 commits into
SCOREC:developfrom
Sichao25:yus/meshFields

Conversation

@Sichao25

Copy link
Copy Markdown
Contributor

Change API to fit a few breaking changes introduced by MeshFields 1.0.0. The return value of CreateLagrangeField is no longer the field itself, and the redundant barycentric coordinates have been removed.

@Sichao25
Sichao25 marked this pull request as ready for review July 29, 2026 16:11
#else
// Computation in barycentric_from_global sometimes produce values
// slightly outside [0, 1] for points on or near element boundaries.
for (int j = 0; j < dim_; ++j) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@cwsmith @Joshua-Kloepfer This code is required due to the assert statements in MeshFields. I'm wondering if those asserts should have tolerances to allow for floating point computations, or if there is a better way to handle this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A PR with a looser tolerance is here: SCOREC/meshFields#97

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can remove the check here in pcms, but this seems to create a few incompatible versions between meshfields 1.0.0 and latest. Would that be a problem? If so, we'd probably need a patch on the meshfields side.

@cwsmith

cwsmith commented Aug 3, 2026 via email

Copy link
Copy Markdown
Contributor

@Sichao25

Sichao25 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

With the tolerance update in meshFields, the assert clamping values into [0,1] has been removed. I've kept the #if MeshFields_VERSION check since some CI and existing workflows may still rely on it. We can remove this check in the future, as there's no need to keep supporting old meshFields. I think this PR is ready for review and merge.

@jacobmerson

Copy link
Copy Markdown
Collaborator

@Sichao25 we may want to put the following into a separate PR, but my understanding is that MeshFields now include parametric coordinates of each DOFHolder. These should be used to construct global coordinates in the layout rather than the hard-coding we do for linear/quadratic currently. This should let us more seemlessly support alternative element types (e.g., reduced quintic) and higher degrees.

@Sichao25

Copy link
Copy Markdown
Contributor Author

Okay. I’ll put that in a separate PR. I think the error here is related to the MeshFields version in the pre-built dependency. @jacobmerson When you have a chance, would you mind checking whether we’re using a MeshFields version newer than 1.0.0?

@jacobmerson

Copy link
Copy Markdown
Collaborator

The prebuilt dependencies are on b1482bbba288df210784b2345eae08e34faabdc4 what hash should be used? I should update that in my build scripts: https://github.com/LACES-LAB/software-dependencies/blob/main/configure-and-build-meshFields.sh

@jacobmerson

Copy link
Copy Markdown
Collaborator

@hgangwar @Fuad-HH @abhiyan123 this PR will be a breaking change when we merge it. I will update my dependency build folder at the same time that merge this PR.

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