From 676bb2205758f9083bfce8728a3dfbd927b6c952 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Mon, 15 Apr 2024 10:26:14 +0200 Subject: [PATCH 01/15] setting type tree on polytopes {Polygon,Polyhedron} <: GraphPolytope <: Polytope <: GridapType --- src/Polyhedra.jl | 78 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/src/Polyhedra.jl b/src/Polyhedra.jl index b53d20c3..b287a0c0 100644 --- a/src/Polyhedra.jl +++ b/src/Polyhedra.jl @@ -3,7 +3,15 @@ const OPEN = -1 -struct Polyhedron{Dp,Tp,Td} +abstract type GraphPolytope{D} <: Polytope{D} end + +struct Polygon{Dp,Tp,Td} <: GraphPolytope{2} + vertices::Vector{Point{Dp,Tp}} + isopen::Bool + data::Td +end + +struct Polyhedron{Dp,Tp,Td} <: GraphPolytope{3} vertices::Vector{Point{Dp,Tp}} edge_vertex_graph::Vector{Vector{Int32}} isopen::Bool @@ -512,6 +520,32 @@ end # Getters +num_dims(::GraphPolytope{D}) where D = D + +num_dims(::Type{<:GraphPolytope{D}}) where D = D + +num_cell_dims(a::GraphPolytope) = num_dims(a) + +num_dims(::T) where T<:Polygon = num_dims(T) + +num_dims(::Type{<:Polygon{D}}) where D = D + +point_eltype(::T) where T<:Polygon = point_eltype(T) + +point_eltype(::Type{<:Polygon{D,T}}) where {D,T} = T + +num_vertices(a::Polygon) = length(a.vertices) + +get_vertex_coordinates(a::Polygon) = a.vertices + +Base.getindex(a::Polygon,i::Integer) = a.vertices[i] + +@inline get_graph(a::Polygon) = a.edge_vertex_graph + +get_data(a::Polygon) = a.data + +Base.isopen(a::Polygon) = a.isopen + num_dims(::T) where T<:Polyhedron = num_dims(T) num_dims(::Type{<:Polyhedron{D}}) where D = D @@ -1246,3 +1280,45 @@ function _append_ref_planes(poly::Polyhedron,planes) end lazy_append(planes,ref_planes) end + +# Gridap Getters + +is_simplex(::GraphPolytope) = false + +is_n_cube(::GraphPolytope) = false + +function Gridap_simplexify(p::GraphPolytope{D}) where D + @assert isopen(p) + X,T = simplexify(p) + @check X == get_vertex_coordinates(p) + T, simplex_polytope(Val{D}()) +end + +simplex_polytope(::Val{0}) = VERTEX + +simplex_polytope(::Val{1}) = SEGMENT + +simplex_polytope(::Val{2}) = TRI + +simplex_polytope(::Val{3}) = TET + + +function get_faces(::GraphPolytope,args...) + @notimplemented +end + +function get_dimranges(::GraphPolytope,args...) + @notimplemented +end + +function get_facedimms(::GraphPolytope) + @notimplemented +end + +function Polytope{N}(p::GraphPolytope,faceid::Integer) where N + @notimplemented +end + +import Base: == + +(==)(a::GraphPolytope,b::GraphPolytope) = false From 1c642bb59d64df029950cd623dab21f194bb6a39 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Mon, 13 May 2024 15:25:20 +0200 Subject: [PATCH 02/15] [polytope] add polytope connectivities with deferred computations --- src/Polyhedra.jl | 295 +++++++++++++++++++++++++++++++++++++++-- src/STLCutters.jl | 2 + test/PolyhedraTests.jl | 15 ++- 3 files changed, 296 insertions(+), 16 deletions(-) diff --git a/src/Polyhedra.jl b/src/Polyhedra.jl index b287a0c0..aee2ed7d 100644 --- a/src/Polyhedra.jl +++ b/src/Polyhedra.jl @@ -14,6 +14,10 @@ end struct Polyhedron{Dp,Tp,Td} <: GraphPolytope{3} vertices::Vector{Point{Dp,Tp}} edge_vertex_graph::Vector{Vector{Int32}} + n_m_to_nface_to_mfaces::Matrix{Vector{Vector{Int32}}} + facedims::Vector{Int32} + dimranges::Vector{UnitRange{Int}} + dface_nfaces::Vector{Vector{Int32}} isopen::Bool data::Td end @@ -30,6 +34,12 @@ end # Constructors +function Polygon(p::Polytope{2},vertices::AbstractVector{<:Point}) + @notimplemented + data = polyhedron_data(p) + Polygon(vertices,data) +end + function Polyhedron(stl::GridTopology) 𝓖 = compute_graph(stl) X = get_vertex_coordinates(stl) @@ -39,6 +49,29 @@ function Polyhedron(stl::GridTopology) p end +function Polyhedron( + vertices::Vector{<:Point}, + graph::Vector{Vector{Int32}}, + isopen::Bool, + data) + + D = 3 + n = D+1 + n_m_to_nface_to_mfaces = Matrix{Vector{Vector{Int32}}}(undef,n,n ) + dimranges = Vector{UnitRange{Int}}(undef,0) + dface_nfaces = Vector{Vector{Int32}}(undef,0) + facedims = Vector{Int32}(undef,0) + Polyhedron( + vertices, + graph, + n_m_to_nface_to_mfaces, + facedims, + dimranges, + dface_nfaces, + isopen, + data) +end + function Polyhedron( vertices::AbstractVector{<:Point}, graph::Vector{<:Vector}, @@ -48,7 +81,6 @@ function Polyhedron( Polyhedron(collect(vertices),graph,isopen,data) end - function Polyhedron( vertices::AbstractVector{<:Point}, graph::Vector{<:Vector} @@ -1302,23 +1334,266 @@ simplex_polytope(::Val{2}) = TRI simplex_polytope(::Val{3}) = TET - -function get_faces(::GraphPolytope,args...) - @notimplemented +function Polytope{0}(p::GraphPolytope,faceid::Integer) + VERTEX end -function get_dimranges(::GraphPolytope,args...) - @notimplemented +function Polytope{1}(p::GraphPolytope,faceid::Integer) + SEGMENT end -function get_facedimms(::GraphPolytope) - @notimplemented +function Polytope{D}(p::GraphPolytope{D},faceid::Integer) where D + p end -function Polytope{N}(p::GraphPolytope,faceid::Integer) where N - @notimplemented +function Polytope{2}(p::Polyhedron,faceid::Integer) + f_to_v = get_faces(p,2,0) + coords = get_vertex_coordinates(p) + vertices = coords[f_to_v[faceid]] + Polygon(vertices) end import Base: == (==)(a::GraphPolytope,b::GraphPolytope) = false + +function num_faces(p::GraphPolytope{D},d::Integer) where D + if d == 0 + num_vertices(p) + elseif d == D + 1 + else + length( get_faces(p,d,0) ) + end +end + +function get_faces(p::GraphPolytope,n::Integer,m::Integer) + setup_faces!(p,n,m) + p.n_m_to_nface_to_mfaces[n+1,m+1] +end + +import Gridap.ReferenceFEs: get_facet_orientations +import Gridap.ReferenceFEs: get_facet_normal +import Gridap.ReferenceFEs: get_edge_tangent +function get_facet_orientations(p::GraphPolytope) + Ones(num_facets(p)) +end + +function get_facet_normal(p::Polyhedron) + D = 3 + f_to_v = get_faces(p,D-1,0) + coords = get_vertex_coordinates(p) + map(f_to_v) do v + v1 = coords[v[2]]-coords[v[1]] + v2 = coords[v[3]]-coords[v[1]] + v1 /= norm(v1) + v2 /= norm(v2) + n = v1 × v2 + n /= norm(n) + end +end + +function get_edge_tangent(p::GraphPolytope) + e_to_v = get_faces(p,1,0) + coords = get_vertex_coordinates(p) + map(e_to_v) do v + v = coords[v[2]]-coords[v[1]] + v / norm(v) + end +end + +import Gridap.ReferenceFEs: get_dimranges +import Gridap.ReferenceFEs: get_dimrange + + +function get_dimranges(p::GraphPolytope) + setup_dimranges!(p) + p.dimranges +end + +function get_dimrange(p::GraphPolytope,d::Integer) + setup_dimranges!(p) + p.dimranges[d+1] +end + +function get_faces(p::GraphPolytope) + setup_face_to_nfaces!(p) + p.dface_nfaces +end + +function get_facedims(p::GraphPolytope) + setup_facedims!(p) + p.facedims +end + +function setup_dimranges!(p::GraphPolytope{D}) where D + if length(p.dimranges) < D+1 + resize!(p.dimranges,D+1) + lens = map(i->num_faces(p,i),0:D) + sums = cumsum(lens) + for (i,(l,s)) in enumerate(zip(lens,sums)) + p.dimranges[i] = s-l+1 : s + end + end +end + +function setup_face_to_nfaces!(p::GraphPolytope) + if length(p.dface_nfaces) < num_vertices(p) + facedims = get_facedims(p) + dface_nfaces = Vector{Vector{Int32}}(undef,length(facedims)) + ofsets = get_offsets(p) + for (f,d) in enumerate(facedims) + df = f - ofsets[d+1] + nfs = Int[] + for n in 0:d + union!(nfs,get_faces(p,d,n)[df] .+ ofsets[n+1]) + end + dface_nfaces[f] = nfs + end + copy!(p.dface_nfaces,dface_nfaces) + end + nothing +end + +using Gridap.ReferenceFEs: _nface_to_nfacedim +function setup_facedims!(p::GraphPolytope) + if length(p.facedims) < num_vertices(p) + dimranges = get_dimranges(p) + n_faces = dimranges[end][end] + facedims = _nface_to_nfacedim(n_faces,dimranges) + copy!(p.facedims,facedims) + end +end + +function setup_faces!(p::GraphPolytope{D},dimfrom,dimto) where D + if isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) + return nothing + end + if dimfrom == dimto + setup_nface_to_nface!(p,dimfrom) + elseif dimfrom == D + setup_cell_to_faces!(p,dimto) + elseif dimto == 0 + setup_face_to_vertices!(p,dimfrom) + elseif dimfrom > dimto + setup_nface_to_mface!(p,dimfrom,dimto) + else + setup_nface_to_mface_dual!(p,dimto,dimfrom) + end + nothing +end + +function setup_face_to_vertices!(p::Polyhedron,d) + if !isassigned(p.n_m_to_nface_to_mfaces,d+1,1) + df_to_v = generate_face_to_vertices(p,d) + p.n_m_to_nface_to_mfaces[d+1,1] = df_to_v + end +end + +function setup_cell_to_faces!(p::GraphPolytope{D},d) where D + if !isassigned(p.n_m_to_nface_to_mfaces,D+1,d+1) + num_f = num_faces(p,d) + c_to_f = [ collect(1:num_f) ] + p.n_m_to_nface_to_mfaces[D+1,d+1] = c_to_f + end +end + +function setup_nface_to_nface!(p::Polyhedron,n) + if !isassigned(p.n_m_to_nface_to_mfaces,n+1,n+1) + num_nf = num_faces(p,n) + nf_to_nf = map(i->Int[i],1:num_nf) + p.n_m_to_nface_to_mfaces[n+1,n+1] = nf_to_nf + end +end + +function setup_nface_to_mface!(p::Polyhedron,n,m) + if !isassigned(p.n_m_to_nface_to_mfaces,n+1,m+1) + @notimplementedif n != 2 && m != 1 + nf_to_v = get_faces(p,n,0) + v_to_mf = get_faces(p,0,m) + nf_to_ftype = map( length, nf_to_v ) + ftype_to_lmf_to_lv = map(1:maximum(nf_to_ftype)) do ftype + map(1:ftype) do i + inext = i == ftype ? 1 : i+1 + Int[i,inext] + end + end + nf_to_mf = find_cell_to_faces( + Table(nf_to_v), + ftype_to_lmf_to_lv, + nf_to_ftype, + Table(v_to_mf)) + p.n_m_to_nface_to_mfaces[n+1,m+1] = Vector(nf_to_mf) + end +end + +function setup_nface_to_mface_dual!(p::Polyhedron,dimto,dimfrom) + if !isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) + @assert dimfrom < dimto + nf_to_mf = get_faces(p,dimto,dimfrom) + n_mf = num_faces(p,dimfrom) + mf_to_nf = generate_cells_around(Table(nf_to_mf),n_mf) + p.n_m_to_nface_to_mfaces[dimfrom+1,dimto+1] = Vector(mf_to_nf) + end +end + + +function generate_face_to_vertices(p::Polyhedron,d::Integer) + if d == 1 + generate_edge_to_vertices(p) + elseif d == 2 + generate_facet_to_vertices(p) + else + @unreachable + end +end + +function generate_facet_to_vertices(poly::Polyhedron{3}) + D = 3 + istouch = map( i -> falses(length(i)), get_graph(poly) ) + T = Vector{Int32}[] + for v in 1:num_vertices(poly) + isactive(poly,v) || continue + for i in 1:length(get_graph(poly)[v]) + !istouch[v][i] || continue + istouch[v][i] = true + vcurrent = v + vnext = get_graph(poly)[v][i] + vnext ∉ (OPEN,UNSET) || continue + k = [v] + while vnext != v + inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) + inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 + istouch[vnext][inext] = true + vcurrent = vnext + vnext = get_graph(poly)[vnext][inext] + vnext ∉ (OPEN,UNSET) || break + push!(k,vcurrent) + end + if length(k) >=D + push!(T,k) + end + end + end + T +end + +function generate_edge_to_vertices(poly::Polyhedron{3}) + graph = get_graph(poly) + T = Vector{Int32}[] + for v in 1:length(graph) + for vneig in graph[v] + if vneig > v + push!(T,[v,vneig]) + end + end + end + T +end + + + +# get_edge_tangent +# get_facet_normal +# get_facet_orientations +# get_vertex_permutations # not implemented diff --git a/src/STLCutters.jl b/src/STLCutters.jl index f7aef074..d40f9352 100644 --- a/src/STLCutters.jl +++ b/src/STLCutters.jl @@ -22,6 +22,8 @@ using PartitionedArrays using Gridap.Geometry: get_face_to_parent_face using Gridap.Geometry: get_cell_to_parent_cell +using Gridap.Geometry: find_cell_to_faces +using Gridap.Geometry: generate_cells_around using GridapEmbedded.Distributed: consistent_bgcell_to_inoutcut! using GridapEmbedded.Distributed: consistent_bgfacet_to_inoutcut! using GridapEmbedded.Distributed: DistributedEmbeddedDiscretization diff --git a/test/PolyhedraTests.jl b/test/PolyhedraTests.jl index 54210e6b..78c67f22 100644 --- a/test/PolyhedraTests.jl +++ b/test/PolyhedraTests.jl @@ -23,13 +23,13 @@ using STLCutters: merge_nodes using STLCutters: simplexify_cell_boundary using STLCutters: compute_grid -p = Polyhedron(TRI) -@test check_graph(p) -#@test volume(p) ≈ 1/2 -#@test surface(p) ≈ 2+√2 +# p = Polyhedron(TRI) +# @test check_graph(p) +# #@test volume(p) ≈ 1/2 +# #@test surface(p) ≈ 2+√2 -p = Polyhedron(QUAD) -@test check_graph(p) +# p = Polyhedron(QUAD) +# @test check_graph(p) #@test volume(p) ≈ 1 #@test surface(p) ≈ 4 @@ -39,6 +39,9 @@ p = Polyhedron(TET) @test surface(p) ≈ 3/2 + (√3)/2 p = Polyhedron(HEX) +STLCutters.generate_facets(p) +STLCutters.generate_edges(p) + @test check_graph(p) @test volume(p) ≈ 1 @test surface(p) ≈ 6 From 99afea8f264a61b812891cfc0c960626e28ff3a9 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Tue, 14 May 2024 15:17:14 +0200 Subject: [PATCH 03/15] [polytope] sort and test GraphPolytope --- src/Polyhedra.jl | 1398 +++++++++++++++++++++------------------- src/STLCutters.jl | 6 + test/PolyhedraTests.jl | 100 ++- 3 files changed, 839 insertions(+), 665 deletions(-) diff --git a/src/Polyhedra.jl b/src/Polyhedra.jl index aee2ed7d..54f655fd 100644 --- a/src/Polyhedra.jl +++ b/src/Polyhedra.jl @@ -3,15 +3,26 @@ const OPEN = -1 -abstract type GraphPolytope{D} <: Polytope{D} end +""" + struct GraphPolytope{D,Dp,Tp} <: Polytope{D} -struct Polygon{Dp,Tp,Td} <: GraphPolytope{2} - vertices::Vector{Point{Dp,Tp}} - isopen::Bool - data::Td -end + A graph polytope is a polytope defined by a set of vertices and a rototation + system (a planar oriented graph). This polytopal representation can represent + any polytope in 2 and 3 dimensions. + + In 2 dimensions ([`Polygon`](@ref)), the representation of the polygon is a closed polyline. + + In 3 dimensions ([`Polyhedron`](@ref)), the rotation system generates the connectivities, each facet is a closed cycle of the graph. + This construction allows complex geometrical operations, e.g., intersecting polytopes by halfspaces. + See also, + + > K. Sugihara, "A robust and consistent algorithm for intersecting convex polyhedra", Comput. Graph. Forum 13 (3) (1994) 45–54, doi: [10.1111/1467-8659.1330045](https://doi.org/10.1111/1467-8659.1330045) + + > D. Powell, T. Abel, "An exact general remeshing scheme applied to physically conservative voxelization", J. Comput. Phys. 297 (Sept. 2015) 340–356, doi: [10.1016/j.jcp.2015.05.022](https://doi.org/10.1016/j.jcp.2015.05.022. -struct Polyhedron{Dp,Tp,Td} <: GraphPolytope{3} + > S. Badia, P. A. Martorell, F. Verdugo. "Geometrical discretisations for unfitted finite elements on explicit boundary representations", J.Comput. Phys. 460 (2022): 111162. doi: [10.1016/j.jcp.2022.111162](https://doi.org/10.1016/j.jcp.2022.111162) +""" +struct GraphPolytope{D,Dp,Tp,Td} <: Polytope{D} vertices::Vector{Point{Dp,Tp}} edge_vertex_graph::Vector{Vector{Int32}} n_m_to_nface_to_mfaces::Matrix{Vector{Vector{Int32}}} @@ -20,7 +31,40 @@ struct Polyhedron{Dp,Tp,Td} <: GraphPolytope{3} dface_nfaces::Vector{Vector{Int32}} isopen::Bool data::Td -end + function GraphPolytope{D}( + vertices::Vector{Point{Dp,Tp}}, + edge_vertex_graph::Vector{Vector{Int32}}, + n_m_to_nface_to_mfaces::Matrix{Vector{Vector{Int32}}}, + facedims::Vector{Int32}, + dimranges::Vector{UnitRange{Int}}, + dface_nfaces::Vector{Vector{Int32}}, + isopen::Bool, + data::Td) where {D,Dp,Tp,Td} + new{D,Dp,Tp,Td}( + vertices, + edge_vertex_graph, + n_m_to_nface_to_mfaces, + facedims, + dimranges, + dface_nfaces, + isopen, + data) + end +end + +""" + Polygon = GraphPolytope{2} + + A polygon is a [`GraphPolytope`](@ref) in 2 dimensions. +""" +const Polygon = GraphPolytope{2} + +""" + Polyhedron = GraphPolytope{3} + + A polyhedron is a [`GraphPolytope`](@ref) in 3 dimensions. +""" +const Polyhedron = GraphPolytope{3} struct PolyhedronData vertex_to_planes::Vector{Vector{Int32}} @@ -34,34 +78,18 @@ end # Constructors -function Polygon(p::Polytope{2},vertices::AbstractVector{<:Point}) - @notimplemented - data = polyhedron_data(p) - Polygon(vertices,data) -end - -function Polyhedron(stl::GridTopology) - 𝓖 = compute_graph(stl) - X = get_vertex_coordinates(stl) - isopen = is_open_surface(stl) - p = Polyhedron(X,𝓖;isopen) - set_original_faces!(p,stl) - p -end - -function Polyhedron( +function GraphPolytope{D}( vertices::Vector{<:Point}, graph::Vector{Vector{Int32}}, isopen::Bool, - data) + data) where D - D = 3 n = D+1 n_m_to_nface_to_mfaces = Matrix{Vector{Vector{Int32}}}(undef,n,n ) dimranges = Vector{UnitRange{Int}}(undef,0) dface_nfaces = Vector{Vector{Int32}}(undef,0) facedims = Vector{Int32}(undef,0) - Polyhedron( + GraphPolytope{D}( vertices, graph, n_m_to_nface_to_mfaces, @@ -72,45 +100,70 @@ function Polyhedron( data) end -function Polyhedron( +function GraphPolytope{D}( vertices::AbstractVector{<:Point}, graph::Vector{<:Vector}, - isopen, - data) + isopen::Bool, + data) where D - Polyhedron(collect(vertices),graph,isopen,data) + GraphPolytope{D}(collect(vertices),graph,isopen,data) end -function Polyhedron( +function GraphPolytope{D}( vertices::AbstractVector{<:Point}, graph::Vector{<:Vector} - ;isopen=false::Bool) + ;isopen=false::Bool) where D - Polyhedron(vertices,graph,isopen,polyhedron_data(length(vertices))) + GraphPolytope{D}(vertices,graph,isopen,polyhedron_data(length(vertices))) end -function Polyhedron( +function GraphPolytope{D}( vertices::AbstractVector{<:Point}, graph::Vector{<:Vector}, - data) + data) where D isopen = false - Polyhedron(vertices,graph,isopen,data) + GraphPolytope{D}(vertices,graph,isopen,data) +end + +function GraphPolytope{D}(stl::GridTopology{Dc,D}) where {Dc,D} + graph = compute_graph(stl) + X = get_vertex_coordinates(stl) + isopen = is_open_surface(stl) + p = GraphPolytope{D}(X,graph;isopen) + set_original_faces!(p,stl) + p end -function Polyhedron(p::Polytope{2},vertices::AbstractVector{<:Point}) +function Polygon(p::Polytope{2},vertices::AbstractVector{<:Point}) if p == TRI e_v_graph = [[2,3],[3,1],[1,2]] + perm = [1,2,3] elseif p == QUAD e_v_graph = [[2, 3],[4, 1],[1, 4],[3, 2]] + perm = [1,2,4,3] else @unreachable end + vertices = map(Reindex(vertices),perm) + e_v_graph = map(Reindex(e_v_graph),perm) + e_v_graph = map(i->replace(i, Dict(perm .=> 1:length(perm))...),e_v_graph) e_v_graph = map(i->Int32.(i),e_v_graph) data = polyhedron_data(p) - Polyhedron(vertices,e_v_graph,data) + Polygon(vertices,e_v_graph,data) +end + +function Polygon(vertices::AbstractVector{<:Point}) + graph = map(1:length(vertices)) do i + inext = i == length(vertices) ? 1 : i+1 + iprev = i == 1 ? length(vertices) : i-1 + Int32[iprev,inext] + end + data = nothing + Polygon(vertices,graph,data) end + function Polyhedron(p::Polytope{3},vertices::AbstractVector{<:Point}) if p == TET e_v_graph = [[2,4,3],[3,4,1],[1,4,2],[1,2,3]] @@ -132,171 +185,543 @@ function Polyhedron(p::Polytope{3},vertices::AbstractVector{<:Point}) Polyhedron(vertices,e_v_graph,data) end -function Polyhedron(p::Polytope) - Polyhedron(p,get_vertex_coordinates(p)) +function GraphPolytope{D}(p::Polytope) where D + GraphPolytope{D}(p,get_vertex_coordinates(p)) end -# Operations +# Interface -function clip(poly::Polyhedron,Π;inside=true,inout=trues(length(Π)),boundary=nothing) - p = poly - for (i,Πi) in enumerate(Π) - side = inside == inout[i] ? :left : :right - p = clip(p,Πi,side;boundary) - !isnothing(p) || break - end - p -end +num_dims(::T) where T<:GraphPolytope = num_dims(T) -function split_overlapping(p::Polyhedron,Π) - p⁻ = clip(p,Π,:left,boundary=true) - p⁺ = clip(p,Π,:right,boundary=true) - p⁻,p⁺ +num_dims(::Type{<:GraphPolytope{D}}) where D = D + +num_cell_dims(a::GraphPolytope) = num_dims(a) + +point_eltype(::T) where T<:GraphPolytope = point_eltype(T) + +point_eltype(::Type{<:GraphPolytope{D,Dp,T}}) where {D,Dp,T} = T + +num_point_dims(::Type{<:GraphPolytope{D,Dp}}) where {D,Dp} = Dp + +num_vertices(a::GraphPolytope) = length(a.vertices) + +get_vertex_coordinates(a::GraphPolytope) = a.vertices + +Base.getindex(a::GraphPolytope,i::Integer) = a.vertices[i] + +""" + get_graph(p::GraphPolytope) -> Vector{Vector{Int32}} + + It returns the edge-vertex graph of the polytope `p`. +""" +@inline get_graph(a::GraphPolytope) = a.edge_vertex_graph + + +""" + get_data(p::GraphPolytope) + + It return the metadata stored in the polytope `p`. +""" +get_data(a::GraphPolytope) = a.data + + +""" + isopen(p::GraphPolytope) -> Bool + + In return whether the polytope is watter tight or not. +""" +Base.isopen(a::GraphPolytope) = a.isopen + +""" + isactive(p::GraphPolytope,vertex::Integer) -> Bool + + It returns whether a vertex is connected to any other vertex. +""" +function isactive(p::Polyhedron,vertex::Integer) + !isempty( get_graph(p)[vertex] ) end -function split_gapping(p::Polyhedron,Π) - p⁻ = clip(p,Π,:left,boundary=false) - p⁺ = clip(p,Π,:right,boundary=false) - p⁻,p⁺ + +""" + check_graph(p::GraphPolytope) -> Bool + + It checks whether the graph is well-constructed. The graph must be oriented + and planar. +""" +function check_graph(p::GraphPolytope) + check_graph(get_graph(p)) end -function clip(p::Polyhedron,Π,side;boundary=nothing::Union{Nothing,Bool},invert=false) - @assert side ∈ (:right,:left) - if boundary === nothing - p⁻,p⁺ = split(p,Π,side;invert) - p = side == :left ? p⁻ : p⁺ - else - invert = false - if side == :right && !boundary - invert = true - side = :left - elseif side == :left && boundary - invert = true - side = :right +function check_graph(graph::AbstractVector{<:AbstractVector}) + for v in 1:length(graph) + !isempty(graph[v]) || continue + for vneig in graph[v] + vneig ∉ (OPEN,UNSET) || continue + v ∈ graph[vneig] || return false end - p = clip(p,Π,side;invert) end + true +end + +is_simplex(::GraphPolytope) = false + +is_n_cube(::GraphPolytope) = false + +function Gridap_simplexify(p::GraphPolytope{D}) where D + @assert isopen(p) + X,T = simplexify(p) + @check X == get_vertex_coordinates(p) + T, simplex_polytope(Val{D}()) +end + +simplex_polytope(::Val{0}) = VERTEX + +simplex_polytope(::Val{1}) = SEGMENT + +simplex_polytope(::Val{2}) = TRI + +simplex_polytope(::Val{3}) = TET + +function Polytope{0}(p::GraphPolytope,faceid::Integer) + VERTEX +end + +function Polytope{1}(p::GraphPolytope,faceid::Integer) + SEGMENT +end + +function Polytope{D}(p::GraphPolytope{D},faceid::Integer) where D p end -function split(p::Polyhedron,Π,side=:both;invert=false) - @assert side ∈ (:both,:left,:right) - distances = get_plane_distances(get_data(p),Π) - _sign = invert ? (-) : (+) - distances = lazy_map(_sign,distances) - smin = Inf - smax = -Inf - for v in 1:num_vertices(p) - isactive(p,v) || continue - smin = min(smin,distances[v]) - smax = max(smax,distances[v]) - end - if smin ≥ 0 - return nothing,p - end - if smax < 0 - if has_coplanars(get_data(p),Π) - add_plane!(get_data(p),Π) - end - return p,nothing - end - new_vertices = empty( get_vertex_coordinates(p) ) - in_graph = _copy(get_graph(p)) - if side == :both - out_graph = _copy(get_graph(p)) - end - ≶ = side ∈ (:both,:left) ? (≥) : (<) - data = copy( get_data(p) ) - D = num_dims(p) - for v in 1:num_vertices(p) - isactive(p,v) || continue - distances[v] ≶ 0 && continue - for (i,vneig) in enumerate( get_graph(p)[v] ) - vneig ∉ (UNSET,OPEN) || continue - distances[vneig] ≶ 0 || continue - vertex = compute_intersection(p[v],distances[v],p[vneig],distances[vneig]) - push!( new_vertices, vertex ) - add_vertex!(data,v,vneig,Π) - push!( in_graph, fill(UNSET,D) ) - in_graph[v][i] = num_vertices(p) + length(new_vertices) - in_graph[end][1] = v - if side == :both - push!( out_graph, fill(UNSET,D) ) - ineig = findfirst( isequal(v), get_graph(p)[vneig] ) - out_graph[vneig][ineig] = num_vertices(p) + length(new_vertices) - out_graph[end][1] = vneig - end - end - end - if side == :both - p_out = split_postprocess!(out_graph,copy(data),new_vertices,p,distances,(<)) +function Polytope{2}(p::Polyhedron,faceid::Integer) + f_to_v = get_faces(p,2,0) + coords = get_vertex_coordinates(p) + vertices = coords[f_to_v[faceid]] + Polygon(vertices) +end + +Base.:(==)(a::GraphPolytope,b::GraphPolytope) = false + +function num_faces(p::GraphPolytope{D},d::Integer) where D + if d == 0 + num_vertices(p) + elseif d == D + 1 else - p_out = nothing + length( get_faces(p,d,0) ) end - p_in = split_postprocess!(in_graph,data,new_vertices,p,distances,(≶)) - p⁻ = side ≠ :right ? p_in : p_out - p⁺ = side ≠ :right ? p_out : p_in - p⁻,p⁺ end -function simplexify(poly::Polyhedron{3}) - !isopen(poly) || return simplexify_surface(poly) - vstart = fill(UNSET,num_vertices(poly)) - stack = Int32[] - for v in 1:num_vertices(poly) - isactive(poly,v) || continue - vstart[v] == UNSET || continue - vstart[v] = v - empty!(stack) - push!(stack,v) - while !isempty(stack) - vcurrent = pop!(stack) - for vneig in get_graph(poly)[vcurrent] - if vstart[vneig] == UNSET - vstart[vneig] = v - push!(stack,vneig) - end - end - end - end - v_to_pv = get_data(poly).vertex_to_parent_vertex - istouch = map( i -> falses(length(i)), get_graph(poly) ) - vertex_coordinates = get_vertex_coordinates(poly) - T = Vector{Int32}[] - X = vertex_coordinates - for v in 1:num_vertices(poly) - isactive(poly,v) || continue - for i in 1:length(get_graph(poly)[v]) - !istouch[v][i] || continue - istouch[v][i] = true - vcurrent = v - vnext = get_graph(poly)[v][i] - while vnext != v - inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) - !isnothing(inext) || break - inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 - istouch[vnext][inext] = true - vcurrent = vnext - vnext = get_graph(poly)[vnext][inext] - @assert vcurrent ≠ vnext - vcurrent ≠ vnext || break - if v ∉ (vstart[v],vcurrent,vnext) - k = [vstart[v],v,vcurrent,vnext] - push!(T,k) - end - end - end - end - X,T +function get_faces(p::GraphPolytope,n::Integer,m::Integer) + setup_faces!(p,n,m) + p.n_m_to_nface_to_mfaces[n+1,m+1] end -function simplexify_surface(poly::Polyhedron{3}) - stack = Int32[] - v_to_pv = get_data(poly).vertex_to_parent_vertex - istouch = map( i -> falses(length(i)), get_graph(poly) ) - T = Vector{Int32}[] - for v in 1:num_vertices(poly) - isactive(poly,v) || continue + +function get_facet_orientations(p::GraphPolytope) + Ones(num_facets(p)) +end + +function get_facet_normal(p::Polyhedron) + D = 3 + f_to_v = get_faces(p,D-1,0) + coords = get_vertex_coordinates(p) + map(f_to_v) do v + v1 = coords[v[2]]-coords[v[1]] + v2 = coords[v[3]]-coords[v[1]] + v1 /= norm(v1) + v2 /= norm(v2) + n = v1 × v2 + n /= norm(n) + end +end + +function get_facet_normal(p::Polygon) + D = 2 + f_to_v = get_faces(p,D-1,0) + coords = get_vertex_coordinates(p) + @notimplementedif num_components(eltype(coords)) != 2 + map(f_to_v) do v + e = coords[v[2]]-coords[v[1]] + n = VectorValue( e[2], -e[1] ) + n /= norm(n) + end +end + +function get_edge_tangent(p::GraphPolytope) + e_to_v = get_faces(p,1,0) + coords = get_vertex_coordinates(p) + map(e_to_v) do v + e = coords[v[2]]-coords[v[1]] + e / norm(e) + end +end + + +function get_dimranges(p::GraphPolytope) + setup_dimranges!(p) + p.dimranges +end + +function get_dimrange(p::GraphPolytope,d::Integer) + setup_dimranges!(p) + p.dimranges[d+1] +end + +function get_faces(p::GraphPolytope) + setup_face_to_nfaces!(p) + p.dface_nfaces +end + +function get_facedims(p::GraphPolytope) + setup_facedims!(p) + p.facedims +end + +function setup_dimranges!(p::GraphPolytope{D}) where D + if length(p.dimranges) < D+1 + lens = map(i->num_faces(p,i),0:D) + sums = cumsum(lens) + resize!(p.dimranges,D+1) + for (i,(l,s)) in enumerate(zip(lens,sums)) + p.dimranges[i] = s-l+1 : s + end + end +end + +function setup_face_to_nfaces!(p::GraphPolytope) + if length(p.dface_nfaces) < num_vertices(p) + facedims = get_facedims(p) + dface_nfaces = Vector{Vector{Int32}}(undef,length(facedims)) + ofsets = get_offsets(p) + for (f,d) in enumerate(facedims) + df = f - ofsets[d+1] + nfs = Int[] + for n in 0:d + union!(nfs,get_faces(p,d,n)[df] .+ ofsets[n+1]) + end + dface_nfaces[f] = nfs + end + copy!(p.dface_nfaces,dface_nfaces) + end + nothing +end + +function setup_facedims!(p::GraphPolytope) + if length(p.facedims) < num_vertices(p) + dimranges = get_dimranges(p) + n_faces = dimranges[end][end] + facedims = _nface_to_nfacedim(n_faces,dimranges) + copy!(p.facedims,facedims) + end +end + +function setup_faces!(p::GraphPolytope{D},dimfrom,dimto) where D + if isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) + return nothing + end + if dimfrom == dimto + setup_nface_to_nface!(p,dimfrom) + elseif dimfrom == D + setup_cell_to_faces!(p,dimto) + elseif dimto == 0 + setup_face_to_vertices!(p,dimfrom) + elseif dimfrom > dimto + setup_nface_to_mface!(p,dimfrom,dimto) + else + setup_nface_to_mface_dual!(p,dimto,dimfrom) + end + nothing +end + +function setup_face_to_vertices!(p::GraphPolytope,d) + if !isassigned(p.n_m_to_nface_to_mfaces,d+1,1) + df_to_v = generate_face_to_vertices(p,d) + p.n_m_to_nface_to_mfaces[d+1,1] = df_to_v + end +end + +function setup_cell_to_faces!(p::GraphPolytope{D},d) where D + if !isassigned(p.n_m_to_nface_to_mfaces,D+1,d+1) + num_f = num_faces(p,d) + c_to_f = [ collect(1:num_f) ] + p.n_m_to_nface_to_mfaces[D+1,d+1] = c_to_f + end +end + +function setup_nface_to_nface!(p::GraphPolytope,n) + if !isassigned(p.n_m_to_nface_to_mfaces,n+1,n+1) + num_nf = num_faces(p,n) + nf_to_nf = map(i->Int[i],1:num_nf) + p.n_m_to_nface_to_mfaces[n+1,n+1] = nf_to_nf + end +end + +function setup_nface_to_mface!(p::Polyhedron,n,m) + if !isassigned(p.n_m_to_nface_to_mfaces,n+1,m+1) + @notimplementedif n != 2 && m != 1 + nf_to_v = get_faces(p,n,0) + v_to_mf = get_faces(p,0,m) + nf_to_ftype = map( length, nf_to_v ) + ftype_to_lmf_to_lv = map(1:maximum(nf_to_ftype)) do ftype + map(1:ftype) do i + inext = i == ftype ? 1 : i+1 + Int[i,inext] + end + end + nf_to_mf = find_cell_to_faces( + Table(nf_to_v), + ftype_to_lmf_to_lv, + nf_to_ftype, + Table(v_to_mf)) + p.n_m_to_nface_to_mfaces[n+1,m+1] = Vector(nf_to_mf) + end +end + +function setup_nface_to_mface_dual!(p::GraphPolytope,dimto,dimfrom) + if !isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) + @assert dimfrom < dimto + nf_to_mf = get_faces(p,dimto,dimfrom) + n_mf = num_faces(p,dimfrom) + mf_to_nf = generate_cells_around(Table(nf_to_mf),n_mf) + p.n_m_to_nface_to_mfaces[dimfrom+1,dimto+1] = Vector(mf_to_nf) + end +end + +function generate_face_to_vertices(p::Polyhedron,d::Integer) + if d == 1 + generate_edge_to_vertices(p) + elseif d == 2 + generate_facet_to_vertices(p) + else + @unreachable + end +end + +function generate_face_to_vertices(p::Polygon,d::Integer) + if d == 1 + generate_facet_to_vertices(p) + else + @unreachable + end +end + +function generate_facet_to_vertices(poly::Polyhedron) + D = 3 + istouch = map( i -> falses(length(i)), get_graph(poly) ) + T = Vector{Int32}[] + for v in 1:num_vertices(poly) + isactive(poly,v) || continue + for i in 1:length(get_graph(poly)[v]) + !istouch[v][i] || continue + istouch[v][i] = true + vcurrent = v + vnext = get_graph(poly)[v][i] + vnext ∉ (OPEN,UNSET) || continue + k = [v] + while vnext != v + inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) + inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 + istouch[vnext][inext] = true + vcurrent = vnext + vnext = get_graph(poly)[vnext][inext] + vnext ∉ (OPEN,UNSET) || break + push!(k,vcurrent) + end + if length(k) >=D + push!(T,k) + end + end + end + T +end + +function generate_edge_to_vertices(poly::GraphPolytope) + graph = get_graph(poly) + T = Vector{Int32}[] + for v in 1:length(graph) + for vneig in graph[v] + if vneig > v + push!(T,[v,vneig]) + end + end + end + T +end + +function generate_facet_to_vertices(poly::Polygon) + graph = get_graph(poly) + T = Vector{Int32}[] + for v in 1:length(graph) + vnext = v == length(graph) ? 1 : v+1 + @assert vnext ∈ graph[v] + push!(T,[v,vnext]) + end + T +end + +# Operations + +function clip(poly::Polyhedron,Π;inside=true,inout=trues(length(Π)),boundary=nothing) + p = poly + for (i,Πi) in enumerate(Π) + side = inside == inout[i] ? :left : :right + p = clip(p,Πi,side;boundary) + !isnothing(p) || break + end + p +end + +function split_overlapping(p::Polyhedron,Π) + p⁻ = clip(p,Π,:left,boundary=true) + p⁺ = clip(p,Π,:right,boundary=true) + p⁻,p⁺ +end + +function split_gapping(p::Polyhedron,Π) + p⁻ = clip(p,Π,:left,boundary=false) + p⁺ = clip(p,Π,:right,boundary=false) + p⁻,p⁺ +end + +function clip(p::Polyhedron,Π,side;boundary=nothing::Union{Nothing,Bool},invert=false) + @assert side ∈ (:right,:left) + if boundary === nothing + p⁻,p⁺ = split(p,Π,side;invert) + p = side == :left ? p⁻ : p⁺ + else + invert = false + if side == :right && !boundary + invert = true + side = :left + elseif side == :left && boundary + invert = true + side = :right + end + p = clip(p,Π,side;invert) + end + p +end + +function split(p::Polyhedron,Π,side=:both;invert=false) + @assert side ∈ (:both,:left,:right) + distances = get_plane_distances(get_data(p),Π) + _sign = invert ? (-) : (+) + distances = lazy_map(_sign,distances) + smin = Inf + smax = -Inf + for v in 1:num_vertices(p) + isactive(p,v) || continue + smin = min(smin,distances[v]) + smax = max(smax,distances[v]) + end + if smin ≥ 0 + return nothing,p + end + if smax < 0 + if has_coplanars(get_data(p),Π) + add_plane!(get_data(p),Π) + end + return p,nothing + end + new_vertices = empty( get_vertex_coordinates(p) ) + in_graph = _copy(get_graph(p)) + if side == :both + out_graph = _copy(get_graph(p)) + end + ≶ = side ∈ (:both,:left) ? (≥) : (<) + data = copy( get_data(p) ) + D = num_dims(p) + for v in 1:num_vertices(p) + isactive(p,v) || continue + distances[v] ≶ 0 && continue + for (i,vneig) in enumerate( get_graph(p)[v] ) + vneig ∉ (UNSET,OPEN) || continue + distances[vneig] ≶ 0 || continue + vertex = compute_intersection(p[v],distances[v],p[vneig],distances[vneig]) + push!( new_vertices, vertex ) + add_vertex!(data,v,vneig,Π) + push!( in_graph, fill(UNSET,D) ) + in_graph[v][i] = num_vertices(p) + length(new_vertices) + in_graph[end][1] = v + if side == :both + push!( out_graph, fill(UNSET,D) ) + ineig = findfirst( isequal(v), get_graph(p)[vneig] ) + out_graph[vneig][ineig] = num_vertices(p) + length(new_vertices) + out_graph[end][1] = vneig + end + end + end + if side == :both + p_out = split_postprocess!(out_graph,copy(data),new_vertices,p,distances,(<)) + else + p_out = nothing + end + p_in = split_postprocess!(in_graph,data,new_vertices,p,distances,(≶)) + p⁻ = side ≠ :right ? p_in : p_out + p⁺ = side ≠ :right ? p_out : p_in + p⁻,p⁺ +end + +function simplexify(poly::Polyhedron{3}) + !isopen(poly) || return simplexify_surface(poly) + vstart = fill(UNSET,num_vertices(poly)) + stack = Int32[] + for v in 1:num_vertices(poly) + isactive(poly,v) || continue + vstart[v] == UNSET || continue + vstart[v] = v + empty!(stack) + push!(stack,v) + while !isempty(stack) + vcurrent = pop!(stack) + for vneig in get_graph(poly)[vcurrent] + if vstart[vneig] == UNSET + vstart[vneig] = v + push!(stack,vneig) + end + end + end + end + v_to_pv = get_data(poly).vertex_to_parent_vertex + istouch = map( i -> falses(length(i)), get_graph(poly) ) + vertex_coordinates = get_vertex_coordinates(poly) + T = Vector{Int32}[] + X = vertex_coordinates + for v in 1:num_vertices(poly) + isactive(poly,v) || continue + for i in 1:length(get_graph(poly)[v]) + !istouch[v][i] || continue + istouch[v][i] = true + vcurrent = v + vnext = get_graph(poly)[v][i] + while vnext != v + inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) + !isnothing(inext) || break + inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 + istouch[vnext][inext] = true + vcurrent = vnext + vnext = get_graph(poly)[vnext][inext] + @assert vcurrent ≠ vnext + vcurrent ≠ vnext || break + if v ∉ (vstart[v],vcurrent,vnext) + k = [vstart[v],v,vcurrent,vnext] + push!(T,k) + end + end + end + end + X,T +end + +function simplexify_surface(poly::Polyhedron{3}) + stack = Int32[] + v_to_pv = get_data(poly).vertex_to_parent_vertex + istouch = map( i -> falses(length(i)), get_graph(poly) ) + T = Vector{Int32}[] + for v in 1:num_vertices(poly) + isactive(poly,v) || continue for i in 1:length(get_graph(poly)[v]) !istouch[v][i] || continue istouch[v][i] = true @@ -523,87 +948,37 @@ function restrict(p::Polyhedron,nodes) vertices = get_vertex_coordinates(p)[nodes] isopen = true Polyhedron(vertices,graph,isopen,data) -end - -function restrict(data::PolyhedronData,nodes) - v_to_Π = data.vertex_to_planes[nodes] - v_to_of = data.vertex_to_original_faces[nodes] - v_to_v = collect(1:length(nodes)) - v_to_e = fill((UNSET,UNSET),length(nodes)) - Π_to_rΠ = copy(data.plane_to_ref_plane) - Π_to_id = copy(data.plane_to_ids) - _Π_to_v_to_d = data.plane_to_vertex_to_distances - Π_to_v_to_d = [ _Π_to_v_to_d[i][nodes] for i in 1:length(Π_to_id) ] - args = v_to_Π, v_to_of, v_to_v, v_to_e, Π_to_v_to_d, Π_to_rΠ, Π_to_id - PolyhedronData(args...) -end - -# Printers - -function writevtk(p::Polyhedron,filename;kwargs...) - writevtk(edge_mesh(p),filename;kwargs...) -end - -function writevtk(ps::Array{<:Polyhedron},filename) - for (i,p) in enumerate(ps) - writevtk(p,filename*"$i") - end -end - -# Getters - -num_dims(::GraphPolytope{D}) where D = D - -num_dims(::Type{<:GraphPolytope{D}}) where D = D - -num_cell_dims(a::GraphPolytope) = num_dims(a) - -num_dims(::T) where T<:Polygon = num_dims(T) - -num_dims(::Type{<:Polygon{D}}) where D = D - -point_eltype(::T) where T<:Polygon = point_eltype(T) - -point_eltype(::Type{<:Polygon{D,T}}) where {D,T} = T - -num_vertices(a::Polygon) = length(a.vertices) - -get_vertex_coordinates(a::Polygon) = a.vertices - -Base.getindex(a::Polygon,i::Integer) = a.vertices[i] - -@inline get_graph(a::Polygon) = a.edge_vertex_graph - -get_data(a::Polygon) = a.data - -Base.isopen(a::Polygon) = a.isopen - -num_dims(::T) where T<:Polyhedron = num_dims(T) - -num_dims(::Type{<:Polyhedron{D}}) where D = D - -point_eltype(::T) where T<:Polyhedron = point_eltype(T) - -point_eltype(::Type{<:Polyhedron{D,T}}) where {D,T} = T - -num_vertices(a::Polyhedron) = length(a.vertices) +end -get_vertex_coordinates(a::Polyhedron) = a.vertices +function restrict(data::PolyhedronData,nodes) + v_to_Π = data.vertex_to_planes[nodes] + v_to_of = data.vertex_to_original_faces[nodes] + v_to_v = collect(1:length(nodes)) + v_to_e = fill((UNSET,UNSET),length(nodes)) + Π_to_rΠ = copy(data.plane_to_ref_plane) + Π_to_id = copy(data.plane_to_ids) + _Π_to_v_to_d = data.plane_to_vertex_to_distances + Π_to_v_to_d = [ _Π_to_v_to_d[i][nodes] for i in 1:length(Π_to_id) ] + args = v_to_Π, v_to_of, v_to_v, v_to_e, Π_to_v_to_d, Π_to_rΠ, Π_to_id + PolyhedronData(args...) +end -Base.getindex(a::Polyhedron,i::Integer) = a.vertices[i] +# Printers -@inline get_graph(a::Polyhedron) = a.edge_vertex_graph +function writevtk(p::Polyhedron,filename;kwargs...) + writevtk(edge_mesh(p),filename;kwargs...) +end -get_data(a::Polyhedron) = a.data +function writevtk(ps::Array{<:Polyhedron},filename) + for (i,p) in enumerate(ps) + writevtk(p,filename*"$i") + end +end -Base.isopen(a::Polyhedron) = a.isopen +# Getters get_vertex_to_planes(a::PolyhedronData) = a.vertex_to_planes -function isactive(p::Polyhedron,vertex::Integer) - !isempty( get_graph(p)[vertex] ) -end - function get_original_reflex_faces(p::Polyhedron{D},stl::GridTopology;empty=true) where D get_original_faces(p,stl,Val{D-2}();empty) end @@ -770,7 +1145,7 @@ end ## Helpers -function check_graph(p::Polyhedron) +function check_graph(p::GraphPolytope) check_graph(get_graph(p)) end @@ -1165,435 +1540,150 @@ function refine_by_vertices(Γ,K,vertices,atol) R end -function get_bounding_box(cell::Polyhedron) - i = findfirst(i->isactive(cell,i),1:num_vertices(cell)) - pmin,pmax = cell[i],cell[i] - for i in 1:num_vertices(cell) - if isactive(cell,i) - pmin = Point( min.(Tuple(cell[i]),Tuple(pmin)) ) - pmax = Point( max.(Tuple(cell[i]),Tuple(pmax)) ) - end - end - pmin,pmax -end - -function has_intersection(cell::Polyhedron,v::Point) - pmin,pmax = get_bounding_box(cell) - all( Tuple(pmin) .< Tuple(v) ) || return false - all( Tuple(pmax) .> Tuple(v) ) || return false - true -end - -function get_direction(v,cell) - pmin,pmax = get_bounding_box(cell) - d0 = Tuple(v) .- Tuple(pmin) - d1 = Tuple(pmax) .- Tuple(v) - d = min.(d0,d1) - d_max = maximum(d) - findfirst(isequal(d_max),d) -end - -function get_planes(v,d,atol) - δ = VectorValue(Base.setindex(Tuple(zero(v)),atol,d)) - Π = CartesianPlane(v,d,+1) - Π⁻ = CartesianPlane(v-δ,d,+1) - Π⁺ = CartesianPlane(v+δ,d,-1) - Π,Π⁻,Π⁺ -end - -function get_new_plane_ids(poly) - id = minimum( get_plane_ids(poly.data) ) - id-1,id-2,id-3 -end - -function round_distances!(poly,atol) - Π_to_v_to_dist = poly.data.plane_to_vertex_to_distances - for i in 1:length(Π_to_v_to_dist) - v_to_dist = Π_to_v_to_dist[i] - for v in 1:length(v_to_dist) - if abs(v_to_dist[v]) < atol - v_to_dist[v] = 0.0 - end - end - end -end - -function delete_inactive_planes!(Γ::Polyhedron,K::Polyhedron,stl::GridTopology) - @assert isopen(Γ) - planes = get_active_planes(Γ,K,stl) - restrict_planes!(Γ,planes) - restrict_planes!(K,planes) -end - -function get_active_planes(Γ::Polyhedron,K::Polyhedron,stl::GridTopology) - used_planes_Γ = _get_used_planes(K) - used_planes_K = _get_used_planes(Γ) - used_planes = lazy_append( used_planes_Γ, used_planes_K ) - face_planes = _get_face_planes(Γ,stl) - planes = lazy_append( used_planes, face_planes ) - _append_ref_planes( Γ, planes ) -end - -function restrict_planes!(poly::Polyhedron,planes) - restrict_planes!(get_data(poly),planes) -end - -function restrict_planes!(data::PolyhedronData,planes) - Π_to_id = data.plane_to_ids - Π_to_v_to_dist = data.plane_to_vertex_to_distances - Π_to_ref_Π = data.plane_to_ref_plane - is_inactive = trues(length(Π_to_id)) - is_touch = falses(length(Π_to_id)) - for Π in planes - i = findfirst(isequal(Π),Π_to_id) - !isnothing(i) || continue - is_inactive[i] = false - end - id = 0 - for i in 1:length(Π_to_id) - if !is_inactive[i] - id += 1 - if !is_touch[i] - ref_plane = abs( Π_to_ref_Π[i] ) - if ref_plane != UNSET - @assert i == ref_plane - for j in i:length(Π_to_id) - if !is_inactive[j] && - !is_touch[j] && - abs( Π_to_ref_Π[j] ) == ref_plane - - _sign = sign( Π_to_ref_Π[j] ) - Π_to_ref_Π[j] = _sign * id - is_touch[j] = true - end - end - end - end - end - end - deleteat!( Π_to_v_to_dist, is_inactive) - deleteat!( Π_to_ref_Π, is_inactive) - deleteat!( Π_to_id, is_inactive) -end - -function _get_used_planes(poly::Polyhedron) - v_to_Π = get_data(poly).vertex_to_planes - planes = Int32[] - for v in 1:length(v_to_Π) - for Π in v_to_Π[v] - if Π ∉ planes - push!(planes,Π) - end - end - end - planes -end - -function _get_face_planes(poly::Polyhedron,stl::GridTopology) - rfaces = get_original_reflex_faces(poly,stl,empty=true) - facets = get_original_facets(poly,stl,empty=true) - lazy_append(rfaces,facets) -end - -function _append_ref_planes(poly::Polyhedron,planes) - ref_planes = Int32[] - Π_to_ref_Π = get_data(poly).plane_to_ref_plane - Π_to_id = get_plane_ids( get_data(poly) ) - for Π in planes - i = findfirst( isequal(Π), Π_to_id ) - i !== nothing || continue - iref = abs(Π_to_ref_Π[i]) - if iref ≠ UNSET - Π_ref = Π_to_id[iref] - if Π_ref ∉ ref_planes && Π_ref ∉ planes - push!(ref_planes,Π_ref) - end - end - end - lazy_append(planes,ref_planes) -end - -# Gridap Getters - -is_simplex(::GraphPolytope) = false - -is_n_cube(::GraphPolytope) = false - -function Gridap_simplexify(p::GraphPolytope{D}) where D - @assert isopen(p) - X,T = simplexify(p) - @check X == get_vertex_coordinates(p) - T, simplex_polytope(Val{D}()) -end - -simplex_polytope(::Val{0}) = VERTEX - -simplex_polytope(::Val{1}) = SEGMENT - -simplex_polytope(::Val{2}) = TRI - -simplex_polytope(::Val{3}) = TET - -function Polytope{0}(p::GraphPolytope,faceid::Integer) - VERTEX -end - -function Polytope{1}(p::GraphPolytope,faceid::Integer) - SEGMENT -end - -function Polytope{D}(p::GraphPolytope{D},faceid::Integer) where D - p -end - -function Polytope{2}(p::Polyhedron,faceid::Integer) - f_to_v = get_faces(p,2,0) - coords = get_vertex_coordinates(p) - vertices = coords[f_to_v[faceid]] - Polygon(vertices) -end - -import Base: == - -(==)(a::GraphPolytope,b::GraphPolytope) = false - -function num_faces(p::GraphPolytope{D},d::Integer) where D - if d == 0 - num_vertices(p) - elseif d == D - 1 - else - length( get_faces(p,d,0) ) - end -end - -function get_faces(p::GraphPolytope,n::Integer,m::Integer) - setup_faces!(p,n,m) - p.n_m_to_nface_to_mfaces[n+1,m+1] -end - -import Gridap.ReferenceFEs: get_facet_orientations -import Gridap.ReferenceFEs: get_facet_normal -import Gridap.ReferenceFEs: get_edge_tangent -function get_facet_orientations(p::GraphPolytope) - Ones(num_facets(p)) -end - -function get_facet_normal(p::Polyhedron) - D = 3 - f_to_v = get_faces(p,D-1,0) - coords = get_vertex_coordinates(p) - map(f_to_v) do v - v1 = coords[v[2]]-coords[v[1]] - v2 = coords[v[3]]-coords[v[1]] - v1 /= norm(v1) - v2 /= norm(v2) - n = v1 × v2 - n /= norm(n) - end -end - -function get_edge_tangent(p::GraphPolytope) - e_to_v = get_faces(p,1,0) - coords = get_vertex_coordinates(p) - map(e_to_v) do v - v = coords[v[2]]-coords[v[1]] - v / norm(v) - end -end - -import Gridap.ReferenceFEs: get_dimranges -import Gridap.ReferenceFEs: get_dimrange - - -function get_dimranges(p::GraphPolytope) - setup_dimranges!(p) - p.dimranges +function get_bounding_box(cell::Polyhedron) + i = findfirst(i->isactive(cell,i),1:num_vertices(cell)) + pmin,pmax = cell[i],cell[i] + for i in 1:num_vertices(cell) + if isactive(cell,i) + pmin = Point( min.(Tuple(cell[i]),Tuple(pmin)) ) + pmax = Point( max.(Tuple(cell[i]),Tuple(pmax)) ) + end + end + pmin,pmax end -function get_dimrange(p::GraphPolytope,d::Integer) - setup_dimranges!(p) - p.dimranges[d+1] +function has_intersection(cell::Polyhedron,v::Point) + pmin,pmax = get_bounding_box(cell) + all( Tuple(pmin) .< Tuple(v) ) || return false + all( Tuple(pmax) .> Tuple(v) ) || return false + true end -function get_faces(p::GraphPolytope) - setup_face_to_nfaces!(p) - p.dface_nfaces +function get_direction(v,cell) + pmin,pmax = get_bounding_box(cell) + d0 = Tuple(v) .- Tuple(pmin) + d1 = Tuple(pmax) .- Tuple(v) + d = min.(d0,d1) + d_max = maximum(d) + findfirst(isequal(d_max),d) end -function get_facedims(p::GraphPolytope) - setup_facedims!(p) - p.facedims +function get_planes(v,d,atol) + δ = VectorValue(Base.setindex(Tuple(zero(v)),atol,d)) + Π = CartesianPlane(v,d,+1) + Π⁻ = CartesianPlane(v-δ,d,+1) + Π⁺ = CartesianPlane(v+δ,d,-1) + Π,Π⁻,Π⁺ end -function setup_dimranges!(p::GraphPolytope{D}) where D - if length(p.dimranges) < D+1 - resize!(p.dimranges,D+1) - lens = map(i->num_faces(p,i),0:D) - sums = cumsum(lens) - for (i,(l,s)) in enumerate(zip(lens,sums)) - p.dimranges[i] = s-l+1 : s - end - end +function get_new_plane_ids(poly) + id = minimum( get_plane_ids(poly.data) ) + id-1,id-2,id-3 end -function setup_face_to_nfaces!(p::GraphPolytope) - if length(p.dface_nfaces) < num_vertices(p) - facedims = get_facedims(p) - dface_nfaces = Vector{Vector{Int32}}(undef,length(facedims)) - ofsets = get_offsets(p) - for (f,d) in enumerate(facedims) - df = f - ofsets[d+1] - nfs = Int[] - for n in 0:d - union!(nfs,get_faces(p,d,n)[df] .+ ofsets[n+1]) +function round_distances!(poly,atol) + Π_to_v_to_dist = poly.data.plane_to_vertex_to_distances + for i in 1:length(Π_to_v_to_dist) + v_to_dist = Π_to_v_to_dist[i] + for v in 1:length(v_to_dist) + if abs(v_to_dist[v]) < atol + v_to_dist[v] = 0.0 end - dface_nfaces[f] = nfs end - copy!(p.dface_nfaces,dface_nfaces) - end - nothing -end - -using Gridap.ReferenceFEs: _nface_to_nfacedim -function setup_facedims!(p::GraphPolytope) - if length(p.facedims) < num_vertices(p) - dimranges = get_dimranges(p) - n_faces = dimranges[end][end] - facedims = _nface_to_nfacedim(n_faces,dimranges) - copy!(p.facedims,facedims) end end -function setup_faces!(p::GraphPolytope{D},dimfrom,dimto) where D - if isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) - return nothing - end - if dimfrom == dimto - setup_nface_to_nface!(p,dimfrom) - elseif dimfrom == D - setup_cell_to_faces!(p,dimto) - elseif dimto == 0 - setup_face_to_vertices!(p,dimfrom) - elseif dimfrom > dimto - setup_nface_to_mface!(p,dimfrom,dimto) - else - setup_nface_to_mface_dual!(p,dimto,dimfrom) - end - nothing +function delete_inactive_planes!(Γ::Polyhedron,K::Polyhedron,stl::GridTopology) + @assert isopen(Γ) + planes = get_active_planes(Γ,K,stl) + restrict_planes!(Γ,planes) + restrict_planes!(K,planes) end -function setup_face_to_vertices!(p::Polyhedron,d) - if !isassigned(p.n_m_to_nface_to_mfaces,d+1,1) - df_to_v = generate_face_to_vertices(p,d) - p.n_m_to_nface_to_mfaces[d+1,1] = df_to_v - end +function get_active_planes(Γ::Polyhedron,K::Polyhedron,stl::GridTopology) + used_planes_Γ = _get_used_planes(K) + used_planes_K = _get_used_planes(Γ) + used_planes = lazy_append( used_planes_Γ, used_planes_K ) + face_planes = _get_face_planes(Γ,stl) + planes = lazy_append( used_planes, face_planes ) + _append_ref_planes( Γ, planes ) end -function setup_cell_to_faces!(p::GraphPolytope{D},d) where D - if !isassigned(p.n_m_to_nface_to_mfaces,D+1,d+1) - num_f = num_faces(p,d) - c_to_f = [ collect(1:num_f) ] - p.n_m_to_nface_to_mfaces[D+1,d+1] = c_to_f - end +function restrict_planes!(poly::Polyhedron,planes) + restrict_planes!(get_data(poly),planes) end -function setup_nface_to_nface!(p::Polyhedron,n) - if !isassigned(p.n_m_to_nface_to_mfaces,n+1,n+1) - num_nf = num_faces(p,n) - nf_to_nf = map(i->Int[i],1:num_nf) - p.n_m_to_nface_to_mfaces[n+1,n+1] = nf_to_nf +function restrict_planes!(data::PolyhedronData,planes) + Π_to_id = data.plane_to_ids + Π_to_v_to_dist = data.plane_to_vertex_to_distances + Π_to_ref_Π = data.plane_to_ref_plane + is_inactive = trues(length(Π_to_id)) + is_touch = falses(length(Π_to_id)) + for Π in planes + i = findfirst(isequal(Π),Π_to_id) + !isnothing(i) || continue + is_inactive[i] = false end -end + id = 0 + for i in 1:length(Π_to_id) + if !is_inactive[i] + id += 1 + if !is_touch[i] + ref_plane = abs( Π_to_ref_Π[i] ) + if ref_plane != UNSET + @assert i == ref_plane + for j in i:length(Π_to_id) + if !is_inactive[j] && + !is_touch[j] && + abs( Π_to_ref_Π[j] ) == ref_plane -function setup_nface_to_mface!(p::Polyhedron,n,m) - if !isassigned(p.n_m_to_nface_to_mfaces,n+1,m+1) - @notimplementedif n != 2 && m != 1 - nf_to_v = get_faces(p,n,0) - v_to_mf = get_faces(p,0,m) - nf_to_ftype = map( length, nf_to_v ) - ftype_to_lmf_to_lv = map(1:maximum(nf_to_ftype)) do ftype - map(1:ftype) do i - inext = i == ftype ? 1 : i+1 - Int[i,inext] + _sign = sign( Π_to_ref_Π[j] ) + Π_to_ref_Π[j] = _sign * id + is_touch[j] = true + end + end + end end end - nf_to_mf = find_cell_to_faces( - Table(nf_to_v), - ftype_to_lmf_to_lv, - nf_to_ftype, - Table(v_to_mf)) - p.n_m_to_nface_to_mfaces[n+1,m+1] = Vector(nf_to_mf) - end -end - -function setup_nface_to_mface_dual!(p::Polyhedron,dimto,dimfrom) - if !isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) - @assert dimfrom < dimto - nf_to_mf = get_faces(p,dimto,dimfrom) - n_mf = num_faces(p,dimfrom) - mf_to_nf = generate_cells_around(Table(nf_to_mf),n_mf) - p.n_m_to_nface_to_mfaces[dimfrom+1,dimto+1] = Vector(mf_to_nf) - end -end - - -function generate_face_to_vertices(p::Polyhedron,d::Integer) - if d == 1 - generate_edge_to_vertices(p) - elseif d == 2 - generate_facet_to_vertices(p) - else - @unreachable end + deleteat!( Π_to_v_to_dist, is_inactive) + deleteat!( Π_to_ref_Π, is_inactive) + deleteat!( Π_to_id, is_inactive) end -function generate_facet_to_vertices(poly::Polyhedron{3}) - D = 3 - istouch = map( i -> falses(length(i)), get_graph(poly) ) - T = Vector{Int32}[] - for v in 1:num_vertices(poly) - isactive(poly,v) || continue - for i in 1:length(get_graph(poly)[v]) - !istouch[v][i] || continue - istouch[v][i] = true - vcurrent = v - vnext = get_graph(poly)[v][i] - vnext ∉ (OPEN,UNSET) || continue - k = [v] - while vnext != v - inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) - inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 - istouch[vnext][inext] = true - vcurrent = vnext - vnext = get_graph(poly)[vnext][inext] - vnext ∉ (OPEN,UNSET) || break - push!(k,vcurrent) - end - if length(k) >=D - push!(T,k) +function _get_used_planes(poly::Polyhedron) + v_to_Π = get_data(poly).vertex_to_planes + planes = Int32[] + for v in 1:length(v_to_Π) + for Π in v_to_Π[v] + if Π ∉ planes + push!(planes,Π) end end end - T + planes end -function generate_edge_to_vertices(poly::Polyhedron{3}) - graph = get_graph(poly) - T = Vector{Int32}[] - for v in 1:length(graph) - for vneig in graph[v] - if vneig > v - push!(T,[v,vneig]) +function _get_face_planes(poly::Polyhedron,stl::GridTopology) + rfaces = get_original_reflex_faces(poly,stl,empty=true) + facets = get_original_facets(poly,stl,empty=true) + lazy_append(rfaces,facets) +end + +function _append_ref_planes(poly::Polyhedron,planes) + ref_planes = Int32[] + Π_to_ref_Π = get_data(poly).plane_to_ref_plane + Π_to_id = get_plane_ids( get_data(poly) ) + for Π in planes + i = findfirst( isequal(Π), Π_to_id ) + i !== nothing || continue + iref = abs(Π_to_ref_Π[i]) + if iref ≠ UNSET + Π_ref = Π_to_id[iref] + if Π_ref ∉ ref_planes && Π_ref ∉ planes + push!(ref_planes,Π_ref) end end end - T + lazy_append(planes,ref_planes) end - - - -# get_edge_tangent -# get_facet_normal -# get_facet_orientations -# get_vertex_permutations # not implemented diff --git a/src/STLCutters.jl b/src/STLCutters.jl index d40f9352..440deabf 100644 --- a/src/STLCutters.jl +++ b/src/STLCutters.jl @@ -24,6 +24,7 @@ using Gridap.Geometry: get_face_to_parent_face using Gridap.Geometry: get_cell_to_parent_cell using Gridap.Geometry: find_cell_to_faces using Gridap.Geometry: generate_cells_around +using Gridap.ReferenceFEs: _nface_to_nfacedim using GridapEmbedded.Distributed: consistent_bgcell_to_inoutcut! using GridapEmbedded.Distributed: consistent_bgfacet_to_inoutcut! using GridapEmbedded.Distributed: DistributedEmbeddedDiscretization @@ -49,6 +50,11 @@ import Gridap.ReferenceFEs: get_offsets import Gridap.ReferenceFEs: get_facedims import Gridap.ReferenceFEs: simplexify import Gridap.ReferenceFEs: get_bounding_box +import Gridap.ReferenceFEs: get_facet_orientations +import Gridap.ReferenceFEs: get_facet_normal +import Gridap.ReferenceFEs: get_edge_tangent +import Gridap.ReferenceFEs: get_dimranges +import Gridap.ReferenceFEs: get_dimrange import Gridap.Geometry: num_cells import Gridap.Geometry: get_cell_vertices import Gridap.Geometry: get_polytopes diff --git a/test/PolyhedraTests.jl b/test/PolyhedraTests.jl index 78c67f22..c27bcb31 100644 --- a/test/PolyhedraTests.jl +++ b/test/PolyhedraTests.jl @@ -9,6 +9,7 @@ using Gridap.Arrays using STLCutters using STLCutters: Polyhedron +using STLCutters: Polygon using STLCutters: STL using STLCutters: restrict using STLCutters: clip @@ -23,15 +24,95 @@ using STLCutters: merge_nodes using STLCutters: simplexify_cell_boundary using STLCutters: compute_grid -# p = Polyhedron(TRI) -# @test check_graph(p) -# #@test volume(p) ≈ 1/2 -# #@test surface(p) ≈ 2+√2 -# p = Polyhedron(QUAD) -# @test check_graph(p) -#@test volume(p) ≈ 1 -#@test surface(p) ≈ 4 +p = Polygon(TRI) +@test check_graph(p) +@test get_faces(p,0,0) == [[1],[2],[3]] +@test get_faces(p,1,0) == [[1,2],[2,3],[3,1]] +@test get_faces(p,2,0) == [[1,2,3]] +@test get_faces(p,0,1) == [[1,3],[1,2],[2,3]] +@test get_faces(p,1,1) == [[1],[2],[3]] +@test get_faces(p,2,1) == [[1,2,3]] +@test get_faces(p,0,2) == [[1],[1],[1]] +@test get_faces(p,1,2) == [[1],[1],[1]] +@test get_faces(p,2,2) == [[1]] +@test get_facedims(p) == [0,0,0,1,1,1,2] +@test Polytope{2}(p,1) === p +@test Polytope{1}(p,1) == SEGMENT +@test Polytope{0}(p,1) == VERTEX + +p = Polygon(QUAD) +@test check_graph(p) +@test get_faces(p,0,0) == [[1],[2],[3],[4]] +@test get_faces(p,1,0) == [[1,2],[2,3],[3,4],[4,1]] +@test get_faces(p,2,0) == [[1,2,3,4]] +@test get_faces(p,0,1) == [[1,4],[1,2],[2,3],[3,4]] +@test get_faces(p,1,1) == [[1],[2],[3],[4]] +@test get_faces(p,2,1) == [[1,2,3,4]] +@test get_faces(p,0,2) == [[1],[1],[1],[1]] +@test get_faces(p,1,2) == [[1],[1],[1],[1]] +@test get_faces(p,2,2) == [[1]] +@test get_facedims(p) == [0,0,0,0,1,1,1,1,2] +@test Polytope{2}(p,1) === p +@test Polytope{1}(p,1) == SEGMENT +@test Polytope{0}(p,1) == VERTEX + +p = Polyhedron(TET) +@test check_graph(p) +@test get_faces(p,0,0) == [[1],[2],[3],[4]] +@test get_faces(p,1,0) == [[1,2],[1,4],[1,3],[2,3],[2,4],[3,4]] +@test get_faces(p,2,0) == [[1,2,3],[1,4,2],[1,3,4],[2,4,3]] +@test get_faces(p,3,0) == [[1,2,3,4]] +@test get_faces(p,0,1) == [[1,2,3],[1,4,5],[3,4,6],[2,5,6]] +@test get_faces(p,1,1) == [[1],[2],[3],[4],[5],[6]] +@test get_faces(p,2,1) == [[1,4,3],[2,5,1],[3,6,2],[5,6,4]] +@test get_faces(p,3,1) == [[1,2,3,4,5,6]] +@test get_faces(p,0,2) == [[1,2,3],[1,2,4],[1,3,4],[2,3,4]] +@test get_faces(p,1,2) == [[1,2],[2,3],[1,3],[1,4],[2,4],[3,4]] +@test get_faces(p,2,2) == [[1],[2],[3],[4]] +@test get_faces(p,3,2) == [[1,2,3,4]] +@test get_faces(p,0,3) == [[1],[1],[1],[1]] +@test get_faces(p,1,3) == [[1],[1],[1],[1],[1],[1]] +@test get_faces(p,2,3) == [[1],[1],[1],[1]] +@test get_faces(p,3,3) == [[1]] +@test get_facedims(p) == [0,0,0,0,1,1,1,1,1,1,2,2,2,2,3] +@test Polytope{3}(p,1) === p +@test isa(Polytope{2}(p,1),Polygon) +@test Polytope{1}(p,1) == SEGMENT +@test Polytope{0}(p,1) == VERTEX + + +p = Polyhedron(HEX) +@test check_graph(p) +@test get_faces(p,0,0) == [[1],[2],[3],[4],[5],[6],[7],[8]] +@test get_faces(p,1,0) == [ + [1,5],[1,2],[1,3],[2,6],[2,4],[3,7],[3,4],[4,8],[5,7],[5,6],[6,8],[7,8]] +@test get_faces(p,2,0) == [ + [1,5,7,3],[1,2,6,5],[1,3,4,2],[2,4,8,6],[3,7,8,4],[5,6,8,7]] +@test get_faces(p,3,0) == [[1,2,3,4,5,6,7,8]] +@test get_faces(p,0,1) == [ + [1,2,3],[2,4,5],[3,6,7],[5,7,8],[1,9,10],[4,10,11],[6,9,12],[8,11,12]] +@test get_faces(p,1,1) == [[1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12]] +@test get_faces(p,2,1) == [ + [1,9,6,3],[2,4,10,1],[3,7,5,2],[5,8,11,4],[6,12,8,7],[10,11,12,9]] +@test get_faces(p,3,1) == [[1,2,3,4,5,6,7,8,9,10,11,12]] +@test get_faces(p,0,2) == [ + [1,2,3],[2,3,4],[1,3,5],[3,4,5],[1,2,6],[2,4,6],[1,5,6],[4,5,6]] +@test get_faces(p,1,2) == [ + [1,2],[2,3],[1,3],[2,4],[3,4],[1,5],[3,5],[4,5],[1,6],[2,6],[4,6],[5,6]] +@test get_faces(p,2,2) == [[1],[2],[3],[4],[5],[6]] +@test get_faces(p,3,2) == [[1,2,3,4,5,6]] +@test get_faces(p,0,3) == [[1],[1],[1],[1],[1],[1],[1],[1]] +@test get_faces(p,1,3) == [[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]] +@test get_faces(p,2,3) == [[1],[1],[1],[1],[1],[1]] +@test get_faces(p,3,3) == [[1]] +@test get_facedims(p) == [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3] +@test Polytope{3}(p,1) === p +@test isa(Polytope{2}(p,1),Polygon) +@test Polytope{1}(p,1) == SEGMENT +@test Polytope{0}(p,1) == VERTEX + +# p = Polyhedron(TET) @test check_graph(p) @@ -39,9 +120,6 @@ p = Polyhedron(TET) @test surface(p) ≈ 3/2 + (√3)/2 p = Polyhedron(HEX) -STLCutters.generate_facets(p) -STLCutters.generate_edges(p) - @test check_graph(p) @test volume(p) ≈ 1 @test surface(p) ≈ 6 From 444d002b769aaf7bc446cca62ae83ea45d1c354d Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Tue, 14 May 2024 17:00:24 +0200 Subject: [PATCH 04/15] [polytope] decoupled GraphPolytope from metadata --- src/Polyhedra.jl | 340 +++++++++++++++++++-------------- src/SubTriangulations.jl | 80 ++++---- test/PolyhedraTests.jl | 7 +- test/SubTriangulationsTests.jl | 9 +- 4 files changed, 248 insertions(+), 188 deletions(-) diff --git a/src/Polyhedra.jl b/src/Polyhedra.jl index 54f655fd..e6fca2ef 100644 --- a/src/Polyhedra.jl +++ b/src/Polyhedra.jl @@ -30,7 +30,7 @@ struct GraphPolytope{D,Dp,Tp,Td} <: Polytope{D} dimranges::Vector{UnitRange{Int}} dface_nfaces::Vector{Vector{Int32}} isopen::Bool - data::Td + metadata::Td function GraphPolytope{D}( vertices::Vector{Point{Dp,Tp}}, edge_vertex_graph::Vector{Vector{Int32}}, @@ -39,7 +39,7 @@ struct GraphPolytope{D,Dp,Tp,Td} <: Polytope{D} dimranges::Vector{UnitRange{Int}}, dface_nfaces::Vector{Vector{Int32}}, isopen::Bool, - data::Td) where {D,Dp,Tp,Td} + metadata::Td) where {D,Dp,Tp,Td} new{D,Dp,Tp,Td}( vertices, edge_vertex_graph, @@ -48,7 +48,7 @@ struct GraphPolytope{D,Dp,Tp,Td} <: Polytope{D} dimranges, dface_nfaces, isopen, - data) + metadata) end end @@ -66,16 +66,6 @@ const Polygon = GraphPolytope{2} """ const Polyhedron = GraphPolytope{3} -struct PolyhedronData - vertex_to_planes::Vector{Vector{Int32}} - vertex_to_original_faces::Vector{Vector{Int32}} - vertex_to_parent_vertex::Vector{Int32} - vertex_to_parent_edge::Vector{Tuple{Int32,Int32}} - plane_to_vertex_to_distances::Vector{Vector{Float64}} - plane_to_ref_plane::Vector{Int32} - plane_to_ids::Vector{Int32} -end - # Constructors function GraphPolytope{D}( @@ -112,9 +102,10 @@ end function GraphPolytope{D}( vertices::AbstractVector{<:Point}, graph::Vector{<:Vector} - ;isopen=false::Bool) where D + ;isopen=false::Bool, + metadata=nothing) where D - GraphPolytope{D}(vertices,graph,isopen,polyhedron_data(length(vertices))) + GraphPolytope{D}(vertices,graph,isopen,metadata) end function GraphPolytope{D}( @@ -126,16 +117,28 @@ function GraphPolytope{D}( GraphPolytope{D}(vertices,graph,isopen,data) end -function GraphPolytope{D}(stl::GridTopology{Dc,D}) where {Dc,D} - graph = compute_graph(stl) - X = get_vertex_coordinates(stl) - isopen = is_open_surface(stl) - p = GraphPolytope{D}(X,graph;isopen) - set_original_faces!(p,stl) +function GraphPolytope{D}(t::GridTopology{Dc,D};metadata=nothing) where {Dc,D} + graph = compute_graph(t) + X = get_vertex_coordinates(t) + isopen = is_open_surface(t) + p = GraphPolytope{D}(X,graph;isopen,metadata) + set_polytope_data!(p,t,metadata) + p +end + +function set_polytope_data!(p::GraphPolytope,t::GridTopology,::Nothing) p end -function Polygon(p::Polytope{2},vertices::AbstractVector{<:Point}) +function get_polytope_data(p::Polytope;metadata=nothing) + get_polytope_data(p,metadata) +end + +function get_polytope_data(p::Polytope,::Nothing) + nothing +end + +function Polygon(p::Polytope{2},vertices::AbstractVector{<:Point};kwargs...) if p == TRI e_v_graph = [[2,3],[3,1],[1,2]] perm = [1,2,3] @@ -149,22 +152,20 @@ function Polygon(p::Polytope{2},vertices::AbstractVector{<:Point}) e_v_graph = map(Reindex(e_v_graph),perm) e_v_graph = map(i->replace(i, Dict(perm .=> 1:length(perm))...),e_v_graph) e_v_graph = map(i->Int32.(i),e_v_graph) - data = polyhedron_data(p) + data = get_polytope_data(p;kwargs...) Polygon(vertices,e_v_graph,data) end -function Polygon(vertices::AbstractVector{<:Point}) +function Polygon(vertices::AbstractVector{<:Point};kwargs...) graph = map(1:length(vertices)) do i inext = i == length(vertices) ? 1 : i+1 iprev = i == 1 ? length(vertices) : i-1 Int32[iprev,inext] end - data = nothing - Polygon(vertices,graph,data) + Polygon(vertices,graph;kwargs...) end - -function Polyhedron(p::Polytope{3},vertices::AbstractVector{<:Point}) +function Polyhedron(p::Polytope{3},vertices::AbstractVector{<:Point};kwargs...) if p == TET e_v_graph = [[2,4,3],[3,4,1],[1,4,2],[1,2,3]] elseif p == HEX @@ -181,12 +182,12 @@ function Polyhedron(p::Polytope{3},vertices::AbstractVector{<:Point}) @unreachable end e_v_graph = map(i->Int32.(i),e_v_graph) - data = polyhedron_data(p) + data = get_polytope_data(p;kwargs...) Polyhedron(vertices,e_v_graph,data) end -function GraphPolytope{D}(p::Polytope) where D - GraphPolytope{D}(p,get_vertex_coordinates(p)) +function GraphPolytope{D}(p::Polytope;kwargs...) where D + GraphPolytope{D}(p,get_vertex_coordinates(p);kwargs...) end # Interface @@ -222,7 +223,7 @@ Base.getindex(a::GraphPolytope,i::Integer) = a.vertices[i] It return the metadata stored in the polytope `p`. """ -get_data(a::GraphPolytope) = a.data +get_data(a::GraphPolytope) = a.metadata """ @@ -241,7 +242,6 @@ function isactive(p::Polyhedron,vertex::Integer) !isempty( get_graph(p)[vertex] ) end - """ check_graph(p::GraphPolytope) -> Bool @@ -358,7 +358,6 @@ function get_edge_tangent(p::GraphPolytope) end end - function get_dimranges(p::GraphPolytope) setup_dimranges!(p) p.dimranges @@ -561,8 +560,156 @@ function generate_facet_to_vertices(poly::Polygon) T end +function Base.copy(poly::Polyhedron) + vertices = get_vertex_coordinates(poly) + graph = get_graph(poly) + open = isopen(poly) + data = get_data(poly) + data = !isnothing(data) ? copy(data) : nothing + Polyhedron(vertices,graph,open,data) +end + +function simplexify(poly::Polyhedron{3}) + !isopen(poly) || return simplexify_surface(poly) + vstart = fill(UNSET,num_vertices(poly)) + stack = Int32[] + for v in 1:num_vertices(poly) + isactive(poly,v) || continue + vstart[v] == UNSET || continue + vstart[v] = v + empty!(stack) + push!(stack,v) + while !isempty(stack) + vcurrent = pop!(stack) + for vneig in get_graph(poly)[vcurrent] + if vstart[vneig] == UNSET + vstart[vneig] = v + push!(stack,vneig) + end + end + end + end + istouch = map( i -> falses(length(i)), get_graph(poly) ) + vertex_coordinates = get_vertex_coordinates(poly) + T = Vector{Int32}[] + X = vertex_coordinates + for v in 1:num_vertices(poly) + isactive(poly,v) || continue + for i in 1:length(get_graph(poly)[v]) + !istouch[v][i] || continue + istouch[v][i] = true + vcurrent = v + vnext = get_graph(poly)[v][i] + while vnext != v + inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) + !isnothing(inext) || break + inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 + istouch[vnext][inext] = true + vcurrent = vnext + vnext = get_graph(poly)[vnext][inext] + @assert vcurrent ≠ vnext + vcurrent ≠ vnext || break + if v ∉ (vstart[v],vcurrent,vnext) + k = [vstart[v],v,vcurrent,vnext] + push!(T,k) + end + end + end + end + X,T +end + +function simplexify_surface(poly::Polyhedron{3}) + istouch = map( i -> falses(length(i)), get_graph(poly) ) + T = Vector{Int32}[] + for v in 1:num_vertices(poly) + isactive(poly,v) || continue + for i in 1:length(get_graph(poly)[v]) + !istouch[v][i] || continue + istouch[v][i] = true + vcurrent = v + vnext = get_graph(poly)[v][i] + vnext ∉ (OPEN,UNSET) || continue + while vnext != v + inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) + inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 + istouch[vnext][inext] = true + vcurrent = vnext + vnext = get_graph(poly)[vnext][inext] + vnext ∉ (OPEN,UNSET) || break + if v ∉ (vcurrent,vnext) + k = [v,vcurrent,vnext] + push!(T,k) + end + end + end + end + get_vertex_coordinates(poly),T +end + +""" + PolyhedronData + + Metadata for [`GraphPolytope`](@ref) that serves for performing geometrical + operations. + + The metadata stores the following information: + * `vertex_to_planes`: A list of planes that intersect each vertex. + * `vertex_to_original_faces`: A list of d-faces of the original polytope or STL + * `vertex_to_parent_vertex`: It maps a vertex to a vertex that has the same coordinates + * `vertex_to_parent_edge`: It maps a vertex a vertex pair that generated that vertex + * `plane_to_vertex_to_distances`: A list of distances from each plane to each vertex + * `plane_to_ref_plane`: It maps a plane to a plane that (almost) co-planar + * `plane_to_ids`: It maps the plane to the plane id +""" +struct PolyhedronData + vertex_to_planes::Vector{Vector{Int32}} + vertex_to_original_faces::Vector{Vector{Int32}} + vertex_to_parent_vertex::Vector{Int32} + vertex_to_parent_edge::Vector{Tuple{Int32,Int32}} + plane_to_vertex_to_distances::Vector{Vector{Float64}} + plane_to_ref_plane::Vector{Int32} + plane_to_ids::Vector{Int32} +end + +struct ClipPolytopeData end + +const clipping = ClipPolytopeData() + +function GraphPolytope{D}( + vertices::Vector{<:Point}, + graph::Vector{Vector{Int32}}, + isopen::Bool, + ::ClipPolytopeData) where D + + data = polyhedron_data(length(vertices)) + GraphPolytope{D}(vertices,graph,isopen,data) +end + +function set_polytope_data!(p::GraphPolytope,t::GridTopology,::ClipPolytopeData) + set_original_faces!(p,t) + p +end + +function get_polytope_data(p::Polytope,::ClipPolytopeData) + polyhedron_data(p) +end + # Operations +""" + clip(p::Polyhedron,planes;kwargs...) -> Polyhedron + + It clips a polyhedron by the halfspace of a plane or a set of planes. + + # Optional keyword arguments + * `inside::Bool=true`: It clips the polyhedron by the inside ourside of the union of halfspace. + * `inout::Vector{Bool}=trues(length(planes))`: In reverses the halfspaces with `inside[i]=false`. + * `boundary::nothing`: + * If `boundary=true`, it preserves the vertices on the planes (zero distance) + * If `boundary=false`, it removes the vertices on the planes (zero distance) + * If `boundary=nothing`, it preserves the vertices on the planes if the normal of the plane points inwards. +""" function clip(poly::Polyhedron,Π;inside=true,inout=trues(length(Π)),boundary=nothing) p = poly for (i,Πi) in enumerate(Π) @@ -604,6 +751,19 @@ function clip(p::Polyhedron,Π,side;boundary=nothing::Union{Nothing,Bool},invert p end + +""" + split(p::Polyhedron,plane;kwargs...) + + It splits a polyhedron by a plane into two polyhedra. + + It returns a tuple of `Union{Polyhedron,Nothing}`. + If one side is empty, it returns `nothing` for that side. + + # Optional keyword arguments + * `side::Symbol=:both`: It returns `:both` sides, the `:left` side, or the `:right` side + * `invert::Bool=false`: It inverts the plane +""" function split(p::Polyhedron,Π,side=:both;invert=false) @assert side ∈ (:both,:left,:right) distances = get_plane_distances(get_data(p),Π) @@ -664,87 +824,6 @@ function split(p::Polyhedron,Π,side=:both;invert=false) p⁻,p⁺ end -function simplexify(poly::Polyhedron{3}) - !isopen(poly) || return simplexify_surface(poly) - vstart = fill(UNSET,num_vertices(poly)) - stack = Int32[] - for v in 1:num_vertices(poly) - isactive(poly,v) || continue - vstart[v] == UNSET || continue - vstart[v] = v - empty!(stack) - push!(stack,v) - while !isempty(stack) - vcurrent = pop!(stack) - for vneig in get_graph(poly)[vcurrent] - if vstart[vneig] == UNSET - vstart[vneig] = v - push!(stack,vneig) - end - end - end - end - v_to_pv = get_data(poly).vertex_to_parent_vertex - istouch = map( i -> falses(length(i)), get_graph(poly) ) - vertex_coordinates = get_vertex_coordinates(poly) - T = Vector{Int32}[] - X = vertex_coordinates - for v in 1:num_vertices(poly) - isactive(poly,v) || continue - for i in 1:length(get_graph(poly)[v]) - !istouch[v][i] || continue - istouch[v][i] = true - vcurrent = v - vnext = get_graph(poly)[v][i] - while vnext != v - inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) - !isnothing(inext) || break - inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 - istouch[vnext][inext] = true - vcurrent = vnext - vnext = get_graph(poly)[vnext][inext] - @assert vcurrent ≠ vnext - vcurrent ≠ vnext || break - if v ∉ (vstart[v],vcurrent,vnext) - k = [vstart[v],v,vcurrent,vnext] - push!(T,k) - end - end - end - end - X,T -end - -function simplexify_surface(poly::Polyhedron{3}) - stack = Int32[] - v_to_pv = get_data(poly).vertex_to_parent_vertex - istouch = map( i -> falses(length(i)), get_graph(poly) ) - T = Vector{Int32}[] - for v in 1:num_vertices(poly) - isactive(poly,v) || continue - for i in 1:length(get_graph(poly)[v]) - !istouch[v][i] || continue - istouch[v][i] = true - vcurrent = v - vnext = get_graph(poly)[v][i] - vnext ∉ (OPEN,UNSET) || continue - while vnext != v - inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) - inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 - istouch[vnext][inext] = true - vcurrent = vnext - vnext = get_graph(poly)[vnext][inext] - vnext ∉ (OPEN,UNSET) || break - if v ∉ (vcurrent,vnext) - k = [v,vcurrent,vnext] - push!(T,k) - end - end - end - end - get_vertex_coordinates(poly),T -end - function simplexify_boundary(poly::Polyhedron{3},stl::GridTopology) D = 3 stack = Int32[] @@ -859,7 +938,7 @@ end function simplexify_cell_boundary(p::Polyhedron,nf::Integer) X,T = simplexify_surface(p) - v_to_planes = p.data.vertex_to_planes + v_to_planes = p.metadata.vertex_to_planes T_to_planes = lazy_map(Broadcasting(Reindex(v_to_planes)),T) c_to_planes = map(i->reduce(intersect,i),T_to_planes) c_to_plane = map(first,c_to_planes) @@ -1145,21 +1224,6 @@ end ## Helpers -function check_graph(p::GraphPolytope) - check_graph(get_graph(p)) -end - -function check_graph(graph::AbstractVector{<:AbstractVector}) - for v in 1:length(graph) - !isempty(graph[v]) || continue - for vneig in graph[v] - vneig ∉ (OPEN,UNSET) || continue - v ∈ graph[vneig] || return false - end - end - true -end - function compact!(p::Polyhedron) ids = findall(i->!isactive(p,i),1:num_vertices(p)) old_to_new = fill(UNSET,num_vertices(p)) @@ -1176,7 +1240,7 @@ function compact!(p::Polyhedron) deleteat!(graph,ids) f = i -> i ∈ (OPEN,UNSET) ? i : old_to_new[i] map!(i->map!(f,i,i),graph,graph) - compact!(p.data,ids,old_to_new) + compact!(p.metadata,ids,old_to_new) p end @@ -1209,14 +1273,6 @@ function compact!(data::PolyhedronData,ids,old_to_new) data end -function Base.copy(poly::Polyhedron) - vertices = get_vertex_coordinates(poly) - graph = get_graph(poly) - open = isopen(poly) - data = copy(get_data(poly)) - Polyhedron(vertices,graph,open,data) -end - function Base.copy(data::PolyhedronData) v_to_Π = copy(data.vertex_to_planes) v_to_of = copy(data.vertex_to_original_faces) @@ -1577,12 +1633,12 @@ function get_planes(v,d,atol) end function get_new_plane_ids(poly) - id = minimum( get_plane_ids(poly.data) ) + id = minimum( get_plane_ids(poly.metadata) ) id-1,id-2,id-3 end function round_distances!(poly,atol) - Π_to_v_to_dist = poly.data.plane_to_vertex_to_distances + Π_to_v_to_dist = poly.metadata.plane_to_vertex_to_distances for i in 1:length(Π_to_v_to_dist) v_to_dist = Π_to_v_to_dist[i] for v in 1:length(v_to_dist) diff --git a/src/SubTriangulations.jl b/src/SubTriangulations.jl index 82a9abe3..0915ad71 100644 --- a/src/SubTriangulations.jl +++ b/src/SubTriangulations.jl @@ -87,7 +87,7 @@ function subtriangulate( c_to_stlf = compute_cell_to_facets(grid,stl) - Γ0 = Polyhedron(stl) + Γ0 = Polyhedron(stl;metadata=clipping) submesh = _get_threaded_empty_arrays(stl) io_arrays = _init_io_arrays(bgmodel,p) @@ -170,7 +170,7 @@ function compute_polyhedra!(caches,Γ0,stl,p,f_to_isempty,Πf,Πr, Πkf,Πkf_ids = filter_face_planes(stl,Πr,reflex_faces,Πf,facets) - K = Polyhedron(p,cell_coords) + K = Polyhedron(p,cell_coords;metadata=clipping) Γk0 = restrict(Γ0,stl,c_to_stlf[cell]) compute_distances!(Γk0,lazy_append(Πk,Πkf),lazy_append(Πk_ids,Πkf_ids)) @@ -395,7 +395,7 @@ function decompose(surf::Polyhedron,cell::Polyhedron,rfaces,empty_facets,stl) else delete_inactive_planes!(surf,cell,stl) rf = rfaces[i] - if !has_coplanars(surf.data,rf) || !contains_coplanars(surf.data,rf) + if !has_coplanars(surf.metadata,rf) || !contains_coplanars(surf.metadata,rf) s⁻,s⁺ = split_overlapping(surf,rf) k⁻,k⁺ = split(cell,rf) S = [s⁻,s⁺] @@ -666,7 +666,7 @@ end function _get_cell_facets_to_iscut(Γk,p;surfacesource) f_to_iscut = falses( num_facets(p) ) if surfacesource == :skin - v_to_Π = Γk.data.vertex_to_planes + v_to_Π = Γk.metadata.vertex_to_planes for v in 1:length(v_to_Π) for Π in v_to_Π[v] if Π < 0 && 0 < abs(Π) ≤ num_facets(p) @@ -863,8 +863,8 @@ function _get_part_to_part_to_facing(poly,facets,f_to_part,parts;inside) end function get_disconnected_facets(poly::Polyhedron,stl::STL) - v_to_pv = poly.data.vertex_to_parent_vertex - v_to_f = poly.data.vertex_to_original_faces + v_to_pv = poly.metadata.vertex_to_parent_vertex + v_to_f = poly.metadata.vertex_to_original_faces facets = get_original_facets(poly,stl,empty=true) facet_to_part = fill(UNSET,length(facets)) stack = Int32[] @@ -908,8 +908,8 @@ function get_disconnected_facets(poly::Polyhedron,stl::STL) end function get_facet_onset(poly::Polyhedron,facet::Integer) - v_to_pv = poly.data.vertex_to_parent_vertex - v_to_f = poly.data.vertex_to_original_faces + v_to_pv = poly.metadata.vertex_to_parent_vertex + v_to_f = poly.metadata.vertex_to_original_faces for v in 1:num_vertices(poly) if isactive(poly,v) && facet ∈ v_to_f[v] for vneig in get_graph(poly)[v] @@ -932,8 +932,8 @@ function get_facet_onset(poly::Polyhedron,facet::Integer) end function is_facet_in_facet(poly::Polyhedron,facet,plane;inside,atol=0) - if has_coplanars(poly.data,plane) - if are_coplanar(poly.data,facet,plane) + if has_coplanars(poly.metadata,plane) + if are_coplanar(poly.metadata,facet,plane) return true end end @@ -960,8 +960,8 @@ function is_reflex(poly::Polyhedron,stl::STL,reflex_face;inside) length(get_faces(stl,Dc-1,Dc)[rf]) == 2 || return false f1 = get_faces(stl,Dc-1,Dc)[rf][1] + get_offset(stl,Dc) f2 = get_faces(stl,Dc-1,Dc)[rf][2] + get_offset(stl,Dc) - has_plane(poly.data,f1) || return false - has_plane(poly.data,f2) || return false + has_plane(poly.metadata,f1) || return false + has_plane(poly.metadata,f2) || return false is_facet_in_facet(poly,f1,f2;inside) || return true is_facet_in_facet(poly,f2,f1;inside) || return true false @@ -1003,8 +1003,8 @@ end function complete_nodes_to_inout!(node_to_inout,polys,inout,p::Polytope) D = num_dims(p) for poly in polys - v_to_Π = poly.data.vertex_to_planes - v_to_v = poly.data.vertex_to_parent_vertex + v_to_Π = poly.metadata.vertex_to_planes + v_to_v = poly.metadata.vertex_to_parent_vertex for v in 1:num_vertices(poly) isactive(poly,v) || continue # v = inout == FACE_CUT ? v : v_to_v[v] @@ -1072,7 +1072,7 @@ function complete_facets_to_inoutcut!(facet_to_inoutcut,polys,inout,p::Polytope) facet_list = Int32[] for poly in polys istouch = map( i -> falses(length(i)), get_graph(poly) ) - v_to_Π = poly.data.vertex_to_planes + v_to_Π = poly.metadata.vertex_to_planes for v in 1:num_vertices(poly) isactive(poly,v) || continue for i in 1:length(get_graph(poly)[v]) @@ -1126,7 +1126,7 @@ function snap_distances!(P,Q;atol) end function snap_distances!(P;atol) - Π_to_v_to_dist = get_plane_distances(P.data) + Π_to_v_to_dist = get_plane_distances(P.metadata) for i in 1:length(Π_to_v_to_dist) v_to_dist = Π_to_v_to_dist[i] for v in 1:length(v_to_dist) @@ -1138,7 +1138,7 @@ function snap_distances!(P;atol) end function merge_coplanar_with_cell_planes(S,K,stl,Πk,Πr,Πf;atol) - planes = S.data.plane_to_ids + planes = S.metadata.plane_to_ids plane_to_qp_plane = fill(Int32(UNSET),length(planes)) for (i,Πi) in enumerate(planes) Πi < 0 || continue @@ -1175,9 +1175,9 @@ end function correct_plane_distances!(S,plane_to_qp_plane,stl;atol) - plane = S.data.plane_to_ids - Π_to_v_to_dist = S.data.plane_to_vertex_to_distances - v_to_f = S.data.vertex_to_original_faces + plane = S.metadata.plane_to_ids + Π_to_v_to_dist = S.metadata.plane_to_vertex_to_distances + v_to_f = S.metadata.vertex_to_original_faces for (i,qp_i) in enumerate( plane_to_qp_plane ) qp_i ≠ 0 || continue v_to_dist = Π_to_v_to_dist[ abs(qp_i) ] @@ -1190,7 +1190,7 @@ function correct_plane_distances!(S,plane_to_qp_plane,stl;atol) end function set_linked_planes!(poly::Polyhedron,Π_to_qp_Π) - planes = poly.data.plane_to_ids + planes = poly.metadata.plane_to_ids set_linked_planes!(poly,Π_to_qp_Π,planes) end @@ -1207,7 +1207,7 @@ function merge_coplanar_planes!(Γk0,K,stl,Πr,Πf;atol) end function link_planes!(surf::Polyhedron,cell::Polyhedron,stl::STL,Πr,Πf;atol) - planes = surf.data.plane_to_ids + planes = surf.metadata.plane_to_ids default_out = fill(UNSET,length(planes)), planes Π_to_faces = find_faces_on_planes!(surf,stl;atol) maximum(length,Π_to_faces) > 0 || return default_out @@ -1222,8 +1222,8 @@ function link_planes!(surf::Polyhedron,cell::Polyhedron,stl::STL,Πr,Πf;atol) end function find_faces_on_planes!(surf::Polyhedron,stl::STL;atol) - planes = surf.data.plane_to_ids - v_to_f = surf.data.vertex_to_original_faces + planes = surf.metadata.plane_to_ids + v_to_f = surf.metadata.vertex_to_original_faces f_to_v = get_face_vertices(stl) c = array_cache(f_to_v) vertices = Int32[] @@ -1231,7 +1231,7 @@ function find_faces_on_planes!(surf::Polyhedron,stl::STL;atol) for (i,Π) in enumerate(planes) Π > 0 || continue faces = Π_to_faces[i] - dists = get_plane_distances(surf.data,Π) + dists = get_plane_distances(surf.metadata,Π) empty!(vertices) for v in 1:num_vertices(surf) @assert isactive(surf,v) @@ -1262,8 +1262,8 @@ function find_faces_on_planes!(surf::Polyhedron,stl::STL;atol) end function link_coplanar_planes(surf,cell,stl,Π_to_faces;atol) - planes = surf.data.plane_to_ids - Π_to_ref_Π = surf.data.plane_to_ref_plane + planes = surf.metadata.plane_to_ids + Π_to_ref_Π = surf.metadata.plane_to_ref_plane Π_to_coplanar_Π = [ Int32[] for _ in 1:length(planes) ] D = num_dims(stl) facedims = get_facedims(stl) @@ -1350,13 +1350,13 @@ function merge_faces!(Π_to_faces,planes,Π_to_ref_Π) end function correct_distances!(surf,Π_to_ref_Π,Π_to_faces) - planes = surf.data.plane_to_ids - v_to_f = surf.data.vertex_to_original_faces + planes = surf.metadata.plane_to_ids + v_to_f = surf.metadata.vertex_to_original_faces for (i,Πi) in enumerate(planes) Πi > 0 || continue Π_to_ref_Π[i] == i || continue !isempty(Π_to_faces[i]) || continue - dists = get_plane_distances(surf.data,Πi) + dists = get_plane_distances(surf.metadata,Πi) for v in 1:num_vertices(surf) dists[v] ≠ 0 || continue if any( f-> f ∈ v_to_f[v], Π_to_faces[i] ) @@ -1392,8 +1392,8 @@ function relative_orientation(Π1,Π2;atol) end function distance_between_planes(poly::Polyhedron,Π1,Π2,stl;restrict=false) - v_to_Π = poly.data.vertex_to_planes - v_to_of = poly.data.vertex_to_original_faces + v_to_Π = poly.metadata.vertex_to_planes + v_to_of = poly.metadata.vertex_to_original_faces if restrict @assert Π1 < 0 @assert Π2 > 0 @@ -1405,8 +1405,8 @@ function distance_between_planes(poly::Polyhedron,Π1,Π2,stl;restrict=false) f1,f2 = Π2,Π2 end end - dist1 = get_plane_distances(poly.data,Π1) - dist2 = get_plane_distances(poly.data,Π2) + dist1 = get_plane_distances(poly.metadata,Π1) + dist2 = get_plane_distances(poly.metadata,Π2) max_dist_a = 0.0 for v in 1:num_vertices(poly) if !restrict || any( Π -> Π ∈ v_to_Π[v] || Π ∈ v_to_of[v], (Π1,f1,f2) ) @@ -1425,9 +1425,9 @@ function distance_between_planes(poly::Polyhedron,Π1,Π2,stl;restrict=false) end function set_linked_planes!(poly::Polyhedron,Π_to_ref_Π,planes) - _Π_to_ref_Π = poly.data.plane_to_ref_plane - _planes = poly.data.plane_to_ids - Π_to_v_to_dist = poly.data.plane_to_vertex_to_distances + _Π_to_ref_Π = poly.metadata.plane_to_ref_plane + _planes = poly.metadata.plane_to_ids + Π_to_v_to_dist = poly.metadata.plane_to_vertex_to_distances for (i,Π) in enumerate(planes) Π_to_ref_Π[i] ≠ UNSET || continue ref_Π = planes[abs(Π_to_ref_Π[i])] @@ -1519,8 +1519,8 @@ function _add_missing_facets( rf_offset = get_offset(stl,D-1) f_offset = get_offset(stl,D) for f in facets - has_coplanars(surf.data,f) || continue - contains_coplanars(surf.data,f) || continue + has_coplanars(surf.metadata,f) || continue + contains_coplanars(surf.metadata,f) || continue for rf in get_faces(stl,D,D-1)[f-f_offset] rf += rf_offset rf ∉ reflex_faces || continue @@ -1597,7 +1597,7 @@ function _one_face_polyhedron(poly::Polyhedron,face::Integer) sort!(nodes) r = restrict(poly,nodes) for v in 1:num_vertices(r) - r.data.vertex_to_original_faces[v] = [face] + r.metadata.vertex_to_original_faces[v] = [face] end r end diff --git a/test/PolyhedraTests.jl b/test/PolyhedraTests.jl index c27bcb31..4318d01b 100644 --- a/test/PolyhedraTests.jl +++ b/test/PolyhedraTests.jl @@ -23,6 +23,7 @@ using STLCutters: read_stl using STLCutters: merge_nodes using STLCutters: simplexify_cell_boundary using STLCutters: compute_grid +using STLCutters: clipping p = Polygon(TRI) @@ -114,12 +115,14 @@ p = Polyhedron(HEX) # -p = Polyhedron(TET) +p = Polyhedron(TET,metadata=clipping) @test check_graph(p) @test volume(p) ≈ 1/6 @test surface(p) ≈ 3/2 + (√3)/2 -p = Polyhedron(HEX) +p = Polyhedron(HEX,metadata=clipping) +p.metadata.vertex_to_planes + @test check_graph(p) @test volume(p) ≈ 1 @test surface(p) ≈ 6 diff --git a/test/SubTriangulationsTests.jl b/test/SubTriangulationsTests.jl index 38b2fa2b..c439b7d8 100644 --- a/test/SubTriangulationsTests.jl +++ b/test/SubTriangulationsTests.jl @@ -27,6 +27,7 @@ using STLCutters: merge_nodes using STLCutters: compute_stl_model using STLCutters: compute_grid using STLCutters: FACE_IN, FACE_OUT, FACE_CUT +using STLCutters: clipping vertices = [ Point(0.1,-0.2,0.5), @@ -54,9 +55,9 @@ stl = STL(stlmodel) # Setup cell stl_facets_k = 1:num_cells(stl) -K = Polyhedron(HEX) +K = Polyhedron(HEX,metadata=clipping) -Γ0 = Polyhedron(stl) +Γ0 = Polyhedron(stl,metadata=clipping) Γk0 = restrict(Γ0,stl,stl_facets_k) stl_reflex_faces_k = get_original_reflex_faces(Γk0,stl) @@ -123,9 +124,9 @@ stl = STL(stlmodel) # Setup cell stl_facets_k = 1:num_cells(stl) -K = Polyhedron(HEX) +K = Polyhedron(HEX,metadata=clipping) -Γ0 = Polyhedron(stl) +Γ0 = Polyhedron(stl,metadata=clipping) Γk0 = restrict(Γ0,stl,stl_facets_k) stl_reflex_faces_k = get_original_reflex_faces(Γk0,stl) From 823a4ebfcae46adb4519f1c5f52c4a93bfc0dfd6 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Tue, 14 May 2024 17:23:50 +0200 Subject: [PATCH 05/15] [polytope] rename simplexify --- src/Polyhedra.jl | 31 +++++++++++++++++++++++-------- src/SubTriangulations.jl | 4 ++-- test/PolyhedraTests.jl | 7 +++++-- test/SubTriangulationsTests.jl | 13 +++++++------ 4 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/Polyhedra.jl b/src/Polyhedra.jl index e6fca2ef..25ce5752 100644 --- a/src/Polyhedra.jl +++ b/src/Polyhedra.jl @@ -267,9 +267,9 @@ is_simplex(::GraphPolytope) = false is_n_cube(::GraphPolytope) = false -function Gridap_simplexify(p::GraphPolytope{D}) where D - @assert isopen(p) - X,T = simplexify(p) +function simplexify(p::GraphPolytope{D}) where D + @assert !isopen(p) + X,T = simplexify_interior(p) @check X == get_vertex_coordinates(p) T, simplex_polytope(Val{D}()) end @@ -569,7 +569,22 @@ function Base.copy(poly::Polyhedron) Polyhedron(vertices,graph,open,data) end -function simplexify(poly::Polyhedron{3}) +function simplexify_interior(p::Polygon) + @assert !isopen(p) + e_to_v = generate_facet_to_vertices(p) + T = Vector{Int32}[] + if length(e_to_v) > 0 + v0 = e_to_v[1][1] + for verts in e_to_v + if v0 ∉ verts + push!(T,[v0,verts[1],verts[2]]) + end + end + end + get_vertex_coordinates(p),T +end + +function simplexify_interior(poly::Polyhedron) !isopen(poly) || return simplexify_surface(poly) vstart = fill(UNSET,num_vertices(poly)) stack = Int32[] @@ -619,7 +634,7 @@ function simplexify(poly::Polyhedron{3}) X,T end -function simplexify_surface(poly::Polyhedron{3}) +function simplexify_surface(poly::Polyhedron) istouch = map( i -> falses(length(i)), get_graph(poly) ) T = Vector{Int32}[] for v in 1:num_vertices(poly) @@ -881,11 +896,11 @@ function simplexify_boundary(::Nothing,args...) nothing,nothing,nothing end -function simplexify(polys::AbstractVector{<:Polyhedron{Dp,Tp}}) where {Dp,Tp} +function simplexify_interior(polys::AbstractVector{<:Polyhedron{Dp,Tp}}) where {Dp,Tp} T = Vector{Int32}[] X = Point{Dp,Tp}[] for poly in polys - Xi,Ti = simplexify(poly) + Xi,Ti = simplexify_interior(poly) append!(T, map(i->i.+length(X),Ti) ) append!(X,Xi) end @@ -990,7 +1005,7 @@ function surface(polys::AbstractVector{<:Polyhedron},args...) end function volume(poly::Polyhedron{3}) - X,T = simplexify(poly) + X,T = simplexify_interior(poly) p = TET c = array_cache(T) sum( i -> measure(get_cell!(c,X,T,p,i)), 1:length(T) ) diff --git a/src/SubTriangulations.jl b/src/SubTriangulations.jl index 0915ad71..2703ab1c 100644 --- a/src/SubTriangulations.jl +++ b/src/SubTriangulations.jl @@ -223,8 +223,8 @@ function save_cell_submesh!(submesh,io_arrays,stl,p,cell,Kn_in,Kn_out,Γk; !isnothing(Kn_in) || return bgcell_to_ioc, bgcell_node_to_io, bgcell_facet_to_ioc = io_arrays - Xin,Tin = simplexify(Kn_in) - Xout,Tout = simplexify(Kn_out) + Xin,Tin = simplexify_interior(Kn_in) + Xout,Tout = simplexify_interior(Kn_out) B = _simplexify_boundary(Kn_in,Kn_out,Γk,stl;surfacesource) X_Fin,T_Fin,f_to_lbgfin = simplexify_cell_boundary(Kn_in,p) X_Fout,T_Fout,f_to_lbgfout = simplexify_cell_boundary(Kn_out,p) diff --git a/test/PolyhedraTests.jl b/test/PolyhedraTests.jl index 4318d01b..d08f6b59 100644 --- a/test/PolyhedraTests.jl +++ b/test/PolyhedraTests.jl @@ -41,6 +41,7 @@ p = Polygon(TRI) @test Polytope{2}(p,1) === p @test Polytope{1}(p,1) == SEGMENT @test Polytope{0}(p,1) == VERTEX +@test simplexify(p) == ([[1,2,3]],TRI) p = Polygon(QUAD) @test check_graph(p) @@ -57,6 +58,7 @@ p = Polygon(QUAD) @test Polytope{2}(p,1) === p @test Polytope{1}(p,1) == SEGMENT @test Polytope{0}(p,1) == VERTEX +@test simplexify(p) == ([[1,2,3],[1,3,4]],TRI) p = Polyhedron(TET) @test check_graph(p) @@ -81,7 +83,7 @@ p = Polyhedron(TET) @test isa(Polytope{2}(p,1),Polygon) @test Polytope{1}(p,1) == SEGMENT @test Polytope{0}(p,1) == VERTEX - +@test simplexify(p) == ([[1,2,4,3]],TET) p = Polyhedron(HEX) @test check_graph(p) @@ -112,7 +114,8 @@ p = Polyhedron(HEX) @test isa(Polytope{2}(p,1),Polygon) @test Polytope{1}(p,1) == SEGMENT @test Polytope{0}(p,1) == VERTEX - +@test simplexify(p) == ( + [[1,2,4,8],[1,2,8,6],[1,3,7,8],[1,3,8,4],[1,5,6,8],[1,5,8,7]],TET) # p = Polyhedron(TET,metadata=clipping) diff --git a/test/SubTriangulationsTests.jl b/test/SubTriangulationsTests.jl index c439b7d8..5dddf153 100644 --- a/test/SubTriangulationsTests.jl +++ b/test/SubTriangulationsTests.jl @@ -28,6 +28,7 @@ using STLCutters: compute_stl_model using STLCutters: compute_grid using STLCutters: FACE_IN, FACE_OUT, FACE_CUT using STLCutters: clipping +using STLCutters: simplexify_interior vertices = [ Point(0.1,-0.2,0.5), @@ -74,9 +75,9 @@ compute_distances!(K,Πf,Πf_ids) Kn_in = refine(K,Γk,stl,stl_reflex_faces_k,inside=true) Kn_out = refine(K,Γk,stl,stl_reflex_faces_k,inside=false) -X_in,T_in = simplexify(Kn_in) -X_out,T_out = simplexify(Kn_out) -X_Γ,T_Γ = simplexify(Γk) +X_in,T_in = simplexify_interior(Kn_in) +X_out,T_out = simplexify_interior(Kn_out) +X_Γ,T_Γ = simplexify_interior(Γk) n_to_io = get_cell_nodes_to_inout(Kn_in,Kn_out,HEX) @@ -143,9 +144,9 @@ compute_distances!(K,Πf,Πf_ids) Kn_in = refine(K,Γk,stl,stl_reflex_faces_k,inside=true) Kn_out = refine(K,Γk,stl,stl_reflex_faces_k,inside=false) -X_in,T_in = simplexify(Kn_in) -X_out,T_out = simplexify(Kn_out) -X_Γ,T_Γ = simplexify(Γk) +X_in,T_in = simplexify_interior(Kn_in) +X_out,T_out = simplexify_interior(Kn_out) +X_Γ,T_Γ = simplexify_interior(Γk) n_to_io = get_cell_nodes_to_inout(Kn_in,Kn_out,HEX) From d2fb73ae0db98d8a275d96b20db82d62339006f4 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Tue, 14 May 2024 17:29:49 +0200 Subject: [PATCH 06/15] adding extra docstrings --- src/Polyhedra.jl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Polyhedra.jl b/src/Polyhedra.jl index 25ce5752..97623550 100644 --- a/src/Polyhedra.jl +++ b/src/Polyhedra.jl @@ -839,6 +839,15 @@ function split(p::Polyhedron,Π,side=:both;invert=false) p⁻,p⁺ end +""" + simplexify_boundary(p::Polyhedron,t::GridTopology) + + It generates a simplex mesh of the surface of the polyhedron that touches the + grid topology. + + It returns the coordinates of the vertices, the connectivities and a mapping + to the topology facets. +""" function simplexify_boundary(poly::Polyhedron{3},stl::GridTopology) D = 3 stack = Int32[] @@ -1300,6 +1309,13 @@ function Base.copy(data::PolyhedronData) PolyhedronData(args...) end +""" + compute_distances!(p::Polyhedron,planes,plane_ids[;atol=0]) + + Compute the distances from the vertices of the polyhedron to each plane of + the list `planes`. If the distance is below `atol`, it sets the distance to + zero. +""" function compute_distances!(p::Polyhedron,Π,faces;atol=0) data = get_data(p) v_to_f = get_data(p).vertex_to_original_faces From 113fe80f80a280d854559b1b817f582e9cc8a176 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Wed, 15 May 2024 11:28:02 +0200 Subject: [PATCH 07/15] edit news --- NEWS.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/NEWS.md b/NEWS.md index e6abf995..6ccf8523 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- `Polyhedron` is now defined in `Gridap` as `GraphPolytope{3} Date: Wed, 15 May 2024 11:28:40 +0200 Subject: [PATCH 08/15] acommodate interface changes in GraphPolytope --- src/Polyhedra.jl | 1351 +++++++++++++++++++------------------- src/STLCutters.jl | 11 +- src/SubTriangulations.jl | 6 +- test/PolyhedraTests.jl | 103 +-- 4 files changed, 699 insertions(+), 772 deletions(-) diff --git a/src/Polyhedra.jl b/src/Polyhedra.jl index 97623550..9133972a 100644 --- a/src/Polyhedra.jl +++ b/src/Polyhedra.jl @@ -3,119 +3,664 @@ const OPEN = -1 -""" - struct GraphPolytope{D,Dp,Tp} <: Polytope{D} - - A graph polytope is a polytope defined by a set of vertices and a rototation - system (a planar oriented graph). This polytopal representation can represent - any polytope in 2 and 3 dimensions. - - In 2 dimensions ([`Polygon`](@ref)), the representation of the polygon is a closed polyline. - - In 3 dimensions ([`Polyhedron`](@ref)), the rotation system generates the connectivities, each facet is a closed cycle of the graph. - This construction allows complex geometrical operations, e.g., intersecting polytopes by halfspaces. - See also, - - > K. Sugihara, "A robust and consistent algorithm for intersecting convex polyhedra", Comput. Graph. Forum 13 (3) (1994) 45–54, doi: [10.1111/1467-8659.1330045](https://doi.org/10.1111/1467-8659.1330045) - - > D. Powell, T. Abel, "An exact general remeshing scheme applied to physically conservative voxelization", J. Comput. Phys. 297 (Sept. 2015) 340–356, doi: [10.1016/j.jcp.2015.05.022](https://doi.org/10.1016/j.jcp.2015.05.022. - - > S. Badia, P. A. Martorell, F. Verdugo. "Geometrical discretisations for unfitted finite elements on explicit boundary representations", J.Comput. Phys. 460 (2022): 111162. doi: [10.1016/j.jcp.2022.111162](https://doi.org/10.1016/j.jcp.2022.111162) -""" -struct GraphPolytope{D,Dp,Tp,Td} <: Polytope{D} - vertices::Vector{Point{Dp,Tp}} - edge_vertex_graph::Vector{Vector{Int32}} - n_m_to_nface_to_mfaces::Matrix{Vector{Vector{Int32}}} - facedims::Vector{Int32} - dimranges::Vector{UnitRange{Int}} - dface_nfaces::Vector{Vector{Int32}} - isopen::Bool - metadata::Td - function GraphPolytope{D}( - vertices::Vector{Point{Dp,Tp}}, - edge_vertex_graph::Vector{Vector{Int32}}, - n_m_to_nface_to_mfaces::Matrix{Vector{Vector{Int32}}}, - facedims::Vector{Int32}, - dimranges::Vector{UnitRange{Int}}, - dface_nfaces::Vector{Vector{Int32}}, - isopen::Bool, - metadata::Td) where {D,Dp,Tp,Td} - new{D,Dp,Tp,Td}( - vertices, - edge_vertex_graph, - n_m_to_nface_to_mfaces, - facedims, - dimranges, - dface_nfaces, - isopen, - metadata) - end -end - -""" - Polygon = GraphPolytope{2} - - A polygon is a [`GraphPolytope`](@ref) in 2 dimensions. -""" -const Polygon = GraphPolytope{2} - -""" - Polyhedron = GraphPolytope{3} - - A polyhedron is a [`GraphPolytope`](@ref) in 3 dimensions. -""" -const Polyhedron = GraphPolytope{3} - -# Constructors - -function GraphPolytope{D}( - vertices::Vector{<:Point}, - graph::Vector{Vector{Int32}}, - isopen::Bool, - data) where D - - n = D+1 - n_m_to_nface_to_mfaces = Matrix{Vector{Vector{Int32}}}(undef,n,n ) - dimranges = Vector{UnitRange{Int}}(undef,0) - dface_nfaces = Vector{Vector{Int32}}(undef,0) - facedims = Vector{Int32}(undef,0) - GraphPolytope{D}( - vertices, - graph, - n_m_to_nface_to_mfaces, - facedims, - dimranges, - dface_nfaces, - isopen, - data) -end - -function GraphPolytope{D}( - vertices::AbstractVector{<:Point}, - graph::Vector{<:Vector}, - isopen::Bool, - data) where D - - GraphPolytope{D}(collect(vertices),graph,isopen,data) -end - -function GraphPolytope{D}( - vertices::AbstractVector{<:Point}, - graph::Vector{<:Vector} - ;isopen=false::Bool, - metadata=nothing) where D - - GraphPolytope{D}(vertices,graph,isopen,metadata) -end - -function GraphPolytope{D}( - vertices::AbstractVector{<:Point}, - graph::Vector{<:Vector}, - data) where D - - isopen = false - GraphPolytope{D}(vertices,graph,isopen,data) -end +# """ +# struct GraphPolytope{D,Dp,Tp} <: Polytope{D} + +# A graph polytope is a general polytope defined by a set of vertices and a rototation +# system (a planar oriented graph). This polytopal representation can represent +# any polytope in 2 and 3 dimensions. + +# In 2 dimensions ([`Polygon`](@ref)), the representation of the polygon is a closed polyline. + +# In 3 dimensions ([`Polyhedron`](@ref)), the rotation system generates the connectivities, each facet is a closed cycle of the graph. +# This construction allows complex geometrical operations, e.g., intersecting polytopes by halfspaces. +# See also, + +# > K. Sugihara, "A robust and consistent algorithm for intersecting convex polyhedra", Comput. Graph. Forum 13 (3) (1994) 45–54, doi: [10.1111/1467-8659.1330045](https://doi.org/10.1111/1467-8659.1330045) + +# > D. Powell, T. Abel, "An exact general remeshing scheme applied to physically conservative voxelization", J. Comput. Phys. 297 (Sept. 2015) 340–356, doi: [10.1016/j.jcp.2015.05.022](https://doi.org/10.1016/j.jcp.2015.05.022. + +# > S. Badia, P. A. Martorell, F. Verdugo. "Geometrical discretisations for unfitted finite elements on explicit boundary representations", J.Comput. Phys. 460 (2022): 111162. doi: [10.1016/j.jcp.2022.111162](https://doi.org/10.1016/j.jcp.2022.111162) +# """ +# struct GraphPolytope{D,Dp,Tp,Td} <: Polytope{D} +# vertices::Vector{Point{Dp,Tp}} +# edge_vertex_graph::Vector{Vector{Int32}} +# n_m_to_nface_to_mfaces::Matrix{Vector{Vector{Int32}}} +# facedims::Vector{Int32} +# dimranges::Vector{UnitRange{Int}} +# dface_nfaces::Vector{Vector{Int32}} +# isopen::Bool +# metadata::Td +# function GraphPolytope{D}( +# vertices::Vector{Point{Dp,Tp}}, +# edge_vertex_graph::Vector{Vector{Int32}}, +# n_m_to_nface_to_mfaces::Matrix{Vector{Vector{Int32}}}, +# facedims::Vector{Int32}, +# dimranges::Vector{UnitRange{Int}}, +# dface_nfaces::Vector{Vector{Int32}}, +# isopen::Bool, +# metadata::Td) where {D,Dp,Tp,Td} +# new{D,Dp,Tp,Td}( +# vertices, +# edge_vertex_graph, +# n_m_to_nface_to_mfaces, +# facedims, +# dimranges, +# dface_nfaces, +# isopen, +# metadata) +# end +# end + +# """ +# Polygon = GraphPolytope{2} + +# A polygon is a [`GraphPolytope`](@ref) in 2 dimensions. +# """ +# const Polygon = GraphPolytope{2} + +# """ +# Polyhedron = GraphPolytope{3} + +# A polyhedron is a [`GraphPolytope`](@ref) in 3 dimensions. +# """ +# const Polyhedron = GraphPolytope{3} + +# # Constructors + +# function GraphPolytope{D}( +# vertices::Vector{<:Point}, +# graph::Vector{Vector{Int32}}, +# isopen::Bool, +# data) where D + +# n = D+1 +# n_m_to_nface_to_mfaces = Matrix{Vector{Vector{Int32}}}(undef,n,n ) +# dimranges = Vector{UnitRange{Int}}(undef,0) +# dface_nfaces = Vector{Vector{Int32}}(undef,0) +# facedims = Vector{Int32}(undef,0) +# GraphPolytope{D}( +# vertices, +# graph, +# n_m_to_nface_to_mfaces, +# facedims, +# dimranges, +# dface_nfaces, +# isopen, +# data) +# end + +# function GraphPolytope{D}( +# vertices::AbstractVector{<:Point}, +# graph::Vector{<:Vector}, +# isopen::Bool, +# data) where D + +# GraphPolytope{D}(collect(vertices),graph,isopen,data) +# end + +# function GraphPolytope{D}( +# vertices::AbstractVector{<:Point}, +# graph::Vector{<:Vector} +# ;isopen=false::Bool, +# metadata=nothing) where D + +# GraphPolytope{D}(vertices,graph,isopen,metadata) +# end + +# function GraphPolytope{D}( +# vertices::AbstractVector{<:Point}, +# graph::Vector{<:Vector}, +# data) where D + +# isopen = false +# GraphPolytope{D}(vertices,graph,isopen,data) +# end + +# function GraphPolytope{D}(t::GridTopology{Dc,D};metadata=nothing) where {Dc,D} +# graph = compute_graph(t) +# X = get_vertex_coordinates(t) +# isopen = is_open_surface(t) +# p = GraphPolytope{D}(X,graph;isopen,metadata) +# set_polytope_data!(p,t,metadata) +# p +# end + +# function set_polytope_data!(p::GraphPolytope,t::GridTopology,::Nothing) +# p +# end + +# function get_polytope_data(p::Polytope;metadata=nothing) +# get_polytope_data(p,metadata) +# end + +# function get_polytope_data(p::Polytope,::Nothing) +# nothing +# end + +# function Polygon(p::Polytope{2},vertices::AbstractVector{<:Point};kwargs...) +# if p == TRI +# e_v_graph = [[2,3],[3,1],[1,2]] +# perm = [1,2,3] +# elseif p == QUAD +# e_v_graph = [[2, 3],[4, 1],[1, 4],[3, 2]] +# perm = [1,2,4,3] +# else +# @unreachable +# end +# vertices = map(Reindex(vertices),perm) +# e_v_graph = map(Reindex(e_v_graph),perm) +# e_v_graph = map(i->replace(i, Dict(perm .=> 1:length(perm))...),e_v_graph) +# e_v_graph = map(i->Int32.(i),e_v_graph) +# data = get_polytope_data(p;kwargs...) +# Polygon(vertices,e_v_graph,data) +# end + +# function Polygon(vertices::AbstractVector{<:Point};kwargs...) +# graph = map(1:length(vertices)) do i +# inext = i == length(vertices) ? 1 : i+1 +# iprev = i == 1 ? length(vertices) : i-1 +# Int32[iprev,inext] +# end +# Polygon(vertices,graph;kwargs...) +# end + +# function Polyhedron(p::Polytope{3},vertices::AbstractVector{<:Point};kwargs...) +# if p == TET +# e_v_graph = [[2,4,3],[3,4,1],[1,4,2],[1,2,3]] +# elseif p == HEX +# e_v_graph = [ +# [5, 2, 3], +# [6, 4, 1], +# [7, 1, 4], +# [8, 3, 2], +# [1, 7, 6], +# [2, 5, 8], +# [3, 8, 5], +# [4, 6, 7] ] +# else +# @unreachable +# end +# e_v_graph = map(i->Int32.(i),e_v_graph) +# data = get_polytope_data(p;kwargs...) +# Polyhedron(vertices,e_v_graph,data) +# end + +# function GraphPolytope{D}(p::Polytope;kwargs...) where D +# GraphPolytope{D}(p,get_vertex_coordinates(p);kwargs...) +# end + +# # Interface + +# num_dims(::T) where T<:GraphPolytope = num_dims(T) + +# num_dims(::Type{<:GraphPolytope{D}}) where D = D + +# num_cell_dims(a::GraphPolytope) = num_dims(a) + +# point_eltype(::T) where T<:GraphPolytope = point_eltype(T) + +# point_eltype(::Type{<:GraphPolytope{D,Dp,T}}) where {D,Dp,T} = T + +# num_point_dims(::Type{<:GraphPolytope{D,Dp}}) where {D,Dp} = Dp + +# num_vertices(a::GraphPolytope) = length(a.vertices) + +# get_vertex_coordinates(a::GraphPolytope) = a.vertices + +# Base.getindex(a::GraphPolytope,i::Integer) = a.vertices[i] + +# """ +# get_graph(p::GraphPolytope) -> Vector{Vector{Int32}} + +# It returns the edge-vertex graph of the polytope `p`. +# """ +# @inline get_graph(a::GraphPolytope) = a.edge_vertex_graph + + +# """ +# get_metadata(p::GraphPolytope) + +# It return the metadata stored in the polytope `p`. +# """ +# get_metadata(a::GraphPolytope) = a.metadata + + +# """ +# isopen(p::GraphPolytope) -> Bool + +# In return whether the polytope is watter tight or not. +# """ +# Base.isopen(a::GraphPolytope) = a.isopen + +# """ +# isactive(p::GraphPolytope,vertex::Integer) -> Bool + +# It returns whether a vertex is connected to any other vertex. +# """ +# function isactive(p::Polyhedron,vertex::Integer) +# !isempty( get_graph(p)[vertex] ) +# end + +# """ +# check_graph(p::GraphPolytope) -> Bool + +# It checks whether the graph is well-constructed. The graph must be oriented +# and planar. +# """ +# function check_graph(p::GraphPolytope) +# check_graph(get_graph(p)) +# end + +# function check_graph(graph::AbstractVector{<:AbstractVector}) +# for v in 1:length(graph) +# !isempty(graph[v]) || continue +# for vneig in graph[v] +# vneig ∉ (OPEN,UNSET) || continue +# v ∈ graph[vneig] || return false +# end +# end +# true +# end + +# is_simplex(::GraphPolytope) = false + +# is_n_cube(::GraphPolytope) = false + +# function simplexify(p::GraphPolytope{D}) where D +# @assert !isopen(p) +# X,T = simplexify_interior(p) +# @check X == get_vertex_coordinates(p) +# T, simplex_polytope(Val{D}()) +# end + +# simplex_polytope(::Val{0}) = VERTEX + +# simplex_polytope(::Val{1}) = SEGMENT + +# simplex_polytope(::Val{2}) = TRI + +# simplex_polytope(::Val{3}) = TET + +# function Polytope{0}(p::GraphPolytope,faceid::Integer) +# VERTEX +# end + +# function Polytope{1}(p::GraphPolytope,faceid::Integer) +# SEGMENT +# end + +# function Polytope{D}(p::GraphPolytope{D},faceid::Integer) where D +# p +# end + +# function Polytope{2}(p::Polyhedron,faceid::Integer) +# f_to_v = get_faces(p,2,0) +# coords = get_vertex_coordinates(p) +# vertices = coords[f_to_v[faceid]] +# Polygon(vertices) +# end + +# Base.:(==)(a::GraphPolytope,b::GraphPolytope) = false + +# function num_faces(p::GraphPolytope{D},d::Integer) where D +# if d == 0 +# num_vertices(p) +# elseif d == D +# 1 +# else +# length( get_faces(p,d,0) ) +# end +# end + +# function get_faces(p::GraphPolytope,n::Integer,m::Integer) +# setup_faces!(p,n,m) +# p.n_m_to_nface_to_mfaces[n+1,m+1] +# end + + +# function get_facet_orientations(p::GraphPolytope) +# Ones(num_facets(p)) +# end + +# function get_facet_normal(p::Polyhedron) +# D = 3 +# f_to_v = get_faces(p,D-1,0) +# coords = get_vertex_coordinates(p) +# map(f_to_v) do v +# v1 = coords[v[2]]-coords[v[1]] +# v2 = coords[v[3]]-coords[v[1]] +# v1 /= norm(v1) +# v2 /= norm(v2) +# n = v1 × v2 +# n /= norm(n) +# end +# end + +# function get_facet_normal(p::Polygon) +# D = 2 +# f_to_v = get_faces(p,D-1,0) +# coords = get_vertex_coordinates(p) +# @notimplementedif num_components(eltype(coords)) != 2 +# map(f_to_v) do v +# e = coords[v[2]]-coords[v[1]] +# n = VectorValue( e[2], -e[1] ) +# n /= norm(n) +# end +# end + +# function get_edge_tangent(p::GraphPolytope) +# e_to_v = get_faces(p,1,0) +# coords = get_vertex_coordinates(p) +# map(e_to_v) do v +# e = coords[v[2]]-coords[v[1]] +# e / norm(e) +# end +# end + +# function get_dimranges(p::GraphPolytope) +# setup_dimranges!(p) +# p.dimranges +# end + +# function get_dimrange(p::GraphPolytope,d::Integer) +# setup_dimranges!(p) +# p.dimranges[d+1] +# end + +# function get_faces(p::GraphPolytope) +# setup_face_to_nfaces!(p) +# p.dface_nfaces +# end + +# function get_facedims(p::GraphPolytope) +# setup_facedims!(p) +# p.facedims +# end + +# function setup_dimranges!(p::GraphPolytope{D}) where D +# if length(p.dimranges) < D+1 +# lens = map(i->num_faces(p,i),0:D) +# sums = cumsum(lens) +# resize!(p.dimranges,D+1) +# for (i,(l,s)) in enumerate(zip(lens,sums)) +# p.dimranges[i] = s-l+1 : s +# end +# end +# end + +# function setup_face_to_nfaces!(p::GraphPolytope) +# if length(p.dface_nfaces) < num_vertices(p) +# facedims = get_facedims(p) +# dface_nfaces = Vector{Vector{Int32}}(undef,length(facedims)) +# ofsets = get_offsets(p) +# for (f,d) in enumerate(facedims) +# df = f - ofsets[d+1] +# nfs = Int[] +# for n in 0:d +# union!(nfs,get_faces(p,d,n)[df] .+ ofsets[n+1]) +# end +# dface_nfaces[f] = nfs +# end +# copy!(p.dface_nfaces,dface_nfaces) +# end +# nothing +# end + +# function setup_facedims!(p::GraphPolytope) +# if length(p.facedims) < num_vertices(p) +# dimranges = get_dimranges(p) +# n_faces = dimranges[end][end] +# facedims = _nface_to_nfacedim(n_faces,dimranges) +# copy!(p.facedims,facedims) +# end +# end + +# function setup_faces!(p::GraphPolytope{D},dimfrom,dimto) where D +# if isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) +# return nothing +# end +# if dimfrom == dimto +# setup_nface_to_nface!(p,dimfrom) +# elseif dimfrom == D +# setup_cell_to_faces!(p,dimto) +# elseif dimto == 0 +# setup_face_to_vertices!(p,dimfrom) +# elseif dimfrom > dimto +# setup_nface_to_mface!(p,dimfrom,dimto) +# else +# setup_nface_to_mface_dual!(p,dimto,dimfrom) +# end +# nothing +# end + +# function setup_face_to_vertices!(p::GraphPolytope,d) +# if !isassigned(p.n_m_to_nface_to_mfaces,d+1,1) +# df_to_v = generate_face_to_vertices(p,d) +# p.n_m_to_nface_to_mfaces[d+1,1] = df_to_v +# end +# end + +# function setup_cell_to_faces!(p::GraphPolytope{D},d) where D +# if !isassigned(p.n_m_to_nface_to_mfaces,D+1,d+1) +# num_f = num_faces(p,d) +# c_to_f = [ collect(1:num_f) ] +# p.n_m_to_nface_to_mfaces[D+1,d+1] = c_to_f +# end +# end + +# function setup_nface_to_nface!(p::GraphPolytope,n) +# if !isassigned(p.n_m_to_nface_to_mfaces,n+1,n+1) +# num_nf = num_faces(p,n) +# nf_to_nf = map(i->Int[i],1:num_nf) +# p.n_m_to_nface_to_mfaces[n+1,n+1] = nf_to_nf +# end +# end + +# function setup_nface_to_mface!(p::Polyhedron,n,m) +# if !isassigned(p.n_m_to_nface_to_mfaces,n+1,m+1) +# @notimplementedif n != 2 && m != 1 +# nf_to_v = get_faces(p,n,0) +# v_to_mf = get_faces(p,0,m) +# nf_to_ftype = map( length, nf_to_v ) +# ftype_to_lmf_to_lv = map(1:maximum(nf_to_ftype)) do ftype +# map(1:ftype) do i +# inext = i == ftype ? 1 : i+1 +# Int[i,inext] +# end +# end +# nf_to_mf = find_cell_to_faces( +# Table(nf_to_v), +# ftype_to_lmf_to_lv, +# nf_to_ftype, +# Table(v_to_mf)) +# p.n_m_to_nface_to_mfaces[n+1,m+1] = Vector(nf_to_mf) +# end +# end + +# function setup_nface_to_mface_dual!(p::GraphPolytope,dimto,dimfrom) +# if !isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) +# @assert dimfrom < dimto +# nf_to_mf = get_faces(p,dimto,dimfrom) +# n_mf = num_faces(p,dimfrom) +# mf_to_nf = generate_cells_around(Table(nf_to_mf),n_mf) +# p.n_m_to_nface_to_mfaces[dimfrom+1,dimto+1] = Vector(mf_to_nf) +# end +# end + +# function generate_face_to_vertices(p::Polyhedron,d::Integer) +# if d == 1 +# generate_edge_to_vertices(p) +# elseif d == 2 +# generate_facet_to_vertices(p) +# else +# @unreachable +# end +# end + +# function generate_face_to_vertices(p::Polygon,d::Integer) +# if d == 1 +# generate_facet_to_vertices(p) +# else +# @unreachable +# end +# end + +# function generate_facet_to_vertices(poly::Polyhedron) +# D = 3 +# istouch = map( i -> falses(length(i)), get_graph(poly) ) +# T = Vector{Int32}[] +# for v in 1:num_vertices(poly) +# isactive(poly,v) || continue +# for i in 1:length(get_graph(poly)[v]) +# !istouch[v][i] || continue +# istouch[v][i] = true +# vcurrent = v +# vnext = get_graph(poly)[v][i] +# vnext ∉ (OPEN,UNSET) || continue +# k = [v] +# while vnext != v +# inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) +# inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 +# istouch[vnext][inext] = true +# vcurrent = vnext +# vnext = get_graph(poly)[vnext][inext] +# vnext ∉ (OPEN,UNSET) || break +# push!(k,vcurrent) +# end +# if length(k) >=D +# push!(T,k) +# end +# end +# end +# T +# end + +# function generate_edge_to_vertices(poly::GraphPolytope) +# graph = get_graph(poly) +# T = Vector{Int32}[] +# for v in 1:length(graph) +# for vneig in graph[v] +# if vneig > v +# push!(T,[v,vneig]) +# end +# end +# end +# T +# end + +# function generate_facet_to_vertices(poly::Polygon) +# graph = get_graph(poly) +# T = Vector{Int32}[] +# for v in 1:length(graph) +# vnext = v == length(graph) ? 1 : v+1 +# @assert vnext ∈ graph[v] +# push!(T,[v,vnext]) +# end +# T +# end + +# function Base.copy(poly::Polyhedron) +# vertices = get_vertex_coordinates(poly) +# graph = get_graph(poly) +# open = isopen(poly) +# data = get_metadata(poly) +# data = !isnothing(data) ? copy(data) : nothing +# Polyhedron(vertices,graph,open,data) +# end + +# function simplexify_interior(p::Polygon) +# @assert !isopen(p) +# e_to_v = generate_facet_to_vertices(p) +# T = Vector{Int32}[] +# if length(e_to_v) > 0 +# v0 = e_to_v[1][1] +# for verts in e_to_v +# if v0 ∉ verts +# push!(T,[v0,verts[1],verts[2]]) +# end +# end +# end +# get_vertex_coordinates(p),T +# end + +# function simplexify_interior(poly::Polyhedron) +# !isopen(poly) || return simplexify_surface(poly) +# vstart = fill(UNSET,num_vertices(poly)) +# stack = Int32[] +# for v in 1:num_vertices(poly) +# isactive(poly,v) || continue +# vstart[v] == UNSET || continue +# vstart[v] = v +# empty!(stack) +# push!(stack,v) +# while !isempty(stack) +# vcurrent = pop!(stack) +# for vneig in get_graph(poly)[vcurrent] +# if vstart[vneig] == UNSET +# vstart[vneig] = v +# push!(stack,vneig) +# end +# end +# end +# end +# istouch = map( i -> falses(length(i)), get_graph(poly) ) +# vertex_coordinates = get_vertex_coordinates(poly) +# T = Vector{Int32}[] +# X = vertex_coordinates +# for v in 1:num_vertices(poly) +# isactive(poly,v) || continue +# for i in 1:length(get_graph(poly)[v]) +# !istouch[v][i] || continue +# istouch[v][i] = true +# vcurrent = v +# vnext = get_graph(poly)[v][i] +# while vnext != v +# inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) +# !isnothing(inext) || break +# inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 +# istouch[vnext][inext] = true +# vcurrent = vnext +# vnext = get_graph(poly)[vnext][inext] +# @assert vcurrent ≠ vnext +# vcurrent ≠ vnext || break +# if v ∉ (vstart[v],vcurrent,vnext) +# k = [vstart[v],v,vcurrent,vnext] +# push!(T,k) +# end +# end +# end +# end +# X,T +# end + +# function simplexify_surface(poly::Polyhedron) +# istouch = map( i -> falses(length(i)), get_graph(poly) ) +# T = Vector{Int32}[] +# for v in 1:num_vertices(poly) +# isactive(poly,v) || continue +# for i in 1:length(get_graph(poly)[v]) +# !istouch[v][i] || continue +# istouch[v][i] = true +# vcurrent = v +# vnext = get_graph(poly)[v][i] +# vnext ∉ (OPEN,UNSET) || continue +# while vnext != v +# inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) +# inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 +# istouch[vnext][inext] = true +# vcurrent = vnext +# vnext = get_graph(poly)[vnext][inext] +# vnext ∉ (OPEN,UNSET) || break +# if v ∉ (vcurrent,vnext) +# k = [v,vcurrent,vnext] +# push!(T,k) +# end +# end +# end +# end +# get_vertex_coordinates(poly),T +# end function GraphPolytope{D}(t::GridTopology{Dc,D};metadata=nothing) where {Dc,D} graph = compute_graph(t) @@ -130,538 +675,6 @@ function set_polytope_data!(p::GraphPolytope,t::GridTopology,::Nothing) p end -function get_polytope_data(p::Polytope;metadata=nothing) - get_polytope_data(p,metadata) -end - -function get_polytope_data(p::Polytope,::Nothing) - nothing -end - -function Polygon(p::Polytope{2},vertices::AbstractVector{<:Point};kwargs...) - if p == TRI - e_v_graph = [[2,3],[3,1],[1,2]] - perm = [1,2,3] - elseif p == QUAD - e_v_graph = [[2, 3],[4, 1],[1, 4],[3, 2]] - perm = [1,2,4,3] - else - @unreachable - end - vertices = map(Reindex(vertices),perm) - e_v_graph = map(Reindex(e_v_graph),perm) - e_v_graph = map(i->replace(i, Dict(perm .=> 1:length(perm))...),e_v_graph) - e_v_graph = map(i->Int32.(i),e_v_graph) - data = get_polytope_data(p;kwargs...) - Polygon(vertices,e_v_graph,data) -end - -function Polygon(vertices::AbstractVector{<:Point};kwargs...) - graph = map(1:length(vertices)) do i - inext = i == length(vertices) ? 1 : i+1 - iprev = i == 1 ? length(vertices) : i-1 - Int32[iprev,inext] - end - Polygon(vertices,graph;kwargs...) -end - -function Polyhedron(p::Polytope{3},vertices::AbstractVector{<:Point};kwargs...) - if p == TET - e_v_graph = [[2,4,3],[3,4,1],[1,4,2],[1,2,3]] - elseif p == HEX - e_v_graph = [ - [5, 2, 3], - [6, 4, 1], - [7, 1, 4], - [8, 3, 2], - [1, 7, 6], - [2, 5, 8], - [3, 8, 5], - [4, 6, 7] ] - else - @unreachable - end - e_v_graph = map(i->Int32.(i),e_v_graph) - data = get_polytope_data(p;kwargs...) - Polyhedron(vertices,e_v_graph,data) -end - -function GraphPolytope{D}(p::Polytope;kwargs...) where D - GraphPolytope{D}(p,get_vertex_coordinates(p);kwargs...) -end - -# Interface - -num_dims(::T) where T<:GraphPolytope = num_dims(T) - -num_dims(::Type{<:GraphPolytope{D}}) where D = D - -num_cell_dims(a::GraphPolytope) = num_dims(a) - -point_eltype(::T) where T<:GraphPolytope = point_eltype(T) - -point_eltype(::Type{<:GraphPolytope{D,Dp,T}}) where {D,Dp,T} = T - -num_point_dims(::Type{<:GraphPolytope{D,Dp}}) where {D,Dp} = Dp - -num_vertices(a::GraphPolytope) = length(a.vertices) - -get_vertex_coordinates(a::GraphPolytope) = a.vertices - -Base.getindex(a::GraphPolytope,i::Integer) = a.vertices[i] - -""" - get_graph(p::GraphPolytope) -> Vector{Vector{Int32}} - - It returns the edge-vertex graph of the polytope `p`. -""" -@inline get_graph(a::GraphPolytope) = a.edge_vertex_graph - - -""" - get_data(p::GraphPolytope) - - It return the metadata stored in the polytope `p`. -""" -get_data(a::GraphPolytope) = a.metadata - - -""" - isopen(p::GraphPolytope) -> Bool - - In return whether the polytope is watter tight or not. -""" -Base.isopen(a::GraphPolytope) = a.isopen - -""" - isactive(p::GraphPolytope,vertex::Integer) -> Bool - - It returns whether a vertex is connected to any other vertex. -""" -function isactive(p::Polyhedron,vertex::Integer) - !isempty( get_graph(p)[vertex] ) -end - -""" - check_graph(p::GraphPolytope) -> Bool - - It checks whether the graph is well-constructed. The graph must be oriented - and planar. -""" -function check_graph(p::GraphPolytope) - check_graph(get_graph(p)) -end - -function check_graph(graph::AbstractVector{<:AbstractVector}) - for v in 1:length(graph) - !isempty(graph[v]) || continue - for vneig in graph[v] - vneig ∉ (OPEN,UNSET) || continue - v ∈ graph[vneig] || return false - end - end - true -end - -is_simplex(::GraphPolytope) = false - -is_n_cube(::GraphPolytope) = false - -function simplexify(p::GraphPolytope{D}) where D - @assert !isopen(p) - X,T = simplexify_interior(p) - @check X == get_vertex_coordinates(p) - T, simplex_polytope(Val{D}()) -end - -simplex_polytope(::Val{0}) = VERTEX - -simplex_polytope(::Val{1}) = SEGMENT - -simplex_polytope(::Val{2}) = TRI - -simplex_polytope(::Val{3}) = TET - -function Polytope{0}(p::GraphPolytope,faceid::Integer) - VERTEX -end - -function Polytope{1}(p::GraphPolytope,faceid::Integer) - SEGMENT -end - -function Polytope{D}(p::GraphPolytope{D},faceid::Integer) where D - p -end - -function Polytope{2}(p::Polyhedron,faceid::Integer) - f_to_v = get_faces(p,2,0) - coords = get_vertex_coordinates(p) - vertices = coords[f_to_v[faceid]] - Polygon(vertices) -end - -Base.:(==)(a::GraphPolytope,b::GraphPolytope) = false - -function num_faces(p::GraphPolytope{D},d::Integer) where D - if d == 0 - num_vertices(p) - elseif d == D - 1 - else - length( get_faces(p,d,0) ) - end -end - -function get_faces(p::GraphPolytope,n::Integer,m::Integer) - setup_faces!(p,n,m) - p.n_m_to_nface_to_mfaces[n+1,m+1] -end - - -function get_facet_orientations(p::GraphPolytope) - Ones(num_facets(p)) -end - -function get_facet_normal(p::Polyhedron) - D = 3 - f_to_v = get_faces(p,D-1,0) - coords = get_vertex_coordinates(p) - map(f_to_v) do v - v1 = coords[v[2]]-coords[v[1]] - v2 = coords[v[3]]-coords[v[1]] - v1 /= norm(v1) - v2 /= norm(v2) - n = v1 × v2 - n /= norm(n) - end -end - -function get_facet_normal(p::Polygon) - D = 2 - f_to_v = get_faces(p,D-1,0) - coords = get_vertex_coordinates(p) - @notimplementedif num_components(eltype(coords)) != 2 - map(f_to_v) do v - e = coords[v[2]]-coords[v[1]] - n = VectorValue( e[2], -e[1] ) - n /= norm(n) - end -end - -function get_edge_tangent(p::GraphPolytope) - e_to_v = get_faces(p,1,0) - coords = get_vertex_coordinates(p) - map(e_to_v) do v - e = coords[v[2]]-coords[v[1]] - e / norm(e) - end -end - -function get_dimranges(p::GraphPolytope) - setup_dimranges!(p) - p.dimranges -end - -function get_dimrange(p::GraphPolytope,d::Integer) - setup_dimranges!(p) - p.dimranges[d+1] -end - -function get_faces(p::GraphPolytope) - setup_face_to_nfaces!(p) - p.dface_nfaces -end - -function get_facedims(p::GraphPolytope) - setup_facedims!(p) - p.facedims -end - -function setup_dimranges!(p::GraphPolytope{D}) where D - if length(p.dimranges) < D+1 - lens = map(i->num_faces(p,i),0:D) - sums = cumsum(lens) - resize!(p.dimranges,D+1) - for (i,(l,s)) in enumerate(zip(lens,sums)) - p.dimranges[i] = s-l+1 : s - end - end -end - -function setup_face_to_nfaces!(p::GraphPolytope) - if length(p.dface_nfaces) < num_vertices(p) - facedims = get_facedims(p) - dface_nfaces = Vector{Vector{Int32}}(undef,length(facedims)) - ofsets = get_offsets(p) - for (f,d) in enumerate(facedims) - df = f - ofsets[d+1] - nfs = Int[] - for n in 0:d - union!(nfs,get_faces(p,d,n)[df] .+ ofsets[n+1]) - end - dface_nfaces[f] = nfs - end - copy!(p.dface_nfaces,dface_nfaces) - end - nothing -end - -function setup_facedims!(p::GraphPolytope) - if length(p.facedims) < num_vertices(p) - dimranges = get_dimranges(p) - n_faces = dimranges[end][end] - facedims = _nface_to_nfacedim(n_faces,dimranges) - copy!(p.facedims,facedims) - end -end - -function setup_faces!(p::GraphPolytope{D},dimfrom,dimto) where D - if isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) - return nothing - end - if dimfrom == dimto - setup_nface_to_nface!(p,dimfrom) - elseif dimfrom == D - setup_cell_to_faces!(p,dimto) - elseif dimto == 0 - setup_face_to_vertices!(p,dimfrom) - elseif dimfrom > dimto - setup_nface_to_mface!(p,dimfrom,dimto) - else - setup_nface_to_mface_dual!(p,dimto,dimfrom) - end - nothing -end - -function setup_face_to_vertices!(p::GraphPolytope,d) - if !isassigned(p.n_m_to_nface_to_mfaces,d+1,1) - df_to_v = generate_face_to_vertices(p,d) - p.n_m_to_nface_to_mfaces[d+1,1] = df_to_v - end -end - -function setup_cell_to_faces!(p::GraphPolytope{D},d) where D - if !isassigned(p.n_m_to_nface_to_mfaces,D+1,d+1) - num_f = num_faces(p,d) - c_to_f = [ collect(1:num_f) ] - p.n_m_to_nface_to_mfaces[D+1,d+1] = c_to_f - end -end - -function setup_nface_to_nface!(p::GraphPolytope,n) - if !isassigned(p.n_m_to_nface_to_mfaces,n+1,n+1) - num_nf = num_faces(p,n) - nf_to_nf = map(i->Int[i],1:num_nf) - p.n_m_to_nface_to_mfaces[n+1,n+1] = nf_to_nf - end -end - -function setup_nface_to_mface!(p::Polyhedron,n,m) - if !isassigned(p.n_m_to_nface_to_mfaces,n+1,m+1) - @notimplementedif n != 2 && m != 1 - nf_to_v = get_faces(p,n,0) - v_to_mf = get_faces(p,0,m) - nf_to_ftype = map( length, nf_to_v ) - ftype_to_lmf_to_lv = map(1:maximum(nf_to_ftype)) do ftype - map(1:ftype) do i - inext = i == ftype ? 1 : i+1 - Int[i,inext] - end - end - nf_to_mf = find_cell_to_faces( - Table(nf_to_v), - ftype_to_lmf_to_lv, - nf_to_ftype, - Table(v_to_mf)) - p.n_m_to_nface_to_mfaces[n+1,m+1] = Vector(nf_to_mf) - end -end - -function setup_nface_to_mface_dual!(p::GraphPolytope,dimto,dimfrom) - if !isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) - @assert dimfrom < dimto - nf_to_mf = get_faces(p,dimto,dimfrom) - n_mf = num_faces(p,dimfrom) - mf_to_nf = generate_cells_around(Table(nf_to_mf),n_mf) - p.n_m_to_nface_to_mfaces[dimfrom+1,dimto+1] = Vector(mf_to_nf) - end -end - -function generate_face_to_vertices(p::Polyhedron,d::Integer) - if d == 1 - generate_edge_to_vertices(p) - elseif d == 2 - generate_facet_to_vertices(p) - else - @unreachable - end -end - -function generate_face_to_vertices(p::Polygon,d::Integer) - if d == 1 - generate_facet_to_vertices(p) - else - @unreachable - end -end - -function generate_facet_to_vertices(poly::Polyhedron) - D = 3 - istouch = map( i -> falses(length(i)), get_graph(poly) ) - T = Vector{Int32}[] - for v in 1:num_vertices(poly) - isactive(poly,v) || continue - for i in 1:length(get_graph(poly)[v]) - !istouch[v][i] || continue - istouch[v][i] = true - vcurrent = v - vnext = get_graph(poly)[v][i] - vnext ∉ (OPEN,UNSET) || continue - k = [v] - while vnext != v - inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) - inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 - istouch[vnext][inext] = true - vcurrent = vnext - vnext = get_graph(poly)[vnext][inext] - vnext ∉ (OPEN,UNSET) || break - push!(k,vcurrent) - end - if length(k) >=D - push!(T,k) - end - end - end - T -end - -function generate_edge_to_vertices(poly::GraphPolytope) - graph = get_graph(poly) - T = Vector{Int32}[] - for v in 1:length(graph) - for vneig in graph[v] - if vneig > v - push!(T,[v,vneig]) - end - end - end - T -end - -function generate_facet_to_vertices(poly::Polygon) - graph = get_graph(poly) - T = Vector{Int32}[] - for v in 1:length(graph) - vnext = v == length(graph) ? 1 : v+1 - @assert vnext ∈ graph[v] - push!(T,[v,vnext]) - end - T -end - -function Base.copy(poly::Polyhedron) - vertices = get_vertex_coordinates(poly) - graph = get_graph(poly) - open = isopen(poly) - data = get_data(poly) - data = !isnothing(data) ? copy(data) : nothing - Polyhedron(vertices,graph,open,data) -end - -function simplexify_interior(p::Polygon) - @assert !isopen(p) - e_to_v = generate_facet_to_vertices(p) - T = Vector{Int32}[] - if length(e_to_v) > 0 - v0 = e_to_v[1][1] - for verts in e_to_v - if v0 ∉ verts - push!(T,[v0,verts[1],verts[2]]) - end - end - end - get_vertex_coordinates(p),T -end - -function simplexify_interior(poly::Polyhedron) - !isopen(poly) || return simplexify_surface(poly) - vstart = fill(UNSET,num_vertices(poly)) - stack = Int32[] - for v in 1:num_vertices(poly) - isactive(poly,v) || continue - vstart[v] == UNSET || continue - vstart[v] = v - empty!(stack) - push!(stack,v) - while !isempty(stack) - vcurrent = pop!(stack) - for vneig in get_graph(poly)[vcurrent] - if vstart[vneig] == UNSET - vstart[vneig] = v - push!(stack,vneig) - end - end - end - end - istouch = map( i -> falses(length(i)), get_graph(poly) ) - vertex_coordinates = get_vertex_coordinates(poly) - T = Vector{Int32}[] - X = vertex_coordinates - for v in 1:num_vertices(poly) - isactive(poly,v) || continue - for i in 1:length(get_graph(poly)[v]) - !istouch[v][i] || continue - istouch[v][i] = true - vcurrent = v - vnext = get_graph(poly)[v][i] - while vnext != v - inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) - !isnothing(inext) || break - inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 - istouch[vnext][inext] = true - vcurrent = vnext - vnext = get_graph(poly)[vnext][inext] - @assert vcurrent ≠ vnext - vcurrent ≠ vnext || break - if v ∉ (vstart[v],vcurrent,vnext) - k = [vstart[v],v,vcurrent,vnext] - push!(T,k) - end - end - end - end - X,T -end - -function simplexify_surface(poly::Polyhedron) - istouch = map( i -> falses(length(i)), get_graph(poly) ) - T = Vector{Int32}[] - for v in 1:num_vertices(poly) - isactive(poly,v) || continue - for i in 1:length(get_graph(poly)[v]) - !istouch[v][i] || continue - istouch[v][i] = true - vcurrent = v - vnext = get_graph(poly)[v][i] - vnext ∉ (OPEN,UNSET) || continue - while vnext != v - inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) - inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 - istouch[vnext][inext] = true - vcurrent = vnext - vnext = get_graph(poly)[vnext][inext] - vnext ∉ (OPEN,UNSET) || break - if v ∉ (vcurrent,vnext) - k = [v,vcurrent,vnext] - push!(T,k) - end - end - end - end - get_vertex_coordinates(poly),T -end - """ PolyhedronData @@ -706,7 +719,7 @@ function set_polytope_data!(p::GraphPolytope,t::GridTopology,::ClipPolytopeData) p end -function get_polytope_data(p::Polytope,::ClipPolytopeData) +function generate_polytope_data(p::Polytope,::ClipPolytopeData) polyhedron_data(p) end @@ -781,7 +794,7 @@ end """ function split(p::Polyhedron,Π,side=:both;invert=false) @assert side ∈ (:both,:left,:right) - distances = get_plane_distances(get_data(p),Π) + distances = get_plane_distances(get_metadata(p),Π) _sign = invert ? (-) : (+) distances = lazy_map(_sign,distances) smin = Inf @@ -795,8 +808,8 @@ function split(p::Polyhedron,Π,side=:both;invert=false) return nothing,p end if smax < 0 - if has_coplanars(get_data(p),Π) - add_plane!(get_data(p),Π) + if has_coplanars(get_metadata(p),Π) + add_plane!(get_metadata(p),Π) end return p,nothing end @@ -806,7 +819,7 @@ function split(p::Polyhedron,Π,side=:both;invert=false) out_graph = _copy(get_graph(p)) end ≶ = side ∈ (:both,:left) ? (≥) : (<) - data = copy( get_data(p) ) + data = copy( get_metadata(p) ) D = num_dims(p) for v in 1:num_vertices(p) isactive(p,v) || continue @@ -851,11 +864,11 @@ end function simplexify_boundary(poly::Polyhedron{3},stl::GridTopology) D = 3 stack = Int32[] - v_to_pv = get_data(poly).vertex_to_parent_vertex + v_to_pv = get_metadata(poly).vertex_to_parent_vertex if isopen(poly) - v_to_Π = get_data(poly).vertex_to_original_faces + v_to_Π = get_metadata(poly).vertex_to_original_faces else - v_to_Π = get_data(poly).vertex_to_planes + v_to_Π = get_metadata(poly).vertex_to_planes end facedims = get_facedims(stl) facet_list = Int32[] @@ -1047,7 +1060,7 @@ function restrict(p::Polyhedron,nodes) graph = get_graph(p)[nodes] f = i -> Int32( i ∈ nodes ? findfirst(isequal(i),nodes) : OPEN ) graph = map(i->map(f,i),graph) - data = restrict(get_data(p),nodes) + data = restrict(get_metadata(p),nodes) vertices = get_vertex_coordinates(p)[nodes] isopen = true Polyhedron(vertices,graph,isopen,data) @@ -1097,7 +1110,7 @@ function get_original_faces(p::Polyhedron,stl::GridTopology,::Val{d};empty) wher end function collect_original_faces(p::Polyhedron,stl::GridTopology,d::Integer) - v_to_f = get_data(p).vertex_to_original_faces + v_to_f = get_metadata(p).vertex_to_original_faces facedims = get_facedims(stl) faces = Int32[] for v in 1:num_vertices(p) @@ -1121,7 +1134,7 @@ function has_original_facet(p::Polyhedron{D},face::Integer;empty=false) where D end function has_original_face(p::Polyhedron,face::Integer,::Val{0};empty=false) - v_to_f = get_data(p).vertex_to_original_faces + v_to_f = get_metadata(p).vertex_to_original_faces for v in 1:num_vertices(p) if isactive(p,v) && face ∈ v_to_f[v] return true @@ -1131,8 +1144,8 @@ function has_original_face(p::Polyhedron,face::Integer,::Val{0};empty=false) end function has_original_face(p::Polyhedron,face::Integer,::Val{1};empty=true) - v_to_f = get_data(p).vertex_to_original_faces - v_to_v = get_data(p).vertex_to_parent_vertex + v_to_f = get_metadata(p).vertex_to_original_faces + v_to_v = get_metadata(p).vertex_to_parent_vertex for v in 1:num_vertices(p) if isactive(p,v) && face ∈ v_to_f[v] for vneig in get_graph(p)[v] @@ -1148,8 +1161,8 @@ end function has_original_face(p::Polyhedron,face::Integer,::Val{2};empty=false) d = 2 - v_to_f = get_data(p).vertex_to_original_faces - v_to_v = get_data(p).vertex_to_parent_vertex + v_to_f = get_metadata(p).vertex_to_original_faces + v_to_v = get_metadata(p).vertex_to_parent_vertex for v in 1:num_vertices(p) if isactive(p,v) && face ∈ v_to_f[v] for vneig in get_graph(p)[v] @@ -1200,7 +1213,7 @@ end function has_faces(p::Polyhedron,::Val{2}) d = 2 - v_to_v = get_data(p).vertex_to_parent_vertex + v_to_v = get_metadata(p).vertex_to_parent_vertex for v in 1:num_vertices(p) isactive(p,v) || continue for vneig in get_graph(p)[v] @@ -1317,8 +1330,8 @@ end zero. """ function compute_distances!(p::Polyhedron,Π,faces;atol=0) - data = get_data(p) - v_to_f = get_data(p).vertex_to_original_faces + data = get_metadata(p) + v_to_f = get_metadata(p).vertex_to_original_faces Π_to_v_to_d = get_plane_distances(data) Π_ids = get_plane_ids(data) Π_to_rΠ = data.plane_to_ref_plane @@ -1401,12 +1414,12 @@ function compute_graph(stl::GridTopology{2}) push!(graph[v],OPEN) end end - check_graph(graph) || error("Unable to build vertex-edge graph") + check_polytope_graph(graph) || error("Unable to build vertex-edge graph") graph end function set_original_faces!(p::Polyhedron,a...) - set_original_faces!(get_data(p),a...) + set_original_faces!(get_metadata(p),a...) p end @@ -1697,7 +1710,7 @@ function get_active_planes(Γ::Polyhedron,K::Polyhedron,stl::GridTopology) end function restrict_planes!(poly::Polyhedron,planes) - restrict_planes!(get_data(poly),planes) + restrict_planes!(get_metadata(poly),planes) end function restrict_planes!(data::PolyhedronData,planes) @@ -1739,7 +1752,7 @@ function restrict_planes!(data::PolyhedronData,planes) end function _get_used_planes(poly::Polyhedron) - v_to_Π = get_data(poly).vertex_to_planes + v_to_Π = get_metadata(poly).vertex_to_planes planes = Int32[] for v in 1:length(v_to_Π) for Π in v_to_Π[v] @@ -1759,8 +1772,8 @@ end function _append_ref_planes(poly::Polyhedron,planes) ref_planes = Int32[] - Π_to_ref_Π = get_data(poly).plane_to_ref_plane - Π_to_id = get_plane_ids( get_data(poly) ) + Π_to_ref_Π = get_metadata(poly).plane_to_ref_plane + Π_to_id = get_plane_ids( get_metadata(poly) ) for Π in planes i = findfirst( isequal(Π), Π_to_id ) i !== nothing || continue diff --git a/src/STLCutters.jl b/src/STLCutters.jl index 440deabf..508c00b3 100644 --- a/src/STLCutters.jl +++ b/src/STLCutters.jl @@ -22,9 +22,10 @@ using PartitionedArrays using Gridap.Geometry: get_face_to_parent_face using Gridap.Geometry: get_cell_to_parent_cell -using Gridap.Geometry: find_cell_to_faces -using Gridap.Geometry: generate_cells_around -using Gridap.ReferenceFEs: _nface_to_nfacedim +using Gridap.ReferenceFEs: check_polytope_graph +using Gridap.ReferenceFEs: get_graph +using Gridap.ReferenceFEs: get_metadata +using Gridap.ReferenceFEs: isactive using GridapEmbedded.Distributed: consistent_bgcell_to_inoutcut! using GridapEmbedded.Distributed: consistent_bgfacet_to_inoutcut! using GridapEmbedded.Distributed: DistributedEmbeddedDiscretization @@ -49,12 +50,16 @@ import Gridap.ReferenceFEs: get_offset import Gridap.ReferenceFEs: get_offsets import Gridap.ReferenceFEs: get_facedims import Gridap.ReferenceFEs: simplexify +import Gridap.ReferenceFEs: simplexify_interior +import Gridap.ReferenceFEs: simplexify_surface +import Gridap.ReferenceFEs: generate_polytope_data import Gridap.ReferenceFEs: get_bounding_box import Gridap.ReferenceFEs: get_facet_orientations import Gridap.ReferenceFEs: get_facet_normal import Gridap.ReferenceFEs: get_edge_tangent import Gridap.ReferenceFEs: get_dimranges import Gridap.ReferenceFEs: get_dimrange +import Gridap.ReferenceFEs: GraphPolytope import Gridap.Geometry: num_cells import Gridap.Geometry: get_cell_vertices import Gridap.Geometry: get_polytopes diff --git a/src/SubTriangulations.jl b/src/SubTriangulations.jl index 2703ab1c..73bcd1ab 100644 --- a/src/SubTriangulations.jl +++ b/src/SubTriangulations.jl @@ -937,8 +937,8 @@ function is_facet_in_facet(poly::Polyhedron,facet,plane;inside,atol=0) return true end end - v_to_f = get_data(poly).vertex_to_original_faces - distances = get_plane_distances(get_data(poly),plane) + v_to_f = get_metadata(poly).vertex_to_original_faces + distances = get_plane_distances(get_metadata(poly),plane) smax = -Inf smin = Inf for v in 1:num_vertices(poly) @@ -1586,7 +1586,7 @@ function _split_reflex_face( end function _one_face_polyhedron(poly::Polyhedron,face::Integer) - v_to_f = get_data(poly).vertex_to_original_faces + v_to_f = get_metadata(poly).vertex_to_original_faces nodes = Int32[] for v in 1:num_vertices(poly) isactive(poly,v) || continue diff --git a/test/PolyhedraTests.jl b/test/PolyhedraTests.jl index d08f6b59..daae7bf9 100644 --- a/test/PolyhedraTests.jl +++ b/test/PolyhedraTests.jl @@ -8,6 +8,7 @@ using Gridap.Geometry using Gridap.Arrays using STLCutters + using STLCutters: Polyhedron using STLCutters: Polygon using STLCutters: STL @@ -17,116 +18,24 @@ using STLCutters: split using STLCutters: surface, volume using STLCutters: get_facet_planes using STLCutters: compute_distances! -using STLCutters: check_graph using STLCutters: compute_stl_model using STLCutters: read_stl using STLCutters: merge_nodes using STLCutters: simplexify_cell_boundary using STLCutters: compute_grid using STLCutters: clipping +using STLCutters: check_polytope_graph -p = Polygon(TRI) -@test check_graph(p) -@test get_faces(p,0,0) == [[1],[2],[3]] -@test get_faces(p,1,0) == [[1,2],[2,3],[3,1]] -@test get_faces(p,2,0) == [[1,2,3]] -@test get_faces(p,0,1) == [[1,3],[1,2],[2,3]] -@test get_faces(p,1,1) == [[1],[2],[3]] -@test get_faces(p,2,1) == [[1,2,3]] -@test get_faces(p,0,2) == [[1],[1],[1]] -@test get_faces(p,1,2) == [[1],[1],[1]] -@test get_faces(p,2,2) == [[1]] -@test get_facedims(p) == [0,0,0,1,1,1,2] -@test Polytope{2}(p,1) === p -@test Polytope{1}(p,1) == SEGMENT -@test Polytope{0}(p,1) == VERTEX -@test simplexify(p) == ([[1,2,3]],TRI) - -p = Polygon(QUAD) -@test check_graph(p) -@test get_faces(p,0,0) == [[1],[2],[3],[4]] -@test get_faces(p,1,0) == [[1,2],[2,3],[3,4],[4,1]] -@test get_faces(p,2,0) == [[1,2,3,4]] -@test get_faces(p,0,1) == [[1,4],[1,2],[2,3],[3,4]] -@test get_faces(p,1,1) == [[1],[2],[3],[4]] -@test get_faces(p,2,1) == [[1,2,3,4]] -@test get_faces(p,0,2) == [[1],[1],[1],[1]] -@test get_faces(p,1,2) == [[1],[1],[1],[1]] -@test get_faces(p,2,2) == [[1]] -@test get_facedims(p) == [0,0,0,0,1,1,1,1,2] -@test Polytope{2}(p,1) === p -@test Polytope{1}(p,1) == SEGMENT -@test Polytope{0}(p,1) == VERTEX -@test simplexify(p) == ([[1,2,3],[1,3,4]],TRI) - -p = Polyhedron(TET) -@test check_graph(p) -@test get_faces(p,0,0) == [[1],[2],[3],[4]] -@test get_faces(p,1,0) == [[1,2],[1,4],[1,3],[2,3],[2,4],[3,4]] -@test get_faces(p,2,0) == [[1,2,3],[1,4,2],[1,3,4],[2,4,3]] -@test get_faces(p,3,0) == [[1,2,3,4]] -@test get_faces(p,0,1) == [[1,2,3],[1,4,5],[3,4,6],[2,5,6]] -@test get_faces(p,1,1) == [[1],[2],[3],[4],[5],[6]] -@test get_faces(p,2,1) == [[1,4,3],[2,5,1],[3,6,2],[5,6,4]] -@test get_faces(p,3,1) == [[1,2,3,4,5,6]] -@test get_faces(p,0,2) == [[1,2,3],[1,2,4],[1,3,4],[2,3,4]] -@test get_faces(p,1,2) == [[1,2],[2,3],[1,3],[1,4],[2,4],[3,4]] -@test get_faces(p,2,2) == [[1],[2],[3],[4]] -@test get_faces(p,3,2) == [[1,2,3,4]] -@test get_faces(p,0,3) == [[1],[1],[1],[1]] -@test get_faces(p,1,3) == [[1],[1],[1],[1],[1],[1]] -@test get_faces(p,2,3) == [[1],[1],[1],[1]] -@test get_faces(p,3,3) == [[1]] -@test get_facedims(p) == [0,0,0,0,1,1,1,1,1,1,2,2,2,2,3] -@test Polytope{3}(p,1) === p -@test isa(Polytope{2}(p,1),Polygon) -@test Polytope{1}(p,1) == SEGMENT -@test Polytope{0}(p,1) == VERTEX -@test simplexify(p) == ([[1,2,4,3]],TET) - -p = Polyhedron(HEX) -@test check_graph(p) -@test get_faces(p,0,0) == [[1],[2],[3],[4],[5],[6],[7],[8]] -@test get_faces(p,1,0) == [ - [1,5],[1,2],[1,3],[2,6],[2,4],[3,7],[3,4],[4,8],[5,7],[5,6],[6,8],[7,8]] -@test get_faces(p,2,0) == [ - [1,5,7,3],[1,2,6,5],[1,3,4,2],[2,4,8,6],[3,7,8,4],[5,6,8,7]] -@test get_faces(p,3,0) == [[1,2,3,4,5,6,7,8]] -@test get_faces(p,0,1) == [ - [1,2,3],[2,4,5],[3,6,7],[5,7,8],[1,9,10],[4,10,11],[6,9,12],[8,11,12]] -@test get_faces(p,1,1) == [[1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12]] -@test get_faces(p,2,1) == [ - [1,9,6,3],[2,4,10,1],[3,7,5,2],[5,8,11,4],[6,12,8,7],[10,11,12,9]] -@test get_faces(p,3,1) == [[1,2,3,4,5,6,7,8,9,10,11,12]] -@test get_faces(p,0,2) == [ - [1,2,3],[2,3,4],[1,3,5],[3,4,5],[1,2,6],[2,4,6],[1,5,6],[4,5,6]] -@test get_faces(p,1,2) == [ - [1,2],[2,3],[1,3],[2,4],[3,4],[1,5],[3,5],[4,5],[1,6],[2,6],[4,6],[5,6]] -@test get_faces(p,2,2) == [[1],[2],[3],[4],[5],[6]] -@test get_faces(p,3,2) == [[1,2,3,4,5,6]] -@test get_faces(p,0,3) == [[1],[1],[1],[1],[1],[1],[1],[1]] -@test get_faces(p,1,3) == [[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]] -@test get_faces(p,2,3) == [[1],[1],[1],[1],[1],[1]] -@test get_faces(p,3,3) == [[1]] -@test get_facedims(p) == [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3] -@test Polytope{3}(p,1) === p -@test isa(Polytope{2}(p,1),Polygon) -@test Polytope{1}(p,1) == SEGMENT -@test Polytope{0}(p,1) == VERTEX -@test simplexify(p) == ( - [[1,2,4,8],[1,2,8,6],[1,3,7,8],[1,3,8,4],[1,5,6,8],[1,5,8,7]],TET) -# - p = Polyhedron(TET,metadata=clipping) -@test check_graph(p) +@test check_polytope_graph(p) @test volume(p) ≈ 1/6 @test surface(p) ≈ 3/2 + (√3)/2 p = Polyhedron(HEX,metadata=clipping) p.metadata.vertex_to_planes -@test check_graph(p) +@test check_polytope_graph(p) @test volume(p) ≈ 1 @test surface(p) ≈ 6 @@ -168,10 +77,10 @@ stl = STL(stlmodel) p1 = Polyhedron(stl) p2 = Polyhedron(stltopo) -@test check_graph(p1) +@test check_polytope_graph(p1) @test surface(p1) ≈ 6 -@test check_graph(p2) +@test check_polytope_graph(p2) @test surface(p2) ≈ 6 From fb36c0d8378d874a25d38a9619592bcaf6ad70c0 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Wed, 15 May 2024 11:42:07 +0200 Subject: [PATCH 09/15] adding manifest temporarily --- Manifest.toml | 1328 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1328 insertions(+) create mode 100644 Manifest.toml diff --git a/Manifest.toml b/Manifest.toml new file mode 100644 index 00000000..a3b484ff --- /dev/null +++ b/Manifest.toml @@ -0,0 +1,1328 @@ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.10.3" +manifest_format = "2.0" +project_hash = "1217f800a589467bdf08b3659809d6e1b668de14" + +[[deps.ADTypes]] +git-tree-sha1 = "9b3993053b87311e699ac9e1bcabec5ae7444f65" +uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" +version = "1.2.0" + + [deps.ADTypes.extensions] + ADTypesChainRulesCoreExt = "ChainRulesCore" + ADTypesEnzymeCoreExt = "EnzymeCore" + + [deps.ADTypes.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" + +[[deps.AbstractFFTs]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef" +uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" +version = "1.5.0" +weakdeps = ["ChainRulesCore", "Test"] + + [deps.AbstractFFTs.extensions] + AbstractFFTsChainRulesCoreExt = "ChainRulesCore" + AbstractFFTsTestExt = "Test" + +[[deps.AbstractTrees]] +git-tree-sha1 = "2d9c9a55f9c93e8887ad391fbae72f8ef55e1177" +uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" +version = "0.4.5" + +[[deps.Accessors]] +deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "MacroTools", "Markdown", "Test"] +git-tree-sha1 = "c0d491ef0b135fd7d63cbc6404286bc633329425" +uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" +version = "0.1.36" + + [deps.Accessors.extensions] + AccessorsAxisKeysExt = "AxisKeys" + AccessorsIntervalSetsExt = "IntervalSets" + AccessorsStaticArraysExt = "StaticArrays" + AccessorsStructArraysExt = "StructArrays" + AccessorsUnitfulExt = "Unitful" + + [deps.Accessors.weakdeps] + AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5" + IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" + Requires = "ae029012-a4dd-5104-9daa-d747884805df" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" + Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" + +[[deps.Adapt]] +deps = ["LinearAlgebra", "Requires"] +git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "4.0.4" +weakdeps = ["StaticArrays"] + + [deps.Adapt.extensions] + AdaptStaticArraysExt = "StaticArrays" + +[[deps.AlgebraicMultigrid]] +deps = ["CommonSolve", "LinearAlgebra", "LinearSolve", "Printf", "Reexport", "SparseArrays"] +git-tree-sha1 = "eb3dbbca423d8e8a1d4061b890f775dcd31b8d7c" +uuid = "2169fc97-5a83-5252-b627-83903c6c433c" +version = "0.6.0" + +[[deps.Algoim]] +deps = ["CxxWrap", "LinearAlgebra", "StaticArrays", "algoimWrapper_jll"] +git-tree-sha1 = "28a966d12fdfa7af54170619ea974f2b97c10f89" +uuid = "0eb9048c-21de-4c7a-bfac-056de1940b74" +version = "0.2.0" + +[[deps.ArgCheck]] +git-tree-sha1 = "a3a402a35a2f7e0b87828ccabbd5ebfbebe356b4" +uuid = "dce04be8-c92d-5529-be00-80e4d2c0e197" +version = "2.3.0" + +[[deps.ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" + +[[deps.ArnoldiMethod]] +deps = ["LinearAlgebra", "Random", "StaticArrays"] +git-tree-sha1 = "f87e559f87a45bece9c9ed97458d3afe98b1ebb9" +uuid = "ec485272-7323-5ecc-a04f-4719b315124d" +version = "0.1.0" + +[[deps.ArrayInterface]] +deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"] +git-tree-sha1 = "133a240faec6e074e07c31ee75619c90544179cf" +uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" +version = "7.10.0" + + [deps.ArrayInterface.extensions] + ArrayInterfaceBandedMatricesExt = "BandedMatrices" + ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" + ArrayInterfaceCUDAExt = "CUDA" + ArrayInterfaceCUDSSExt = "CUDSS" + ArrayInterfaceChainRulesExt = "ChainRules" + ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" + ArrayInterfaceReverseDiffExt = "ReverseDiff" + ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" + ArrayInterfaceTrackerExt = "Tracker" + + [deps.ArrayInterface.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" + CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" + CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" + ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" + GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + +[[deps.ArrayLayouts]] +deps = ["FillArrays", "LinearAlgebra"] +git-tree-sha1 = "33207a8be6267bc389d0701e97a9bce6a4de68eb" +uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" +version = "1.9.2" +weakdeps = ["SparseArrays"] + + [deps.ArrayLayouts.extensions] + ArrayLayoutsSparseArraysExt = "SparseArrays" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" + +[[deps.AutoHashEquals]] +deps = ["Pkg"] +git-tree-sha1 = "daaeb6f7f77b88c072a83a2451801818acb5c63b" +uuid = "15f4f7f2-30c1-5605-9d31-71845cf9641f" +version = "2.1.0" + +[[deps.BSON]] +git-tree-sha1 = "4c3e506685c527ac6a54ccc0c8c76fd6f91b42fb" +uuid = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" +version = "0.3.9" + +[[deps.Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[deps.BitTwiddlingConvenienceFunctions]] +deps = ["Static"] +git-tree-sha1 = "0c5f81f47bbbcf4aea7b2959135713459170798b" +uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b" +version = "0.1.5" + +[[deps.BlockArrays]] +deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra"] +git-tree-sha1 = "9a9610fbe5779636f75229e423e367124034af41" +uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e" +version = "0.16.43" + +[[deps.CPUSummary]] +deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] +git-tree-sha1 = "585a387a490f1c4bd88be67eea15b93da5e85db7" +uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" +version = "0.2.5" + +[[deps.ChainRulesCore]] +deps = ["Compat", "LinearAlgebra"] +git-tree-sha1 = "575cd02e080939a33b6df6c5853d14924c08e35b" +uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" +version = "1.23.0" +weakdeps = ["SparseArrays"] + + [deps.ChainRulesCore.extensions] + ChainRulesCoreSparseArraysExt = "SparseArrays" + +[[deps.CircularArrays]] +deps = ["OffsetArrays"] +git-tree-sha1 = "e24a6f390e5563583bb4315c73035b5b3f3e7ab4" +uuid = "7a955b69-7140-5f4e-a0ed-f168c5e2e749" +version = "1.4.0" + +[[deps.CloseOpenIntervals]] +deps = ["Static", "StaticArrayInterface"] +git-tree-sha1 = "70232f82ffaab9dc52585e0dd043b5e0c6b714f1" +uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9" +version = "0.1.12" + +[[deps.CodecZlib]] +deps = ["TranscodingStreams", "Zlib_jll"] +git-tree-sha1 = "59939d8a997469ee05c4b4944560a820f9ba0d73" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.7.4" + +[[deps.ColorTypes]] +deps = ["FixedPointNumbers", "Random"] +git-tree-sha1 = "b10d0b65641d57b8b4d5e234446582de5047050d" +uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" +version = "0.11.5" + +[[deps.Combinatorics]] +git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860" +uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" +version = "1.0.2" + +[[deps.CommonSolve]] +git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" +uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" +version = "0.2.4" + +[[deps.CommonSubexpressions]] +deps = ["MacroTools", "Test"] +git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" +uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" +version = "0.3.0" + +[[deps.Compat]] +deps = ["TOML", "UUIDs"] +git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "4.15.0" +weakdeps = ["Dates", "LinearAlgebra"] + + [deps.Compat.extensions] + CompatLinearAlgebraExt = "LinearAlgebra" + +[[deps.CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.1.1+0" + +[[deps.CompositionsBase]] +git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad" +uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b" +version = "0.1.2" +weakdeps = ["InverseFunctions"] + + [deps.CompositionsBase.extensions] + CompositionsBaseInverseFunctionsExt = "InverseFunctions" + +[[deps.ConcreteStructs]] +git-tree-sha1 = "f749037478283d372048690eb3b5f92a79432b34" +uuid = "2569d6c7-a4a2-43d3-a901-331e8e4be471" +version = "0.2.3" + +[[deps.ConstructionBase]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "260fd2400ed2dab602a7c15cf10c1933c59930a2" +uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" +version = "1.5.5" + + [deps.ConstructionBase.extensions] + ConstructionBaseIntervalSetsExt = "IntervalSets" + ConstructionBaseStaticArraysExt = "StaticArrays" + + [deps.ConstructionBase.weakdeps] + IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + +[[deps.CpuId]] +deps = ["Markdown"] +git-tree-sha1 = "fcbb72b032692610bfbdb15018ac16a36cf2e406" +uuid = "adafc99b-e345-5852-983c-f28acb93d879" +version = "0.3.1" + +[[deps.CxxWrap]] +deps = ["Libdl", "MacroTools", "libcxxwrap_julia_jll"] +git-tree-sha1 = "3345cb637ca1efb2ebf7f5145558522b92660d1f" +uuid = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" +version = "0.14.2" + +[[deps.DataAPI]] +git-tree-sha1 = "abe83f3a2f1b857aac70ef8b269080af17764bbe" +uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" +version = "1.16.0" + +[[deps.DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "1d0a14036acb104d9e89698bd408f63ab58cdc82" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.20" + +[[deps.DataValueInterfaces]] +git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" +uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" +version = "1.0.0" + +[[deps.Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[deps.DiffResults]] +deps = ["StaticArraysCore"] +git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621" +uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" +version = "1.1.0" + +[[deps.DiffRules]] +deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] +git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" +uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" +version = "1.15.1" + +[[deps.Distances]] +deps = ["LinearAlgebra", "Statistics", "StatsAPI"] +git-tree-sha1 = "66c4c81f259586e8f002eacebc177e1fb06363b0" +uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" +version = "0.10.11" +weakdeps = ["ChainRulesCore", "SparseArrays"] + + [deps.Distances.extensions] + DistancesChainRulesCoreExt = "ChainRulesCore" + DistancesSparseArraysExt = "SparseArrays" + +[[deps.Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.9.3" + +[[deps.Downloads]] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" + +[[deps.EarCut_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "e3290f2d49e661fbd94046d7e3726ffcb2d41053" +uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5" +version = "2.2.4+0" + +[[deps.EnumX]] +git-tree-sha1 = "bdb1942cd4c45e3c678fd11569d5cccd80976237" +uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" +version = "1.0.4" + +[[deps.ExprTools]] +git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" +uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" +version = "0.1.10" + +[[deps.Extents]] +git-tree-sha1 = "2140cd04483da90b2da7f99b2add0750504fc39c" +uuid = "411431e0-e8b7-467b-b5e0-f676ba4f2910" +version = "0.1.2" + +[[deps.FFTW]] +deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"] +git-tree-sha1 = "4820348781ae578893311153d69049a93d05f39d" +uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" +version = "1.8.0" + +[[deps.FFTW_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "c6033cc3892d0ef5bb9cd29b7f2f0331ea5184ea" +uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a" +version = "3.3.10+0" + +[[deps.FastGaussQuadrature]] +deps = ["LinearAlgebra", "SpecialFunctions", "StaticArrays"] +git-tree-sha1 = "fd923962364b645f3719855c88f7074413a6ad92" +uuid = "442a2c76-b920-505d-bb47-c5924d526838" +version = "1.0.2" + +[[deps.FastLapackInterface]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "f4102aab9c7df8691ed09f9c42e34f5ab5458ab9" +uuid = "29a986be-02c6-4525-aec4-84b980013641" +version = "2.0.3" + +[[deps.FileIO]] +deps = ["Pkg", "Requires", "UUIDs"] +git-tree-sha1 = "82d8afa92ecf4b52d78d869f038ebfb881267322" +uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" +version = "1.16.3" + +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[deps.FillArrays]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "0653c0a2396a6da5bc4766c43041ef5fd3efbe57" +uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" +version = "1.11.0" + + [deps.FillArrays.extensions] + FillArraysPDMatsExt = "PDMats" + FillArraysSparseArraysExt = "SparseArrays" + FillArraysStatisticsExt = "Statistics" + + [deps.FillArrays.weakdeps] + PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150" + SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[deps.FiniteDiff]] +deps = ["ArrayInterface", "LinearAlgebra", "Requires", "Setfield", "SparseArrays"] +git-tree-sha1 = "2de436b72c3422940cbe1367611d137008af7ec3" +uuid = "6a86dc24-6348-571c-b903-95158fe2bd41" +version = "2.23.1" + + [deps.FiniteDiff.extensions] + FiniteDiffBandedMatricesExt = "BandedMatrices" + FiniteDiffBlockBandedMatricesExt = "BlockBandedMatrices" + FiniteDiffStaticArraysExt = "StaticArrays" + + [deps.FiniteDiff.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + +[[deps.FixedPointNumbers]] +deps = ["Statistics"] +git-tree-sha1 = "05882d6995ae5c12bb5f36dd2ed3f61c98cbb172" +uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" +version = "0.8.5" + +[[deps.ForwardDiff]] +deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions"] +git-tree-sha1 = "cf0fe81336da9fb90944683b8c41984b08793dad" +uuid = "f6369f11-7733-5829-9624-2563aa707210" +version = "0.10.36" +weakdeps = ["StaticArrays"] + + [deps.ForwardDiff.extensions] + ForwardDiffStaticArraysExt = "StaticArrays" + +[[deps.FunctionWrappers]] +git-tree-sha1 = "d62485945ce5ae9c0c48f124a84998d755bae00e" +uuid = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e" +version = "1.1.3" + +[[deps.FunctionWrappersWrappers]] +deps = ["FunctionWrappers"] +git-tree-sha1 = "b104d487b34566608f8b4e1c39fb0b10aa279ff8" +uuid = "77dc65aa-8811-40c2-897b-53d922fa7daf" +version = "0.1.3" + +[[deps.Future]] +deps = ["Random"] +uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" + +[[deps.GPUArraysCore]] +deps = ["Adapt"] +git-tree-sha1 = "ec632f177c0d990e64d955ccc1b8c04c485a0950" +uuid = "46192b85-c4d5-4398-a991-12ede77f4527" +version = "0.1.6" + +[[deps.GeoInterface]] +deps = ["Extents"] +git-tree-sha1 = "801aef8228f7f04972e596b09d4dba481807c913" +uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" +version = "1.3.4" + +[[deps.GeometryBasics]] +deps = ["EarCut_jll", "Extents", "GeoInterface", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"] +git-tree-sha1 = "b62f2b2d76cee0d61a2ef2b3118cd2a3215d3134" +uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326" +version = "0.4.11" + +[[deps.Gridap]] +deps = ["AbstractTrees", "BSON", "BlockArrays", "Combinatorics", "DataStructures", "DocStringExtensions", "FastGaussQuadrature", "FileIO", "FillArrays", "ForwardDiff", "JLD2", "JSON", "LineSearches", "LinearAlgebra", "NLsolve", "NearestNeighbors", "PolynomialBases", "QuadGK", "Random", "SparseArrays", "SparseMatricesCSR", "StaticArrays", "Statistics", "Test", "WriteVTK"] +git-tree-sha1 = "dcded32ccd2fbf55579c6cb9885a175a6a4d3a2f" +repo-rev = "general_polytope" +repo-url = "https://github.com/gridap/Gridap.jl.git" +uuid = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e" +version = "0.18.2" + +[[deps.GridapDistributed]] +deps = ["BlockArrays", "FillArrays", "Gridap", "LinearAlgebra", "MPI", "PartitionedArrays", "SparseArrays", "SparseMatricesCSR", "WriteVTK"] +git-tree-sha1 = "53c27134cd80fabb3a845cbc588486444a2f0571" +uuid = "f9701e48-63b3-45aa-9a63-9bc6c271f355" +version = "0.4.0" + +[[deps.GridapEmbedded]] +deps = ["AbstractTrees", "Algoim", "Combinatorics", "CxxWrap", "FillArrays", "Gridap", "GridapDistributed", "LightGraphs", "LinearAlgebra", "MPI", "MiniQhull", "PartitionedArrays", "Random", "Test", "algoimWrapper_jll"] +git-tree-sha1 = "87ca4f64cd1ee88be51b3ad623ae594385c990c1" +uuid = "8838a6a3-0006-4405-b874-385995508d5d" +version = "0.9.2" + +[[deps.HostCPUFeatures]] +deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"] +git-tree-sha1 = "eb8fed28f4994600e29beef49744639d985a04b2" +uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" +version = "0.1.16" + +[[deps.Hwloc_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "ca0f6bf568b4bfc807e7537f081c81e35ceca114" +uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" +version = "2.10.0+0" + +[[deps.IfElse]] +git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" +uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" +version = "0.1.1" + +[[deps.Inflate]] +git-tree-sha1 = "ea8031dea4aff6bd41f1df8f2fdfb25b33626381" +uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" +version = "0.1.4" + +[[deps.IntelOpenMP_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "be50fe8df3acbffa0274a744f1a99d29c45a57f4" +uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0" +version = "2024.1.0+0" + +[[deps.InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[deps.InverseFunctions]] +deps = ["Test"] +git-tree-sha1 = "e7cbed5032c4c397a6ac23d1493f3289e01231c4" +uuid = "3587e190-3f89-42d0-90ee-14403ec27112" +version = "0.1.14" +weakdeps = ["Dates"] + + [deps.InverseFunctions.extensions] + DatesExt = "Dates" + +[[deps.IrrationalConstants]] +git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" +uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" +version = "0.2.2" + +[[deps.IterTools]] +git-tree-sha1 = "42d5f897009e7ff2cf88db414a389e5ed1bdd023" +uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +version = "1.10.0" + +[[deps.IterativeSolvers]] +deps = ["LinearAlgebra", "Printf", "Random", "RecipesBase", "SparseArrays"] +git-tree-sha1 = "59545b0a2b27208b0650df0a46b8e3019f85055b" +uuid = "42fd0dbc-a981-5370-80f2-aaf504508153" +version = "0.9.4" + +[[deps.IteratorInterfaceExtensions]] +git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" +uuid = "82899510-4779-5014-852e-03e436cf321d" +version = "1.0.0" + +[[deps.JLD2]] +deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "Pkg", "PrecompileTools", "Printf", "Reexport", "Requires", "TranscodingStreams", "UUIDs"] +git-tree-sha1 = "dca9ff5abdf5fab4456876bc93f80c59a37b81df" +uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819" +version = "0.4.47" + +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.5.0" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.4" + +[[deps.KLU]] +deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"] +git-tree-sha1 = "07649c499349dad9f08dde4243a4c597064663e9" +uuid = "ef3ab10e-7fda-4108-b977-705223b18434" +version = "0.6.0" + +[[deps.Krylov]] +deps = ["LinearAlgebra", "Printf", "SparseArrays"] +git-tree-sha1 = "267dad6b4b7b5d529c76d40ff48d33f7e94cb834" +uuid = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" +version = "0.9.6" + +[[deps.LayoutPointers]] +deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] +git-tree-sha1 = "62edfee3211981241b57ff1cedf4d74d79519277" +uuid = "10f19ff3-798f-405d-979b-55457f8fc047" +version = "0.1.15" + +[[deps.LazyArrays]] +deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "MacroTools", "MatrixFactorizations", "SparseArrays"] +git-tree-sha1 = "35079a6a869eecace778bcda8641f9a54ca3a828" +uuid = "5078a376-72f3-5289-bfd5-ec5146d43c02" +version = "1.10.0" +weakdeps = ["StaticArrays"] + + [deps.LazyArrays.extensions] + LazyArraysStaticArraysExt = "StaticArrays" + +[[deps.LazyArtifacts]] +deps = ["Artifacts", "Pkg"] +uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" + +[[deps.LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.4" + +[[deps.LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "8.4.0+0" + +[[deps.LibGit2]] +deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[deps.LibGit2_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] +uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" +version = "1.6.4+0" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.11.0+1" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[deps.Libiconv_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" +uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" +version = "1.17.0+0" + +[[deps.LightGraphs]] +deps = ["ArnoldiMethod", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] +git-tree-sha1 = "432428df5f360964040ed60418dd5601ecd240b6" +uuid = "093fc24a-ae57-5d10-9952-331d41423f4d" +version = "1.3.5" + +[[deps.LightXML]] +deps = ["Libdl", "XML2_jll"] +git-tree-sha1 = "3a994404d3f6709610701c7dabfc03fed87a81f8" +uuid = "9c8b4983-aa76-5018-a973-4c85ecc9e179" +version = "0.9.1" + +[[deps.LineSearches]] +deps = ["LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "Printf"] +git-tree-sha1 = "7bbea35cec17305fc70a0e5b4641477dc0789d9d" +uuid = "d3d80556-e9d4-5f37-9878-2ab0fcc64255" +version = "7.2.0" + +[[deps.LinearAlgebra]] +deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[deps.LinearSolve]] +deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "DocStringExtensions", "EnumX", "FastLapackInterface", "GPUArraysCore", "InteractiveUtils", "KLU", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveFactorization", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Sparspak", "StaticArraysCore", "UnPack"] +git-tree-sha1 = "efd815eaa56c0ffdf86581df5aaefb7e901323a0" +uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" +version = "2.30.0" + + [deps.LinearSolve.extensions] + LinearSolveBandedMatricesExt = "BandedMatrices" + LinearSolveBlockDiagonalsExt = "BlockDiagonals" + LinearSolveCUDAExt = "CUDA" + LinearSolveCUDSSExt = "CUDSS" + LinearSolveEnzymeExt = ["Enzyme", "EnzymeCore"] + LinearSolveFastAlmostBandedMatricesExt = ["FastAlmostBandedMatrices"] + LinearSolveHYPREExt = "HYPRE" + LinearSolveIterativeSolversExt = "IterativeSolvers" + LinearSolveKernelAbstractionsExt = "KernelAbstractions" + LinearSolveKrylovKitExt = "KrylovKit" + LinearSolveMetalExt = "Metal" + LinearSolvePardisoExt = "Pardiso" + LinearSolveRecursiveArrayToolsExt = "RecursiveArrayTools" + + [deps.LinearSolve.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + BlockDiagonals = "0a1fb500-61f7-11e9-3c65-f5ef3456f9f0" + CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" + CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" + Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" + EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" + FastAlmostBandedMatrices = "9d29842c-ecb8-4973-b1e9-a27b1157504e" + HYPRE = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771" + IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153" + KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" + KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" + Metal = "dde4c033-4e86-420c-a63e-0dd931031962" + Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2" + RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" + +[[deps.LogExpFunctions]] +deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] +git-tree-sha1 = "18144f3e9cbe9b15b070288eef858f71b291ce37" +uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" +version = "0.3.27" + + [deps.LogExpFunctions.extensions] + LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" + LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" + LogExpFunctionsInverseFunctionsExt = "InverseFunctions" + + [deps.LogExpFunctions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" + InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" + +[[deps.Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[deps.LoopVectorization]] +deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"] +git-tree-sha1 = "8f6786d8b2b3248d79db3ad359ce95382d5a6df8" +uuid = "bdcacae8-1622-11e9-2a5c-532679323890" +version = "0.12.170" +weakdeps = ["ChainRulesCore", "ForwardDiff", "SpecialFunctions"] + + [deps.LoopVectorization.extensions] + ForwardDiffExt = ["ChainRulesCore", "ForwardDiff"] + SpecialFunctionsExt = "SpecialFunctions" + +[[deps.MKL_jll]] +deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "oneTBB_jll"] +git-tree-sha1 = "80b2833b56d466b3858d565adcd16a4a05f2089b" +uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7" +version = "2024.1.0+0" + +[[deps.MPI]] +deps = ["Distributed", "DocStringExtensions", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "PkgVersion", "PrecompileTools", "Requires", "Serialization", "Sockets"] +git-tree-sha1 = "4e3136db3735924f96632a5b40a5979f1f53fa07" +uuid = "da04e1cc-30fd-572f-bb4f-1f8673147195" +version = "0.20.19" + + [deps.MPI.extensions] + AMDGPUExt = "AMDGPU" + CUDAExt = "CUDA" + + [deps.MPI.weakdeps] + AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e" + CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" + +[[deps.MPICH_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] +git-tree-sha1 = "4099bb6809ac109bfc17d521dad33763bcf026b7" +uuid = "7cb0a576-ebde-5e09-9194-50597f1243b4" +version = "4.2.1+1" + +[[deps.MPIPreferences]] +deps = ["Libdl", "Preferences"] +git-tree-sha1 = "c105fe467859e7f6e9a852cb15cb4301126fac07" +uuid = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" +version = "0.1.11" + +[[deps.MPItrampoline_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] +git-tree-sha1 = "ce0ca3dd147c43de175c5aff161315a424f4b8ac" +uuid = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748" +version = "5.3.3+1" + +[[deps.MacroTools]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.13" + +[[deps.ManualMemory]] +git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd" +uuid = "d125e4d3-2237-4719-b19c-fa641b8a4667" +version = "0.1.8" + +[[deps.Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[deps.MatrixFactorizations]] +deps = ["ArrayLayouts", "LinearAlgebra", "Printf", "Random"] +git-tree-sha1 = "6731e0574fa5ee21c02733e397beb133df90de35" +uuid = "a3b82374-2e81-5b9e-98ce-41277c0e4c87" +version = "2.2.0" + +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.2+1" + +[[deps.MeshIO]] +deps = ["ColorTypes", "FileIO", "GeometryBasics", "Printf"] +git-tree-sha1 = "8c26ab950860dfca6767f2bbd90fdf1e8ddc678b" +uuid = "7269a6da-0436-5bbc-96c2-40638cbb6118" +version = "0.4.11" + +[[deps.MicrosoftMPI_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f12a29c4400ba812841c6ace3f4efbb6dbb3ba01" +uuid = "9237b28f-5490-5468-be7b-bb81f5f5e6cf" +version = "10.1.4+2" + +[[deps.MiniQhull]] +deps = ["QhullMiniWrapper_jll"] +git-tree-sha1 = "9dc837d180ee49eeb7c8b77bb1c860452634b0d1" +uuid = "978d7f02-9e05-4691-894f-ae31a51d76ca" +version = "0.4.0" + +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[deps.MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2023.1.10" + +[[deps.NLSolversBase]] +deps = ["DiffResults", "Distributed", "FiniteDiff", "ForwardDiff"] +git-tree-sha1 = "a0b464d183da839699f4c79e7606d9d186ec172c" +uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" +version = "7.8.3" + +[[deps.NLsolve]] +deps = ["Distances", "LineSearches", "LinearAlgebra", "NLSolversBase", "Printf", "Reexport"] +git-tree-sha1 = "019f12e9a1a7880459d0173c182e6a99365d7ac1" +uuid = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" +version = "4.5.1" + +[[deps.NaNMath]] +deps = ["OpenLibm_jll"] +git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" +uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +version = "1.0.2" + +[[deps.NearestNeighbors]] +deps = ["Distances", "StaticArrays"] +git-tree-sha1 = "ded64ff6d4fdd1cb68dfcbb818c69e144a5b2e4c" +uuid = "b8a86587-4115-5ab1-83bc-aa920d37bbce" +version = "0.4.16" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.OffsetArrays]] +git-tree-sha1 = "e64b4f5ea6b7389f6f046d13d4896a8f9c1ba71e" +uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +version = "1.14.0" +weakdeps = ["Adapt"] + + [deps.OffsetArrays.extensions] + OffsetArraysAdaptExt = "Adapt" + +[[deps.OpenBLAS32_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6065c4cff8fee6c6770b277af45d5082baacdba1" +uuid = "656ef2d0-ae68-5445-9ca0-591084a874a2" +version = "0.3.24+0" + +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.23+4" + +[[deps.OpenLibm_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "05823500-19ac-5b8b-9628-191a04bc5112" +version = "0.8.1+2" + +[[deps.OpenMPI_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] +git-tree-sha1 = "e25c1778a98e34219a00455d6e4384e017ea9762" +uuid = "fe0851c0-eecd-5654-98d4-656369965a5c" +version = "4.1.6+0" + +[[deps.OpenSpecFun_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" +uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" +version = "0.5.5+0" + +[[deps.OrderedCollections]] +git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.6.3" + +[[deps.Parameters]] +deps = ["OrderedCollections", "UnPack"] +git-tree-sha1 = "34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe" +uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" +version = "0.12.3" + +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.8.1" + +[[deps.PartitionedArrays]] +deps = ["CircularArrays", "Distances", "FillArrays", "IterativeSolvers", "LinearAlgebra", "MPI", "Printf", "Random", "SparseArrays", "SparseMatricesCSR"] +git-tree-sha1 = "149d2287770c6a533507d74beaa73d76c0727922" +uuid = "5a9dfac6-5c52-46f7-8278-5e2210713be9" +version = "0.3.4" + +[[deps.Pkg]] +deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.10.0" + +[[deps.PkgVersion]] +deps = ["Pkg"] +git-tree-sha1 = "f9501cc0430a26bc3d156ae1b5b0c1b47af4d6da" +uuid = "eebad327-c553-4316-9ea0-9fa01ccd7688" +version = "0.3.3" + +[[deps.Polyester]] +deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Requires", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"] +git-tree-sha1 = "b3e2bae88cf07baf0a051fe09666b8ef97aefe93" +uuid = "f517fe37-dbe3-4b94-8317-1923a5111588" +version = "0.7.14" + +[[deps.PolyesterWeave]] +deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"] +git-tree-sha1 = "240d7170f5ffdb285f9427b92333c3463bf65bf6" +uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" +version = "0.2.1" + +[[deps.PolynomialBases]] +deps = ["ArgCheck", "AutoHashEquals", "FFTW", "FastGaussQuadrature", "LinearAlgebra", "Requires", "SimpleUnPack", "SpecialFunctions"] +git-tree-sha1 = "aa1877430a7e8b0c7a35ea095c415d462af0870f" +uuid = "c74db56a-226d-5e98-8bb0-a6049094aeea" +version = "0.4.21" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.2.1" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.3" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[deps.ProgressMeter]] +deps = ["Distributed", "Printf"] +git-tree-sha1 = "763a8ceb07833dd51bb9e3bbca372de32c0605ad" +uuid = "92933f4c-e287-5a05-a399-4b506db050ca" +version = "1.10.0" + +[[deps.QhullMiniWrapper_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Qhull_jll"] +git-tree-sha1 = "607cf73c03f8a9f83b36db0b86a3a9c14179621f" +uuid = "460c41e3-6112-5d7f-b78c-b6823adb3f2d" +version = "1.0.0+1" + +[[deps.Qhull_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "be2449911f4d6cfddacdf7efc895eceda3eee5c1" +uuid = "784f63db-0788-585a-bace-daefebcd302b" +version = "8.0.1003+0" + +[[deps.QuadGK]] +deps = ["DataStructures", "LinearAlgebra"] +git-tree-sha1 = "9b23c31e76e333e6fb4c1595ae6afa74966a729e" +uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" +version = "2.9.4" + +[[deps.REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[deps.Random]] +deps = ["SHA"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[deps.RecipesBase]] +deps = ["PrecompileTools"] +git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" +uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +version = "1.3.4" + +[[deps.RecursiveArrayTools]] +deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "SparseArrays", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] +git-tree-sha1 = "47f8fedb92e196d21d8d1f5f92d5de42449d1078" +uuid = "731186ca-8d62-57ce-b412-fbd966d074cd" +version = "3.18.1" + + [deps.RecursiveArrayTools.extensions] + RecursiveArrayToolsFastBroadcastExt = "FastBroadcast" + RecursiveArrayToolsForwardDiffExt = "ForwardDiff" + RecursiveArrayToolsMeasurementsExt = "Measurements" + RecursiveArrayToolsMonteCarloMeasurementsExt = "MonteCarloMeasurements" + RecursiveArrayToolsReverseDiffExt = ["ReverseDiff", "Zygote"] + RecursiveArrayToolsTrackerExt = "Tracker" + RecursiveArrayToolsZygoteExt = "Zygote" + + [deps.RecursiveArrayTools.weakdeps] + FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898" + ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" + Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" + MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + +[[deps.RecursiveFactorization]] +deps = ["LinearAlgebra", "LoopVectorization", "Polyester", "PrecompileTools", "StrideArraysCore", "TriangularSolve"] +git-tree-sha1 = "6db1a75507051bc18bfa131fbc7c3f169cc4b2f6" +uuid = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" +version = "0.2.23" + +[[deps.Reexport]] +git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" +uuid = "189a3867-3050-52da-a836-e630ba90ab69" +version = "1.2.2" + +[[deps.Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.3.0" + +[[deps.RuntimeGeneratedFunctions]] +deps = ["ExprTools", "SHA", "Serialization"] +git-tree-sha1 = "04c968137612c4a5629fa531334bb81ad5680f00" +uuid = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" +version = "0.5.13" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.SIMDTypes]] +git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c" +uuid = "94e857df-77ce-4151-89e5-788b33177be4" +version = "0.1.0" + +[[deps.SLEEFPirates]] +deps = ["IfElse", "Static", "VectorizationBase"] +git-tree-sha1 = "3aac6d68c5e57449f5b9b865c9ba50ac2970c4cf" +uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" +version = "0.6.42" + +[[deps.SciMLBase]] +deps = ["ADTypes", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] +git-tree-sha1 = "64486bd2cd4edc0da368ec839f62b6a4e118927b" +uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" +version = "2.37.0" + + [deps.SciMLBase.extensions] + SciMLBaseChainRulesCoreExt = "ChainRulesCore" + SciMLBaseMakieExt = "Makie" + SciMLBasePartialFunctionsExt = "PartialFunctions" + SciMLBasePyCallExt = "PyCall" + SciMLBasePythonCallExt = "PythonCall" + SciMLBaseRCallExt = "RCall" + SciMLBaseZygoteExt = "Zygote" + + [deps.SciMLBase.weakdeps] + ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" + PartialFunctions = "570af359-4316-4cb7-8c74-252c00c2016b" + PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" + PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d" + RCall = "6f49c342-dc21-5d91-9882-a32aef131414" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + +[[deps.SciMLOperators]] +deps = ["ArrayInterface", "DocStringExtensions", "LinearAlgebra", "MacroTools", "Setfield", "SparseArrays", "StaticArraysCore"] +git-tree-sha1 = "10499f619ef6e890f3f4a38914481cc868689cd5" +uuid = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" +version = "0.3.8" + +[[deps.SciMLStructures]] +git-tree-sha1 = "d778a74df2f64059c38453b34abad1953b2b8722" +uuid = "53ae85a6-f571-4167-b2af-e1d143709226" +version = "1.2.0" + +[[deps.Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[deps.Setfield]] +deps = ["ConstructionBase", "Future", "MacroTools", "StaticArraysCore"] +git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" +uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" +version = "1.1.1" + +[[deps.SharedArrays]] +deps = ["Distributed", "Mmap", "Random", "Serialization"] +uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" + +[[deps.SimpleTraits]] +deps = ["InteractiveUtils", "MacroTools"] +git-tree-sha1 = "5d7e3f4e11935503d3ecaf7186eac40602e7d231" +uuid = "699a6c99-e7fa-54fc-8d76-47d257e15c1d" +version = "0.9.4" + +[[deps.SimpleUnPack]] +git-tree-sha1 = "58e6353e72cde29b90a69527e56df1b5c3d8c437" +uuid = "ce78b400-467f-4804-87d8-8f486da07d0a" +version = "1.1.0" + +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[deps.SparseArrays]] +deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +version = "1.10.0" + +[[deps.SparseMatricesCSR]] +deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] +git-tree-sha1 = "38677ca58e80b5cad2382e5a1848f93b054ad28d" +uuid = "a0a7dd2c-ebf4-11e9-1f05-cf50bc540ca1" +version = "0.6.7" + +[[deps.Sparspak]] +deps = ["Libdl", "LinearAlgebra", "Logging", "OffsetArrays", "Printf", "SparseArrays", "Test"] +git-tree-sha1 = "342cf4b449c299d8d1ceaf00b7a49f4fbc7940e7" +uuid = "e56a9233-b9d6-4f03-8d0f-1825330902ac" +version = "0.3.9" + +[[deps.SpecialFunctions]] +deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] +git-tree-sha1 = "2f5d4697f21388cbe1ff299430dd169ef97d7e14" +uuid = "276daf66-3868-5448-9aa4-cd146d93841b" +version = "2.4.0" +weakdeps = ["ChainRulesCore"] + + [deps.SpecialFunctions.extensions] + SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" + +[[deps.Static]] +deps = ["IfElse"] +git-tree-sha1 = "d2fdac9ff3906e27f7a618d47b676941baa6c80c" +uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" +version = "0.8.10" + +[[deps.StaticArrayInterface]] +deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] +git-tree-sha1 = "5d66818a39bb04bf328e92bc933ec5b4ee88e436" +uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" +version = "1.5.0" +weakdeps = ["OffsetArrays", "StaticArrays"] + + [deps.StaticArrayInterface.extensions] + StaticArrayInterfaceOffsetArraysExt = "OffsetArrays" + StaticArrayInterfaceStaticArraysExt = "StaticArrays" + +[[deps.StaticArrays]] +deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] +git-tree-sha1 = "bf074c045d3d5ffd956fa0a461da38a44685d6b2" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "1.9.3" +weakdeps = ["ChainRulesCore", "Statistics"] + + [deps.StaticArrays.extensions] + StaticArraysChainRulesCoreExt = "ChainRulesCore" + StaticArraysStatisticsExt = "Statistics" + +[[deps.StaticArraysCore]] +git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" +uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" +version = "1.4.2" + +[[deps.Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +version = "1.10.0" + +[[deps.StatsAPI]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed" +uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" +version = "1.7.0" + +[[deps.StrideArraysCore]] +deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"] +git-tree-sha1 = "25349bf8f63aa36acbff5e3550a86e9f5b0ef682" +uuid = "7792a7ef-975c-4747-a70f-980b88e8d1da" +version = "0.5.6" + +[[deps.StructArrays]] +deps = ["ConstructionBase", "DataAPI", "Tables"] +git-tree-sha1 = "f4dc295e983502292c4c3f951dbb4e985e35b3be" +uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" +version = "0.6.18" +weakdeps = ["Adapt", "GPUArraysCore", "SparseArrays", "StaticArrays"] + + [deps.StructArrays.extensions] + StructArraysAdaptExt = "Adapt" + StructArraysGPUArraysCoreExt = "GPUArraysCore" + StructArraysSparseArraysExt = "SparseArrays" + StructArraysStaticArraysExt = "StaticArrays" + +[[deps.SuiteSparse]] +deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] +uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" + +[[deps.SuiteSparse_jll]] +deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] +uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" +version = "7.2.1+1" + +[[deps.SymbolicIndexingInterface]] +deps = ["Accessors", "ArrayInterface", "RuntimeGeneratedFunctions", "StaticArraysCore"] +git-tree-sha1 = "b479c7a16803f08779ac5b7f9844a42621baeeda" +uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5" +version = "0.3.21" + +[[deps.TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.3" + +[[deps.TableTraits]] +deps = ["IteratorInterfaceExtensions"] +git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" +uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" +version = "1.0.1" + +[[deps.Tables]] +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"] +git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d" +uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +version = "1.11.1" + +[[deps.Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.0" + +[[deps.Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.ThreadingUtilities]] +deps = ["ManualMemory"] +git-tree-sha1 = "eda08f7e9818eb53661b3deb74e3159460dfbc27" +uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5" +version = "0.5.2" + +[[deps.TranscodingStreams]] +git-tree-sha1 = "5d54d076465da49d6746c647022f3b3674e64156" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.10.8" +weakdeps = ["Random", "Test"] + + [deps.TranscodingStreams.extensions] + TestExt = ["Test", "Random"] + +[[deps.TriangularSolve]] +deps = ["CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "LoopVectorization", "Polyester", "Static", "VectorizationBase"] +git-tree-sha1 = "66c68a20907800c0b7c04ff8a6164115e8747de2" +uuid = "d5829a12-d9aa-46ab-831f-fb7c9ab06edf" +version = "0.2.0" + +[[deps.UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[deps.UnPack]] +git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" +uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" +version = "1.0.2" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[deps.VTKBase]] +git-tree-sha1 = "c2d0db3ef09f1942d08ea455a9e252594be5f3b6" +uuid = "4004b06d-e244-455f-a6ce-a5f9919cc534" +version = "1.0.1" + +[[deps.VectorizationBase]] +deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"] +git-tree-sha1 = "6129a4faf6242e7c3581116fbe3270f3ab17c90d" +uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" +version = "0.21.67" + +[[deps.WriteVTK]] +deps = ["Base64", "CodecZlib", "FillArrays", "LightXML", "TranscodingStreams", "VTKBase"] +git-tree-sha1 = "48b9e8e9c83865e99e57f027d4edfa94e0acddae" +uuid = "64499a7a-5c06-52f2-abe2-ccb03c286192" +version = "1.19.1" + +[[deps.XML2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] +git-tree-sha1 = "532e22cf7be8462035d092ff21fada7527e2c488" +uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" +version = "2.12.6+0" + +[[deps.Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.13+1" + +[[deps.algoimWrapper_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenBLAS32_jll", "libcxxwrap_julia_jll"] +git-tree-sha1 = "52e80bb6259731283d43ab3d8a2a326e91de54ef" +uuid = "3c43aa7b-5398-51f3-8d75-8f051e6faa4d" +version = "0.2.1+0" + +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.8.0+1" + +[[deps.libcxxwrap_julia_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "02d0a0a623248c709727088aaf722ab14f1463a5" +uuid = "3eaa8342-bff7-56a5-9981-c04077f7cee7" +version = "0.11.2+1" + +[[deps.nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.52.0+1" + +[[deps.oneTBB_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "7d0ea0f4895ef2f5cb83645fa689e52cb55cf493" +uuid = "1317d2d5-d96f-522e-a858-c73665f53c3e" +version = "2021.12.0+0" + +[[deps.p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+2" From 5cb5d9e1bab7aefcc33fc102e0867fa59b72d50f Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Wed, 15 May 2024 11:42:49 +0200 Subject: [PATCH 10/15] delete comments --- src/Polyhedra.jl | 659 ---------------------------------------------- src/STLCutters.jl | 1 + 2 files changed, 1 insertion(+), 659 deletions(-) diff --git a/src/Polyhedra.jl b/src/Polyhedra.jl index 9133972a..ac248f6d 100644 --- a/src/Polyhedra.jl +++ b/src/Polyhedra.jl @@ -3,665 +3,6 @@ const OPEN = -1 -# """ -# struct GraphPolytope{D,Dp,Tp} <: Polytope{D} - -# A graph polytope is a general polytope defined by a set of vertices and a rototation -# system (a planar oriented graph). This polytopal representation can represent -# any polytope in 2 and 3 dimensions. - -# In 2 dimensions ([`Polygon`](@ref)), the representation of the polygon is a closed polyline. - -# In 3 dimensions ([`Polyhedron`](@ref)), the rotation system generates the connectivities, each facet is a closed cycle of the graph. -# This construction allows complex geometrical operations, e.g., intersecting polytopes by halfspaces. -# See also, - -# > K. Sugihara, "A robust and consistent algorithm for intersecting convex polyhedra", Comput. Graph. Forum 13 (3) (1994) 45–54, doi: [10.1111/1467-8659.1330045](https://doi.org/10.1111/1467-8659.1330045) - -# > D. Powell, T. Abel, "An exact general remeshing scheme applied to physically conservative voxelization", J. Comput. Phys. 297 (Sept. 2015) 340–356, doi: [10.1016/j.jcp.2015.05.022](https://doi.org/10.1016/j.jcp.2015.05.022. - -# > S. Badia, P. A. Martorell, F. Verdugo. "Geometrical discretisations for unfitted finite elements on explicit boundary representations", J.Comput. Phys. 460 (2022): 111162. doi: [10.1016/j.jcp.2022.111162](https://doi.org/10.1016/j.jcp.2022.111162) -# """ -# struct GraphPolytope{D,Dp,Tp,Td} <: Polytope{D} -# vertices::Vector{Point{Dp,Tp}} -# edge_vertex_graph::Vector{Vector{Int32}} -# n_m_to_nface_to_mfaces::Matrix{Vector{Vector{Int32}}} -# facedims::Vector{Int32} -# dimranges::Vector{UnitRange{Int}} -# dface_nfaces::Vector{Vector{Int32}} -# isopen::Bool -# metadata::Td -# function GraphPolytope{D}( -# vertices::Vector{Point{Dp,Tp}}, -# edge_vertex_graph::Vector{Vector{Int32}}, -# n_m_to_nface_to_mfaces::Matrix{Vector{Vector{Int32}}}, -# facedims::Vector{Int32}, -# dimranges::Vector{UnitRange{Int}}, -# dface_nfaces::Vector{Vector{Int32}}, -# isopen::Bool, -# metadata::Td) where {D,Dp,Tp,Td} -# new{D,Dp,Tp,Td}( -# vertices, -# edge_vertex_graph, -# n_m_to_nface_to_mfaces, -# facedims, -# dimranges, -# dface_nfaces, -# isopen, -# metadata) -# end -# end - -# """ -# Polygon = GraphPolytope{2} - -# A polygon is a [`GraphPolytope`](@ref) in 2 dimensions. -# """ -# const Polygon = GraphPolytope{2} - -# """ -# Polyhedron = GraphPolytope{3} - -# A polyhedron is a [`GraphPolytope`](@ref) in 3 dimensions. -# """ -# const Polyhedron = GraphPolytope{3} - -# # Constructors - -# function GraphPolytope{D}( -# vertices::Vector{<:Point}, -# graph::Vector{Vector{Int32}}, -# isopen::Bool, -# data) where D - -# n = D+1 -# n_m_to_nface_to_mfaces = Matrix{Vector{Vector{Int32}}}(undef,n,n ) -# dimranges = Vector{UnitRange{Int}}(undef,0) -# dface_nfaces = Vector{Vector{Int32}}(undef,0) -# facedims = Vector{Int32}(undef,0) -# GraphPolytope{D}( -# vertices, -# graph, -# n_m_to_nface_to_mfaces, -# facedims, -# dimranges, -# dface_nfaces, -# isopen, -# data) -# end - -# function GraphPolytope{D}( -# vertices::AbstractVector{<:Point}, -# graph::Vector{<:Vector}, -# isopen::Bool, -# data) where D - -# GraphPolytope{D}(collect(vertices),graph,isopen,data) -# end - -# function GraphPolytope{D}( -# vertices::AbstractVector{<:Point}, -# graph::Vector{<:Vector} -# ;isopen=false::Bool, -# metadata=nothing) where D - -# GraphPolytope{D}(vertices,graph,isopen,metadata) -# end - -# function GraphPolytope{D}( -# vertices::AbstractVector{<:Point}, -# graph::Vector{<:Vector}, -# data) where D - -# isopen = false -# GraphPolytope{D}(vertices,graph,isopen,data) -# end - -# function GraphPolytope{D}(t::GridTopology{Dc,D};metadata=nothing) where {Dc,D} -# graph = compute_graph(t) -# X = get_vertex_coordinates(t) -# isopen = is_open_surface(t) -# p = GraphPolytope{D}(X,graph;isopen,metadata) -# set_polytope_data!(p,t,metadata) -# p -# end - -# function set_polytope_data!(p::GraphPolytope,t::GridTopology,::Nothing) -# p -# end - -# function get_polytope_data(p::Polytope;metadata=nothing) -# get_polytope_data(p,metadata) -# end - -# function get_polytope_data(p::Polytope,::Nothing) -# nothing -# end - -# function Polygon(p::Polytope{2},vertices::AbstractVector{<:Point};kwargs...) -# if p == TRI -# e_v_graph = [[2,3],[3,1],[1,2]] -# perm = [1,2,3] -# elseif p == QUAD -# e_v_graph = [[2, 3],[4, 1],[1, 4],[3, 2]] -# perm = [1,2,4,3] -# else -# @unreachable -# end -# vertices = map(Reindex(vertices),perm) -# e_v_graph = map(Reindex(e_v_graph),perm) -# e_v_graph = map(i->replace(i, Dict(perm .=> 1:length(perm))...),e_v_graph) -# e_v_graph = map(i->Int32.(i),e_v_graph) -# data = get_polytope_data(p;kwargs...) -# Polygon(vertices,e_v_graph,data) -# end - -# function Polygon(vertices::AbstractVector{<:Point};kwargs...) -# graph = map(1:length(vertices)) do i -# inext = i == length(vertices) ? 1 : i+1 -# iprev = i == 1 ? length(vertices) : i-1 -# Int32[iprev,inext] -# end -# Polygon(vertices,graph;kwargs...) -# end - -# function Polyhedron(p::Polytope{3},vertices::AbstractVector{<:Point};kwargs...) -# if p == TET -# e_v_graph = [[2,4,3],[3,4,1],[1,4,2],[1,2,3]] -# elseif p == HEX -# e_v_graph = [ -# [5, 2, 3], -# [6, 4, 1], -# [7, 1, 4], -# [8, 3, 2], -# [1, 7, 6], -# [2, 5, 8], -# [3, 8, 5], -# [4, 6, 7] ] -# else -# @unreachable -# end -# e_v_graph = map(i->Int32.(i),e_v_graph) -# data = get_polytope_data(p;kwargs...) -# Polyhedron(vertices,e_v_graph,data) -# end - -# function GraphPolytope{D}(p::Polytope;kwargs...) where D -# GraphPolytope{D}(p,get_vertex_coordinates(p);kwargs...) -# end - -# # Interface - -# num_dims(::T) where T<:GraphPolytope = num_dims(T) - -# num_dims(::Type{<:GraphPolytope{D}}) where D = D - -# num_cell_dims(a::GraphPolytope) = num_dims(a) - -# point_eltype(::T) where T<:GraphPolytope = point_eltype(T) - -# point_eltype(::Type{<:GraphPolytope{D,Dp,T}}) where {D,Dp,T} = T - -# num_point_dims(::Type{<:GraphPolytope{D,Dp}}) where {D,Dp} = Dp - -# num_vertices(a::GraphPolytope) = length(a.vertices) - -# get_vertex_coordinates(a::GraphPolytope) = a.vertices - -# Base.getindex(a::GraphPolytope,i::Integer) = a.vertices[i] - -# """ -# get_graph(p::GraphPolytope) -> Vector{Vector{Int32}} - -# It returns the edge-vertex graph of the polytope `p`. -# """ -# @inline get_graph(a::GraphPolytope) = a.edge_vertex_graph - - -# """ -# get_metadata(p::GraphPolytope) - -# It return the metadata stored in the polytope `p`. -# """ -# get_metadata(a::GraphPolytope) = a.metadata - - -# """ -# isopen(p::GraphPolytope) -> Bool - -# In return whether the polytope is watter tight or not. -# """ -# Base.isopen(a::GraphPolytope) = a.isopen - -# """ -# isactive(p::GraphPolytope,vertex::Integer) -> Bool - -# It returns whether a vertex is connected to any other vertex. -# """ -# function isactive(p::Polyhedron,vertex::Integer) -# !isempty( get_graph(p)[vertex] ) -# end - -# """ -# check_graph(p::GraphPolytope) -> Bool - -# It checks whether the graph is well-constructed. The graph must be oriented -# and planar. -# """ -# function check_graph(p::GraphPolytope) -# check_graph(get_graph(p)) -# end - -# function check_graph(graph::AbstractVector{<:AbstractVector}) -# for v in 1:length(graph) -# !isempty(graph[v]) || continue -# for vneig in graph[v] -# vneig ∉ (OPEN,UNSET) || continue -# v ∈ graph[vneig] || return false -# end -# end -# true -# end - -# is_simplex(::GraphPolytope) = false - -# is_n_cube(::GraphPolytope) = false - -# function simplexify(p::GraphPolytope{D}) where D -# @assert !isopen(p) -# X,T = simplexify_interior(p) -# @check X == get_vertex_coordinates(p) -# T, simplex_polytope(Val{D}()) -# end - -# simplex_polytope(::Val{0}) = VERTEX - -# simplex_polytope(::Val{1}) = SEGMENT - -# simplex_polytope(::Val{2}) = TRI - -# simplex_polytope(::Val{3}) = TET - -# function Polytope{0}(p::GraphPolytope,faceid::Integer) -# VERTEX -# end - -# function Polytope{1}(p::GraphPolytope,faceid::Integer) -# SEGMENT -# end - -# function Polytope{D}(p::GraphPolytope{D},faceid::Integer) where D -# p -# end - -# function Polytope{2}(p::Polyhedron,faceid::Integer) -# f_to_v = get_faces(p,2,0) -# coords = get_vertex_coordinates(p) -# vertices = coords[f_to_v[faceid]] -# Polygon(vertices) -# end - -# Base.:(==)(a::GraphPolytope,b::GraphPolytope) = false - -# function num_faces(p::GraphPolytope{D},d::Integer) where D -# if d == 0 -# num_vertices(p) -# elseif d == D -# 1 -# else -# length( get_faces(p,d,0) ) -# end -# end - -# function get_faces(p::GraphPolytope,n::Integer,m::Integer) -# setup_faces!(p,n,m) -# p.n_m_to_nface_to_mfaces[n+1,m+1] -# end - - -# function get_facet_orientations(p::GraphPolytope) -# Ones(num_facets(p)) -# end - -# function get_facet_normal(p::Polyhedron) -# D = 3 -# f_to_v = get_faces(p,D-1,0) -# coords = get_vertex_coordinates(p) -# map(f_to_v) do v -# v1 = coords[v[2]]-coords[v[1]] -# v2 = coords[v[3]]-coords[v[1]] -# v1 /= norm(v1) -# v2 /= norm(v2) -# n = v1 × v2 -# n /= norm(n) -# end -# end - -# function get_facet_normal(p::Polygon) -# D = 2 -# f_to_v = get_faces(p,D-1,0) -# coords = get_vertex_coordinates(p) -# @notimplementedif num_components(eltype(coords)) != 2 -# map(f_to_v) do v -# e = coords[v[2]]-coords[v[1]] -# n = VectorValue( e[2], -e[1] ) -# n /= norm(n) -# end -# end - -# function get_edge_tangent(p::GraphPolytope) -# e_to_v = get_faces(p,1,0) -# coords = get_vertex_coordinates(p) -# map(e_to_v) do v -# e = coords[v[2]]-coords[v[1]] -# e / norm(e) -# end -# end - -# function get_dimranges(p::GraphPolytope) -# setup_dimranges!(p) -# p.dimranges -# end - -# function get_dimrange(p::GraphPolytope,d::Integer) -# setup_dimranges!(p) -# p.dimranges[d+1] -# end - -# function get_faces(p::GraphPolytope) -# setup_face_to_nfaces!(p) -# p.dface_nfaces -# end - -# function get_facedims(p::GraphPolytope) -# setup_facedims!(p) -# p.facedims -# end - -# function setup_dimranges!(p::GraphPolytope{D}) where D -# if length(p.dimranges) < D+1 -# lens = map(i->num_faces(p,i),0:D) -# sums = cumsum(lens) -# resize!(p.dimranges,D+1) -# for (i,(l,s)) in enumerate(zip(lens,sums)) -# p.dimranges[i] = s-l+1 : s -# end -# end -# end - -# function setup_face_to_nfaces!(p::GraphPolytope) -# if length(p.dface_nfaces) < num_vertices(p) -# facedims = get_facedims(p) -# dface_nfaces = Vector{Vector{Int32}}(undef,length(facedims)) -# ofsets = get_offsets(p) -# for (f,d) in enumerate(facedims) -# df = f - ofsets[d+1] -# nfs = Int[] -# for n in 0:d -# union!(nfs,get_faces(p,d,n)[df] .+ ofsets[n+1]) -# end -# dface_nfaces[f] = nfs -# end -# copy!(p.dface_nfaces,dface_nfaces) -# end -# nothing -# end - -# function setup_facedims!(p::GraphPolytope) -# if length(p.facedims) < num_vertices(p) -# dimranges = get_dimranges(p) -# n_faces = dimranges[end][end] -# facedims = _nface_to_nfacedim(n_faces,dimranges) -# copy!(p.facedims,facedims) -# end -# end - -# function setup_faces!(p::GraphPolytope{D},dimfrom,dimto) where D -# if isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) -# return nothing -# end -# if dimfrom == dimto -# setup_nface_to_nface!(p,dimfrom) -# elseif dimfrom == D -# setup_cell_to_faces!(p,dimto) -# elseif dimto == 0 -# setup_face_to_vertices!(p,dimfrom) -# elseif dimfrom > dimto -# setup_nface_to_mface!(p,dimfrom,dimto) -# else -# setup_nface_to_mface_dual!(p,dimto,dimfrom) -# end -# nothing -# end - -# function setup_face_to_vertices!(p::GraphPolytope,d) -# if !isassigned(p.n_m_to_nface_to_mfaces,d+1,1) -# df_to_v = generate_face_to_vertices(p,d) -# p.n_m_to_nface_to_mfaces[d+1,1] = df_to_v -# end -# end - -# function setup_cell_to_faces!(p::GraphPolytope{D},d) where D -# if !isassigned(p.n_m_to_nface_to_mfaces,D+1,d+1) -# num_f = num_faces(p,d) -# c_to_f = [ collect(1:num_f) ] -# p.n_m_to_nface_to_mfaces[D+1,d+1] = c_to_f -# end -# end - -# function setup_nface_to_nface!(p::GraphPolytope,n) -# if !isassigned(p.n_m_to_nface_to_mfaces,n+1,n+1) -# num_nf = num_faces(p,n) -# nf_to_nf = map(i->Int[i],1:num_nf) -# p.n_m_to_nface_to_mfaces[n+1,n+1] = nf_to_nf -# end -# end - -# function setup_nface_to_mface!(p::Polyhedron,n,m) -# if !isassigned(p.n_m_to_nface_to_mfaces,n+1,m+1) -# @notimplementedif n != 2 && m != 1 -# nf_to_v = get_faces(p,n,0) -# v_to_mf = get_faces(p,0,m) -# nf_to_ftype = map( length, nf_to_v ) -# ftype_to_lmf_to_lv = map(1:maximum(nf_to_ftype)) do ftype -# map(1:ftype) do i -# inext = i == ftype ? 1 : i+1 -# Int[i,inext] -# end -# end -# nf_to_mf = find_cell_to_faces( -# Table(nf_to_v), -# ftype_to_lmf_to_lv, -# nf_to_ftype, -# Table(v_to_mf)) -# p.n_m_to_nface_to_mfaces[n+1,m+1] = Vector(nf_to_mf) -# end -# end - -# function setup_nface_to_mface_dual!(p::GraphPolytope,dimto,dimfrom) -# if !isassigned(p.n_m_to_nface_to_mfaces,dimfrom+1,dimto+1) -# @assert dimfrom < dimto -# nf_to_mf = get_faces(p,dimto,dimfrom) -# n_mf = num_faces(p,dimfrom) -# mf_to_nf = generate_cells_around(Table(nf_to_mf),n_mf) -# p.n_m_to_nface_to_mfaces[dimfrom+1,dimto+1] = Vector(mf_to_nf) -# end -# end - -# function generate_face_to_vertices(p::Polyhedron,d::Integer) -# if d == 1 -# generate_edge_to_vertices(p) -# elseif d == 2 -# generate_facet_to_vertices(p) -# else -# @unreachable -# end -# end - -# function generate_face_to_vertices(p::Polygon,d::Integer) -# if d == 1 -# generate_facet_to_vertices(p) -# else -# @unreachable -# end -# end - -# function generate_facet_to_vertices(poly::Polyhedron) -# D = 3 -# istouch = map( i -> falses(length(i)), get_graph(poly) ) -# T = Vector{Int32}[] -# for v in 1:num_vertices(poly) -# isactive(poly,v) || continue -# for i in 1:length(get_graph(poly)[v]) -# !istouch[v][i] || continue -# istouch[v][i] = true -# vcurrent = v -# vnext = get_graph(poly)[v][i] -# vnext ∉ (OPEN,UNSET) || continue -# k = [v] -# while vnext != v -# inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) -# inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 -# istouch[vnext][inext] = true -# vcurrent = vnext -# vnext = get_graph(poly)[vnext][inext] -# vnext ∉ (OPEN,UNSET) || break -# push!(k,vcurrent) -# end -# if length(k) >=D -# push!(T,k) -# end -# end -# end -# T -# end - -# function generate_edge_to_vertices(poly::GraphPolytope) -# graph = get_graph(poly) -# T = Vector{Int32}[] -# for v in 1:length(graph) -# for vneig in graph[v] -# if vneig > v -# push!(T,[v,vneig]) -# end -# end -# end -# T -# end - -# function generate_facet_to_vertices(poly::Polygon) -# graph = get_graph(poly) -# T = Vector{Int32}[] -# for v in 1:length(graph) -# vnext = v == length(graph) ? 1 : v+1 -# @assert vnext ∈ graph[v] -# push!(T,[v,vnext]) -# end -# T -# end - -# function Base.copy(poly::Polyhedron) -# vertices = get_vertex_coordinates(poly) -# graph = get_graph(poly) -# open = isopen(poly) -# data = get_metadata(poly) -# data = !isnothing(data) ? copy(data) : nothing -# Polyhedron(vertices,graph,open,data) -# end - -# function simplexify_interior(p::Polygon) -# @assert !isopen(p) -# e_to_v = generate_facet_to_vertices(p) -# T = Vector{Int32}[] -# if length(e_to_v) > 0 -# v0 = e_to_v[1][1] -# for verts in e_to_v -# if v0 ∉ verts -# push!(T,[v0,verts[1],verts[2]]) -# end -# end -# end -# get_vertex_coordinates(p),T -# end - -# function simplexify_interior(poly::Polyhedron) -# !isopen(poly) || return simplexify_surface(poly) -# vstart = fill(UNSET,num_vertices(poly)) -# stack = Int32[] -# for v in 1:num_vertices(poly) -# isactive(poly,v) || continue -# vstart[v] == UNSET || continue -# vstart[v] = v -# empty!(stack) -# push!(stack,v) -# while !isempty(stack) -# vcurrent = pop!(stack) -# for vneig in get_graph(poly)[vcurrent] -# if vstart[vneig] == UNSET -# vstart[vneig] = v -# push!(stack,vneig) -# end -# end -# end -# end -# istouch = map( i -> falses(length(i)), get_graph(poly) ) -# vertex_coordinates = get_vertex_coordinates(poly) -# T = Vector{Int32}[] -# X = vertex_coordinates -# for v in 1:num_vertices(poly) -# isactive(poly,v) || continue -# for i in 1:length(get_graph(poly)[v]) -# !istouch[v][i] || continue -# istouch[v][i] = true -# vcurrent = v -# vnext = get_graph(poly)[v][i] -# while vnext != v -# inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) -# !isnothing(inext) || break -# inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 -# istouch[vnext][inext] = true -# vcurrent = vnext -# vnext = get_graph(poly)[vnext][inext] -# @assert vcurrent ≠ vnext -# vcurrent ≠ vnext || break -# if v ∉ (vstart[v],vcurrent,vnext) -# k = [vstart[v],v,vcurrent,vnext] -# push!(T,k) -# end -# end -# end -# end -# X,T -# end - -# function simplexify_surface(poly::Polyhedron) -# istouch = map( i -> falses(length(i)), get_graph(poly) ) -# T = Vector{Int32}[] -# for v in 1:num_vertices(poly) -# isactive(poly,v) || continue -# for i in 1:length(get_graph(poly)[v]) -# !istouch[v][i] || continue -# istouch[v][i] = true -# vcurrent = v -# vnext = get_graph(poly)[v][i] -# vnext ∉ (OPEN,UNSET) || continue -# while vnext != v -# inext = findfirst( isequal(vcurrent), get_graph(poly)[vnext] ) -# inext = ( inext % length( get_graph(poly)[vnext] ) ) + 1 -# istouch[vnext][inext] = true -# vcurrent = vnext -# vnext = get_graph(poly)[vnext][inext] -# vnext ∉ (OPEN,UNSET) || break -# if v ∉ (vcurrent,vnext) -# k = [v,vcurrent,vnext] -# push!(T,k) -# end -# end -# end -# end -# get_vertex_coordinates(poly),T -# end - function GraphPolytope{D}(t::GridTopology{Dc,D};metadata=nothing) where {Dc,D} graph = compute_graph(t) X = get_vertex_coordinates(t) diff --git a/src/STLCutters.jl b/src/STLCutters.jl index 508c00b3..f452f8bc 100644 --- a/src/STLCutters.jl +++ b/src/STLCutters.jl @@ -26,6 +26,7 @@ using Gridap.ReferenceFEs: check_polytope_graph using Gridap.ReferenceFEs: get_graph using Gridap.ReferenceFEs: get_metadata using Gridap.ReferenceFEs: isactive +using Gridap.ReferenceFEs: point_eltype using GridapEmbedded.Distributed: consistent_bgcell_to_inoutcut! using GridapEmbedded.Distributed: consistent_bgfacet_to_inoutcut! using GridapEmbedded.Distributed: DistributedEmbeddedDiscretization From e68dd60f160669e95c16fcca4e4dae503664a605 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Wed, 15 May 2024 14:02:06 +0200 Subject: [PATCH 11/15] [polytope] rename GraphPolytope to GeneralPolytope --- Manifest.toml | 2 +- NEWS.md | 2 +- src/Polyhedra.jl | 14 +++++++------- src/STLCutters.jl | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Manifest.toml b/Manifest.toml index a3b484ff..edaedc99 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -464,7 +464,7 @@ version = "0.4.11" [[deps.Gridap]] deps = ["AbstractTrees", "BSON", "BlockArrays", "Combinatorics", "DataStructures", "DocStringExtensions", "FastGaussQuadrature", "FileIO", "FillArrays", "ForwardDiff", "JLD2", "JSON", "LineSearches", "LinearAlgebra", "NLsolve", "NearestNeighbors", "PolynomialBases", "QuadGK", "Random", "SparseArrays", "SparseMatricesCSR", "StaticArrays", "Statistics", "Test", "WriteVTK"] -git-tree-sha1 = "dcded32ccd2fbf55579c6cb9885a175a6a4d3a2f" +git-tree-sha1 = "155aa692a0b30aac808143e571bbac901a9f4af6" repo-rev = "general_polytope" repo-url = "https://github.com/gridap/Gridap.jl.git" uuid = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e" diff --git a/NEWS.md b/NEWS.md index 6ccf8523..9fb66528 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- `Polyhedron` is now defined in `Gridap` as `GraphPolytope{3} Date: Thu, 25 Jul 2024 18:11:32 +0200 Subject: [PATCH 12/15] rm manifest --- Manifest.toml | 1328 ------------------------------------------------- 1 file changed, 1328 deletions(-) delete mode 100644 Manifest.toml diff --git a/Manifest.toml b/Manifest.toml deleted file mode 100644 index edaedc99..00000000 --- a/Manifest.toml +++ /dev/null @@ -1,1328 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -julia_version = "1.10.3" -manifest_format = "2.0" -project_hash = "1217f800a589467bdf08b3659809d6e1b668de14" - -[[deps.ADTypes]] -git-tree-sha1 = "9b3993053b87311e699ac9e1bcabec5ae7444f65" -uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" -version = "1.2.0" - - [deps.ADTypes.extensions] - ADTypesChainRulesCoreExt = "ChainRulesCore" - ADTypesEnzymeCoreExt = "EnzymeCore" - - [deps.ADTypes.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" - -[[deps.AbstractFFTs]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef" -uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" -version = "1.5.0" -weakdeps = ["ChainRulesCore", "Test"] - - [deps.AbstractFFTs.extensions] - AbstractFFTsChainRulesCoreExt = "ChainRulesCore" - AbstractFFTsTestExt = "Test" - -[[deps.AbstractTrees]] -git-tree-sha1 = "2d9c9a55f9c93e8887ad391fbae72f8ef55e1177" -uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" -version = "0.4.5" - -[[deps.Accessors]] -deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "MacroTools", "Markdown", "Test"] -git-tree-sha1 = "c0d491ef0b135fd7d63cbc6404286bc633329425" -uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" -version = "0.1.36" - - [deps.Accessors.extensions] - AccessorsAxisKeysExt = "AxisKeys" - AccessorsIntervalSetsExt = "IntervalSets" - AccessorsStaticArraysExt = "StaticArrays" - AccessorsStructArraysExt = "StructArrays" - AccessorsUnitfulExt = "Unitful" - - [deps.Accessors.weakdeps] - AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5" - IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" - Requires = "ae029012-a4dd-5104-9daa-d747884805df" - StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" - StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" - Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" - -[[deps.Adapt]] -deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099" -uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "4.0.4" -weakdeps = ["StaticArrays"] - - [deps.Adapt.extensions] - AdaptStaticArraysExt = "StaticArrays" - -[[deps.AlgebraicMultigrid]] -deps = ["CommonSolve", "LinearAlgebra", "LinearSolve", "Printf", "Reexport", "SparseArrays"] -git-tree-sha1 = "eb3dbbca423d8e8a1d4061b890f775dcd31b8d7c" -uuid = "2169fc97-5a83-5252-b627-83903c6c433c" -version = "0.6.0" - -[[deps.Algoim]] -deps = ["CxxWrap", "LinearAlgebra", "StaticArrays", "algoimWrapper_jll"] -git-tree-sha1 = "28a966d12fdfa7af54170619ea974f2b97c10f89" -uuid = "0eb9048c-21de-4c7a-bfac-056de1940b74" -version = "0.2.0" - -[[deps.ArgCheck]] -git-tree-sha1 = "a3a402a35a2f7e0b87828ccabbd5ebfbebe356b4" -uuid = "dce04be8-c92d-5529-be00-80e4d2c0e197" -version = "2.3.0" - -[[deps.ArgTools]] -uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" -version = "1.1.1" - -[[deps.ArnoldiMethod]] -deps = ["LinearAlgebra", "Random", "StaticArrays"] -git-tree-sha1 = "f87e559f87a45bece9c9ed97458d3afe98b1ebb9" -uuid = "ec485272-7323-5ecc-a04f-4719b315124d" -version = "0.1.0" - -[[deps.ArrayInterface]] -deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "133a240faec6e074e07c31ee75619c90544179cf" -uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -version = "7.10.0" - - [deps.ArrayInterface.extensions] - ArrayInterfaceBandedMatricesExt = "BandedMatrices" - ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" - ArrayInterfaceCUDAExt = "CUDA" - ArrayInterfaceCUDSSExt = "CUDSS" - ArrayInterfaceChainRulesExt = "ChainRules" - ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" - ArrayInterfaceReverseDiffExt = "ReverseDiff" - ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" - ArrayInterfaceTrackerExt = "Tracker" - - [deps.ArrayInterface.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" - CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" - CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" - ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" - GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - -[[deps.ArrayLayouts]] -deps = ["FillArrays", "LinearAlgebra"] -git-tree-sha1 = "33207a8be6267bc389d0701e97a9bce6a4de68eb" -uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" -version = "1.9.2" -weakdeps = ["SparseArrays"] - - [deps.ArrayLayouts.extensions] - ArrayLayoutsSparseArraysExt = "SparseArrays" - -[[deps.Artifacts]] -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" - -[[deps.AutoHashEquals]] -deps = ["Pkg"] -git-tree-sha1 = "daaeb6f7f77b88c072a83a2451801818acb5c63b" -uuid = "15f4f7f2-30c1-5605-9d31-71845cf9641f" -version = "2.1.0" - -[[deps.BSON]] -git-tree-sha1 = "4c3e506685c527ac6a54ccc0c8c76fd6f91b42fb" -uuid = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" -version = "0.3.9" - -[[deps.Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[deps.BitTwiddlingConvenienceFunctions]] -deps = ["Static"] -git-tree-sha1 = "0c5f81f47bbbcf4aea7b2959135713459170798b" -uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b" -version = "0.1.5" - -[[deps.BlockArrays]] -deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra"] -git-tree-sha1 = "9a9610fbe5779636f75229e423e367124034af41" -uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e" -version = "0.16.43" - -[[deps.CPUSummary]] -deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] -git-tree-sha1 = "585a387a490f1c4bd88be67eea15b93da5e85db7" -uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" -version = "0.2.5" - -[[deps.ChainRulesCore]] -deps = ["Compat", "LinearAlgebra"] -git-tree-sha1 = "575cd02e080939a33b6df6c5853d14924c08e35b" -uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.23.0" -weakdeps = ["SparseArrays"] - - [deps.ChainRulesCore.extensions] - ChainRulesCoreSparseArraysExt = "SparseArrays" - -[[deps.CircularArrays]] -deps = ["OffsetArrays"] -git-tree-sha1 = "e24a6f390e5563583bb4315c73035b5b3f3e7ab4" -uuid = "7a955b69-7140-5f4e-a0ed-f168c5e2e749" -version = "1.4.0" - -[[deps.CloseOpenIntervals]] -deps = ["Static", "StaticArrayInterface"] -git-tree-sha1 = "70232f82ffaab9dc52585e0dd043b5e0c6b714f1" -uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9" -version = "0.1.12" - -[[deps.CodecZlib]] -deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "59939d8a997469ee05c4b4944560a820f9ba0d73" -uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.4" - -[[deps.ColorTypes]] -deps = ["FixedPointNumbers", "Random"] -git-tree-sha1 = "b10d0b65641d57b8b4d5e234446582de5047050d" -uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" -version = "0.11.5" - -[[deps.Combinatorics]] -git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860" -uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" -version = "1.0.2" - -[[deps.CommonSolve]] -git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" -uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" -version = "0.2.4" - -[[deps.CommonSubexpressions]] -deps = ["MacroTools", "Test"] -git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" -uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" -version = "0.3.0" - -[[deps.Compat]] -deps = ["TOML", "UUIDs"] -git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.15.0" -weakdeps = ["Dates", "LinearAlgebra"] - - [deps.Compat.extensions] - CompatLinearAlgebraExt = "LinearAlgebra" - -[[deps.CompilerSupportLibraries_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.1.1+0" - -[[deps.CompositionsBase]] -git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad" -uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b" -version = "0.1.2" -weakdeps = ["InverseFunctions"] - - [deps.CompositionsBase.extensions] - CompositionsBaseInverseFunctionsExt = "InverseFunctions" - -[[deps.ConcreteStructs]] -git-tree-sha1 = "f749037478283d372048690eb3b5f92a79432b34" -uuid = "2569d6c7-a4a2-43d3-a901-331e8e4be471" -version = "0.2.3" - -[[deps.ConstructionBase]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "260fd2400ed2dab602a7c15cf10c1933c59930a2" -uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.5.5" - - [deps.ConstructionBase.extensions] - ConstructionBaseIntervalSetsExt = "IntervalSets" - ConstructionBaseStaticArraysExt = "StaticArrays" - - [deps.ConstructionBase.weakdeps] - IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" - StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" - -[[deps.CpuId]] -deps = ["Markdown"] -git-tree-sha1 = "fcbb72b032692610bfbdb15018ac16a36cf2e406" -uuid = "adafc99b-e345-5852-983c-f28acb93d879" -version = "0.3.1" - -[[deps.CxxWrap]] -deps = ["Libdl", "MacroTools", "libcxxwrap_julia_jll"] -git-tree-sha1 = "3345cb637ca1efb2ebf7f5145558522b92660d1f" -uuid = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" -version = "0.14.2" - -[[deps.DataAPI]] -git-tree-sha1 = "abe83f3a2f1b857aac70ef8b269080af17764bbe" -uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.16.0" - -[[deps.DataStructures]] -deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "1d0a14036acb104d9e89698bd408f63ab58cdc82" -uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.20" - -[[deps.DataValueInterfaces]] -git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" -uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" -version = "1.0.0" - -[[deps.Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[deps.DiffResults]] -deps = ["StaticArraysCore"] -git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621" -uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" -version = "1.1.0" - -[[deps.DiffRules]] -deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] -git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" -uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.15.1" - -[[deps.Distances]] -deps = ["LinearAlgebra", "Statistics", "StatsAPI"] -git-tree-sha1 = "66c4c81f259586e8f002eacebc177e1fb06363b0" -uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" -version = "0.10.11" -weakdeps = ["ChainRulesCore", "SparseArrays"] - - [deps.Distances.extensions] - DistancesChainRulesCoreExt = "ChainRulesCore" - DistancesSparseArraysExt = "SparseArrays" - -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[deps.DocStringExtensions]] -deps = ["LibGit2"] -git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" -uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.9.3" - -[[deps.Downloads]] -deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] -uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" -version = "1.6.0" - -[[deps.EarCut_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "e3290f2d49e661fbd94046d7e3726ffcb2d41053" -uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5" -version = "2.2.4+0" - -[[deps.EnumX]] -git-tree-sha1 = "bdb1942cd4c45e3c678fd11569d5cccd80976237" -uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" -version = "1.0.4" - -[[deps.ExprTools]] -git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" -uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" -version = "0.1.10" - -[[deps.Extents]] -git-tree-sha1 = "2140cd04483da90b2da7f99b2add0750504fc39c" -uuid = "411431e0-e8b7-467b-b5e0-f676ba4f2910" -version = "0.1.2" - -[[deps.FFTW]] -deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"] -git-tree-sha1 = "4820348781ae578893311153d69049a93d05f39d" -uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" -version = "1.8.0" - -[[deps.FFTW_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "c6033cc3892d0ef5bb9cd29b7f2f0331ea5184ea" -uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a" -version = "3.3.10+0" - -[[deps.FastGaussQuadrature]] -deps = ["LinearAlgebra", "SpecialFunctions", "StaticArrays"] -git-tree-sha1 = "fd923962364b645f3719855c88f7074413a6ad92" -uuid = "442a2c76-b920-505d-bb47-c5924d526838" -version = "1.0.2" - -[[deps.FastLapackInterface]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "f4102aab9c7df8691ed09f9c42e34f5ab5458ab9" -uuid = "29a986be-02c6-4525-aec4-84b980013641" -version = "2.0.3" - -[[deps.FileIO]] -deps = ["Pkg", "Requires", "UUIDs"] -git-tree-sha1 = "82d8afa92ecf4b52d78d869f038ebfb881267322" -uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -version = "1.16.3" - -[[deps.FileWatching]] -uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" - -[[deps.FillArrays]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "0653c0a2396a6da5bc4766c43041ef5fd3efbe57" -uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" -version = "1.11.0" - - [deps.FillArrays.extensions] - FillArraysPDMatsExt = "PDMats" - FillArraysSparseArraysExt = "SparseArrays" - FillArraysStatisticsExt = "Statistics" - - [deps.FillArrays.weakdeps] - PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150" - SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" - Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" - -[[deps.FiniteDiff]] -deps = ["ArrayInterface", "LinearAlgebra", "Requires", "Setfield", "SparseArrays"] -git-tree-sha1 = "2de436b72c3422940cbe1367611d137008af7ec3" -uuid = "6a86dc24-6348-571c-b903-95158fe2bd41" -version = "2.23.1" - - [deps.FiniteDiff.extensions] - FiniteDiffBandedMatricesExt = "BandedMatrices" - FiniteDiffBlockBandedMatricesExt = "BlockBandedMatrices" - FiniteDiffStaticArraysExt = "StaticArrays" - - [deps.FiniteDiff.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" - StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" - -[[deps.FixedPointNumbers]] -deps = ["Statistics"] -git-tree-sha1 = "05882d6995ae5c12bb5f36dd2ed3f61c98cbb172" -uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" -version = "0.8.5" - -[[deps.ForwardDiff]] -deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions"] -git-tree-sha1 = "cf0fe81336da9fb90944683b8c41984b08793dad" -uuid = "f6369f11-7733-5829-9624-2563aa707210" -version = "0.10.36" -weakdeps = ["StaticArrays"] - - [deps.ForwardDiff.extensions] - ForwardDiffStaticArraysExt = "StaticArrays" - -[[deps.FunctionWrappers]] -git-tree-sha1 = "d62485945ce5ae9c0c48f124a84998d755bae00e" -uuid = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e" -version = "1.1.3" - -[[deps.FunctionWrappersWrappers]] -deps = ["FunctionWrappers"] -git-tree-sha1 = "b104d487b34566608f8b4e1c39fb0b10aa279ff8" -uuid = "77dc65aa-8811-40c2-897b-53d922fa7daf" -version = "0.1.3" - -[[deps.Future]] -deps = ["Random"] -uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" - -[[deps.GPUArraysCore]] -deps = ["Adapt"] -git-tree-sha1 = "ec632f177c0d990e64d955ccc1b8c04c485a0950" -uuid = "46192b85-c4d5-4398-a991-12ede77f4527" -version = "0.1.6" - -[[deps.GeoInterface]] -deps = ["Extents"] -git-tree-sha1 = "801aef8228f7f04972e596b09d4dba481807c913" -uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" -version = "1.3.4" - -[[deps.GeometryBasics]] -deps = ["EarCut_jll", "Extents", "GeoInterface", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"] -git-tree-sha1 = "b62f2b2d76cee0d61a2ef2b3118cd2a3215d3134" -uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326" -version = "0.4.11" - -[[deps.Gridap]] -deps = ["AbstractTrees", "BSON", "BlockArrays", "Combinatorics", "DataStructures", "DocStringExtensions", "FastGaussQuadrature", "FileIO", "FillArrays", "ForwardDiff", "JLD2", "JSON", "LineSearches", "LinearAlgebra", "NLsolve", "NearestNeighbors", "PolynomialBases", "QuadGK", "Random", "SparseArrays", "SparseMatricesCSR", "StaticArrays", "Statistics", "Test", "WriteVTK"] -git-tree-sha1 = "155aa692a0b30aac808143e571bbac901a9f4af6" -repo-rev = "general_polytope" -repo-url = "https://github.com/gridap/Gridap.jl.git" -uuid = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e" -version = "0.18.2" - -[[deps.GridapDistributed]] -deps = ["BlockArrays", "FillArrays", "Gridap", "LinearAlgebra", "MPI", "PartitionedArrays", "SparseArrays", "SparseMatricesCSR", "WriteVTK"] -git-tree-sha1 = "53c27134cd80fabb3a845cbc588486444a2f0571" -uuid = "f9701e48-63b3-45aa-9a63-9bc6c271f355" -version = "0.4.0" - -[[deps.GridapEmbedded]] -deps = ["AbstractTrees", "Algoim", "Combinatorics", "CxxWrap", "FillArrays", "Gridap", "GridapDistributed", "LightGraphs", "LinearAlgebra", "MPI", "MiniQhull", "PartitionedArrays", "Random", "Test", "algoimWrapper_jll"] -git-tree-sha1 = "87ca4f64cd1ee88be51b3ad623ae594385c990c1" -uuid = "8838a6a3-0006-4405-b874-385995508d5d" -version = "0.9.2" - -[[deps.HostCPUFeatures]] -deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"] -git-tree-sha1 = "eb8fed28f4994600e29beef49744639d985a04b2" -uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" -version = "0.1.16" - -[[deps.Hwloc_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "ca0f6bf568b4bfc807e7537f081c81e35ceca114" -uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" -version = "2.10.0+0" - -[[deps.IfElse]] -git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" -uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" -version = "0.1.1" - -[[deps.Inflate]] -git-tree-sha1 = "ea8031dea4aff6bd41f1df8f2fdfb25b33626381" -uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" -version = "0.1.4" - -[[deps.IntelOpenMP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "be50fe8df3acbffa0274a744f1a99d29c45a57f4" -uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0" -version = "2024.1.0+0" - -[[deps.InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[deps.InverseFunctions]] -deps = ["Test"] -git-tree-sha1 = "e7cbed5032c4c397a6ac23d1493f3289e01231c4" -uuid = "3587e190-3f89-42d0-90ee-14403ec27112" -version = "0.1.14" -weakdeps = ["Dates"] - - [deps.InverseFunctions.extensions] - DatesExt = "Dates" - -[[deps.IrrationalConstants]] -git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" -uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" -version = "0.2.2" - -[[deps.IterTools]] -git-tree-sha1 = "42d5f897009e7ff2cf88db414a389e5ed1bdd023" -uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" -version = "1.10.0" - -[[deps.IterativeSolvers]] -deps = ["LinearAlgebra", "Printf", "Random", "RecipesBase", "SparseArrays"] -git-tree-sha1 = "59545b0a2b27208b0650df0a46b8e3019f85055b" -uuid = "42fd0dbc-a981-5370-80f2-aaf504508153" -version = "0.9.4" - -[[deps.IteratorInterfaceExtensions]] -git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" -uuid = "82899510-4779-5014-852e-03e436cf321d" -version = "1.0.0" - -[[deps.JLD2]] -deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "Pkg", "PrecompileTools", "Printf", "Reexport", "Requires", "TranscodingStreams", "UUIDs"] -git-tree-sha1 = "dca9ff5abdf5fab4456876bc93f80c59a37b81df" -uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819" -version = "0.4.47" - -[[deps.JLLWrappers]] -deps = ["Artifacts", "Preferences"] -git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" -uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.5.0" - -[[deps.JSON]] -deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" -uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.4" - -[[deps.KLU]] -deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"] -git-tree-sha1 = "07649c499349dad9f08dde4243a4c597064663e9" -uuid = "ef3ab10e-7fda-4108-b977-705223b18434" -version = "0.6.0" - -[[deps.Krylov]] -deps = ["LinearAlgebra", "Printf", "SparseArrays"] -git-tree-sha1 = "267dad6b4b7b5d529c76d40ff48d33f7e94cb834" -uuid = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" -version = "0.9.6" - -[[deps.LayoutPointers]] -deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] -git-tree-sha1 = "62edfee3211981241b57ff1cedf4d74d79519277" -uuid = "10f19ff3-798f-405d-979b-55457f8fc047" -version = "0.1.15" - -[[deps.LazyArrays]] -deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "MacroTools", "MatrixFactorizations", "SparseArrays"] -git-tree-sha1 = "35079a6a869eecace778bcda8641f9a54ca3a828" -uuid = "5078a376-72f3-5289-bfd5-ec5146d43c02" -version = "1.10.0" -weakdeps = ["StaticArrays"] - - [deps.LazyArrays.extensions] - LazyArraysStaticArraysExt = "StaticArrays" - -[[deps.LazyArtifacts]] -deps = ["Artifacts", "Pkg"] -uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" - -[[deps.LibCURL]] -deps = ["LibCURL_jll", "MozillaCACerts_jll"] -uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" -version = "0.6.4" - -[[deps.LibCURL_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] -uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "8.4.0+0" - -[[deps.LibGit2]] -deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[deps.LibGit2_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] -uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" -version = "1.6.4+0" - -[[deps.LibSSH2_jll]] -deps = ["Artifacts", "Libdl", "MbedTLS_jll"] -uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" -version = "1.11.0+1" - -[[deps.Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[deps.Libiconv_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" -uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" -version = "1.17.0+0" - -[[deps.LightGraphs]] -deps = ["ArnoldiMethod", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] -git-tree-sha1 = "432428df5f360964040ed60418dd5601ecd240b6" -uuid = "093fc24a-ae57-5d10-9952-331d41423f4d" -version = "1.3.5" - -[[deps.LightXML]] -deps = ["Libdl", "XML2_jll"] -git-tree-sha1 = "3a994404d3f6709610701c7dabfc03fed87a81f8" -uuid = "9c8b4983-aa76-5018-a973-4c85ecc9e179" -version = "0.9.1" - -[[deps.LineSearches]] -deps = ["LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "Printf"] -git-tree-sha1 = "7bbea35cec17305fc70a0e5b4641477dc0789d9d" -uuid = "d3d80556-e9d4-5f37-9878-2ab0fcc64255" -version = "7.2.0" - -[[deps.LinearAlgebra]] -deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - -[[deps.LinearSolve]] -deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "DocStringExtensions", "EnumX", "FastLapackInterface", "GPUArraysCore", "InteractiveUtils", "KLU", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveFactorization", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Sparspak", "StaticArraysCore", "UnPack"] -git-tree-sha1 = "efd815eaa56c0ffdf86581df5aaefb7e901323a0" -uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" -version = "2.30.0" - - [deps.LinearSolve.extensions] - LinearSolveBandedMatricesExt = "BandedMatrices" - LinearSolveBlockDiagonalsExt = "BlockDiagonals" - LinearSolveCUDAExt = "CUDA" - LinearSolveCUDSSExt = "CUDSS" - LinearSolveEnzymeExt = ["Enzyme", "EnzymeCore"] - LinearSolveFastAlmostBandedMatricesExt = ["FastAlmostBandedMatrices"] - LinearSolveHYPREExt = "HYPRE" - LinearSolveIterativeSolversExt = "IterativeSolvers" - LinearSolveKernelAbstractionsExt = "KernelAbstractions" - LinearSolveKrylovKitExt = "KrylovKit" - LinearSolveMetalExt = "Metal" - LinearSolvePardisoExt = "Pardiso" - LinearSolveRecursiveArrayToolsExt = "RecursiveArrayTools" - - [deps.LinearSolve.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockDiagonals = "0a1fb500-61f7-11e9-3c65-f5ef3456f9f0" - CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" - CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" - Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" - EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" - FastAlmostBandedMatrices = "9d29842c-ecb8-4973-b1e9-a27b1157504e" - HYPRE = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771" - IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153" - KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" - KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" - Metal = "dde4c033-4e86-420c-a63e-0dd931031962" - Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2" - RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" - -[[deps.LogExpFunctions]] -deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "18144f3e9cbe9b15b070288eef858f71b291ce37" -uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.27" - - [deps.LogExpFunctions.extensions] - LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" - LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" - LogExpFunctionsInverseFunctionsExt = "InverseFunctions" - - [deps.LogExpFunctions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" - InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" - -[[deps.Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[deps.LoopVectorization]] -deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"] -git-tree-sha1 = "8f6786d8b2b3248d79db3ad359ce95382d5a6df8" -uuid = "bdcacae8-1622-11e9-2a5c-532679323890" -version = "0.12.170" -weakdeps = ["ChainRulesCore", "ForwardDiff", "SpecialFunctions"] - - [deps.LoopVectorization.extensions] - ForwardDiffExt = ["ChainRulesCore", "ForwardDiff"] - SpecialFunctionsExt = "SpecialFunctions" - -[[deps.MKL_jll]] -deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "oneTBB_jll"] -git-tree-sha1 = "80b2833b56d466b3858d565adcd16a4a05f2089b" -uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7" -version = "2024.1.0+0" - -[[deps.MPI]] -deps = ["Distributed", "DocStringExtensions", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "PkgVersion", "PrecompileTools", "Requires", "Serialization", "Sockets"] -git-tree-sha1 = "4e3136db3735924f96632a5b40a5979f1f53fa07" -uuid = "da04e1cc-30fd-572f-bb4f-1f8673147195" -version = "0.20.19" - - [deps.MPI.extensions] - AMDGPUExt = "AMDGPU" - CUDAExt = "CUDA" - - [deps.MPI.weakdeps] - AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e" - CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" - -[[deps.MPICH_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "4099bb6809ac109bfc17d521dad33763bcf026b7" -uuid = "7cb0a576-ebde-5e09-9194-50597f1243b4" -version = "4.2.1+1" - -[[deps.MPIPreferences]] -deps = ["Libdl", "Preferences"] -git-tree-sha1 = "c105fe467859e7f6e9a852cb15cb4301126fac07" -uuid = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" -version = "0.1.11" - -[[deps.MPItrampoline_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "ce0ca3dd147c43de175c5aff161315a424f4b8ac" -uuid = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748" -version = "5.3.3+1" - -[[deps.MacroTools]] -deps = ["Markdown", "Random"] -git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df" -uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.13" - -[[deps.ManualMemory]] -git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd" -uuid = "d125e4d3-2237-4719-b19c-fa641b8a4667" -version = "0.1.8" - -[[deps.Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[deps.MatrixFactorizations]] -deps = ["ArrayLayouts", "LinearAlgebra", "Printf", "Random"] -git-tree-sha1 = "6731e0574fa5ee21c02733e397beb133df90de35" -uuid = "a3b82374-2e81-5b9e-98ce-41277c0e4c87" -version = "2.2.0" - -[[deps.MbedTLS_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.28.2+1" - -[[deps.MeshIO]] -deps = ["ColorTypes", "FileIO", "GeometryBasics", "Printf"] -git-tree-sha1 = "8c26ab950860dfca6767f2bbd90fdf1e8ddc678b" -uuid = "7269a6da-0436-5bbc-96c2-40638cbb6118" -version = "0.4.11" - -[[deps.MicrosoftMPI_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f12a29c4400ba812841c6ace3f4efbb6dbb3ba01" -uuid = "9237b28f-5490-5468-be7b-bb81f5f5e6cf" -version = "10.1.4+2" - -[[deps.MiniQhull]] -deps = ["QhullMiniWrapper_jll"] -git-tree-sha1 = "9dc837d180ee49eeb7c8b77bb1c860452634b0d1" -uuid = "978d7f02-9e05-4691-894f-ae31a51d76ca" -version = "0.4.0" - -[[deps.Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[deps.MozillaCACerts_jll]] -uuid = "14a3606d-f60d-562e-9121-12d972cd8159" -version = "2023.1.10" - -[[deps.NLSolversBase]] -deps = ["DiffResults", "Distributed", "FiniteDiff", "ForwardDiff"] -git-tree-sha1 = "a0b464d183da839699f4c79e7606d9d186ec172c" -uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" -version = "7.8.3" - -[[deps.NLsolve]] -deps = ["Distances", "LineSearches", "LinearAlgebra", "NLSolversBase", "Printf", "Reexport"] -git-tree-sha1 = "019f12e9a1a7880459d0173c182e6a99365d7ac1" -uuid = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" -version = "4.5.1" - -[[deps.NaNMath]] -deps = ["OpenLibm_jll"] -git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" -uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" -version = "1.0.2" - -[[deps.NearestNeighbors]] -deps = ["Distances", "StaticArrays"] -git-tree-sha1 = "ded64ff6d4fdd1cb68dfcbb818c69e144a5b2e4c" -uuid = "b8a86587-4115-5ab1-83bc-aa920d37bbce" -version = "0.4.16" - -[[deps.NetworkOptions]] -uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" -version = "1.2.0" - -[[deps.OffsetArrays]] -git-tree-sha1 = "e64b4f5ea6b7389f6f046d13d4896a8f9c1ba71e" -uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.14.0" -weakdeps = ["Adapt"] - - [deps.OffsetArrays.extensions] - OffsetArraysAdaptExt = "Adapt" - -[[deps.OpenBLAS32_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"] -git-tree-sha1 = "6065c4cff8fee6c6770b277af45d5082baacdba1" -uuid = "656ef2d0-ae68-5445-9ca0-591084a874a2" -version = "0.3.24+0" - -[[deps.OpenBLAS_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] -uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.23+4" - -[[deps.OpenLibm_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "05823500-19ac-5b8b-9628-191a04bc5112" -version = "0.8.1+2" - -[[deps.OpenMPI_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "e25c1778a98e34219a00455d6e4384e017ea9762" -uuid = "fe0851c0-eecd-5654-98d4-656369965a5c" -version = "4.1.6+0" - -[[deps.OpenSpecFun_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" -uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.5+0" - -[[deps.OrderedCollections]] -git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" -uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.6.3" - -[[deps.Parameters]] -deps = ["OrderedCollections", "UnPack"] -git-tree-sha1 = "34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe" -uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" -version = "0.12.3" - -[[deps.Parsers]] -deps = ["Dates", "PrecompileTools", "UUIDs"] -git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" -uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.8.1" - -[[deps.PartitionedArrays]] -deps = ["CircularArrays", "Distances", "FillArrays", "IterativeSolvers", "LinearAlgebra", "MPI", "Printf", "Random", "SparseArrays", "SparseMatricesCSR"] -git-tree-sha1 = "149d2287770c6a533507d74beaa73d76c0727922" -uuid = "5a9dfac6-5c52-46f7-8278-5e2210713be9" -version = "0.3.4" - -[[deps.Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.10.0" - -[[deps.PkgVersion]] -deps = ["Pkg"] -git-tree-sha1 = "f9501cc0430a26bc3d156ae1b5b0c1b47af4d6da" -uuid = "eebad327-c553-4316-9ea0-9fa01ccd7688" -version = "0.3.3" - -[[deps.Polyester]] -deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Requires", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"] -git-tree-sha1 = "b3e2bae88cf07baf0a051fe09666b8ef97aefe93" -uuid = "f517fe37-dbe3-4b94-8317-1923a5111588" -version = "0.7.14" - -[[deps.PolyesterWeave]] -deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"] -git-tree-sha1 = "240d7170f5ffdb285f9427b92333c3463bf65bf6" -uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" -version = "0.2.1" - -[[deps.PolynomialBases]] -deps = ["ArgCheck", "AutoHashEquals", "FFTW", "FastGaussQuadrature", "LinearAlgebra", "Requires", "SimpleUnPack", "SpecialFunctions"] -git-tree-sha1 = "aa1877430a7e8b0c7a35ea095c415d462af0870f" -uuid = "c74db56a-226d-5e98-8bb0-a6049094aeea" -version = "0.4.21" - -[[deps.PrecompileTools]] -deps = ["Preferences"] -git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" -uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.2.1" - -[[deps.Preferences]] -deps = ["TOML"] -git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" -uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.4.3" - -[[deps.Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[deps.ProgressMeter]] -deps = ["Distributed", "Printf"] -git-tree-sha1 = "763a8ceb07833dd51bb9e3bbca372de32c0605ad" -uuid = "92933f4c-e287-5a05-a399-4b506db050ca" -version = "1.10.0" - -[[deps.QhullMiniWrapper_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Qhull_jll"] -git-tree-sha1 = "607cf73c03f8a9f83b36db0b86a3a9c14179621f" -uuid = "460c41e3-6112-5d7f-b78c-b6823adb3f2d" -version = "1.0.0+1" - -[[deps.Qhull_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "be2449911f4d6cfddacdf7efc895eceda3eee5c1" -uuid = "784f63db-0788-585a-bace-daefebcd302b" -version = "8.0.1003+0" - -[[deps.QuadGK]] -deps = ["DataStructures", "LinearAlgebra"] -git-tree-sha1 = "9b23c31e76e333e6fb4c1595ae6afa74966a729e" -uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" -version = "2.9.4" - -[[deps.REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[deps.Random]] -deps = ["SHA"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[deps.RecipesBase]] -deps = ["PrecompileTools"] -git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" -uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -version = "1.3.4" - -[[deps.RecursiveArrayTools]] -deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "SparseArrays", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] -git-tree-sha1 = "47f8fedb92e196d21d8d1f5f92d5de42449d1078" -uuid = "731186ca-8d62-57ce-b412-fbd966d074cd" -version = "3.18.1" - - [deps.RecursiveArrayTools.extensions] - RecursiveArrayToolsFastBroadcastExt = "FastBroadcast" - RecursiveArrayToolsForwardDiffExt = "ForwardDiff" - RecursiveArrayToolsMeasurementsExt = "Measurements" - RecursiveArrayToolsMonteCarloMeasurementsExt = "MonteCarloMeasurements" - RecursiveArrayToolsReverseDiffExt = ["ReverseDiff", "Zygote"] - RecursiveArrayToolsTrackerExt = "Tracker" - RecursiveArrayToolsZygoteExt = "Zygote" - - [deps.RecursiveArrayTools.weakdeps] - FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898" - ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" - Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" - MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" - -[[deps.RecursiveFactorization]] -deps = ["LinearAlgebra", "LoopVectorization", "Polyester", "PrecompileTools", "StrideArraysCore", "TriangularSolve"] -git-tree-sha1 = "6db1a75507051bc18bfa131fbc7c3f169cc4b2f6" -uuid = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" -version = "0.2.23" - -[[deps.Reexport]] -git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" -uuid = "189a3867-3050-52da-a836-e630ba90ab69" -version = "1.2.2" - -[[deps.Requires]] -deps = ["UUIDs"] -git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" -uuid = "ae029012-a4dd-5104-9daa-d747884805df" -version = "1.3.0" - -[[deps.RuntimeGeneratedFunctions]] -deps = ["ExprTools", "SHA", "Serialization"] -git-tree-sha1 = "04c968137612c4a5629fa531334bb81ad5680f00" -uuid = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" -version = "0.5.13" - -[[deps.SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" -version = "0.7.0" - -[[deps.SIMDTypes]] -git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c" -uuid = "94e857df-77ce-4151-89e5-788b33177be4" -version = "0.1.0" - -[[deps.SLEEFPirates]] -deps = ["IfElse", "Static", "VectorizationBase"] -git-tree-sha1 = "3aac6d68c5e57449f5b9b865c9ba50ac2970c4cf" -uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" -version = "0.6.42" - -[[deps.SciMLBase]] -deps = ["ADTypes", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] -git-tree-sha1 = "64486bd2cd4edc0da368ec839f62b6a4e118927b" -uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "2.37.0" - - [deps.SciMLBase.extensions] - SciMLBaseChainRulesCoreExt = "ChainRulesCore" - SciMLBaseMakieExt = "Makie" - SciMLBasePartialFunctionsExt = "PartialFunctions" - SciMLBasePyCallExt = "PyCall" - SciMLBasePythonCallExt = "PythonCall" - SciMLBaseRCallExt = "RCall" - SciMLBaseZygoteExt = "Zygote" - - [deps.SciMLBase.weakdeps] - ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" - PartialFunctions = "570af359-4316-4cb7-8c74-252c00c2016b" - PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" - PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d" - RCall = "6f49c342-dc21-5d91-9882-a32aef131414" - Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" - -[[deps.SciMLOperators]] -deps = ["ArrayInterface", "DocStringExtensions", "LinearAlgebra", "MacroTools", "Setfield", "SparseArrays", "StaticArraysCore"] -git-tree-sha1 = "10499f619ef6e890f3f4a38914481cc868689cd5" -uuid = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" -version = "0.3.8" - -[[deps.SciMLStructures]] -git-tree-sha1 = "d778a74df2f64059c38453b34abad1953b2b8722" -uuid = "53ae85a6-f571-4167-b2af-e1d143709226" -version = "1.2.0" - -[[deps.Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[deps.Setfield]] -deps = ["ConstructionBase", "Future", "MacroTools", "StaticArraysCore"] -git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" -uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" -version = "1.1.1" - -[[deps.SharedArrays]] -deps = ["Distributed", "Mmap", "Random", "Serialization"] -uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" - -[[deps.SimpleTraits]] -deps = ["InteractiveUtils", "MacroTools"] -git-tree-sha1 = "5d7e3f4e11935503d3ecaf7186eac40602e7d231" -uuid = "699a6c99-e7fa-54fc-8d76-47d257e15c1d" -version = "0.9.4" - -[[deps.SimpleUnPack]] -git-tree-sha1 = "58e6353e72cde29b90a69527e56df1b5c3d8c437" -uuid = "ce78b400-467f-4804-87d8-8f486da07d0a" -version = "1.1.0" - -[[deps.Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[deps.SparseArrays]] -deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -version = "1.10.0" - -[[deps.SparseMatricesCSR]] -deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "38677ca58e80b5cad2382e5a1848f93b054ad28d" -uuid = "a0a7dd2c-ebf4-11e9-1f05-cf50bc540ca1" -version = "0.6.7" - -[[deps.Sparspak]] -deps = ["Libdl", "LinearAlgebra", "Logging", "OffsetArrays", "Printf", "SparseArrays", "Test"] -git-tree-sha1 = "342cf4b449c299d8d1ceaf00b7a49f4fbc7940e7" -uuid = "e56a9233-b9d6-4f03-8d0f-1825330902ac" -version = "0.3.9" - -[[deps.SpecialFunctions]] -deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "2f5d4697f21388cbe1ff299430dd169ef97d7e14" -uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.4.0" -weakdeps = ["ChainRulesCore"] - - [deps.SpecialFunctions.extensions] - SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" - -[[deps.Static]] -deps = ["IfElse"] -git-tree-sha1 = "d2fdac9ff3906e27f7a618d47b676941baa6c80c" -uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" -version = "0.8.10" - -[[deps.StaticArrayInterface]] -deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] -git-tree-sha1 = "5d66818a39bb04bf328e92bc933ec5b4ee88e436" -uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" -version = "1.5.0" -weakdeps = ["OffsetArrays", "StaticArrays"] - - [deps.StaticArrayInterface.extensions] - StaticArrayInterfaceOffsetArraysExt = "OffsetArrays" - StaticArrayInterfaceStaticArraysExt = "StaticArrays" - -[[deps.StaticArrays]] -deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] -git-tree-sha1 = "bf074c045d3d5ffd956fa0a461da38a44685d6b2" -uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.9.3" -weakdeps = ["ChainRulesCore", "Statistics"] - - [deps.StaticArrays.extensions] - StaticArraysChainRulesCoreExt = "ChainRulesCore" - StaticArraysStatisticsExt = "Statistics" - -[[deps.StaticArraysCore]] -git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" -uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.2" - -[[deps.Statistics]] -deps = ["LinearAlgebra", "SparseArrays"] -uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -version = "1.10.0" - -[[deps.StatsAPI]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed" -uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" -version = "1.7.0" - -[[deps.StrideArraysCore]] -deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"] -git-tree-sha1 = "25349bf8f63aa36acbff5e3550a86e9f5b0ef682" -uuid = "7792a7ef-975c-4747-a70f-980b88e8d1da" -version = "0.5.6" - -[[deps.StructArrays]] -deps = ["ConstructionBase", "DataAPI", "Tables"] -git-tree-sha1 = "f4dc295e983502292c4c3f951dbb4e985e35b3be" -uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" -version = "0.6.18" -weakdeps = ["Adapt", "GPUArraysCore", "SparseArrays", "StaticArrays"] - - [deps.StructArrays.extensions] - StructArraysAdaptExt = "Adapt" - StructArraysGPUArraysCoreExt = "GPUArraysCore" - StructArraysSparseArraysExt = "SparseArrays" - StructArraysStaticArraysExt = "StaticArrays" - -[[deps.SuiteSparse]] -deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] -uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" - -[[deps.SuiteSparse_jll]] -deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] -uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "7.2.1+1" - -[[deps.SymbolicIndexingInterface]] -deps = ["Accessors", "ArrayInterface", "RuntimeGeneratedFunctions", "StaticArraysCore"] -git-tree-sha1 = "b479c7a16803f08779ac5b7f9844a42621baeeda" -uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5" -version = "0.3.21" - -[[deps.TOML]] -deps = ["Dates"] -uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -version = "1.0.3" - -[[deps.TableTraits]] -deps = ["IteratorInterfaceExtensions"] -git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" -uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" -version = "1.0.1" - -[[deps.Tables]] -deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"] -git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d" -uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.11.1" - -[[deps.Tar]] -deps = ["ArgTools", "SHA"] -uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" -version = "1.10.0" - -[[deps.Test]] -deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[deps.ThreadingUtilities]] -deps = ["ManualMemory"] -git-tree-sha1 = "eda08f7e9818eb53661b3deb74e3159460dfbc27" -uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5" -version = "0.5.2" - -[[deps.TranscodingStreams]] -git-tree-sha1 = "5d54d076465da49d6746c647022f3b3674e64156" -uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.10.8" -weakdeps = ["Random", "Test"] - - [deps.TranscodingStreams.extensions] - TestExt = ["Test", "Random"] - -[[deps.TriangularSolve]] -deps = ["CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "LoopVectorization", "Polyester", "Static", "VectorizationBase"] -git-tree-sha1 = "66c68a20907800c0b7c04ff8a6164115e8747de2" -uuid = "d5829a12-d9aa-46ab-831f-fb7c9ab06edf" -version = "0.2.0" - -[[deps.UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[deps.UnPack]] -git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" -uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" -version = "1.0.2" - -[[deps.Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[deps.VTKBase]] -git-tree-sha1 = "c2d0db3ef09f1942d08ea455a9e252594be5f3b6" -uuid = "4004b06d-e244-455f-a6ce-a5f9919cc534" -version = "1.0.1" - -[[deps.VectorizationBase]] -deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"] -git-tree-sha1 = "6129a4faf6242e7c3581116fbe3270f3ab17c90d" -uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" -version = "0.21.67" - -[[deps.WriteVTK]] -deps = ["Base64", "CodecZlib", "FillArrays", "LightXML", "TranscodingStreams", "VTKBase"] -git-tree-sha1 = "48b9e8e9c83865e99e57f027d4edfa94e0acddae" -uuid = "64499a7a-5c06-52f2-abe2-ccb03c286192" -version = "1.19.1" - -[[deps.XML2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] -git-tree-sha1 = "532e22cf7be8462035d092ff21fada7527e2c488" -uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.12.6+0" - -[[deps.Zlib_jll]] -deps = ["Libdl"] -uuid = "83775a58-1f1d-513f-b197-d71354ab007a" -version = "1.2.13+1" - -[[deps.algoimWrapper_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenBLAS32_jll", "libcxxwrap_julia_jll"] -git-tree-sha1 = "52e80bb6259731283d43ab3d8a2a326e91de54ef" -uuid = "3c43aa7b-5398-51f3-8d75-8f051e6faa4d" -version = "0.2.1+0" - -[[deps.libblastrampoline_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.8.0+1" - -[[deps.libcxxwrap_julia_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "02d0a0a623248c709727088aaf722ab14f1463a5" -uuid = "3eaa8342-bff7-56a5-9981-c04077f7cee7" -version = "0.11.2+1" - -[[deps.nghttp2_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.52.0+1" - -[[deps.oneTBB_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "7d0ea0f4895ef2f5cb83645fa689e52cb55cf493" -uuid = "1317d2d5-d96f-522e-a858-c73665f53c3e" -version = "2021.12.0+0" - -[[deps.p7zip_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" -version = "17.4.0+2" From 0ce2164c041156c394fbe72a999a5d1c9cbeac53 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Thu, 25 Jul 2024 18:12:48 +0200 Subject: [PATCH 13/15] bump project version 0.3.0 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 631e2ef5..a9f07482 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "STLCutters" uuid = "284f087d-c8bb-44c4-af3c-39d0e1f330a5" authors = ["Pere Antoni Martorell", "Large Scale Scientific Computing"] -version = "0.2.1" +version = "0.3.0" [deps] AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c" From 3adabe32436b4ce079a68bd0b4486944e4422582 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Thu, 25 Jul 2024 18:56:48 +0200 Subject: [PATCH 14/15] local distributed simplexify [temporary] --- src/Distributed.jl | 2 +- test/DistributedTests/CutterTests.jl | 2 +- test/DistributedTests/Poisson.jl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Distributed.jl b/src/Distributed.jl index 2e430445..e7fc7c38 100644 --- a/src/Distributed.jl +++ b/src/Distributed.jl @@ -693,7 +693,7 @@ end # PR @ GridapDistributed.jl -function Gridap.ReferenceFEs.simplexify(model::DistributedDiscreteModel{D};kwargs...) where D +function _simplexify(model::DistributedDiscreteModel{D};kwargs...) where D models = map(local_views(model)) do m Gridap.ReferenceFEs.simplexify(m;kwargs...) end diff --git a/test/DistributedTests/CutterTests.jl b/test/DistributedTests/CutterTests.jl index 3253e343..ad6d8f0f 100644 --- a/test/DistributedTests/CutterTests.jl +++ b/test/DistributedTests/CutterTests.jl @@ -35,7 +35,7 @@ function main(distribute; pmax = pmax + diagonal*δ bgmodel = CartesianDiscreteModel(ranks,np,pmin,pmax,nc) if simplex - bgmodel = simplexify(bgmodel,positive=true) + bgmodel = STLCutters._simplexify(bgmodel,positive=true) end cutter = STLCutter(;tolfactor,timers) diff --git a/test/DistributedTests/Poisson.jl b/test/DistributedTests/Poisson.jl index 768ad5bf..7195aa52 100644 --- a/test/DistributedTests/Poisson.jl +++ b/test/DistributedTests/Poisson.jl @@ -36,7 +36,7 @@ function main(distribute; pmax = pmax + diagonal*δ bgmodel = CartesianDiscreteModel(ranks,np,pmin,pmax,nc) if simplex - bgmodel = simplexify(bgmodel,positive=true) + bgmodel = STLCutters._simplexify(bgmodel,positive=true) end cutter = STLCutter(;tolfactor) From b572bd11509e6030430a2cf467dd9c4d1189ae65 Mon Sep 17 00:00:00 2001 From: Pere Antoni Martorell Date: Thu, 25 Jul 2024 18:58:30 +0200 Subject: [PATCH 15/15] edit cross reference docstring --- src/Polyhedra.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Polyhedra.jl b/src/Polyhedra.jl index 308d3d64..ea37e419 100644 --- a/src/Polyhedra.jl +++ b/src/Polyhedra.jl @@ -19,7 +19,7 @@ end """ PolyhedronData - Metadata for [`GeneralPolytope`](@ref) that serves for performing geometrical + Metadata for `Gridap.ReferenceFEs.GeneralPolytope` that serves for performing geometrical operations. The metadata stores the following information: