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

function barriers #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

function barriers #40

wants to merge 3 commits into from

Conversation

KnutAM
Copy link
Member

@KnutAM KnutAM commented Sep 3, 2024

Got inspired when seeing #39, after that is fixed, these were the main sources of time spent in the translation.

using Gmsh: Gmsh, gmsh
using FerriteGmsh
using Downloads: download

function get_msh()
    logo_mesh = "logo.geo"
    asset_url = "https://raw.githubusercontent.com/Ferrite-FEM/Ferrite.jl/gh-pages/assets/"
    isfile(logo_mesh) || download(string(asset_url, logo_mesh), logo_mesh)
    Gmsh.initialize()
    gmsh.open("logo.geo")
    gmsh.option.setNumber("Mesh.MeshSizeMax", 0.01)
    gmsh.model.mesh.generate(2)
    gmsh.write("logo.msh")
    Gmsh.finalize()
end

function load_msh()
    return togrid("logo.msh")
end

@time load_msh() goes from 0.250281 seconds (264.77 k allocations: 17.653 MiB) to 0.190106 seconds (36.86 k allocations: 10.099 MiB) without #39 (with #39, the relative change is more significant and almost all time is spent in gmsh.open).

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.

1 participant