Skip to content

Commit

Permalink
Merge branch 'main' into bg/gtest
Browse files Browse the repository at this point in the history
  • Loading branch information
benegee committed Aug 24, 2023
2 parents a66c1cb + e19b886 commit 363ec19
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,14 @@ to use the C and Fortran APIs of libtrixi, and can be found in the
[`examples/`](examples/) folder.

If you just want to test the Julia part of libtrixi, i.e., LibTrixi.jl, you can also run
everything from Julia. From the repository root, execute
everything from Julia.

```shell
JULIA_DEPOT_PATH=$PWD/libtrixi-julia/julia-depot \
JULIA_DEPOT_PATH=<julia-depot_directory> \
LIBTRIXI_DEBUG=all \
julia --project=<libtrixi-julia_directory>
<install_directory>/share/libtrixi/LibTrixi.jl/examples/simple_trixi_controller.jl
<install_directory>/share/libtrixi/examples/simple_trixi_controller.jl
<install_directory>/share/libtrixi/LibTrixi.jl/examples/libelixir_tree1d_dgsem_advection_basic.jl
```

Note: Most auxiliary output is hidden unless the environment variable `LIBTRIXI_DEBUG` is
Expand Down
3 changes: 3 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ foreach ( EXAMPLE ${EXAMPLES} )
install( TARGETS ${TARGET_NAME} )

endforeach()

# install the julia controller example as well
install( FILES simple_trixi_controller.jl DESTINATION share/libtrixi/examples/ )
9 changes: 5 additions & 4 deletions examples/simple_trixi_controller.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using LibTrixi

project_dir = "libtrixi-julia"
libelixir = "LibTrixi.jl/examples/libelixir_tree1d_dgsem_advection_basic.jl"
if length(ARGS) < 1
error("ERROR: missing argument LIBELIXIR_PATH")
end

println("*** Trixi controller *** Set up Trixi simulation")
handle = trixi_initialize_simulation(libelixir)
handle = trixi_initialize_simulation(ARGS[1])

println("*** Trixi controller *** Current time step length: ", trixi_calculate_dt(handle))

Expand All @@ -15,4 +16,4 @@ while trixi_is_finished(handle) == 0
end

println("*** Trixi controller *** Finalize Trixi simulation")
handle = trixi_finalize_simulation(handle)
trixi_finalize_simulation(handle)
4 changes: 2 additions & 2 deletions utils/libtrixi-init-julia
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ usage: libtrixi-init-julia [-h] [-f]
PREFIX_OR_REPO
Set up all necessary project files in the current working directory and set appropriate
Julia preferences for using the system-installed MPI and p4est libraries. Furthermore, this
will install all dependencies in a local Julia depot folder (unless changed with the
Julia preferences for using the system-installed MPI and t8code libraries. Furthermore,
this will install all dependencies in a local Julia depot folder (unless changed with the
'--julia-depot' flag).
The following files/folders will be created (or updated, if the '-f' flag is given):
Expand Down

0 comments on commit 363ec19

Please sign in to comment.