Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix negative CellVolumes for grids from 3D simplexgrid constructor #54

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/simplexgrid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,11 @@ function simplexgrid(_X::AbstractVector,_Y::AbstractVector,_Z::AbstractVector;
p111 = ip+1+nx+nxy;

icell=icell+1; @. cellnodes[:,icell]=(p000,p100,p110,p111)
icell=icell+1; @. cellnodes[:,icell]=(p000,p100,p101,p111)
icell=icell+1; @. cellnodes[:,icell]=(p000,p101,p100,p111)
icell=icell+1; @. cellnodes[:,icell]=(p000,p010,p011,p111)
icell=icell+1; @. cellnodes[:,icell]=(p000,p010,p110,p111)
icell=icell+1; @. cellnodes[:,icell]=(p000,p110,p010,p111)
icell=icell+1; @. cellnodes[:,icell]=(p000,p001,p101,p111)
icell=icell+1; @. cellnodes[:,icell]=(p000,p001,p011,p111)
icell=icell+1; @. cellnodes[:,icell]=(p000,p011,p001,p111)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ end
sha256(f)
end |> bytes2hex

@test sha_code == "93a31139ccb3ae3017351d7cef0c2639c5def97c9744699543fe8bc58e1ebcea"
@test sha_code == "f7e86e426aa6673699bd470f6db328a177eabdee74c71cfa6a855a2507b4f1bb"
end


3 changes: 2 additions & 1 deletion test/test_gridstuff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,15 @@ function run_grid_tests()

X = LinRange(0, 1, 10)
grid = simplexgrid(X, X)
@test all(grid[CellVolumes] .> 0)
sub = subgrid(grid, [2], transform=function(a,b) a[1]=b[2] end, boundary=true)
@test check_cellfinder(sub)

grid = simplexgrid(X, X, X)
@test all(grid[CellVolumes] .> 0)
sub = subgrid(grid, [5], boundary=true)
@test check_cellfinder(sub)



@test check_uniform_refinement(reference_domain(Triangle2D), false)
@test check_uniform_refinement(reference_domain(Triangle2D), true)
Expand Down
Loading