Skip to content

Commit

Permalink
Merge pull request #252 from gridap/simplexify_for_1d_case
Browse files Browse the repository at this point in the history
Extended simplexify for SEGMENT and VERTEX
  • Loading branch information
fverdugo authored May 15, 2020
2 parents 5d14172 + 42bd76e commit c8cf93e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/ReferenceFEs/ExtrusionPolytopes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,26 @@ function is_n_cube(p::ExtrusionPolytope{0})
true
end

function is_simplex(p::ExtrusionPolytope{1})
true
end

function is_n_cube(p::ExtrusionPolytope{1})
true
end

function simplexify(p::ExtrusionPolytope)
@notimplemented
end

function simplexify(p::ExtrusionPolytope{0})
[[1,],], VERTEX
end

function simplexify(p::ExtrusionPolytope{1})
[[1,2],], SEGMENT
end

function simplexify(p::ExtrusionPolytope{2})
if p == QUAD
([[1,2,3],[2,3,4]], TRI)
Expand Down
12 changes: 12 additions & 0 deletions test/ReferenceFEsTests/ExtrusionPolytopesTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,22 @@ r = [[[1,2],[2,1]],[[1,2],[2,1]],[[1,2],[2,1]]]
v,p = simplexify(QUAD)
@test p == TRI

v,p = simplexify(TRI)
@test p == TRI

v,p = simplexify(HEX)
@test p == TET

v,p = simplexify(TET)
@test p == TET

v,p = simplexify(SEGMENT)
@test p == SEGMENT
@test is_simplex(p)

v,p = simplexify(VERTEX)
@test p == VERTEX
@test is_simplex(p)



Expand Down

0 comments on commit c8cf93e

Please sign in to comment.