-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b1b37c
commit 1918464
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import Base | ||
|
||
# pass as first argument the path to libopenPMD.jl.so | ||
|
||
module openPMD | ||
using CxxWrap | ||
@wrapmodule(ARGS[1]) | ||
|
||
function __init__() | ||
@initcxx | ||
end | ||
end | ||
|
||
s = openPMD.CXX_Series( | ||
"../samples/lowlevel_julia_test.json", openPMD.ACCESS_CREATE) | ||
|
||
function Base.getindex( | ||
cont::Cont, | ||
index, | ||
) where | ||
{ | ||
A, | ||
B, | ||
Cont<:openPMD.CXX_Container{A,B} | ||
} | ||
return openPMD.cxx_getindex(cont, index) | ||
end | ||
|
||
iteration = openPMD.cxx_iterations(s)[100] | ||
mesh = openPMD.cxx_meshes(iteration) | ||
# empty brackets to dereference CxxRef | ||
# automatic dereferencing works only for Int types since CxxRwap.jl defines | ||
# Base.getindex(x::CxxBaseRef, i::Int) = Base.getindex(x[], i) | ||
mesh[]["E"][]["x"] | ||
openPMD.cxx_flush(s, "{}") |