Skip to content

Commit

Permalink
Fix #10
Browse files Browse the repository at this point in the history
  • Loading branch information
j-fu committed Mar 22, 2024
1 parent 8b8b9b9 commit 59387b2
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 13 deletions.
4 changes: 2 additions & 2 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.0"
version = "2.0.1"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand All @@ -19,7 +19,7 @@ Triangulate = "f7e6ffb2-c36d-4f8f-a77e-16e897189344"
[compat]
DocStringExtensions = "0.8,0.9"
ElasticArrays = "^1.2"
ExtendableGrids = "1.4"
ExtendableGrids = "1.4.1"
FileIO = "1"
LinearAlgebra = "1.6"
MeshIO = "0.4"
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ PlutoSliderServer = "2fc8631c-6f24-4c5b-bca7-cbb509c42db4"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
PlutoVista = "646e1f28-b900-46d7-9d87-d554eb38a413"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SimplexGridFactory = "57bfcd06-606e-45d6-baf4-4ba06da0efd5"
TetGen = "c5d3f3f7-f850-59f6-8a2e-ffc6dc1317ea"
Triangulate = "f7e6ffb2-c36d-4f8f-a77e-16e897189344"
Expand Down
33 changes: 30 additions & 3 deletions notebooks/cylinder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using InteractiveUtils
begin
import Pkg as _Pkg
haskey(ENV, "PLUTO_PROJECT") && _Pkg.activate(ENV["PLUTO_PROJECT"])
using Revise
using ExtendableGrids
using SimplexGridFactory
using GridVisualize
Expand Down Expand Up @@ -78,7 +79,7 @@ md"""
"""

# ╔═╡ 3ef68de0-1f52-46a7-8e20-a6f001060d9e
g_base=glue(g_ring,g_disk,g1regions=[1])
g_base=glue(g_ring,g_disk,g1regions=[1],naive=false, tol=1.0e-7,strict=true)

# ╔═╡ 8922be39-5e1b-4cbe-82c9-cccd5fc34160
gridplot(g_base)
Expand All @@ -95,7 +96,7 @@ Z=range(0,len,length=nz)
g_cyl=simplexgrid(g_base,Z,top_offset=2)

# ╔═╡ 8027688a-600f-477c-a581-6bd785a517d6
gridplot(g_cyl, Plotter=PlutoVista)
gridplot(g_cyl, Plotter=PlutoVista, zplanes=[5])

# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
Expand All @@ -104,13 +105,15 @@ ExtendableGrids = "cfc395e8-590f-11e8-1f13-43a2532b2fa8"
GridVisualize = "5eed8a63-0fb0-45eb-886d-8d5a387d12b8"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PlutoVista = "646e1f28-b900-46d7-9d87-d554eb38a413"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SimplexGridFactory = "57bfcd06-606e-45d6-baf4-4ba06da0efd5"
Triangulate = "f7e6ffb2-c36d-4f8f-a77e-16e897189344"
[compat]
ExtendableGrids = "~1.3.1"
GridVisualize = "~1.5.0"
PlutoVista = "~1.0.1"
Revise = "~3.5.14"
SimplexGridFactory = "~1.0.0"
Triangulate = "~2.3.2"
"""
Expand All @@ -121,7 +124,7 @@ PLUTO_MANIFEST_TOML_CONTENTS = """
julia_version = "1.10.2"
manifest_format = "2.0"
project_hash = "6ea0a77596332aae7856c2f36f5e8e6ba7be719a"
project_hash = "317448f093e73cc07a675ae6803264f706094f72"
[[deps.AbstractPlutoDingetjes]]
deps = ["Pkg"]
Expand Down Expand Up @@ -175,6 +178,12 @@ weakdeps = ["SparseArrays"]
[deps.ChainRulesCore.extensions]
ChainRulesCoreSparseArraysExt = "SparseArrays"
[[deps.CodeTracking]]
deps = ["InteractiveUtils", "UUIDs"]
git-tree-sha1 = "c0216e792f518b39b22212127d4a84dc31e4e386"
uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
version = "1.3.5"
[[deps.CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"]
git-tree-sha1 = "59939d8a997469ee05c4b4944560a820f9ba0d73"
Expand Down Expand Up @@ -421,6 +430,12 @@ git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.5.0"
[[deps.JuliaInterpreter]]
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
git-tree-sha1 = "0015726aa3eb28973fbbdbb7ca2ed6396ffe3a23"
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.9.30"
[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
Expand Down Expand Up @@ -483,6 +498,12 @@ version = "0.3.27"
[[deps.Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
[[deps.LoweredCodeUtils]]
deps = ["JuliaInterpreter"]
git-tree-sha1 = "31e27f0b0bf0df3e3e951bfcc43fe8c730a219f6"
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
version = "2.4.5"
[[deps.Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
Expand Down Expand Up @@ -595,6 +616,12 @@ git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.3.0"
[[deps.Revise]]
deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Pkg", "REPL", "Requires", "UUIDs", "Unicode"]
git-tree-sha1 = "12aa2d7593df490c407a3bbd8b86b8b515017f3e"
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
version = "3.5.14"
[[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"
Expand Down
17 changes: 9 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ using Triangulate
using TetGen
using LinearAlgebra

@testset "explicit imports" begin

@testset "ExplicitImports" begin
@test ExplicitImports.check_no_implicit_imports(SimplexGridFactory) === nothing
@test ExplicitImports.check_no_stale_explicit_imports(SimplexGridFactory) === nothing
end


if isdefined(Docs,:undocumented_names) # >=1.11
@testset "undocumented names" begin
@testset "UndocumentedNames" begin
@test isempty(Docs.undocumented_names(SimplexGridFactory))
end
end
Expand Down Expand Up @@ -46,7 +47,7 @@ function testgrid(grid::ExtendableGrid, testdata)
end
testgrid(builder::SimplexGridBuilder, testdata) = testgrid(simplexgrid(builder), testdata)

@testset " Basic triangulation 2d" begin
@testset "Basic triangulation 2d" begin
function test_ctriangulateio()
nodes = Matrix{Cdouble}([1.0 0.0; 0.0 1.0; -1.0 0.0; 0.0 -1.0]')
faces = Matrix{Cint}([1 2; 2 3; 3 4; 4 1]')
Expand Down Expand Up @@ -122,7 +123,7 @@ end
@test testgrid(test_simplesquare(; unsuitable = test_triunsuitable), (299, 550, 46))
end

@testset " SimplexGridBuilder 2d" begin
@testset "SimplexGridBuilder 2d" begin
function test_buildersquare(; kwargs...)
builder = SimplexGridBuilder(; Generator = Triangulate)
cellregion!(builder, 1)
Expand Down Expand Up @@ -210,7 +211,7 @@ end
@test testgrid(test_simplecube(; unsuitable = test_tetunsuitable), (223, 971, 198))
end

@testset " SimplexGridBuilder 3d" begin
@testset "SimplexGridBuilder 3d" begin
function test_buildercube0(; kwargs...)
builder = SimplexGridBuilder(; Generator = TetGen)
cellregion!(builder, 1)
Expand Down Expand Up @@ -250,7 +251,7 @@ end
@test testgrid(test_buildercube(; unsuitable = test_tetunsuitable), (223, 971, 198))
end

@testset " examples2d.jl" begin
@testset "examples2d.jl" begin
include("../examples/examples2d.jl")
@test SimplexGridFactory.triangulateio(triangulation_of_domain()) isa TriangulateIO
@test testgrid(triangulation_of_domain(), (10, 8, 10))
Expand All @@ -262,7 +263,7 @@ end
@test testgrid(glue_2d(), (846, 1642, 94))
end;

@testset " examples3d.jl" begin
@testset "examples3d.jl" begin
include("../examples/examples3d.jl")
@test testgrid(tetrahedralization_of_cube(), (718, 2456, 1094))
@test testgrid(tet_cube_with_primitives(), (5658, 27324, 6888))
Expand All @@ -276,7 +277,7 @@ end;
# Pkg.activate(@__DIR__)
# end

@testset " primitives" begin
@testset "primitives" begin
function prim2d()
builder = SimplexGridBuilder(; Generator = Triangulate)
rect2d!(builder, [-1, -1], [1, 1])
Expand Down

0 comments on commit 59387b2

Please sign in to comment.