Skip to content

Commit

Permalink
propagate labels of surface elements
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrKryslUCSD committed Jun 18, 2024
1 parent 61af9f1 commit d551cc7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FinEtools"
uuid = "91bb5406-6c9a-523d-811d-0644c4229550"
authors = ["Petr Krysl <[email protected]>"]
version = "8.0.23"
version = "8.0.24"

[deps]
DataDrop = "aa547a04-dd37-49ab-8e73-656744f8a8fc"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The package supports application packages, for instance:

## News

- 06/17/2024: Propagate labels of extruded triangles.
- 05/19/2024: Make it possible to have different kinds of degrees of freedom.
- 04/19/2024: Replace asserts with errors.
- 04/11/2024: Speed up box selection of elements.
Expand Down
6 changes: 6 additions & 0 deletions src/MeshTetrahedronModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@ function _doextrude(fens, fes::FESetT3, nLayers, extrusionh)
nn1 = count(fens) # number of nodes in the surface to be extruded
nt1 = count(fes)
ntets = 3 * nt1 * nLayers # number of tetrahedra to be generated
labels = zeros(Int, ntets)
tconn = zeros(Int, ntets, 4)
xyz = zeros(eltype(fens.xyz), nn1 * (nLayers + 1), 3) # array of coordinates for each of the nodes in the resulting mesh
for j = 1:nn1
Expand All @@ -1011,16 +1012,21 @@ function _doextrude(fens, fes::FESetT3, nLayers, extrusionh)
# The algorithm traverses triangles one by one and generates three tetrahedra
# per triangle. The connectivities of those tetrahedra are:
i, j, k = (fes.conn[triangle] .+ (layer - 1) * nn1)
label = fes.label[triangle]
N = nn1
tconn[cel, :] = [i, i < j ? j : j + N, i < k ? k : k + N, i + N]
labels[cel] = label
cel = cel + 1
tconn[cel, :] = [j, j < k ? k : k + N, j < i ? i : i + N, j + N]
labels[cel] = label
cel = cel + 1
tconn[cel, :] = [k, k < i ? i : i + N, k < j ? j : j + N, k + N]
labels[cel] = label
cel = cel + 1
end
end
efes = FESetT4(tconn)
setlabel!(efes, labels)
efens = FENodeSet(xyz)
return efens, efes
end
Expand Down
1 change: 1 addition & 0 deletions test/test_meshing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6449,6 +6449,7 @@ function test()
@test count(fens) == (nlayers + 1) * count(surfens)
# @show fens, fes
@test count(fes) == 3 * nlayers * count(surfes)
@test length(findall(x -> x == 3, fes.label)) == count(fes)
# @show count(fens)
goodnodes = true
for i in eachindex(fes)
Expand Down

2 comments on commit d551cc7

@PetrKryslUCSD
Copy link
Owner Author

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/109223

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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 v8.0.24 -m "<description of version>" d551cc793be9b2eba8a269ea6b9f8b687531975a
git push origin v8.0.24

Please sign in to comment.