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 mesh.interpolate_line(mesh, xi, axis) #811

Merged
merged 2 commits into from
Jul 20, 2024
Merged

Conversation

adtzlr
Copy link
Owner

@adtzlr adtzlr commented Jul 20, 2024

This enables an interpolation of a line mesh in N-D space, hopefully useful for further progress on #810.

import felupe as fem
import numpy as np

# create a line mesh
mesh = fem.mesh.Line(n=5).expand(n=1)
t = mesh.x.copy()
mesh.points[:, 0] = np.sin(np.pi / 2 * t)
mesh.points[:, 1] = np.cos(np.pi / 2 * t)

xi = np.linspace(0, 1, 101)
mesh_new = interpolate_line(mesh, xi=xi, axis=1)
derivative = mesh_new.points_derivative(xi)

ax = mesh_new.imshow(style="points", color="black")

image

@adtzlr adtzlr added the enhancement New feature or request label Jul 20, 2024
@adtzlr adtzlr self-assigned this Jul 20, 2024
Copy link

codecov bot commented Jul 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.46%. Comparing base (3c042de) to head (55cb643).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #811   +/-   ##
=======================================
  Coverage   97.45%   97.46%           
=======================================
  Files         138      139    +1     
  Lines        5510     5528   +18     
=======================================
+ Hits         5370     5388   +18     
  Misses        140      140           

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

@adtzlr adtzlr merged commit 1d8585a into main Jul 20, 2024
8 checks passed
@adtzlr adtzlr deleted the add-mesh-interpolate-line branch July 20, 2024 22:33
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