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

Use simplexgrid(tetgenio) from ExtendableGrids 1.6, require Julia 1.9 #11

Merged
merged 1 commit into from
May 24, 2024
Merged
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
9 changes: 3 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SimplexGridFactory"
uuid = "57bfcd06-606e-45d6-baf4-4ba06da0efd5"
authors = ["Juergen Fuhrmann <[email protected]>"]
version = "2.0.1"
version = "2.1.0"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand All @@ -19,15 +19,12 @@ Triangulate = "f7e6ffb2-c36d-4f8f-a77e-16e897189344"
[compat]
DocStringExtensions = "0.8,0.9"
ElasticArrays = "^1.2"
ExtendableGrids = "1.4.1"
ExtendableGrids = "1.6"
FileIO = "1"
LinearAlgebra = "1.6"
MeshIO = "0.4"
Printf = "1.6"
TetGen = "1.5"
Triangulate = "2.3.1"
julia = "^1.6"
julia = "1.9"

[extras]
TetGen = "c5d3f3f7-f850-59f6-8a2e-ffc6dc1317ea"
Triangulate = "f7e6ffb2-c36d-4f8f-a77e-16e897189344"
16 changes: 1 addition & 15 deletions src/tetgen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,7 @@ function ExtendableGrids.simplexgrid(::Type{TetGenType}, TetGen, input; kwargs..

tetout = TetGen.tetrahedralize(input, flags)

pointlist = tetout.pointlist

tetrahedronlist = tetout.tetrahedronlist

if size(tetout.tetrahedronattributelist, 2) == 0
cellregions = ones(Int32, size(tetrahedronlist, 2))
else
cellregions = Vector{Int32}(vec(tetout.tetrahedronattributelist))
end

segmentlist = tetout.trifacelist

segmentmarkerlist = tetout.trifacemarkerlist

ExtendableGrids.simplexgrid(pointlist, tetrahedronlist, cellregions, segmentlist, segmentmarkerlist)
ExtendableGrids.simplexgrid(tetout)
end

"""
Expand Down
26 changes: 1 addition & 25 deletions src/triangle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,7 @@ function ExtendableGrids.simplexgrid(::Type{TriangulateType}, Triangulate, input
end

triout, vorout = Triangulate.triangulate(flags, input)

pointlist = triout.pointlist

trianglelist = triout.trianglelist

if size(triout.triangleattributelist, 2) == 0
# Add default for cellregions if that was not created
cellregions = ones(Int32, size(trianglelist, 2))
else
cellregions = Vector{Int32}(vec(triout.triangleattributelist))
end

segmentlist = triout.segmentlist

segmentmarkerlist = triout.segmentmarkerlist

if size(pointlist, 2) == 0
error("Emtpy list of generated points. May be the geometry description is not watertight ?") |> throw
end

if size(trianglelist, 2) == 0
error("Emtpy list of generated triangles. May be the geometry description is not watertight ?") |> throw
end

ExtendableGrids.simplexgrid(pointlist, trianglelist, cellregions, segmentlist, segmentmarkerlist)
ExtendableGrids.simplexgrid(triout)
end

"""
Expand Down
Loading