Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion 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 <[email protected]>", "Christian Merdon <[email protected]>", "Johannes Taraz <[email protected]>", "Patrick Jaap <[email protected]>"]
version = "1.14.2"
authors = ["Juergen Fuhrmann <[email protected]>", "Christian Merdon <[email protected]>", "Johannes Taraz <[email protected]>", "Patrick Jaap <[email protected]>"]

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand All @@ -10,6 +10,7 @@ Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
ElasticArrays = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4"
ExtensionErrors = "b7d44a4a-b691-4b61-aae1-e3eded184641"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -27,6 +28,9 @@ Metis = "2679e427-3c69-5b7f-982b-ece356f1e94b"
TetGen = "c5d3f3f7-f850-59f6-8a2e-ffc6dc1317ea"
Triangulate = "f7e6ffb2-c36d-4f8f-a77e-16e897189344"

[sources]
ExtensionErrors = {rev = "main", url = "https://github.com/jpthiele/ExtensionErrors.jl.git"}

[extensions]
ExtendableGridsGmshExt = "Gmsh"
ExtendableGridsMetisExt = "Metis"
Expand All @@ -40,6 +44,7 @@ Compat = "4.10"
Dates = "1.9"
DocStringExtensions = "0.8,0.9"
ElasticArrays = "1"
ExtensionErrors = "1.0.0"
Gmsh = "0.2.2,0.3"
Graphs = "1.11.1"
InteractiveUtils = "1.9"
Expand Down
18 changes: 5 additions & 13 deletions src/io.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using WriteVTK

using ExtensionErrors
# conversion from AbstractElementGeometry to WriteVTK.VTKCellTypes
WriteVTK.VTKCellType(::Type{<:AbstractElementGeometry1D}) = VTKCellTypes.VTK_LINE
WriteVTK.VTKCellType(::Type{<:Triangle2D}) = VTKCellTypes.VTK_TRIANGLE
Expand Down Expand Up @@ -162,19 +162,11 @@ function simplexgrid(file::String; format = "", kwargs...)
end

function simplexgrid(file::String, ::Type{Val{:msh}}; kwargs...)
return try
simplexgrid_from_gmsh(file)
catch e
throw(ErrorException("Missing Gmsh extension. Add Gmsh.jl to your environment and import it to read msh files."))
end
return simplexgrid_from_gmsh(file)
end

function simplexgrid(file::String, ::Type{Val{:geo}}; kwargs...)
return try
simplexgrid_from_gmsh(file)
catch e
throw(ErrorException("Missing Gmsh extension. Add Gmsh.jl to your environment and import it to read geo files."))
end
return simplexgrid_from_gmsh(file)
end

function simplexgrid(file::String, ::Type{Val{:sg}}; kwargs...)
Expand Down Expand Up @@ -272,10 +264,10 @@ function simplexgrid(file::String, ::Type{Val{:sg}}; kwargs...)
return g
end

function simplexgrid_from_gmsh end
@extensionfunction simplexgrid_from_gmsh(filename;incomplete=false,Tc = Float32,Ti=Int32) Gmsh

function simplexgrid_to_gmsh end

function mixedgrid_from_gmsh end
@extensionfunction mixedgrid_from_gmsh(filename;Tc = Float32, Ti = Int32) Gmsh

function mixedgrid_to_gmsh end
Loading