From f3008e86c4548c2a1feabf81f862289500e17c07 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Wed, 2 Aug 2023 06:31:51 +0000 Subject: [PATCH] build based on cb98aa6 --- dev/benchmark/index.html | 2 +- dev/contributing/index.html | 2 +- dev/examples/index.html | 2 +- .../postprocess/demo_convert2vti/index.html | 2 +- .../demo_em_extract_slice/index.html | 2 +- .../demo_lineextracting_mt/index.html | 2 +- dev/examples/postprocess/demo_log/index.html | 2 +- .../demo_magnetopause_2d_mt/index.html | 2 +- .../demo_pointextracting/index.html | 2 +- .../demo_pointsextracting/index.html | 2 +- .../index.html | 2 +- .../demo_wave_satellite_mt/index.html | 2 +- .../demo_wave_search_mt/index.html | 2 +- .../demo_wave_tracing_mt/index.html | 2 +- .../postprocess/demo_x_o_points/index.html | 2 +- .../demo_x_points_extracting/index.html | 2 +- .../demo_1d2d_mp_pyplot/index.html | 2 +- .../visualization/demo_1d2d_pyplot/index.html | 2 +- .../demo_1d_animation_pyplot/index.html | 2 +- .../demo_2d_animation_pyplot/index.html | 2 +- .../demo_2d_mp_pyplot/index.html | 2 +- .../demo_2dcontourseries_pyplot/index.html | 2 +- .../demo_2dplot_plots/index.html | 2 +- .../demo_2dplot_pyplot/index.html | 2 +- .../demo_3dcuts_pyplot/index.html | 2 +- .../demo_B_fieldline_mp_pyplot/index.html | 2 +- .../demo_B_fieldline_pyplot/index.html | 2 +- .../demo_bowshock_2d_mt/index.html | 2 +- .../demo_bowshock_2dlocation/index.html | 2 +- .../demo_diff_extracting/index.html | 2 +- .../demo_energy_spectrum/index.html | 2 +- .../demo_field_tracing_2d/index.html | 2 +- .../demo_field_tracing_3d/index.html | 2 +- .../demo_lineextracting_mp_pyplot/index.html | 2 +- .../demo_lineextracting_pyplot/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../visualization/demo_mesh_pyplot/index.html | 2 +- .../demo_mp_progressbar/index.html | 2 +- .../demo_poynting_mt_pyplot/index.html | 2 +- .../demo_tensor_pyplot/index.html | 2 +- .../visualization/demo_vdf_pyplot/index.html | 2 +- .../visualization/demo_vdfs_pyplot/index.html | 2 +- .../demo_vector_pyplot/index.html | 2 +- dev/gallery/index.html | 2 +- dev/index.html | 2 +- dev/internal/index.html | 38 +++++++++---------- dev/log/index.html | 2 +- dev/manual/index.html | 2 +- dev/python/index.html | 2 +- dev/search/index.html | 2 +- 51 files changed, 69 insertions(+), 69 deletions(-) diff --git a/dev/benchmark/index.html b/dev/benchmark/index.html index 7518ac2d..9a4e623f 100644 --- a/dev/benchmark/index.html +++ b/dev/benchmark/index.html @@ -1,2 +1,2 @@ -Benchmarks · Vlasiator.jl

Benchmarks

The test file information are listed below:

IndexFilenameNumber of CellsDimensionAMRPublic
11d_single.vlsv201NoYes
2bulk.2d.vlsv6,3001NoYes
32d_double.vlsv51,2002NoYes
42d_AFC.vlsv4,612,5002NoYes
53d_EGI.vlsv3,966,5803YesNo

Access to the public data can be found from vlsv_data.

Note

The numbers shown here are comparisons between Analysator v0.9 and Vlasiator.jl v0.9.32 running Python 3.6.9/3.9.7 and Julia 1.8.3 with the scripts perf.jl and perf.py. The timings are collected from a i5-10210U @ 1.6GHz CPU with 16 GB RAM if not specified.

  • Loading meta data[1]
File IndexJulia [ms]Python [ms]Ratio
10.181.196.6
20.511.663.1
32.333.111.3
45062770.5
55492830.5
  • Reading DCCRG grid variables
File IndexJulia [ms]Python [ms]Ratio
10.0040.0717
20.02[2]0.084
30.17[2]0.211.2
420[2]231.1
511[2]111.0
  • Reading field solver grid variables[3]
File IndexSizeJulia [s]Julia, mmap [s]Python [s]Ratio
56.2 GiB Float32188567
  • Plotting 2D density contours on a uniform mesh (no GUI)
File IndexJulia [s]Python [s]Ratio
40.55.411
  • Plotting 2D density slices from a 3D AMR mesh (no GUI)
File IndexJulia [s][4]Python [s]Ratio
50.53.16.2
  • Static virtual satellite tracking from 3D AMR data (26G per frame, 32 MB Cell IDs) on a cluster[5]
FramesJulia, 1 thread [s]Julia, 2 threads [s]Python [s]
84545341220
  • 1See the issue about sorting. The performance of EzXML is also not ideal: we may need to find a better XML parser in Julia.
  • 2Vlasiator.jl can be faster if there is no conversion from Float64 to Float32. See Precision.
  • 3The field solver grid is a regular Cartesian grid at the finest refinement level introduced after Vlasiator 5. Therefore fsgrid variables are quite large for 3D AMR runs: with limited memory (e.g. 16 GB RAM) you may encounter out-of-memory issues when reading fg_b more than once. In Vlasiator.jl, we provide the option usemmap=true for reading large arrays –- see Memory for more.
  • 4The first time execution will be slower due to JIT compilation (which is excluded in the timing here). This is known as "Time-To-First-X" in the Julia community.
  • 5University of Helsinki cluster Vorna with Intel Xeon E5-2697 @ 2.70GHz.
+Benchmarks · Vlasiator.jl

Benchmarks

The test file information are listed below:

IndexFilenameNumber of CellsDimensionAMRPublic
11d_single.vlsv201NoYes
2bulk.2d.vlsv6,3001NoYes
32d_double.vlsv51,2002NoYes
42d_AFC.vlsv4,612,5002NoYes
53d_EGI.vlsv3,966,5803YesNo

Access to the public data can be found from vlsv_data.

Note

The numbers shown here are comparisons between Analysator v0.9 and Vlasiator.jl v0.9.32 running Python 3.6.9/3.9.7 and Julia 1.8.3 with the scripts perf.jl and perf.py. The timings are collected from a i5-10210U @ 1.6GHz CPU with 16 GB RAM if not specified.

  • Loading meta data[1]
File IndexJulia [ms]Python [ms]Ratio
10.181.196.6
20.511.663.1
32.333.111.3
45062770.5
55492830.5
  • Reading DCCRG grid variables
File IndexJulia [ms]Python [ms]Ratio
10.0040.0717
20.02[2]0.084
30.17[2]0.211.2
420[2]231.1
511[2]111.0
  • Reading field solver grid variables[3]
File IndexSizeJulia [s]Julia, mmap [s]Python [s]Ratio
56.2 GiB Float32188567
  • Plotting 2D density contours on a uniform mesh (no GUI)
File IndexJulia [s]Python [s]Ratio
40.55.411
  • Plotting 2D density slices from a 3D AMR mesh (no GUI)
File IndexJulia [s][4]Python [s]Ratio
50.53.16.2
  • Static virtual satellite tracking from 3D AMR data (26G per frame, 32 MB Cell IDs) on a cluster[5]
FramesJulia, 1 thread [s]Julia, 2 threads [s]Python [s]
84545341220
  • 1See the issue about sorting. The performance of EzXML is also not ideal: we may need to find a better XML parser in Julia.
  • 2Vlasiator.jl can be faster if there is no conversion from Float64 to Float32. See Precision.
  • 3The field solver grid is a regular Cartesian grid at the finest refinement level introduced after Vlasiator 5. Therefore fsgrid variables are quite large for 3D AMR runs: with limited memory (e.g. 16 GB RAM) you may encounter out-of-memory issues when reading fg_b more than once. In Vlasiator.jl, we provide the option usemmap=true for reading large arrays –- see Memory for more.
  • 4The first time execution will be slower due to JIT compilation (which is excluded in the timing here). This is known as "Time-To-First-X" in the Julia community.
  • 5University of Helsinki cluster Vorna with Intel Xeon E5-2697 @ 2.70GHz.
diff --git a/dev/contributing/index.html b/dev/contributing/index.html index ddae93e1..7ac6e75a 100644 --- a/dev/contributing/index.html +++ b/dev/contributing/index.html @@ -1,3 +1,3 @@ Contributing · Vlasiator.jl

Contributing

  • Try to explain your contribution with simple language.
  • References are always welcome.
  • Follow the coding standards in the source.

Reporting issues

If you are experiencing issues or have discovered a bug, please report it on GitHub. To make the resolution process easier, please include the version of Julia and Vlasiator.jl in your writeup. These can be found with two commands:

julia> versioninfo()
-julia> using Pkg; Pkg.status()

Feature requests

If you have suggestions of improvement or algorithms that you would like to see implemented in Vlasiator.jl, please open an issue on GitHub. Suggestions as well as feature requests are very welcome.

Code contribution

If you have code that you would like to contribute to Vlasiator.jl, that is awesome! Please open an issue before you create the pull request on GitHub so that we make sure your idea is aligned with our goals for the project.

After your idea is discussed and revised by maintainers, please get the development version of the project by typing the following in the package manager:

] activate @dev

This will create a fresh environment called @dev where you can play with the project components without compromising your normal user environment.

] dev Vlasiator

This will clone all the project components in your ~/.julia folder so that you can modify it and submit a pull request on GitHub later. Don't hesitate to ask questions. We are looking forward to your contributions.

+julia> using Pkg; Pkg.status()

Feature requests

If you have suggestions of improvement or algorithms that you would like to see implemented in Vlasiator.jl, please open an issue on GitHub. Suggestions as well as feature requests are very welcome.

Code contribution

If you have code that you would like to contribute to Vlasiator.jl, that is awesome! Please open an issue before you create the pull request on GitHub so that we make sure your idea is aligned with our goals for the project.

After your idea is discussed and revised by maintainers, please get the development version of the project by typing the following in the package manager:

] activate @dev

This will create a fresh environment called @dev where you can play with the project components without compromising your normal user environment.

] dev Vlasiator

This will clone all the project components in your ~/.julia folder so that you can modify it and submit a pull request on GitHub later. Don't hesitate to ask questions. We are looking forward to your contributions.

diff --git a/dev/examples/index.html b/dev/examples/index.html index 84be6e2d..fe897a46 100644 --- a/dev/examples/index.html +++ b/dev/examples/index.html @@ -167,4 +167,4 @@

This demo shows how to plot vector components

card-cover-image

Vector components

-
+
diff --git a/dev/examples/postprocess/demo_convert2vti/index.html b/dev/examples/postprocess/demo_convert2vti/index.html index 6fb159d5..4e24f568 100644 --- a/dev/examples/postprocess/demo_convert2vti/index.html +++ b/dev/examples/postprocess/demo_convert2vti/index.html @@ -6,4 +6,4 @@ Threads.@threads for file in files @info file, Threads.threadid() write_vtk(file; vti=true) -end

This page was generated using DemoCards.jl.

+end

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_em_extract_slice/index.html b/dev/examples/postprocess/demo_em_extract_slice/index.html index 6a18a494..415f7428 100644 --- a/dev/examples/postprocess/demo_em_extract_slice/index.html +++ b/dev/examples/postprocess/demo_em_extract_slice/index.html @@ -91,4 +91,4 @@ jldsave(outdir*outfile; E, B, n, v, p) end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_lineextracting_mt/index.html b/dev/examples/postprocess/demo_lineextracting_mt/index.html index c5a102da..a28ca5d8 100644 --- a/dev/examples/postprocess/demo_lineextracting_mt/index.html +++ b/dev/examples/postprocess/demo_lineextracting_mt/index.html @@ -43,4 +43,4 @@ println("Line extraction finished!") end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_log/index.html b/dev/examples/postprocess/demo_log/index.html index a675dca0..38510b93 100644 --- a/dev/examples/postprocess/demo_log/index.html +++ b/dev/examples/postprocess/demo_log/index.html @@ -11,4 +11,4 @@ scatter(timestamps, speed, markershape=:circle, #yaxis=:log10, - xlabel="Time", ylabel="Time per simulated second [s]")

This page was generated using DemoCards.jl.

+ xlabel="Time", ylabel="Time per simulated second [s]")

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_magnetopause_2d_mt/index.html b/dev/examples/postprocess/demo_magnetopause_2d_mt/index.html index 8b5ac0bc..df4ff2cd 100644 --- a/dev/examples/postprocess/demo_magnetopause_2d_mt/index.html +++ b/dev/examples/postprocess/demo_magnetopause_2d_mt/index.html @@ -63,4 +63,4 @@ @time z,x,v,ey = extract_magnetopause_var(files) -jldsave("magnetopause.jld2"; z,x,v,ey)

This page was generated using DemoCards.jl.

+jldsave("magnetopause.jld2"; z,x,v,ey)

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_pointextracting/index.html b/dev/examples/postprocess/demo_pointextracting/index.html index 2d0f6dce..b665cede 100644 --- a/dev/examples/postprocess/demo_pointextracting/index.html +++ b/dev/examples/postprocess/demo_pointextracting/index.html @@ -78,4 +78,4 @@ fig.suptitle("Density Pulse Run, location = [12, 0, 0]", fontsize="xx-large") savefig("virtual_satellite.png", bbox_inches="tight") -=#

This page was generated using DemoCards.jl.

+=#

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_pointsextracting/index.html b/dev/examples/postprocess/demo_pointsextracting/index.html index fb776472..fa338b63 100644 --- a/dev/examples/postprocess/demo_pointsextracting/index.html +++ b/dev/examples/postprocess/demo_pointsextracting/index.html @@ -51,4 +51,4 @@ @time extract_vars(files, locations) -println("Virtual satellite extraction done!")

This page was generated using DemoCards.jl.

+println("Virtual satellite extraction done!")

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_pointsextracting_2d_uniform/index.html b/dev/examples/postprocess/demo_pointsextracting_2d_uniform/index.html index 68d109a1..429a003c 100644 --- a/dev/examples/postprocess/demo_pointsextracting_2d_uniform/index.html +++ b/dev/examples/postprocess/demo_pointsextracting_2d_uniform/index.html @@ -71,4 +71,4 @@ @time extract_vars(files, dx) -println("Virtual satellite extraction done!")

This page was generated using DemoCards.jl.

+println("Virtual satellite extraction done!")

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_wave_satellite_mt/index.html b/dev/examples/postprocess/demo_wave_satellite_mt/index.html index eb381b97..1d7383e9 100644 --- a/dev/examples/postprocess/demo_wave_satellite_mt/index.html +++ b/dev/examples/postprocess/demo_wave_satellite_mt/index.html @@ -214,4 +214,4 @@ savefig("virtual_satellite_wave.png"; dpi=300) end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_wave_search_mt/index.html b/dev/examples/postprocess/demo_wave_search_mt/index.html index bbcabe4c..7f176190 100644 --- a/dev/examples/postprocess/demo_wave_search_mt/index.html +++ b/dev/examples/postprocess/demo_wave_search_mt/index.html @@ -159,4 +159,4 @@ println("Virtual satellite extraction done!") end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_wave_tracing_mt/index.html b/dev/examples/postprocess/demo_wave_tracing_mt/index.html index dc0476b2..662ecb0e 100644 --- a/dev/examples/postprocess/demo_wave_tracing_mt/index.html +++ b/dev/examples/postprocess/demo_wave_tracing_mt/index.html @@ -401,4 +401,4 @@ outdir) end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_x_o_points/index.html b/dev/examples/postprocess/demo_x_o_points/index.html index 9e13c002..50d43543 100644 --- a/dev/examples/postprocess/demo_x_o_points/index.html +++ b/dev/examples/postprocess/demo_x_o_points/index.html @@ -48,4 +48,4 @@ ax.legend([s1, s2], ["X-point", "O-point"]) end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/postprocess/demo_x_points_extracting/index.html b/dev/examples/postprocess/demo_x_points_extracting/index.html index 620ca54f..abb8a8aa 100644 --- a/dev/examples/postprocess/demo_x_points_extracting/index.html +++ b/dev/examples/postprocess/demo_x_points_extracting/index.html @@ -51,4 +51,4 @@ jldsave("x_point_locations.jld2"; x_points_x, x_points_z, ey) end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_1d2d_mp_pyplot/index.html b/dev/examples/visualization/demo_1d2d_mp_pyplot/index.html index aa4bab55..b03047c6 100644 --- a/dev/examples/visualization/demo_1d2d_mp_pyplot/index.html +++ b/dev/examples/visualization/demo_1d2d_mp_pyplot/index.html @@ -265,4 +265,4 @@ n -= 1 end println("Finished in $(round(t, digits=2))s.") -end

This page was generated using DemoCards.jl.

+end

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_1d2d_pyplot/index.html b/dev/examples/visualization/demo_1d2d_pyplot/index.html index 4a8c96c6..8357f502 100644 --- a/dev/examples/visualization/demo_1d2d_pyplot/index.html +++ b/dev/examples/visualization/demo_1d2d_pyplot/index.html @@ -237,4 +237,4 @@ end close(plotargs[1]) -println("Finished!")

This page was generated using DemoCards.jl.

+println("Finished!")

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_1d_animation_pyplot/index.html b/dev/examples/visualization/demo_1d_animation_pyplot/index.html index e34800d4..4e93625c 100644 --- a/dev/examples/visualization/demo_1d_animation_pyplot/index.html +++ b/dev/examples/visualization/demo_1d_animation_pyplot/index.html @@ -31,4 +31,4 @@ frames=length(files), blit=true, repeat_delay=1000, interval=200) # Make sure ffmpeg is available! -anim.save("line.mp4", writer="ffmpeg", fps=30)

This page was generated using DemoCards.jl.

+anim.save("line.mp4", writer="ffmpeg", fps=30)

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_2d_animation_pyplot/index.html b/dev/examples/visualization/demo_2d_animation_pyplot/index.html index 154ace9c..05290e56 100644 --- a/dev/examples/visualization/demo_2d_animation_pyplot/index.html +++ b/dev/examples/visualization/demo_2d_animation_pyplot/index.html @@ -49,4 +49,4 @@ frames=length(files), blit=true, repeat_delay=1000, interval=50) # Make sure ffmpeg is available! -anim.save("contour.mp4", writer="ffmpeg", fps=30)

This page was generated using DemoCards.jl.

+anim.save("contour.mp4", writer="ffmpeg", fps=30)

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_2d_mp_pyplot/index.html b/dev/examples/visualization/demo_2d_mp_pyplot/index.html index 4f54c171..2019ef84 100644 --- a/dev/examples/visualization/demo_2d_mp_pyplot/index.html +++ b/dev/examples/visualization/demo_2d_mp_pyplot/index.html @@ -175,4 +175,4 @@ n -= 1 end println("Finished in $(round(t, digits=2))s.") -end

This page was generated using DemoCards.jl.

+end

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_2dcontourseries_pyplot/index.html b/dev/examples/visualization/demo_2dcontourseries_pyplot/index.html index 873faccd..a8e18325 100644 --- a/dev/examples/visualization/demo_2dcontourseries_pyplot/index.html +++ b/dev/examples/visualization/demo_2dcontourseries_pyplot/index.html @@ -49,4 +49,4 @@ savefig(outdir*lpad(i, 4, '0')*".png", bbox_inches="tight", dpi=100) end -close()

This page was generated using DemoCards.jl.

+close()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_2dplot_plots/index.html b/dev/examples/visualization/demo_2dplot_plots/index.html index 842e244e..93e8a926 100644 --- a/dev/examples/visualization/demo_2dplot_plots/index.html +++ b/dev/examples/visualization/demo_2dplot_plots/index.html @@ -22,4 +22,4 @@ ylims!(boxcoords[3], boxcoords[4]) =# -streamplot(meta, nameV, comp="xy", color="w", density=2.0)

This page was generated using DemoCards.jl.

+streamplot(meta, nameV, comp="xy", color="w", density=2.0)

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_2dplot_pyplot/index.html b/dev/examples/visualization/demo_2dplot_pyplot/index.html index 1381d8af..b0f8c046 100644 --- a/dev/examples/visualization/demo_2dplot_pyplot/index.html +++ b/dev/examples/visualization/demo_2dplot_pyplot/index.html @@ -40,4 +40,4 @@ file = "bulk.0000501.vlsv" nameρ = "rho" -main(file, nameρ)

This page was generated using DemoCards.jl.

+main(file, nameρ)

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_3dcuts_pyplot/index.html b/dev/examples/visualization/demo_3dcuts_pyplot/index.html index a6fbcd5d..e7fb4ccc 100644 --- a/dev/examples/visualization/demo_3dcuts_pyplot/index.html +++ b/dev/examples/visualization/demo_3dcuts_pyplot/index.html @@ -33,4 +33,4 @@ cb_title_str *= ",["*datainfo.unitLaTeX*"]" cb_title = cb.ax.set_title(cb_title_str, fontsize=14, fontweight="bold") -plt.savefig("test.png", bbox_inches="tight")

This page was generated using DemoCards.jl.

+plt.savefig("test.png", bbox_inches="tight")

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_B_fieldline_mp_pyplot/index.html b/dev/examples/visualization/demo_B_fieldline_mp_pyplot/index.html index 7a772718..2a09b69c 100644 --- a/dev/examples/visualization/demo_B_fieldline_mp_pyplot/index.html +++ b/dev/examples/visualization/demo_B_fieldline_mp_pyplot/index.html @@ -162,4 +162,4 @@ n -= 1 end println("Finished in $(round(t, digits=2))s.") -end

This page was generated using DemoCards.jl.

+end

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_B_fieldline_pyplot/index.html b/dev/examples/visualization/demo_B_fieldline_pyplot/index.html index 29a22c27..fc141ae8 100644 --- a/dev/examples/visualization/demo_B_fieldline_pyplot/index.html +++ b/dev/examples/visualization/demo_B_fieldline_pyplot/index.html @@ -64,4 +64,4 @@ end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_bowshock_2d_mt/index.html b/dev/examples/visualization/demo_bowshock_2d_mt/index.html index dbced870..a5ecc684 100644 --- a/dev/examples/visualization/demo_bowshock_2d_mt/index.html +++ b/dev/examples/visualization/demo_bowshock_2d_mt/index.html @@ -48,4 +48,4 @@ @time x_crossing, y_crossing = extract_bowshock_position(files) -jldsave("example.jld2"; x_crossing, y_crossing)

This page was generated using DemoCards.jl.

+jldsave("example.jld2"; x_crossing, y_crossing)

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_bowshock_2dlocation/index.html b/dev/examples/visualization/demo_bowshock_2dlocation/index.html index cc03cf13..3f3087f3 100644 --- a/dev/examples/visualization/demo_bowshock_2dlocation/index.html +++ b/dev/examples/visualization/demo_bowshock_2dlocation/index.html @@ -28,4 +28,4 @@ imshow(T', extent=(x[1], x[end], y[1], y[end]), origin="lower", cmap=plt.get_cmap("ocean")) plot(x_crossing, y_crossing, "r") axis("scaled") -savefig("bs_temp_test.png")

This page was generated using DemoCards.jl.

+savefig("bs_temp_test.png")

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_diff_extracting/index.html b/dev/examples/visualization/demo_diff_extracting/index.html index 614561b2..16f74466 100644 --- a/dev/examples/visualization/demo_diff_extracting/index.html +++ b/dev/examples/visualization/demo_diff_extracting/index.html @@ -54,4 +54,4 @@ #savefig("test_diff.png") end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_energy_spectrum/index.html b/dev/examples/visualization/demo_energy_spectrum/index.html index f4f35da6..638427de 100644 --- a/dev/examples/visualization/demo_energy_spectrum/index.html +++ b/dev/examples/visualization/demo_energy_spectrum/index.html @@ -49,4 +49,4 @@ legend() end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_field_tracing_2d/index.html b/dev/examples/visualization/demo_field_tracing_2d/index.html index 231c97ac..74a5bc46 100644 --- a/dev/examples/visualization/demo_field_tracing_2d/index.html +++ b/dev/examples/visualization/demo_field_tracing_2d/index.html @@ -31,4 +31,4 @@ streamplot(meta, nameV, comp="xy", color="w", density=1.0) end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_field_tracing_3d/index.html b/dev/examples/visualization/demo_field_tracing_3d/index.html index 21084bc5..56d2e5d2 100644 --- a/dev/examples/visualization/demo_field_tracing_3d/index.html +++ b/dev/examples/visualization/demo_field_tracing_3d/index.html @@ -68,4 +68,4 @@ ax.plot3D(x./RE, y./RE, z./RE) end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_lineextracting_mp_pyplot/index.html b/dev/examples/visualization/demo_lineextracting_mp_pyplot/index.html index 183ebeed..1263cf7a 100644 --- a/dev/examples/visualization/demo_lineextracting_mp_pyplot/index.html +++ b/dev/examples/visualization/demo_lineextracting_mp_pyplot/index.html @@ -140,4 +140,4 @@ n -= 1 end println("Finished in $(round(t, digits=2))s.") -end

This page was generated using DemoCards.jl.

+end

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_lineextracting_pyplot/index.html b/dev/examples/visualization/demo_lineextracting_pyplot/index.html index 3826aaeb..61deccd4 100644 --- a/dev/examples/visualization/demo_lineextracting_pyplot/index.html +++ b/dev/examples/visualization/demo_lineextracting_pyplot/index.html @@ -102,4 +102,4 @@ println("Finished!") end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_lineextracting_pyplot_basic1/index.html b/dev/examples/visualization/demo_lineextracting_pyplot_basic1/index.html index f5f1f778..12ce5563 100644 --- a/dev/examples/visualization/demo_lineextracting_pyplot_basic1/index.html +++ b/dev/examples/visualization/demo_lineextracting_pyplot_basic1/index.html @@ -71,4 +71,4 @@ close(fig) end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_lineextracting_pyplot_basic2/index.html b/dev/examples/visualization/demo_lineextracting_pyplot_basic2/index.html index a104bd04..3abcccc9 100644 --- a/dev/examples/visualization/demo_lineextracting_pyplot_basic2/index.html +++ b/dev/examples/visualization/demo_lineextracting_pyplot_basic2/index.html @@ -49,4 +49,4 @@ println("plot finished!") end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_mesh_pyplot/index.html b/dev/examples/visualization/demo_mesh_pyplot/index.html index f9d1de86..9e2abf73 100644 --- a/dev/examples/visualization/demo_mesh_pyplot/index.html +++ b/dev/examples/visualization/demo_mesh_pyplot/index.html @@ -13,4 +13,4 @@ fig = plt.figure() pcolormesh(meta, "proton/vg_rho"; axisunit=SI) -plotmesh(meta, projection="y"; color="w")

This page was generated using DemoCards.jl.

+plotmesh(meta, projection="y"; color="w")

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_mp_progressbar/index.html b/dev/examples/visualization/demo_mp_progressbar/index.html index adedeb71..b3518893 100644 --- a/dev/examples/visualization/demo_mp_progressbar/index.html +++ b/dev/examples/visualization/demo_mp_progressbar/index.html @@ -235,4 +235,4 @@ end put!(channel, false) # this tells the printing task to finish end -end

This page was generated using DemoCards.jl.

+end

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_poynting_mt_pyplot/index.html b/dev/examples/visualization/demo_poynting_mt_pyplot/index.html index 4b0c5f2d..6b704fab 100644 --- a/dev/examples/visualization/demo_poynting_mt_pyplot/index.html +++ b/dev/examples/visualization/demo_poynting_mt_pyplot/index.html @@ -269,4 +269,4 @@ x1 = range(extent[1], extent[2], length=length(range1)) x2 = range(extent[3], extent[4], length=length(range2)) -plot_poynting(de_filtered, db_filtered, b̄, x1, x2, frequency_range)

This page was generated using DemoCards.jl.

+plot_poynting(de_filtered, db_filtered, b̄, x1, x2, frequency_range)

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_tensor_pyplot/index.html b/dev/examples/visualization/demo_tensor_pyplot/index.html index 9877474c..5023a498 100644 --- a/dev/examples/visualization/demo_tensor_pyplot/index.html +++ b/dev/examples/visualization/demo_tensor_pyplot/index.html @@ -69,4 +69,4 @@ savefig("ptensor.png", bbox_inches="tight") end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_vdf_pyplot/index.html b/dev/examples/visualization/demo_vdf_pyplot/index.html index 3df5b6be..b3111cf3 100644 --- a/dev/examples/visualization/demo_vdf_pyplot/index.html +++ b/dev/examples/visualization/demo_vdf_pyplot/index.html @@ -28,4 +28,4 @@ ax.scatter(xcell, ycell, marker="+", color="w") end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_vdfs_pyplot/index.html b/dev/examples/visualization/demo_vdfs_pyplot/index.html index e1d6b2f8..e84103ae 100644 --- a/dev/examples/visualization/demo_vdfs_pyplot/index.html +++ b/dev/examples/visualization/demo_vdfs_pyplot/index.html @@ -51,4 +51,4 @@ end end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/examples/visualization/demo_vector_pyplot/index.html b/dev/examples/visualization/demo_vector_pyplot/index.html index 100c8133..2be287cc 100644 --- a/dev/examples/visualization/demo_vector_pyplot/index.html +++ b/dev/examples/visualization/demo_vector_pyplot/index.html @@ -65,4 +65,4 @@ savefig("Bvector.png", bbox_inches="tight") end -main()

This page was generated using DemoCards.jl.

+main()

This page was generated using DemoCards.jl.

diff --git a/dev/gallery/index.html b/dev/gallery/index.html index f46f2766..f9b544a4 100644 --- a/dev/gallery/index.html +++ b/dev/gallery/index.html @@ -1,2 +1,2 @@ -Gallery · Vlasiator.jl

Gallery

PyPlot

  • Proton density in a laminar flow with points denoting cell centers. demo

  • Proton density of Earth's magnetosphere in the meridional cut from 2D simulation, with fieldlines through fixed seeding points. demo

  • Proton density of Earth's magnetosphere in the meridional plane from 3D simulation.

  • Proton density of Earth's magnetosphere in the equatorial plane from 2D simulation, zoomed in to the magnetosheath and foreshock region, with streamlines and density contour at 10 amu/cc. demo

  • Proton density of Earth's magnetosphere in the normal cut planes from 3D simulation. demo

  • Proton phase space distribution projected onto the X-Z plane. demo

Makie

Demos can be found in the Usage section of VlasiatorMakie.

  • Various colored contours from 2D equatorial run

  • Interactive proton density slice from 3D AMR run

  • Three orthogonal slices of proton density from 3D AMR run

  • Isosurface of Bz = 0 from 3D AMR run

  • Proton phase space distribution projected onto the X-Z plane

  • Interactive proton phase space distribution in the three orthogonal planes

  • Proton phase space distribution

ParaView

VLSV files can be converted to the structured VTK format, and then visualized in ParaView.

  • 2D slice contour of density in the meriodional plane with streamlines

  • 2D slices of density viewing from upstream

+Gallery · Vlasiator.jl

Gallery

PyPlot

  • Proton density in a laminar flow with points denoting cell centers. demo

  • Proton density of Earth's magnetosphere in the meridional cut from 2D simulation, with fieldlines through fixed seeding points. demo

  • Proton density of Earth's magnetosphere in the meridional plane from 3D simulation.

  • Proton density of Earth's magnetosphere in the equatorial plane from 2D simulation, zoomed in to the magnetosheath and foreshock region, with streamlines and density contour at 10 amu/cc. demo

  • Proton density of Earth's magnetosphere in the normal cut planes from 3D simulation. demo

  • Proton phase space distribution projected onto the X-Z plane. demo

Makie

Demos can be found in the Usage section of VlasiatorMakie.

  • Various colored contours from 2D equatorial run

  • Interactive proton density slice from 3D AMR run

  • Three orthogonal slices of proton density from 3D AMR run

  • Isosurface of Bz = 0 from 3D AMR run

  • Proton phase space distribution projected onto the X-Z plane

  • Interactive proton phase space distribution in the three orthogonal planes

  • Proton phase space distribution

ParaView

VLSV files can be converted to the structured VTK format, and then visualized in ParaView.

  • 2D slice contour of density in the meriodional plane with streamlines

  • 2D slices of density viewing from upstream

diff --git a/dev/index.html b/dev/index.html index b4ed0647..e4e94c2b 100644 --- a/dev/index.html +++ b/dev/index.html @@ -4,4 +4,4 @@ \mathbf{u}_\alpha &= \frac{1}{n_\alpha}\int \mathbf{v}f_\alpha(\mathbf{r},\mathbf{v},t)\mathrm{d}\mathbf{v} \end{aligned}\]

The magnetic field is updated using Faraday's law:

\[\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}\]

and the electric field is given by the generalized Ohm's law:

\[\mathbf{E} = -\mathbf{u}_\alpha \times\mathbf{B} + \frac{1}{n_\alpha q_\alpha}\mathbf{j}\times\mathbf{B} - \frac{1}{n_\alpha q_\alpha}\nabla\cdot\overleftrightarrow{P}_e + \eta \mathbf{j}\]

The four terms on the right-handed side are the convection term, the Hall term, the electron pressure gradient term, and the resistive term, respectively. The total current density $\mathbf{j}$ is obtained from Ampère's law where the displacement current has been neglected:

\[\nabla\times\mathbf{B} = \mu_0 \mathbf{j}\]

Finally, by determining the electron pressure tensor by using an appropriate equation of state, the evolution of the system can be followed in time. For example, let $\overleftrightarrow{P}_e = p_e \overleftrightarrow{I}$ where $p_e$ is the isotropic scalar electron pressure. In an isothermal process,

\[p_e = n_e k_B T_e\]

where $n_e \approx n_i$ and $T_e$ is a constant. In an adiabatic process with index $\gamma$,

\[p_e / n_e^\gamma = \text{const.}\]

The different processes can be generalized into the polytropic process:

\[p_e / n_e^n = \text{const.}\]

When the ideal gas law applies, the polytropic index $n=1$ for an isothermal process, and $n=\gamma$ for an adiabatic process.

For more details, please refer to Vlasov methods in space physics and astrophysics.

Getting started

To install,

julia> ]
 pkg> add Vlasiator

You can then use the package via

julia> using Vlasiator

Visualization

If you aim at using Matplotlib, besides adding PyPlot and the Vlasiator specific wrapper VlasiatorPyPlot, you should also link to a preinstalled Python version by setting the environment variable and building the PyCall package

ENV["PYTHON"]="your python executable"
-Pkg.build("PyCall")

If ENV["PYTHON"] = "" before building, a private Python distribution will be installed via Miniconda. Details are described in automated matplotlib installation.

You can add Makie.jl and VlasiatorMakie.jl through the pkg manger. The sub-package VlasiatorMakie provides user recipes for Makie.

Add Plots.jl through the pkg manager. Built-in user recipes for Plots are provided.

Author

This module is written by Hongyang Zhou. For citing Vlasiator.jl, please refer to DOI.

+Pkg.build("PyCall")

If ENV["PYTHON"] = "" before building, a private Python distribution will be installed via Miniconda. Details are described in automated matplotlib installation.

You can add Makie.jl and VlasiatorMakie.jl through the pkg manger. The sub-package VlasiatorMakie provides user recipes for Makie.

Add Plots.jl through the pkg manager. Built-in user recipes for Plots are provided.

Author

This module is written by Hongyang Zhou. For citing Vlasiator.jl, please refer to DOI.

diff --git a/dev/internal/index.html b/dev/internal/index.html index 7325f624..e3edaaac 100644 --- a/dev/internal/index.html +++ b/dev/internal/index.html @@ -1,29 +1,29 @@ -API Reference · Vlasiator.jl

Internal

Public APIs

Vlasiator.check_plasma_characteristicsMethod
check_plasma_characteristics(n, v, T, B)

Display characteristic plasma parameters given density n, bulk velocity v, temperature T, and magnetic field strength B in SI units.

source
Vlasiator.compute_flux_functionMethod
compute_flux_function(b::AbstractArray{T,N}, Δ::Vector{T}, nG::Int=2) where {T,N}

Calculate the 2D magnetic flux function ψ from the magnetic field b and discrete steps Δ. nG is the number of ghost cells along each dimension in the vector field. ψ is defined as $\psi = \int B_x dz = - \int B_z dx$ from $\mathbf{B} = \hat{y}\times\nabla\psi$ in the X-Z plane and Y is the out-of-plane direction. This is strictly true if B is divergence-free and the guide field By is constant. However, numerically there will be errors. The current implementation calculates ψ by integrating along -z boundary first, and then going along z. Reference: Flux function

source
Vlasiator.extractsatMethod
extractsat(files::AbstractVector{String}, var::String, cid::Int)

Multi-threaded extraction of var at a fixed cell ID cid from files. This assumes that files come from the same grid structure.

source
Vlasiator.find_reconnection_pointsMethod
find_reconnection_points(ψ::Array{T,2}; retol::Float64=1e-4,
-   method::Int=1) -> indices_x, indices_o

Find X-point and O-point indices in 2D magnetic field topology from flux function ψ. The current implementation does not work for the 3 layers near the boundary.

Keywords

  • retol=1e-1: determines the relative tolerance of the ratio w.r.t. |∇ψ|² to accept a gradient as 0.
  • method=1: method 1 compute the cell-centered 1st and 2nd order derivatives and check the Hessian matrix; method 2 check the flux function at each point against its 8 neighbors, which is more deterministic.
source
Vlasiator.getKLdivergenceMethod
getKLdivergence(meta, VDF; species="proton")
-getKLdivergence(meta, vcellids, vcellf; species="proton")

Obtain the KL-divergence ∫ f*log(f/g)dv, where f is the VDF from Vlasiator and g is the analytical Maxwellian distribution that generates the same density as f. The value ranges from [0, +∞], with 0 meaning perfect Maxwellian. Usually the values are quite small. Alternatively, one can pass original vcellids and vcellf directly.

source
Vlasiator.getcellMethod
getcell(meta::MetaVLSV, location:::AbstractVector{<:AbstractFloat}) -> Int

Return cell ID containing the given spatial location in meter, excluding domain boundaries. Only accept 3D location.

source
Vlasiator.getcellinlineMethod
getcellinline(meta, point1::Vector, point2::Vector) -> cellids, distances, coords

Returns cell IDs, distances and coordinates for every cell in a line between two given points point1 and point2. TODO: preallocation?

source
Vlasiator.getcellwithvdfFunction
getcellwithvdf(meta, species::String="proton") -> cellids

Get all the cell IDs with VDF saved associated with meta.

source
Vlasiator.getdensityMethod
getdensity(meta, VDF; species="proton")
+API Reference · Vlasiator.jl

Internal

Public APIs

Vlasiator.check_plasma_characteristicsMethod
check_plasma_characteristics(n, v, T, B)

Display characteristic plasma parameters given density n, bulk velocity v, temperature T, and magnetic field strength B in SI units.

source
Vlasiator.compute_flux_functionMethod
compute_flux_function(b::AbstractArray{T,N}, Δ::Vector{T}, nG::Int=2) where {T,N}

Calculate the 2D magnetic flux function ψ from the magnetic field b and discrete steps Δ. nG is the number of ghost cells along each dimension in the vector field. ψ is defined as $\psi = \int B_x dz = - \int B_z dx$ from $\mathbf{B} = \hat{y}\times\nabla\psi$ in the X-Z plane and Y is the out-of-plane direction. This is strictly true if B is divergence-free and the guide field By is constant. However, numerically there will be errors. The current implementation calculates ψ by integrating along -z boundary first, and then going along z. Reference: Flux function

source
Vlasiator.extractsatMethod
extractsat(files::AbstractVector{String}, var::String, cid::Int)

Multi-threaded extraction of var at a fixed cell ID cid from files. This assumes that files come from the same grid structure.

source
Vlasiator.find_reconnection_pointsMethod
find_reconnection_points(ψ::Array{T,2}; retol::Float64=1e-4,
+   method::Int=1) -> indices_x, indices_o

Find X-point and O-point indices in 2D magnetic field topology from flux function ψ. The current implementation does not work for the 3 layers near the boundary.

Keywords

  • retol=1e-1: determines the relative tolerance of the ratio w.r.t. |∇ψ|² to accept a gradient as 0.
  • method=1: method 1 compute the cell-centered 1st and 2nd order derivatives and check the Hessian matrix; method 2 check the flux function at each point against its 8 neighbors, which is more deterministic.
source
Vlasiator.getKLdivergenceMethod
getKLdivergence(meta, VDF; species="proton")
+getKLdivergence(meta, vcellids, vcellf; species="proton")

Obtain the KL-divergence ∫ f*log(f/g)dv, where f is the VDF from Vlasiator and g is the analytical Maxwellian distribution that generates the same density as f. The value ranges from [0, +∞], with 0 meaning perfect Maxwellian. Usually the values are quite small. Alternatively, one can pass original vcellids and vcellf directly.

source
Vlasiator.getcellMethod
getcell(meta::MetaVLSV, location:::AbstractVector{<:AbstractFloat}) -> Int

Return cell ID containing the given spatial location in meter, excluding domain boundaries. Only accept 3D location.

source
Vlasiator.getcellinlineMethod
getcellinline(meta, point1::Vector, point2::Vector) -> cellids, distances, coords

Returns cell IDs, distances and coordinates for every cell in a line between two given points point1 and point2. TODO: preallocation?

source
Vlasiator.getcellwithvdfFunction
getcellwithvdf(meta, species::String="proton") -> cellids

Get all the cell IDs with VDF saved associated with meta.

source
Vlasiator.getdensityMethod
getdensity(meta, VDF; species="proton")
 getdensity(meta, vcellf; species="proton")
-getdensity(vmesh::VMeshInfo, vcellf)

Get density from VDF of species associated with meta, n = ∫ f(r,v) dV. Alternatively, one can directly pass vcellids as original indices of nonzero VDFs and vcellf as their corresponding values.

source
Vlasiator.getheatfluxvectorMethod
getheatfluxvector(meta, VDF; species="proton")
+getdensity(vmesh::VMeshInfo, vcellf)

Get density from VDF of species associated with meta, n = ∫ f(r,v) dV. Alternatively, one can directly pass vcellids as original indices of nonzero VDFs and vcellf as their corresponding values.

source
Vlasiator.getheatfluxvectorMethod
getheatfluxvector(meta, VDF; species="proton")
 getheatfluxvector(meta, vcellids, vcellf; species="proton")
-getheatfluxvector(vmesh::VMeshInfo, vcellids, vcellf)

Get heat flux vector (3 components) of species from VDF associated with meta, qᵢ = m/2 * ∫ (v - u)²(v - u)ᵢ * f(r,v) dV. Alternatively, one can directly pass vcellids, vcellf, as in getdensity.

source
Vlasiator.getlevelMethod
getlevel(meta::MetaVLSV, cid::Int) -> Int

Return the AMR level of a given cell ID cid.

Warning

This function does not check if the VLSV file of meta actually contains cid; it may be shadowed by refined children.

source
Vlasiator.getmaxwellianityMethod
getmaxwellianity(meta, VDF; species="proton")
-getmaxwellianity(meta, vcellids, vcellf; species="proton")

Obtain the Maxwellian similarity factor -log(1/(2n) * ∫ |f - g| dv), where f is the VDF from Vlasiator and g is the analytical Maxwellian distribution that generates the same density as f. The value ranges from [0, +∞], with 0 meaning not Maxwellian-distributed at all, and +∞ a perfect Maxwellian distribution. Alternatively, one can pass original vcellids and vcellf directly.

source
Vlasiator.getnearestcellwithvdfFunction
getnearestcellwithvdf(meta, id::Int, species::String="proton") -> Int

Find the nearest spatial cell with VDF saved for species of a given cell id associated with meta.

source
Vlasiator.getpressureMethod
getpressure(meta, VDF; species="proton")
+getheatfluxvector(vmesh::VMeshInfo, vcellids, vcellf)

Get heat flux vector (3 components) of species from VDF associated with meta, qᵢ = m/2 * ∫ (v - u)²(v - u)ᵢ * f(r,v) dV. Alternatively, one can directly pass vcellids, vcellf, as in getdensity.

source
Vlasiator.getlevelMethod
getlevel(meta::MetaVLSV, cid::Int) -> Int

Return the AMR level of a given cell ID cid.

Warning

This function does not check if the VLSV file of meta actually contains cid; it may be shadowed by refined children.

source
Vlasiator.getmaxwellianityMethod
getmaxwellianity(meta, VDF; species="proton")
+getmaxwellianity(meta, vcellids, vcellf; species="proton")

Obtain the Maxwellian similarity factor -log(1/(2n) * ∫ |f - g| dv), where f is the VDF from Vlasiator and g is the analytical Maxwellian distribution that generates the same density as f. The value ranges from [0, +∞], with 0 meaning not Maxwellian-distributed at all, and +∞ a perfect Maxwellian distribution. Alternatively, one can pass original vcellids and vcellf directly.

source
Vlasiator.getnearestcellwithvdfFunction
getnearestcellwithvdf(meta, id::Int, species::String="proton") -> Int

Find the nearest spatial cell with VDF saved for species of a given cell id associated with meta.

source
Vlasiator.getpressureMethod
getpressure(meta, VDF; species="proton")
 getpressure(meta, vcellids, vcellf; species="proton")
-getpressure(vmesh::VMeshInfo, vcellids, vcellf)

Get pressure tensor (6 components: Pxx, Pyy, Pzz, Pyz, Pzx, Pxy) of species from VDF associated with meta, pᵢⱼ = m * ∫ (v - u)ᵢ(v - u)ⱼ * f(r,v) dV. Alternatively, one can directly pass vcellids, vcellf, as in getdensity.

source
Vlasiator.getsiblingsMethod
getsiblings(meta::MetaVLSV, cid::Int) -> Vector{Int}

Return sibling cells of a given cid, including itself.

source
Vlasiator.getslicecellMethod
getslicecell(meta, sliceoffset, dir, minCoord, maxCoord) -> idlist, indexlist

Find the cell IDs idlist which are needed to plot a 2d cut through of a 3d mesh, in a direction dir at sliceoffset, and the indexlist, which is a mapping from original order to the cut plane and can be used to select data onto the plane.

source
Vlasiator.getvcellcoordinatesMethod
getvcellcoordinates(meta::MetaVLSV, vcellids::Vector; species="proton")

Return velocity cells' coordinates of species and vcellids.

source
Vlasiator.getvelocityMethod
getvelocity(meta, VDF; species="proton")
+getpressure(vmesh::VMeshInfo, vcellids, vcellf)

Get pressure tensor (6 components: Pxx, Pyy, Pzz, Pyz, Pzx, Pxy) of species from VDF associated with meta, pᵢⱼ = m * ∫ (v - u)ᵢ(v - u)ⱼ * f(r,v) dV. Alternatively, one can directly pass vcellids, vcellf, as in getdensity.

source
Vlasiator.getsiblingsMethod
getsiblings(meta::MetaVLSV, cid::Int) -> Vector{Int}

Return sibling cells of a given cid, including itself.

source
Vlasiator.getslicecellMethod
getslicecell(meta, sliceoffset, dir, minCoord, maxCoord) -> idlist, indexlist

Find the cell IDs idlist which are needed to plot a 2d cut through of a 3d mesh, in a direction dir at sliceoffset, and the indexlist, which is a mapping from original order to the cut plane and can be used to select data onto the plane.

source
Vlasiator.getvcellcoordinatesMethod
getvcellcoordinates(meta::MetaVLSV, vcellids::Vector; species="proton")

Return velocity cells' coordinates of species and vcellids.

source
Vlasiator.getvelocityMethod
getvelocity(meta, VDF; species="proton")
 getvelocity(meta, vcellids, vcellf; species="proton")
-getvelocity(vmesh::VMeshInfo, vcellids, vcellf)

Get bulk velocity from VDF of species, u = ∫ v * f(r,v) dV / n. Alternatively, one can directly pass vcellids, vcellf, as in getdensity.

source
Vlasiator.hasparameterMethod
hasparameter(meta::MetaVLSV, param::String) -> Bool

Check if the VLSV file contains a certain parameter param.

source
Vlasiator.hasvariableMethod
hasvariable(meta::MetaVLSV, var::String) -> Bool

Check if the VLSV file associated with meta contains a variable var.

source
Vlasiator.issameFunction
issame(file1, file2, tol=1e-4; strict=true, verbose=false) -> Bool

Check if two VLSV files file1 and file2 are approximately identical, under relative tolerance tol. If strict=true, the file size difference should be less than 1%.

source
Vlasiator.loadMethod
load(file::AbstractString)) -> MetaVLSV

Generate a MetaVLSV object from file of VLSV format.

source
Vlasiator.readlogMethod
readlog(file::AbstractString)

Read the run log file, check the iteration status and return the timestamps (exluding the last) as well as the model running speed in physical seconds per simulated seconds.

source
Vlasiator.readparameterMethod
readparameter(meta::MetaVLSV, param::String)

Return the parameter value from the VLSV file associated with meta.

source
Vlasiator.readvariableFunction
readvariable(meta::MetaVLSV, var::String, sorted::Bool=true, usemmap::Bool=false) -> Array

Return variable value of var from the VLSV file associated with meta. By default for DCCRG variables are sorted by cell ID. usemmap decides whether to use memory-mapped IO, which is especially useful for large arrays.

source
Vlasiator.readvariableMethod
readvariable(meta::MetaVLSV, var::String, cid::Int) -> Array

Read variable var in cell cid associated with meta.

source
Vlasiator.readvariableMethod
readvariable(meta::MetaVLSV, var::String, ids::Vector{Int}) -> Array

Read variable var in a collection of cells ids associated with meta. if ids is empty, return the whole sorted array of var.

source
Vlasiator.readvcellsMethod
readvcells(meta::MetaVLSV, cid::Int; species="proton") -> vcellids, vcellf

Read velocity cells of species from a spatial cell of ID cid associated with meta, and return a map of velocity cell ids vcellids and corresponding value vcellf.

source
Vlasiator.refinesliceMethod
refineslice(meta, idlist::Vector{Int}, data::AbstractVector, normal::Symbol) -> Vector
+getvelocity(vmesh::VMeshInfo, vcellids, vcellf)

Get bulk velocity from VDF of species, u = ∫ v * f(r,v) dV / n. Alternatively, one can directly pass vcellids, vcellf, as in getdensity.

source
Vlasiator.hasparameterMethod
hasparameter(meta::MetaVLSV, param::String) -> Bool

Check if the VLSV file contains a certain parameter param.

source
Vlasiator.hasvariableMethod
hasvariable(meta::MetaVLSV, var::String) -> Bool

Check if the VLSV file associated with meta contains a variable var.

source
Vlasiator.issameFunction
issame(file1, file2, tol=1e-4; strict=true, verbose=false) -> Bool

Check if two VLSV files file1 and file2 are approximately identical, under relative tolerance tol. If strict=true, the file size difference should be less than 1%.

source
Vlasiator.loadMethod
load(file::AbstractString)) -> MetaVLSV

Generate a MetaVLSV object from file of VLSV format.

source
Vlasiator.readlogMethod
readlog(file::AbstractString)

Read the run log file, check the iteration status and return the timestamps (exluding the last) as well as the model running speed in physical seconds per simulated seconds.

source
Vlasiator.readparameterMethod
readparameter(meta::MetaVLSV, param::String)

Return the parameter value from the VLSV file associated with meta.

source
Vlasiator.readvariableFunction
readvariable(meta::MetaVLSV, var::String, sorted::Bool=true, usemmap::Bool=false) -> Array

Return variable value of var from the VLSV file associated with meta. By default for DCCRG variables are sorted by cell ID. usemmap decides whether to use memory-mapped IO, which is especially useful for large arrays.

source
Vlasiator.readvariableMethod
readvariable(meta::MetaVLSV, var::String, cid::Int) -> Array

Read variable var in cell cid associated with meta.

source
Vlasiator.readvariableMethod
readvariable(meta::MetaVLSV, var::String, ids::Vector{Int}) -> Array

Read variable var in a collection of cells ids associated with meta. if ids is empty, return the whole sorted array of var.

source
Vlasiator.readvcellsMethod
readvcells(meta::MetaVLSV, cid::Int; species="proton") -> vcellids, vcellf

Read velocity cells of species from a spatial cell of ID cid associated with meta, and return a map of velocity cell ids vcellids and corresponding value vcellf.

source
Vlasiator.refinesliceMethod
refineslice(meta, idlist::Vector{Int}, data::AbstractVector, normal::Symbol) -> Vector
 refineslice(meta, idlist::Vector{Int}, data::AbstractMatrix, normal::Symbol) -> Matrix
-refineslice(meta, idlist::Vector{Int}, data::AbstractArray, dir::Int)

Generate data on the finest refinement level given cellids idlist and variable data on the slice perpendicular to normal. If data is 2D, then the first dimension is treated as vector components.

source
Vlasiator.write_vlsvMethod
write_vlsv(filein, fileout, newvars::Vector{Tuple{Vector, String, VarInfo}};
-   force=false)

Generate a new VLSV fileout based on filein, with newvars added. force=true overwrites the existing fileout.

source
Vlasiator.write_vtkMethod
write_vtk(meta::MetaVLSV; kwargs...)
-write_vtk(file::AbstractString; kwargs...)

Convert VLSV file to VTK format.

Keywords

  • vars::Vector{String}=[""]: select which variables to convert.
  • ascii::Bool=false: output stored in ASCII or compressed binary format.
  • maxamronly::Bool=false: generate image files on the highest refinement level only.
  • box::Vector: selected box range in 3D.
  • outdir::String="": output directory.
  • verbose::Bool=false: display logs during conversion.
source

PyPlot Wrapper APIs

Modules = [VlasiatorPyPlot]
-Pages   = ["VlasiatorPyPlot.jl"]

Private APIs

Base.ndimsMethod
ndims(meta::MetaVLSV) -> Int

Return the simulation spatial dimension of VLSV data.

source
Vlasiator.curlMethod
curl(A::AbstractArray{T,N}, dx:Union{Vector{U}, NTuple{3,U}}) where {T,N,U}

Calculate 2nd order cell-centered ∇×A where A is a 4D array of size (3, nx, ny, nz) and dx is a vector of grid intervals in each dimension.

source
Vlasiator.divergenceMethod
divergence(A::AbstractArray{T,N}, dx::Vector{U}=ones(T, 3)) where {T,N,U}

Calculate 2nd order cell-centered ∇⋅A where A is a 4D array of size (3, nx, ny, nz) and dx is a vector of grid intervals in each dimension.

source
Vlasiator.downsample_fgMethod
downsample_fg(meta::MetaVLSV, v_fg::Array)
-downsample_fg(meta::MetaVLSV, var::String)

Downsample a field solver array v_fg to the spatial grid associated with meta.

source
Vlasiator.fillmeshMethod
fillmesh(meta::MetaVLSV, vars::Vector{String};
-   skipghosttype=true, maxamronly=false, verbose=false) -> celldata, vtkGhostType

Fill the DCCRG mesh with quantity of vars on all refinement levels.

Return arguments

  • celldata::Vector{Vector{Array}}: data for each variable on each AMR level.
  • vtkGhostType::Array{UInt8}: cell status (to be completed!).
source
Vlasiator.getRotationMatrixMethod
getRotationMatrix(e1::Matrix, e2::Matrix) -> SMatrix{3,3}

Obtain the rotation matrix from orthgonal base vectors e1 to e2, such that a vector $\mathbf{u}_1$ in e1 can be expressed as $\mathbf{u}_1 = M\cdot \mathbf{u}_2$, where $M$ is the rotation matrix and $\mathbf{u}_2$ is the same vector in e2.

Example

e1 = [1.0 0.0 0.0; 0.0 1.0 0.0; 0.0 0.0 1.0]
+refineslice(meta, idlist::Vector{Int}, data::AbstractArray, dir::Int)

Generate data on the finest refinement level given cellids idlist and variable data on the slice perpendicular to normal. If data is 2D, then the first dimension is treated as vector components.

source
Vlasiator.write_vlsvMethod
write_vlsv(filein, fileout, newvars::Vector{Tuple{Vector, String, VarInfo}};
+   force=false)

Generate a new VLSV fileout based on filein, with newvars added. force=true overwrites the existing fileout.

source
Vlasiator.write_vtkMethod
write_vtk(meta::MetaVLSV; kwargs...)
+write_vtk(file::AbstractString; kwargs...)

Convert VLSV file to VTK format.

Keywords

  • vars::Vector{String}=[""]: select which variables to convert.
  • ascii::Bool=false: output stored in ASCII or compressed binary format.
  • maxamronly::Bool=false: generate image files on the highest refinement level only.
  • box::Vector: selected box range in 3D.
  • outdir::String="": output directory.
  • verbose::Bool=false: display logs during conversion.
source

PyPlot Wrapper APIs

Modules = [VlasiatorPyPlot]
+Pages   = ["VlasiatorPyPlot.jl"]

Private APIs

Base.ndimsMethod
ndims(meta::MetaVLSV) -> Int

Return the simulation spatial dimension of VLSV data.

source
Vlasiator.curlMethod
curl(A::AbstractArray{T,N}, dx:Union{Vector{U}, NTuple{3,U}}) where {T,N,U}

Calculate 2nd order cell-centered ∇×A where A is a 4D array of size (3, nx, ny, nz) and dx is a vector of grid intervals in each dimension.

source
Vlasiator.divergenceMethod
divergence(A::AbstractArray{T,N}, dx::Vector{U}=ones(T, 3)) where {T,N,U}

Calculate 2nd order cell-centered ∇⋅A where A is a 4D array of size (3, nx, ny, nz) and dx is a vector of grid intervals in each dimension.

source
Vlasiator.downsample_fgMethod
downsample_fg(meta::MetaVLSV, v_fg::Array)
+downsample_fg(meta::MetaVLSV, var::String)

Downsample a field solver array v_fg to the spatial grid associated with meta.

source
Vlasiator.fillmeshMethod
fillmesh(meta::MetaVLSV, vars::Vector{String};
+   skipghosttype=true, maxamronly=false, verbose=false) -> celldata, vtkGhostType

Fill the DCCRG mesh with quantity of vars on all refinement levels.

Return arguments

  • celldata::Vector{Vector{Array}}: data for each variable on each AMR level.
  • vtkGhostType::Array{UInt8}: cell status (to be completed!).
source
Vlasiator.getRotationMatrixMethod
getRotationMatrix(e1::Matrix, e2::Matrix) -> SMatrix{3,3}

Obtain the rotation matrix from orthgonal base vectors e1 to e2, such that a vector $\mathbf{u}_1$ in e1 can be expressed as $\mathbf{u}_1 = M\cdot \mathbf{u}_2$, where $M$ is the rotation matrix and $\mathbf{u}_2$ is the same vector in e2.

Example

e1 = [1.0 0.0 0.0; 0.0 1.0 0.0; 0.0 0.0 1.0]
 e2 = [0.0 1.0 0.0; 1.0 0.0 0.0; 0.0 0.0 1.0]
-R = getRotationMatrix(e1, e2)
source
Vlasiator.getRotationMatrixMethod
getRotationMatrix(axis::AbstractVector, angle::Real) --> SMatrix{3,3}

Create a rotation matrix for rotating a 3D vector around a unit axis by an angle in radians. Reference: Rotation matrix from axis and angle

Example

using LinearAlgebra
 v = [-0.5, 1.0, 1.0]
 v̂ = normalize(v)
 θ = deg2rad(-74)
-R = getRotationMatrix(v̂, θ)
source
Vlasiator.get_axisMethod
get_axis(axisunit::AxisUnit, plotrange::NTuple{4,<:Real}, sizes::NTuple{2,<:Integer})
-get_axis(pArgs::PlotArgs)

Return x and y ranges for 2D.

source
Vlasiator.get_fg_array_cellMethod
get_fg_array_cell(meta::MetaVLSV, v_fg::Array, cid::Int)

Return a subarray of the field solver grid array, corresponding to the fsgrid covered by the spatial cell ID cid.

source
Vlasiator.get_fg_indices_subvolumeFunction
get_fg_indices_subvolume(meta::MetaVLSV, lower, upper, tol::Float64=1e-3)

Get indices for subarray of fsgrid variables, in a cuboid defined by lower and upper vertices. This is used for mapping a set of fsgrid cells to a given DCCRG cell. Shift the corners (lower, upper) inward by a distance controlled by tol. If direct low-inclusive behaviour is required, tol shall be set to 0.

source
Vlasiator.getdata2dMethod
getdata2d(meta::MetaVLSV, var::String)

Return 2d scalar/vector data. Nonpublic since it won't work with DCCRG AMR.

source
Vlasiator.gradientMethod
gradient(A::AbstractArray{T,N}, dx::Vector{U}) where {T,N,U}

Calculate 2nd order cell-centered ∇A where A is a scalar array and dx is a vector of grid intervals in each dimension.

Warning

The current implementation has issues at the boundary if gradient is taken multiple times.

source
Vlasiator.prep1dMethod
prep1d(meta::MetaVLSV, var::String; i1::Int=0, i2::Int=0, comp::Int=0) -> Array

Obtain a 1D slice from 2D meta of var. i1 is the index for the first dimension, and i2 is the index for the second dimension; only one of them is needed. Use comp to select vector components.

source
Vlasiator.prep2dFunction
prep2d(meta::MetaVLSV, var::String, comp::Union{Symbol, Int}=0) -> Array

Obtain data from meta of var for 2D plotting. Use comp to select vector components.

source
Vlasiator.prep2dsliceMethod
prep2dslice(meta::MetaVLSV, var::String, normal, comp, pArgs::PlotArgs)

Return data of var on a uniform 2D mesh on the finest AMR level. Use normal to select the plane orientation, and comp to select the component of a vector, same as in pcolormesh.

source
Vlasiator.prep_vdfMethod
prep_vdf(meta::MetaVLSV, location::AbstractVector; kwargs...)

Return the cell velocities v1, v2, bin ranges r1, r2, cell VDF values fweight, and strings of labels and titles for VDF plots.

Keywords

  • unit::AxisUnit: location unit in SI, EARTH.
  • unitv::String: velocity unit in ("km/s", "m/s").
  • limits::Vector{Real}: velocity space range given in [xmin, xmax, ymin, ymax].
  • slicetype: symbol for choosing the slice type from :xy, :xz, :yz, :bperp, :bpar1, :bpar2.
  • center: symbol for setting the reference frame from :bulk, :peak.
  • vslicethick: setting the velocity space slice thickness in the normal direction. If set to 0, the whole distribution along the normal direction is projected onto a plane. Currently this is only meaningful when center is set such that a range near the bulk/peak normal velocity is selected.
  • weight::Symbol: choosing distribution weights from phase space density or particle flux between :particle and :flux.
  • flimit: minimum VDF threshold for plotting.
  • verbose: display the selection process.
source
Vlasiator.read_variable_as_fgMethod
read_variable_as_fg(meta::MetaVLSV, var::String)

Interpolate DCCRG variable var to field solver grid size. This is an alternative method to fillmesh, but not optimized for performance.

source
Vlasiator.reconstructMethod
reconstruct(vmesh::VMeshInfo, vcellids::Vector{Int32}, vcellf::Vector{<:AbstractFloat})

Reconstruct the full VDFs in 3D. vcellids are raw indices of nonzero VDFs ordered by blocks, and vcellf are the corresponding values in each cell.

source
Vlasiator.reorderMethod
reorder(vmesh::VMeshInfo, vcellids::Vector{Int32}) -> vcellids_origin

Reorder vblock-organized VDF indexes into x–>y–>z indexes. vcellids are raw indices of nonzero VDFs ordered by blocks.

source
Vlasiator.rotateTensorToVectorZMethod
rotateTensorToVectorZ(tensor::AbstractMatrix, vector::AbstractVector) -> SMatrix{3,3}

Rotate tensor with a rotation matrix that aligns the 3rd direction with vector, which is equivalent to change the basis from (i,j,k) to (i′,j′,k′) where k′ ∥ vector. Reference: Tensor rotation

source
Vlasiator.save_imageFunction
save_image(meta::MetaVLSV, file, vars, data, vtkGhostType, level,
-   ascii=false, append=true, box=[-Inf, Inf, -Inf, Inf, -Inf, Inf])

Save data of name vars at AMR level into VTK image file of name file.

Arguments

  • file::String: output file name.
  • vars::Vector{String}: variable names to be saved.
  • data::Vector{Vector{Array}}: data for all the variables on each refinement level.
  • vtkGhostType::Array{UInt8}: array for visibility control.
  • level::Int: refinement level (0-based).
  • ascii::Bool=false: save output in ASCII or binary format.
  • append::Bool=true: determines whether to append data at the end of file or do in-block writing.
  • box::Vector: selected box range in 3D.
source
Vlasiator.set_argsMethod
set_args(meta::MetaVLSV, var::String, axisunit::AxisUnit;
-   normal::Symbol=:none, origin=0.0)

Set plot-related arguments of var in axisunit. normal and origin are used for 2D slices of 3D data, as specified in pcolormesh.

source
Vlasiator.set_limMethod
set_lim(vmin, vmax, data, colorscale=Linear)

Set colormap limits vmin, vmax for data under scale colorscale.

source
+R = getRotationMatrix(v̂, θ)
source
Vlasiator.get_axisMethod
get_axis(axisunit::AxisUnit, plotrange::NTuple{4,<:Real}, sizes::NTuple{2,<:Integer})
+get_axis(pArgs::PlotArgs)

Return x and y ranges for 2D.

source
Vlasiator.get_fg_array_cellMethod
get_fg_array_cell(meta::MetaVLSV, v_fg::Array, cid::Int)

Return a subarray of the field solver grid array, corresponding to the fsgrid covered by the spatial cell ID cid.

source
Vlasiator.get_fg_indices_subvolumeFunction
get_fg_indices_subvolume(meta::MetaVLSV, lower, upper, tol::Float64=1e-3)

Get indices for subarray of fsgrid variables, in a cuboid defined by lower and upper vertices. This is used for mapping a set of fsgrid cells to a given DCCRG cell. Shift the corners (lower, upper) inward by a distance controlled by tol. If direct low-inclusive behaviour is required, tol shall be set to 0.

source
Vlasiator.getdata2dMethod
getdata2d(meta::MetaVLSV, var::String)

Return 2d scalar/vector data. Nonpublic since it won't work with DCCRG AMR.

source
Vlasiator.gradientMethod
gradient(A::AbstractArray{T,N}, dx::Vector{U}) where {T,N,U}

Calculate 2nd order cell-centered ∇A where A is a scalar array and dx is a vector of grid intervals in each dimension.

Warning

The current implementation has issues at the boundary if gradient is taken multiple times.

source
Vlasiator.prep1dMethod
prep1d(meta::MetaVLSV, var::String; i1::Int=0, i2::Int=0, comp::Int=0) -> Array

Obtain a 1D slice from 2D meta of var. i1 is the index for the first dimension, and i2 is the index for the second dimension; only one of them is needed. Use comp to select vector components.

source
Vlasiator.prep2dFunction
prep2d(meta::MetaVLSV, var::String, comp::Union{Symbol, Int}=0) -> Array

Obtain data from meta of var for 2D plotting. Use comp to select vector components.

source
Vlasiator.prep2dsliceMethod
prep2dslice(meta::MetaVLSV, var::String, normal, comp, pArgs::PlotArgs)

Return data of var on a uniform 2D mesh on the finest AMR level. Use normal to select the plane orientation, and comp to select the component of a vector, same as in pcolormesh.

source
Vlasiator.prep_vdfMethod
prep_vdf(meta::MetaVLSV, location::AbstractVector; kwargs...)

Return the cell velocities v1, v2, bin ranges r1, r2, cell VDF values fweight, and strings of labels and titles for VDF plots.

Keywords

  • unit::AxisUnit: location unit in SI, EARTH.
  • unitv::String: velocity unit in ("km/s", "m/s").
  • limits::Vector{Real}: velocity space range given in [xmin, xmax, ymin, ymax].
  • slicetype: symbol for choosing the slice type from :xy, :xz, :yz, :bperp, :bpar1, :bpar2.
  • center: symbol for setting the reference frame from :bulk, :peak.
  • vslicethick: setting the velocity space slice thickness in the normal direction. If set to 0, the whole distribution along the normal direction is projected onto a plane. Currently this is only meaningful when center is set such that a range near the bulk/peak normal velocity is selected.
  • weight::Symbol: choosing distribution weights from phase space density or particle flux between :particle and :flux.
  • flimit: minimum VDF threshold for plotting.
  • verbose: display the selection process.
source
Vlasiator.read_variable_as_fgMethod
read_variable_as_fg(meta::MetaVLSV, var::String)

Interpolate DCCRG variable var to field solver grid size. This is an alternative method to fillmesh, but not optimized for performance.

source
Vlasiator.reconstructMethod
reconstruct(vmesh::VMeshInfo, vcellids::Vector{Int32}, vcellf::Vector{<:AbstractFloat})

Reconstruct the full VDFs in 3D. vcellids are raw indices of nonzero VDFs ordered by blocks, and vcellf are the corresponding values in each cell.

source
Vlasiator.reorderMethod
reorder(vmesh::VMeshInfo, vcellids::Vector{Int32}) -> vcellids_origin

Reorder vblock-organized VDF indexes into x–>y–>z indexes. vcellids are raw indices of nonzero VDFs ordered by blocks.

source
Vlasiator.rotateTensorToVectorZMethod
rotateTensorToVectorZ(tensor::AbstractMatrix, vector::AbstractVector) -> SMatrix{3,3}

Rotate tensor with a rotation matrix that aligns the 3rd direction with vector, which is equivalent to change the basis from (i,j,k) to (i′,j′,k′) where k′ ∥ vector. Reference: Tensor rotation

source
Vlasiator.save_imageFunction
save_image(meta::MetaVLSV, file, vars, data, vtkGhostType, level,
+   ascii=false, append=true, box=[-Inf, Inf, -Inf, Inf, -Inf, Inf])

Save data of name vars at AMR level into VTK image file of name file.

Arguments

  • file::String: output file name.
  • vars::Vector{String}: variable names to be saved.
  • data::Vector{Vector{Array}}: data for all the variables on each refinement level.
  • vtkGhostType::Array{UInt8}: array for visibility control.
  • level::Int: refinement level (0-based).
  • ascii::Bool=false: save output in ASCII or binary format.
  • append::Bool=true: determines whether to append data at the end of file or do in-block writing.
  • box::Vector: selected box range in 3D.
source
Vlasiator.set_argsMethod
set_args(meta::MetaVLSV, var::String, axisunit::AxisUnit;
+   normal::Symbol=:none, origin=0.0)

Set plot-related arguments of var in axisunit. normal and origin are used for 2D slices of 3D data, as specified in pcolormesh.

source
Vlasiator.set_limMethod
set_lim(vmin, vmax, data, colorscale=Linear)

Set colormap limits vmin, vmax for data under scale colorscale.

source
diff --git a/dev/log/index.html b/dev/log/index.html index 50cfc3df..9373325e 100644 --- a/dev/log/index.html +++ b/dev/log/index.html @@ -3,4 +3,4 @@ rootpath = artifact"testdata" files = joinpath.(rootpath, ("bulk.1d.vlsv", "bulk.2d.vlsv", "bulk.amr.vlsv"))

These are also used in the standard test. These will be automatically downloaded from vlsv_data if you run the package test locally.

Performance

The VLSV loader inherits the basic structure from Analysator and is redesigned for performance.

For development, it is recommended to use PkgBenchmark.jl to run the test suite:

using PkgBenchmark, Vlasiator
-results = benchmarkpkg(Vlasiator)

or if you want to compare the current status of the package against a different git version

judge(Vlasiator, "97e3dca6b2474d7bdc5b62b5bf98ecf070516e5e")

To export results to Markdown,

export_markdown("testresult", results)

See more in the PkgBenchmark manual.

Precision

For post-processing and data analysis purposes, it makes less sense to stick to double precisions, so we mostly use Float32 in Vlasiator.jl for numerical arrays. Several exceptions are:

Int vs. UInt

Integers but not unsigned integers shall be used for indexing, even though unsigned integers are tempting.

Memory

Vlasiator output files can be large. If we have limited memory relative to the file size, Vlasiator.jl provide direct hard disk mapping through mmap in Julia. With this mechanism you never need to worry about unable to process data with small free memory. Besides, we found that proper usage of mmap can also speed up reading and reduce memory comsumption. However, without reinterpret we may encounter the alignment issue!

Parallelism

The current design choice is to achieve optimal serial performance per file, and apply parallel processing across individual files. In most common cases, the time it takes for post-processing one snapshot is reasonably short, but the number of snapshots are large. Julia's built-in support for all kinds of parallelism paradigm (multithreading, multiprocessing, channel) and external support from packages (MPI.jl, Polyester.jl) can be relatively easily incorported to make the whole workflow parallel.

See more in the examples.

VTK

VLSV is just an uncompressed binary format. If we convert VLSV to VTK through write_vtk, the generated VTK files, even the highest resolution one with every coarse cell mapping to the finest level, can be several times smaller than the original VLSV file.

One drawback of this conversion is that it cannot deal with phase space outputs, i.e. VDFs.

+results = benchmarkpkg(Vlasiator)

or if you want to compare the current status of the package against a different git version

judge(Vlasiator, "97e3dca6b2474d7bdc5b62b5bf98ecf070516e5e")

To export results to Markdown,

export_markdown("testresult", results)

See more in the PkgBenchmark manual.

Precision

For post-processing and data analysis purposes, it makes less sense to stick to double precisions, so we mostly use Float32 in Vlasiator.jl for numerical arrays. Several exceptions are:

Int vs. UInt

Integers but not unsigned integers shall be used for indexing, even though unsigned integers are tempting.

Memory

Vlasiator output files can be large. If we have limited memory relative to the file size, Vlasiator.jl provide direct hard disk mapping through mmap in Julia. With this mechanism you never need to worry about unable to process data with small free memory. Besides, we found that proper usage of mmap can also speed up reading and reduce memory comsumption. However, without reinterpret we may encounter the alignment issue!

Parallelism

The current design choice is to achieve optimal serial performance per file, and apply parallel processing across individual files. In most common cases, the time it takes for post-processing one snapshot is reasonably short, but the number of snapshots are large. Julia's built-in support for all kinds of parallelism paradigm (multithreading, multiprocessing, channel) and external support from packages (MPI.jl, Polyester.jl) can be relatively easily incorported to make the whole workflow parallel.

See more in the examples.

VTK

VLSV is just an uncompressed binary format. If we convert VLSV to VTK through write_vtk, the generated VTK files, even the highest resolution one with every coarse cell mapping to the finest level, can be several times smaller than the original VLSV file.

One drawback of this conversion is that it cannot deal with phase space outputs, i.e. VDFs.

diff --git a/dev/manual/index.html b/dev/manual/index.html index 09bf64f9..1a33135c 100644 --- a/dev/manual/index.html +++ b/dev/manual/index.html @@ -47,4 +47,4 @@ push!(vars, (pa, "panisotropy", VarInfo("", "", "", ""))) write_vlsv("bulk.1d.vlsv", "bulk.1d_new.vlsv", vars)
Note

Writing new FsGrid variables is not supported. All quantities from the original file is maintained.

Converting to VTK

We can convert VLSV files into VTK format. Since DCCRG is Cartesian based with uniform spacing, each level of mesh refinement corresponds to a VTK image file, and the cell refinement relationships are stored in vtkGhostType as well as the vthb file.

To convert a VLSV file into VTK,

write_vtk(file)

This function accepts either string of file names or MetaVLSV.

To see the full list of options, please refer to the documentation in API Reference. Example usage can be found here.

Warning

As of ParaView 5.9.1, there are display issues with VTKOverlappingAMR. However, we can read the generated image files directly. There is also an keyword argument for write_vtk called maxamronly: when it is set to true, then only the image file at the highest refinement level is generated. This part is experimental and subject to change in the future.

Tracking log files

The runtime performance per iteration can be monitored through log files:

file = "logfile.txt"
-timestamps, speed = readlog(file)

Here is a live demo.

Examples

More examples are provided about

Feel free to check those out and try on your data!

+timestamps, speed = readlog(file)

Here is a live demo.

Examples

More examples are provided about

Feel free to check those out and try on your data!

diff --git a/dev/python/index.html b/dev/python/index.html index f10ea963..4ffa92c3 100644 --- a/dev/python/index.html +++ b/dev/python/index.html @@ -20,4 +20,4 @@ jl = Julia(compiled_modules=False) jl.eval('include("examples/demo_2dplot_pyplot.jl")') import matplotlib.pyplot as plt -plt.show()
Note

This approach is for you to have a taste of the package with a Python frontend. The workaround shown above for handling the static python libraries makes it slow for regular use. An alternative solution would be creating system images, but as of Julia 1.6 the user experience is not smooth. For better integrated experience with its full power, it is recommended to use the package inside Julia.

+plt.show()
Note

This approach is for you to have a taste of the package with a Python frontend. The workaround shown above for handling the static python libraries makes it slow for regular use. An alternative solution would be creating system images, but as of Julia 1.6 the user experience is not smooth. For better integrated experience with its full power, it is recommended to use the package inside Julia.

diff --git a/dev/search/index.html b/dev/search/index.html index 8c166e7b..8cb7a860 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · Vlasiator.jl

Loading search...

    +Search · Vlasiator.jl

    Loading search...