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

MaterialStrain.plot() shows wrong preview #752

Closed
adtzlr opened this issue Apr 30, 2024 · 0 comments · Fixed by #755
Closed

MaterialStrain.plot() shows wrong preview #752

adtzlr opened this issue Apr 30, 2024 · 0 comments · Fixed by #755
Labels
bug Something isn't working plotting view, plot, screenshot, imshow

Comments

@adtzlr
Copy link
Owner

adtzlr commented Apr 30, 2024

The preview of MaterialStrain with state variables is wrong

import felupe as fem

umat = fem.MaterialStrain(
    material=fem.linear_elastic_plastic_isotropic_hardening,
    λ=2.0,
    μ=1.0,
    σy=1.0,
    K=0,
    dim=3,
    statevars=(1, (3, 3)),
    tangent=False,
)
move = fem.math.linsteps([1, 1.8, 1.4], num=21)
ax = umat.plot(ux=move, bx=None, ps=None)
ax.lines[0].set_marker("o")

image

but this is correct:

mesh = fem.Cube(n=2)
region = fem.RegionHexahedron(mesh)
field = fem.FieldContainer([fem.Field(region, dim=3)])
boundaries, loadcase = fem.dof.uniaxial(field, clamped=False)
solid = fem.SolidBody(umat, field)
step = fem.Step(
    items=[solid], ramp={boundaries["move"]: move - 1}, boundaries=boundaries
)

job = fem.CharacteristicCurve(steps=[step], boundary=boundaries["move"])
job.evaluate()
fig, ax = job.plot(
    xlabel="Displacement $u$ in mm $\longrightarrow$",
    ylabel="Normal Force $F$ in N $\longrightarrow$",
)

image

@adtzlr adtzlr added bug Something isn't working plotting view, plot, screenshot, imshow labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plotting view, plot, screenshot, imshow
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant