Skip to content

Commit 226dc40

Browse files
authored
Add macro for t8_geom_load_tree_data_fn (#71)
1 parent baa52ff commit 226dc40

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/T8code.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ include("Libt8.jl")
1919

2020
export @t8_adapt_callback
2121
export @t8_replace_callback
22+
export @t8_load_tree_data
2223
export @T8_ASSERT
2324
export t8_free
2425

@@ -213,6 +214,20 @@ macro t8_replace_callback(callback)
213214
Cint, t8_locidx_t)))
214215
end
215216

217+
# typedef void (*t8_geom_load_tree_data_fn) (t8_cmesh_t cmesh,
218+
# t8_gloidx_t gtreeid,
219+
# const void **tree_data);
220+
"""
221+
@t8_load_tree_data(callback)
222+
223+
Wrap the Julia function `callback` in an `@cfunction` with the appropriate
224+
signature required for callback functions in [`t8_geom_load_tree_data_fn`](@ref).
225+
"""
226+
macro t8_load_tree_data(callback)
227+
:(@cfunction($callback, Cvoid,
228+
(t8_cmesh_t, t8_gloidx_t, Ptr{Cvoid})))
229+
end
230+
216231
function __init__()
217232
if !preferences_set_correctly()
218233
@warn "System MPI version detected, but not a system t8code version. To make T8code.jl work, you need to set the preferences, see https://github.com/DLR-AMR/T8code.jl#using-a-custom-version-of-mpi-andor-t8code."

0 commit comments

Comments
 (0)