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

Increased test coverage for internal operations #104

Merged
merged 10 commits into from
Nov 10, 2023

Conversation

termi-official
Copy link
Member

@termi-official termi-official commented Nov 7, 2023

Tracking down #67

Reproducer plot

using Ferrite
import FerriteViz
using FerriteViz: ε
import GLMakie #activating the backend, switch to GLMakie or CairoMakie (for 2D) locally

include("src/ferrite-examples/incompressible-elasticity.jl") #defines dh_linear, dh_quadratic, u_linear, u_quadratic and mp

(dh_linear_grad, u_linear_grad) = FerriteViz.interpolate_gradient_field(dh_linear, u_linear, :u)
(dh_quadratic_grad, u_quadratic_grad) = FerriteViz.interpolate_gradient_field(dh_quadratic, u_quadratic, :u)
plotter_linear = FerriteViz.MakiePlotter(dh_linear_grad, u_linear_grad)
plotter_quadratic = FerriteViz.MakiePlotter(dh_quadratic_grad, u_quadratic_grad)
σ(∇u) = 2*mp.G*dev(ε(∇u)) + mp.K*tr(ε(∇u))*ones(ε(∇u)) #helper function to map gradient to stress
cmap = :jet

f = GLMakie.Figure()
axs = [GLMakie.Axis(f[1, 1], title="Strain norm (linear)"),GLMakie.Axis(f[1, 2], title="Stress norm (linear)"),GLMakie.Axis(f[1, 3], title="Pressure (deformed, linear)"),
       GLMakie.Axis(f[3, 1], title="Strain norm (quadratic)"),GLMakie.Axis(f[3, 2], title="Stress norm (quadratic)"),GLMakie.Axis(f[3, 3], title="Pressure (deformed, quadratic)")]
p1 = FerriteViz.solutionplot!(axs[1], plotter_linear, process=∇u->norm(ε(∇u)), colormap=cmap, field=:gradient)
p2 = FerriteViz.solutionplot!(axs[2], plotter_linear, process=∇u->norm(σ(∇u)), colormap=cmap, field=:gradient)
p3 = FerriteViz.solutionplot!(axs[3], dh_linear, u_linear, field=:p, deformation_field=:u, colormap=cmap)
f[2,1] = GLMakie.Colorbar(f[1,1], p1, vertical=false)
f[2,2] = GLMakie.Colorbar(f[1,2], p2, vertical=false)
f[2,3] = GLMakie.Colorbar(f[1,3], p3, vertical=false)

p4 = FerriteViz.solutionplot!(axs[4], plotter_quadratic, process=∇u->norm(ε(∇u)), colormap=cmap, field=:gradient)
p5 = FerriteViz.solutionplot!(axs[5], plotter_quadratic, process=∇u->norm(σ(∇u)), colormap=cmap, field=:gradient)
p6 = FerriteViz.solutionplot!(axs[6], dh_quadratic, u_quadratic, field=:p, deformation_field=:u, colormap=cmap)
f[4,1] = GLMakie.Colorbar(f[3,1], p1, vertical=false)
f[4,2] = GLMakie.Colorbar(f[3,2], p2, vertical=false)
f[4,3] = GLMakie.Colorbar(f[3,3], p3, vertical=false)

f

@termi-official termi-official linked an issue Nov 8, 2023 that may be closed by this pull request
7 tasks
@koehlerson
Copy link
Member

image
something is broken with the docstring here, cannot mark it in github review

@termi-official
Copy link
Member Author

termi-official commented Nov 8, 2023

Yea, I think they never actually worked. Will fix in #106

@termi-official termi-official marked this pull request as ready for review November 8, 2023 16:06
@termi-official
Copy link
Member Author

Don't mind the branch name.

@termi-official termi-official marked this pull request as draft November 8, 2023 16:32
@termi-official termi-official marked this pull request as ready for review November 8, 2023 17:54
@koehlerson koehlerson merged commit 616c95a into master Nov 10, 2023
6 of 7 checks passed
@koehlerson koehlerson deleted the do/fix-gradient-interpolation branch November 10, 2023 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase test coverage for internal operations
2 participants