File tree 2 files changed +43
-0
lines changed
2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -652,6 +652,14 @@ if(openPMD_HAVE_JULIA)
652
652
POSITION_INDEPENDENT_CODE ON
653
653
WINDOWS_EXPORT_ALL_SYMBOLS ON
654
654
)
655
+
656
+ add_test (NAME CLI.julia_lowlevel
657
+ COMMAND julia
658
+ ${openPMD_SOURCE_DIR} /test /julia/lowlevel_test.jl
659
+ ${openPMD_LIBRARY_OUTPUT_DIRECTORY} /libopenPMD.jl.so
660
+ WORKING_DIRECTORY
661
+ ${openPMD_RUNTIME_OUTPUT_DIRECTORY}
662
+ )
655
663
endif ()
656
664
657
665
# python bindings
Original file line number Diff line number Diff line change
1
+ import Base
2
+
3
+ # pass as first argument the path to libopenPMD.jl.so
4
+
5
+ module openPMD
6
+ using CxxWrap
7
+ @wrapmodule (ARGS [1 ])
8
+
9
+ function __init__ ()
10
+ @initcxx
11
+ end
12
+ end
13
+
14
+ s = openPMD. CXX_Series (
15
+ " ../samples/lowlevel_julia_test.json" , openPMD. ACCESS_CREATE)
16
+
17
+ function Base. getindex (
18
+ cont:: Cont ,
19
+ index,
20
+ ) where
21
+ {
22
+ A,
23
+ B,
24
+ Cont<: openPMD.CXX_Container{A,B}
25
+ }
26
+ return openPMD. cxx_getindex (cont, index)
27
+ end
28
+
29
+ iteration = openPMD. cxx_iterations (s)[100 ]
30
+ mesh = openPMD. cxx_meshes (iteration)
31
+ # empty brackets to dereference CxxRef
32
+ # automatic dereferencing works only for Int types since CxxRwap.jl defines
33
+ # Base.getindex(x::CxxBaseRef, i::Int) = Base.getindex(x[], i)
34
+ mesh[][" E" ][][" x" ]
35
+ openPMD. cxx_flush (s, " {}" )
You can’t perform that action at this time.
0 commit comments