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

Make ArbitraryOrderLagrangeElement VTK-compatible #702

Merged
merged 7 commits into from
Mar 16, 2024

Conversation

adtzlr
Copy link
Owner

@adtzlr adtzlr commented Mar 15, 2024

  • Elements with order > 2

image

closes #701

import felupe as fem
import pyvista as pv

cube = fem.mesh.CubeArbitraryOrderHexahedron(order=5)
region = fem.RegionLagrange(cube, order=5, dim=3)
field = fem.FieldContainer([fem.Field(region, dim=3)])
cube.plot(opacity=0.9).show()

boundaries, loadcase = fem.dof.uniaxial(field, clamped=True, move=-0.3)

solid = fem.SolidBody(umat=fem.NeoHooke(mu=1, bulk=5), field=field)
step = fem.Step(items=[solid], boundaries=boundaries)
job = fem.Job(steps=[step]).evaluate()

surface = field.plot().mesh.separate_cells().extract_surface(nonlinear_subdivision=4)
edges = surface.extract_feature_edges()

plotter = pv.Plotter()
plotter.add_mesh(surface)
plotter.add_mesh(edges, style="wireframe", color="black", line_width=3)
plotter.show()

@adtzlr adtzlr added bug Something isn't working enhancement New feature or request labels Mar 15, 2024
@adtzlr adtzlr self-assigned this Mar 15, 2024
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.43%. Comparing base (6e46c49) to head (5335ca3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #702   +/-   ##
=======================================
  Coverage   97.42%   97.43%           
=======================================
  Files          94       94           
  Lines        5014     5033   +19     
=======================================
+ Hits         4885     4904   +19     
  Misses        129      129           

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

@adtzlr
Copy link
Owner Author

adtzlr commented Mar 16, 2024

This is from ParaView, order=3

Screenshot_20240316_072358

@adtzlr
Copy link
Owner Author

adtzlr commented Mar 16, 2024

The lagrange hexahedron must be modified. According to the screenshot, this is a linear hexahedron and then a grid without the corner vertices.

Warning: It seems that ParaView uses a different sorting than PyVista!?

@adtzlr
Copy link
Owner Author

adtzlr commented Mar 16, 2024

Furthermore, the point ordering is different among VTK versions. https://discourse.julialang.org/t/writevtk-node-numbering-for-27-node-lagrange-hexahedron/93698/9

@adtzlr adtzlr merged commit 7e5c5da into main Mar 16, 2024
9 checks passed
@adtzlr adtzlr deleted the enhance-lagrange-element branch March 16, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RegionLagrange gives negative diff. volumes for RectangleArbitraryOrderQuad
1 participant