Skip to content

Commit

Permalink
fix for node ordering in tensor grid constructor such that no negativ…
Browse files Browse the repository at this point in the history
…e cell volumes occur
  • Loading branch information
Christian Merdon committed Mar 22, 2022
1 parent 78761c2 commit f9d47ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ExtendableGrids"
uuid = "cfc395e8-590f-11e8-1f13-43a2532b2fa8"
authors = ["Juergen Fuhrmann <[email protected]>, Christian Merdon <[email protected]>"]
version = "0.9.1"
version = "0.9.2"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
17 changes: 16 additions & 1 deletion src/simplexgrid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,22 @@ function simplexgrid(grid2::ExtendableGrid, coordZ; bot_offset=0,cell_offset=0,t
end
ishift+=nnodes2
end
simplexgrid(coord3,cells3,cellregions3,bfaces3,bfaceregions3)

xgrid = simplexgrid(coord3,cells3,cellregions3,bfaces3,bfaceregions3)

## quick and dirty fix of local orderings to avoid negative CellVolumes
## and problems with CellFinder
cellvolumes = xgrid[CellVolumes]
cellnodes = xgrid[CellNodes]
for cell = 1 : num_cells(xgrid)
if cellvolumes[cell] < 0
ishift = cellnodes[1,cell]
cellnodes[1,cell] = cellnodes[2,cell]
cellnodes[2,cell] = ishift
cellvolumes[cell] *= -1
end
end
return xgrid
end


Expand Down

2 comments on commit f9d47ae

@j-fu
Copy link
Member

@j-fu j-fu commented on f9d47ae Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/57087

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.2 -m "<description of version>" f9d47ae0d297d379a7e1838727f6ad303e390274
git push origin v0.9.2

Please sign in to comment.