Skip to content

Conversation

@jacanchaplais
Copy link
Collaborator

@jacanchaplais jacanchaplais commented Jul 7, 2025

Relevant issue or PR

Closes #4.

Description of changes

  • Move vectoradd_jax example to a subdirectory of examples/
  • Improve README for vectoradd_jax
  • Add jax_fem example, with README, run script, and example JSON input for bar parameters

Suggested by @dionhaefner

  • Explore whether we can use default values for arrays to make bar_params auto-populated
  • Make the output a spatially resolved field (some FEM solution, eg. stress)
  • Add related output plots

Testing done

None yet. Will need to test, since this is an extract of #9, and bits may be missing.

@jacanchaplais jacanchaplais self-assigned this Jul 7, 2025
@jacanchaplais jacanchaplais added the documentation Improvements or additions to documentation label Jul 7, 2025
@jacanchaplais jacanchaplais requested a review from apaleyes as a code owner July 7, 2025 10:45
@codecov
Copy link

codecov bot commented Jul 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.95%. Comparing base (8e0ba97) to head (2d359c5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #12   +/-   ##
=======================================
  Coverage   94.95%   94.95%           
=======================================
  Files           4        4           
  Lines         218      218           
  Branches       25       25           
=======================================
  Hits          207      207           
  Misses          8        8           
  Partials        3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jacanchaplais
Copy link
Collaborator Author

@apaleyes I think the massive diff is sort of unavoidable because of examples/ directory being changed. The only file which was actually changed in the vectoradd_jax subdirectory was the README. Everything else under that directory is just copying the files. The actual diff is under examples/jax_fem/.

@PasteurBot
Copy link
Contributor

PasteurBot commented Jul 14, 2025

CLA signatures confirmed

All contributors have signed the Contributor License Agreement.
Posted by the CLA Assistant Lite bot.

@NolanBlack
Copy link

CLA signatures required

Thank you for your PR, we really appreciate it! Like many open-source projects, we ask that all contributors sign our Contributor License Agreement before we can accept your contribution. This only needs to be done once per contributor. You can do so by commenting the following on this pull request:

@PasteurBot I have read the CLA Document and I hereby sign the CLA

2 out of 3 committers have signed the CLA.✅ (jacanchaplais)[https://github.com/jacanchaplais]✅ (dionhaefner)[https://github.com/dionhaefner]❌ @NolanBlackYou can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@PasteurBot I have read the CLA Document and I hereby sign the CLA

@NolanBlack
Copy link

@PasteurBot I have read the CLA Document and I hereby sign the CLA

@NolanBlack
Copy link

@PasteurBot I have read the CLA Document and I hereby sign the CLA

what am I missing here? 🫠

jacanchaplais added a commit that referenced this pull request Jul 23, 2025
#### Relevant issue or PR
<!-- If the changes resolve an issue or follow some other PR, link to
them here. GitHub references are strongly preferred, but links to other
resources, such as Jira or Confluence, can also be used. Only link
something if it is directly relevant. -->
Cherry picked from #9.

#### Description of changes
<!-- Add a high-level description of changes, focusing on the *what* and
*why*. -->
Adds examples section to Sphinx generated ReadTheDocs. Won't work until
#12 is merged, since it relies on the new directory structure in the
`examples/` folder.

#### Testing done
<!-- Describe how the changes were tested; e.g., "CI passes", "Tested
manually in stagingrepo#123", screenshots of a terminal session that
verify the changes, or any other evidence of testing the changes. -->
@jacanchaplais jacanchaplais removed their assignment Aug 8, 2025
@apaleyes
Copy link
Contributor

@jacanchaplais @NolanBlack just wondering if this PR is done and just waiting for a review, before diving into said review. Any clues?

@jacanchaplais
Copy link
Collaborator Author

jacanchaplais commented Aug 14, 2025

Hi @apaleyes! The data generation part is done, but the visualisation still needs to be performed. Not being an CAD / engineering guy, I don't know what a meaningful visual of the data would be. @dionhaefner mentioned he may assign himself the task for fun, but either way we'll need somebody to take the von Mises stress and come up with a nice PyVista visual for it to merge this PR.

@dionhaefner
Copy link
Contributor

Should be stable from my side. @jacanchaplais want to give this a spin? The README likely needs to be updated too.

Copy link
Collaborator Author

@jacanchaplais jacanchaplais left a comment

Choose a reason for hiding this comment

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

Seem to be getting errors due to the shape of the bar params. This occurs both with the provided bar_params.json file, and copying and pasting the example from the help text above the input.

image image

@dionhaefner
Copy link
Contributor

Should work now, good catch.

@NolanBlack Would you be able to verify whether the von-Mises stresses look reasonable? I have no intuition for this 😅

@jacanchaplais
Copy link
Collaborator Author

Should work now, good catch.

Works for me and looks cool! Thanks @dionhaefner! :)

@NolanBlack
Copy link

Should work now, good catch.

@NolanBlack Would you be able to verify whether the von-Mises stresses look reasonable? I have no intuition for this 😅

I pushed some fixes and polish. I think everything is okay now, at least this seams to make sense to me:
image
The only nit I still have is that the output stress should be perfectly symmetric about the x axis, but it is slightly off. Likely just interpolation errors when doing the surface->sdf->density translation. IMO this is too picky for the scope of this project, but I just wanted to document this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Tesseract-JAX FEM optimisation example

6 participants