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

Add morph() for JAX-based Material #880

Merged
merged 11 commits into from
Nov 2, 2024
Merged

Add morph() for JAX-based Material #880

merged 11 commits into from
Nov 2, 2024

Conversation

adtzlr
Copy link
Owner

@adtzlr adtzlr commented Nov 2, 2024

This PR adds the MORPH material formulation for a JAX-based material. It is about 6x faster compared to the tensortrax-implementation with a more numpy-like experience.

import felupe as fem

umat = fem.constitution.autodiff.jax.Material(
    fem.constitution.autodiff.jax.models.lagrange.morph,
    p=[0.039, 0.371, 0.174, 2.41, 0.0094, 6.84, 5.65, 0.244],
    nstatevars=13,
)
mesh = fem.Cube(n=2)
region = fem.RegionHexahedron(mesh)
field = fem.FieldContainer([fem.Field(region, dim=3)])

boundaries, loadcase = fem.dof.uniaxial(field, clamped=True)
solid = fem.SolidBody(umat=umat, field=field)

move = fem.math.linsteps([0, 1], num=3)
ramp = {boundaries["move"]: move}
step = fem.Step(items=[solid], ramp=ramp, boundaries=boundaries)
job = fem.Job(steps=[step])
job.evaluate(tol=1e-4)

@adtzlr adtzlr added the enhancement New feature or request label Nov 2, 2024
@adtzlr adtzlr self-assigned this Nov 2, 2024
@adtzlr
Copy link
Owner Author

adtzlr commented Nov 2, 2024

remove Python 3.8 support (EOL), see #863

Copy link

codecov bot commented Nov 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.62%. Comparing base (b87862a) to head (06eaffc).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #880      +/-   ##
==========================================
+ Coverage   97.60%   97.62%   +0.01%     
==========================================
  Files         154      157       +3     
  Lines        5888     5928      +40     
==========================================
+ Hits         5747     5787      +40     
  Misses        141      141              

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

@adtzlr adtzlr merged commit 39738ea into main Nov 2, 2024
7 checks passed
@adtzlr adtzlr deleted the add-morph-jax branch November 2, 2024 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant