Skip to content

Commit

Permalink
Merge pull request #33 from j-fu/gmsh-extension2
Browse files Browse the repository at this point in the history
add requires for 1.6
  • Loading branch information
j-fu authored Jul 25, 2023
2 parents 664d493 + c1879ca commit baf258e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 20 deletions.
12 changes: 5 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ExtendableGrids"
uuid = "cfc395e8-590f-11e8-1f13-43a2532b2fa8"
authors = ["Juergen Fuhrmann <juergen.fuhrmann@wias-berlin.de>, Christian Merdon <christian.merdon@wias-berlin.de>"]
version = "1.0.0"
version = "1.1.0"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand All @@ -14,13 +14,15 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"

[weakdeps]
Gmsh = "705231aa-382f-11e9-3f0c-b7cb4346fdeb"

[extensions]
ExtendableGridsGmshExt = "Gmsh"

Expand All @@ -30,15 +32,11 @@ Bijections = "0.1.4"
DocStringExtensions = "0.8,0.9"
ElasticArrays = "1"
Gmsh = "0.2.2"
Requires = "1.1.3"
Requires = "1.3"
StaticArrays = "1"
StatsBase = "0.34"
WriteVTK = "1.14"
julia = "1.6"

[extras]
Gmsh = "705231aa-382f-11e9-3f0c-b7cb4346fdeb"


[weakdeps]
Gmsh = "705231aa-382f-11e9-3f0c-b7cb4346fdeb"
21 changes: 12 additions & 9 deletions ext/ExtendableGridsGmshExt.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
module ExtendableGridsGmshExt

#if isdefined(Base, :get_extension)
# ###!!! We do only need gmsh directly, no Gridap stuff
# import Gmsh: gmsh
#else
# import ..Gmsh: gmsh
#end
if isdefined(Base, :get_extension)
import Gmsh: gmsh
else
import ..Gmsh: gmsh
end

import ExtendableGrids: ExtendableGrid, simplexgrid
import ExtendableGrids: Coordinates, CellNodes, CellRegions, BFaceNodes, BFaceRegions
Expand All @@ -15,7 +14,6 @@ import ExtendableGrids: simplexgrid_from_gmsh, write_gmsh
#!!! Make a license warning at initialization ? Gmsh is GPL - mention this in the readme.

###??? Do we really need this dependency here ? I would rather like to live without, the more that it seems to make some problems.
using Gmsh: gmsh
using StatsBase: countmap
using Bijections

Expand Down Expand Up @@ -350,9 +348,14 @@ end
(this function has to be called with an initialized gmsh environment)
"""
function grid_to_gmshfile(grid::ExtendableGrid, filename::String)

gmsh.model = grid_to_mod(grid)

if VERSION>=v"1.9"
# This possibility is new in 1.9, see
# https://github.com/JuliaLang/julia/blob/release-1.9/NEWS.md#new-language-features
gmsh.model = grid_to_mod(grid)
else
grid_to_mod(grid)
end
gmsh.write(filename)

end
Expand Down
14 changes: 14 additions & 0 deletions src/ExtendableGrids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ using Dates
using LinearAlgebra


if !isdefined(Base, :get_extension)
using Requires
end


include("adjacency.jl")
Expand Down Expand Up @@ -183,4 +186,15 @@ export TokenStream, gettoken, expecttoken,trytoken
include("io.jl")
export writeVTK


@static if !isdefined(Base, :get_extension)
function __init__()
@require Gmsh = "705231aa-382f-11e9-3f0c-b7cb4346fdeb" begin
include("../ext/ExtendableGridsGmshExt.jl")
end
end
end



end # module
5 changes: 1 addition & 4 deletions src/simplexgrid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -731,14 +731,11 @@ function simplexgrid(file::String;format="")
end


# Implementation in Gmsh ext
# Implementations in Gmsh extension
function simplexgrid_from_gmsh end

function write_gmsh end

function simplexgrid(mod::Module)

end

"""
$(TYPEDSIGNATURES)
Expand Down

2 comments on commit baf258e

@j-fu
Copy link
Owner Author

@j-fu j-fu commented on baf258e Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/88286

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.1.0 -m "<description of version>" baf258e9806ccf4e2bbf10bbbdb1584d238ec502
git push origin v1.1.0

Please sign in to comment.