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

Add non-public API functions. #51

Merged
merged 3 commits into from
Jan 29, 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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "T8code"
uuid = "d0cc0030-9a40-4274-8435-baadcfd54fa1"
authors = ["Johannes Markert <[email protected]>"]
version = "0.5.1"
version = "0.5.2"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand Down
39 changes: 39 additions & 0 deletions src/T8code.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,43 @@ function __init__()
end
end

function t8_free(ptr)
T8code.Libt8.sc_free(t8_get_package_id(), ptr)
end

# Following functions are not part of the official public API of t8code but are
# needed nevertheless by some application codes. This will be fixed resp. more
# streamlined in future releases of t8code.

export t8_forest_ghost_get_remotes
function t8_forest_ghost_get_remotes(forest)
num_remotes_ref = Ref{Cint}()
remotes_ptr = @ccall T8code.Libt8.libt8.t8_forest_ghost_get_remotes(forest::t8_forest_t,
num_remotes_ref::Ptr{Cint})::Ptr{Cint}
remotes = unsafe_wrap(Array, remotes_ptr, num_remotes_ref[])
end

export t8_forest_ghost_remote_first_elem
function t8_forest_ghost_remote_first_elem(forest, remote)
@ccall T8code.Libt8.libt8.t8_forest_ghost_remote_first_elem(forest::t8_forest_t,
remote::Cint)::t8_locidx_t
end

export t8_forest_ghost_num_trees
function t8_forest_ghost_num_trees(forest)
@ccall T8code.Libt8.libt8.t8_forest_ghost_num_trees(forest::t8_forest_t)::t8_locidx_t
end

export t8_forest_ghost_get_tree_element_offset
function t8_forest_ghost_get_tree_element_offset(forest, lghost_tree)
@ccall T8code.Libt8.libt8.t8_forest_ghost_get_tree_element_offset(forest::t8_forest_t,
lghost_tree::t8_locidx_t)::t8_locidx_t
end

export t8_forest_ghost_get_global_treeid
function t8_forest_ghost_get_global_treeid(forest, lghost_tree)
@ccall T8code.Libt8.libt8.t8_forest_ghost_get_global_treeid(forest::t8_forest_t,
lghost_tree::t8_locidx_t)::t8_gloidx_t
end

end
Loading