From 098e2bc146a9bf72aabbf33c15587022c76d9f7d Mon Sep 17 00:00:00 2001 From: s6nistam Date: Fri, 13 Dec 2024 13:40:31 +0100 Subject: [PATCH] renamed ParaviewCatalyst to ParaViewCatalyst --- docs/src/visualization.md | 16 +++---- .../elixir_advection_basic_catalyst.jl | 4 +- .../elixir_advection_cubed_sphere_catalyst.jl | 4 +- ...er_circular_wind_nonconforming_catalyst.jl | 4 +- ...urce_terms_nonconforming_earth_catalyst.jl | 4 +- .../elixir_advection_basic_catalyst.jl | 4 +- .../elixir_advection_amr_catalyst.jl | 4 +- .../elixir_advection_basic_catalyst.jl | 4 +- .../elixir_advection_amr_catalyst.jl | 6 +-- .../elixir_advection_basic_catalyst.jl | 4 +- .../elixir_euler_amr_catalyst.jl | 4 +- ...elixir_euler_amr_visualization_catalyst.jl | 4 +- src/Trixi.jl | 8 ++-- src/callbacks_step/paraview_catalyst.jl | 46 +++++++++---------- 14 files changed, 58 insertions(+), 58 deletions(-) diff --git a/docs/src/visualization.md b/docs/src/visualization.md index 5e2732e464d..f06e736028e 100644 --- a/docs/src/visualization.md +++ b/docs/src/visualization.md @@ -400,10 +400,10 @@ below: ``` ### Visualizing results during a simulation using Paraview Catalyst -With a Paraview Installation containing the Catalyst Library, you can use the ParaviewCatalystCallback to visualise your results in Paraview during the simulation. +With a Paraview Installation containing the Catalyst Library, you can use the ParaViewCatalystCallback to visualise your results in Paraview during the simulation. ```julia - ParaviewCatalystCallback(; interval=0, nvisnodes = nothing, catalyst_pipeline = nothing) + ParaViewCatalystCallback(; interval=0, nvisnodes = nothing, catalyst_pipeline = nothing) ``` + `interval` determines the amount of timesteps between calls of this callback + `nvisnodes` determines the number of visualization nodes. @@ -412,7 +412,7 @@ With a Paraview Installation containing the Catalyst Library, you can use the Pa + For example in a 3D Plot each cell has a nxnxn array of visualization nodes + `catalyst_pipeline` a path to the catalyst pipeline if the default should not be used + The starting view shown by Paraview is determined by a python pipeline - + ParaviewCatalyst.jl includes a standard `catalyst_pipeline.py` + + ParaViewCatalyst.jl includes a standard `catalyst_pipeline.py` + In principle your current view in Paraview can be exported as a pipeline using File->Save Catalyst State... but in practice the resulting pipelines did not work in our testing. ```python @@ -426,14 +426,14 @@ With a Paraview Installation containing the Catalyst Library, you can use the Pa a block like this needed to replace the bottom of the exported pipeline, to get it working for us -To be able to use the ParaviewCatalystCallback you need +To be able to use the ParaViewCatalystCallback you need + A Paraview Installation containing the Catalyst Library -+ The ParaviewCatalyst.jl Julia package ++ The ParaViewCatalyst.jl Julia package + The PARAVIEW_CATALYST_PATH Environment Variable set to the location of the Catalyst Library contained in Paraview -To use the ParaviewCatalystCallback you have to -+ Include ParaviewCatalyst.jl in your julia Script via `using ParaviewCatalyst` -+ Create a ParaviewCatalystCallback and add it to your Callbackset +To use the ParaViewCatalystCallback you have to ++ Include ParaViewCatalyst.jl in your julia Script via `using ParaViewCatalyst` ++ Create a ParaViewCatalystCallback and add it to your Callbackset + Before running the script: + Open Paraview and press Catalyst->Connect... and use the standard Port of 22222 (if not specified otherwise in the pipeline) + Press Catalyst->Pause Simulation diff --git a/examples/p4est_2d_dgsem/elixir_advection_basic_catalyst.jl b/examples/p4est_2d_dgsem/elixir_advection_basic_catalyst.jl index e4f6ec22155..02676d8f9a4 100644 --- a/examples/p4est_2d_dgsem/elixir_advection_basic_catalyst.jl +++ b/examples/p4est_2d_dgsem/elixir_advection_basic_catalyst.jl @@ -3,7 +3,7 @@ using OrdinaryDiffEq using Trixi -using ParaviewCatalyst +using ParaViewCatalyst ############################################################################### # semidiscretization of the linear advection equation @@ -48,7 +48,7 @@ save_solution = SaveSolutionCallback(interval = 100, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 1.6) -catalyst_callback = ParaviewCatalystCallback(interval=100) +catalyst_callback = ParaViewCatalystCallback(interval=100) # Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, diff --git a/examples/p4est_3d_dgsem/elixir_advection_cubed_sphere_catalyst.jl b/examples/p4est_3d_dgsem/elixir_advection_cubed_sphere_catalyst.jl index d2e2ad915f8..8e13bbeacd3 100644 --- a/examples/p4est_3d_dgsem/elixir_advection_cubed_sphere_catalyst.jl +++ b/examples/p4est_3d_dgsem/elixir_advection_cubed_sphere_catalyst.jl @@ -1,7 +1,7 @@ using OrdinaryDiffEq using Trixi -using ParaviewCatalyst +using ParaViewCatalyst ############################################################################### # semidiscretization of the linear advection equation @@ -46,7 +46,7 @@ save_solution = SaveSolutionCallback(interval = 100, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 1.2) -catalyst_callback = ParaviewCatalystCallback(interval=100, interpolation=true) +catalyst_callback = ParaViewCatalystCallback(interval=100, interpolation=true) # Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, diff --git a/examples/p4est_3d_dgsem/elixir_euler_circular_wind_nonconforming_catalyst.jl b/examples/p4est_3d_dgsem/elixir_euler_circular_wind_nonconforming_catalyst.jl index 6074a83741f..b5576bc023e 100644 --- a/examples/p4est_3d_dgsem/elixir_euler_circular_wind_nonconforming_catalyst.jl +++ b/examples/p4est_3d_dgsem/elixir_euler_circular_wind_nonconforming_catalyst.jl @@ -8,7 +8,7 @@ using OrdinaryDiffEq using Trixi using LinearAlgebra -using ParaviewCatalyst +using ParaViewCatalyst ############################################################################### # semidiscretization of the compressible Euler equations @@ -126,7 +126,7 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition = true, adapt_initial_condition_only_refine = true) -catalyst_callback = ParaviewCatalystCallback(interval=100) +catalyst_callback = ParaViewCatalystCallback(interval=100) callbacks = CallbackSet(summary_callback, analysis_callback, diff --git a/examples/p4est_3d_dgsem/elixir_euler_source_terms_nonconforming_earth_catalyst.jl b/examples/p4est_3d_dgsem/elixir_euler_source_terms_nonconforming_earth_catalyst.jl index d5703ba0f46..149879650cc 100644 --- a/examples/p4est_3d_dgsem/elixir_euler_source_terms_nonconforming_earth_catalyst.jl +++ b/examples/p4est_3d_dgsem/elixir_euler_source_terms_nonconforming_earth_catalyst.jl @@ -5,7 +5,7 @@ using OrdinaryDiffEq using Trixi using LinearAlgebra -using ParaviewCatalyst +using ParaViewCatalyst ############################################################################### # semidiscretization of the compressible Euler equations @@ -120,7 +120,7 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition = true, adapt_initial_condition_only_refine = true) -catalyst_callback = ParaviewCatalystCallback(interval=100) +catalyst_callback = ParaViewCatalystCallback(interval=100) callbacks = CallbackSet(summary_callback, analysis_callback, diff --git a/examples/tree_1d_dgsem/elixir_advection_basic_catalyst.jl b/examples/tree_1d_dgsem/elixir_advection_basic_catalyst.jl index b6d6cd905c3..c05449e6afe 100644 --- a/examples/tree_1d_dgsem/elixir_advection_basic_catalyst.jl +++ b/examples/tree_1d_dgsem/elixir_advection_basic_catalyst.jl @@ -1,7 +1,7 @@ using OrdinaryDiffEq using Trixi -using ParaviewCatalyst +using ParaViewCatalyst ############################################################################### # semidiscretization of the linear advection equation @@ -44,7 +44,7 @@ save_solution = SaveSolutionCallback(interval = 100, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 1.6) -catalyst_callback = ParaviewCatalystCallback(interval=10) +catalyst_callback = ParaViewCatalystCallback(interval=10) # Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, diff --git a/examples/tree_2d_dgsem/elixir_advection_amr_catalyst.jl b/examples/tree_2d_dgsem/elixir_advection_amr_catalyst.jl index 58c104fba2a..16673aa8592 100644 --- a/examples/tree_2d_dgsem/elixir_advection_amr_catalyst.jl +++ b/examples/tree_2d_dgsem/elixir_advection_amr_catalyst.jl @@ -1,7 +1,7 @@ using OrdinaryDiffEq using Trixi -using ParaviewCatalyst +using ParaViewCatalyst ############################################################################### # semidiscretization of the linear advection equation @@ -50,7 +50,7 @@ amr_callback = AMRCallback(semi, amr_controller, stepsize_callback = StepsizeCallback(cfl = 1.6) -catalyst_callback = ParaviewCatalystCallback(interval=10) +catalyst_callback = ParaViewCatalystCallback(interval=10) callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, diff --git a/examples/tree_2d_dgsem/elixir_advection_basic_catalyst.jl b/examples/tree_2d_dgsem/elixir_advection_basic_catalyst.jl index b4f5cfebe63..a81205448a4 100644 --- a/examples/tree_2d_dgsem/elixir_advection_basic_catalyst.jl +++ b/examples/tree_2d_dgsem/elixir_advection_basic_catalyst.jl @@ -1,7 +1,7 @@ using OrdinaryDiffEq using Trixi -using ParaviewCatalyst +using ParaViewCatalyst ############################################################################### # semidiscretization of the linear advection equation @@ -44,7 +44,7 @@ save_solution = SaveSolutionCallback(interval = 100, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 1.6) -catalyst_callback = ParaviewCatalystCallback(interval=10) +catalyst_callback = ParaViewCatalystCallback(interval=10) # Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, diff --git a/examples/tree_3d_dgsem/elixir_advection_amr_catalyst.jl b/examples/tree_3d_dgsem/elixir_advection_amr_catalyst.jl index c487bfb2946..a6d2683e400 100644 --- a/examples/tree_3d_dgsem/elixir_advection_amr_catalyst.jl +++ b/examples/tree_3d_dgsem/elixir_advection_amr_catalyst.jl @@ -1,7 +1,7 @@ using OrdinaryDiffEq using Trixi -using ParaviewCatalyst +using ParaViewCatalyst ############################################################################### # semidiscretization of the linear advection equation @@ -50,8 +50,8 @@ amr_callback = AMRCallback(semi, amr_controller, stepsize_callback = StepsizeCallback(cfl = 1.2) -# catalyst_callback = ParaviewCatalystCallback(interval=100) -catalyst_callback = ParaviewCatalystCallback(interval=100, catalyst_pipeline= joinpath(@__DIR__, "elixir_advection_amr_catalyst_pipeline.py")) +# catalyst_callback = ParaViewCatalystCallback(interval=100) +catalyst_callback = ParaViewCatalystCallback(interval=100, catalyst_pipeline= joinpath(@__DIR__, "elixir_advection_amr_catalyst_pipeline.py")) callbacks = CallbackSet(summary_callback, analysis_callback, diff --git a/examples/tree_3d_dgsem/elixir_advection_basic_catalyst.jl b/examples/tree_3d_dgsem/elixir_advection_basic_catalyst.jl index 8234f87c29b..d74ed834dec 100644 --- a/examples/tree_3d_dgsem/elixir_advection_basic_catalyst.jl +++ b/examples/tree_3d_dgsem/elixir_advection_basic_catalyst.jl @@ -1,7 +1,7 @@ using OrdinaryDiffEq using Trixi -using ParaviewCatalyst +using ParaViewCatalyst ############################################################################### # semidiscretization of the linear advection equation @@ -44,7 +44,7 @@ save_solution = SaveSolutionCallback(interval = 100, # The StepsizeCallback handles the re-calculation of the maximum Δt after each time step stepsize_callback = StepsizeCallback(cfl = 1.2) -catalyst_callback = ParaviewCatalystCallback(interval=10, interpolation=true) +catalyst_callback = ParaViewCatalystCallback(interval=10, interpolation=true) # Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, diff --git a/examples/tree_3d_dgsem/elixir_euler_amr_catalyst.jl b/examples/tree_3d_dgsem/elixir_euler_amr_catalyst.jl index 423abf0cda4..ae016e05f6d 100644 --- a/examples/tree_3d_dgsem/elixir_euler_amr_catalyst.jl +++ b/examples/tree_3d_dgsem/elixir_euler_amr_catalyst.jl @@ -1,7 +1,7 @@ using OrdinaryDiffEq using Trixi -using ParaviewCatalyst +using ParaViewCatalyst ############################################################################### # semidiscretization of the compressible Euler equations @@ -70,7 +70,7 @@ amr_callback = AMRCallback(semi, amr_controller, stepsize_callback = StepsizeCallback(cfl = 0.9) -catalyst_callback = ParaviewCatalystCallback(interval=100) +catalyst_callback = ParaViewCatalystCallback(interval=100) callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, diff --git a/examples/tree_3d_dgsem/elixir_euler_amr_visualization_catalyst.jl b/examples/tree_3d_dgsem/elixir_euler_amr_visualization_catalyst.jl index 040453bdf0c..7708a86ee5f 100644 --- a/examples/tree_3d_dgsem/elixir_euler_amr_visualization_catalyst.jl +++ b/examples/tree_3d_dgsem/elixir_euler_amr_visualization_catalyst.jl @@ -1,7 +1,7 @@ using OrdinaryDiffEq using Trixi -using ParaviewCatalyst +using ParaViewCatalyst using Plots using GLMakie @@ -74,7 +74,7 @@ stepsize_callback = StepsizeCallback(cfl = 0.9) visualization_callback = VisualizationCallback(interval = 20, clims = (0, 1)) -catalyst_callback = ParaviewCatalystCallback(interval=100) +catalyst_callback = ParaViewCatalystCallback(interval=100) callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, diff --git a/src/Trixi.jl b/src/Trixi.jl index 0d30d92a8d6..56fcb29fc4d 100644 --- a/src/Trixi.jl +++ b/src/Trixi.jl @@ -261,7 +261,7 @@ export SemidiscretizationCoupled export SummaryCallback, SteadyStateCallback, AnalysisCallback, AliveCallback, SaveRestartCallback, SaveSolutionCallback, TimeSeriesCallback, VisualizationCallback, - AveragingCallback, ParaviewCatalystCallback, + AveragingCallback, ParaViewCatalystCallback, AMRCallback, StepsizeCallback, GlmSpeedCallback, LBMCollisionCallback, EulerAcousticsCouplingCallback, TrivialCallback, AnalysisCallbackCoupled, @@ -305,10 +305,10 @@ function __init__() using .Plots: Plots end - # Enable features that depend on the availability of the ParaviewCatalyst package + # Enable features that depend on the availability of the ParaViewCatalyst package # TODO: extension? - @require ParaviewCatalyst="0fa3a46a-29f8-4c04-a671-08df7e71e505" begin - using .ParaviewCatalyst: ParaviewCatalyst + @require ParaViewCatalyst="0fa3a46a-29f8-4c04-a671-08df7e71e505" begin + using .ParaViewCatalyst: ParaViewCatalyst end @require GLMakie="e9467ef8-e4e7-5192-8a1a-b1aee30e663a" begin diff --git a/src/callbacks_step/paraview_catalyst.jl b/src/callbacks_step/paraview_catalyst.jl index 042e5a52585..f45d08a33db 100644 --- a/src/callbacks_step/paraview_catalyst.jl +++ b/src/callbacks_step/paraview_catalyst.jl @@ -5,7 +5,7 @@ @muladd begin #! format: noindent -mutable struct ParaviewCatalystCallback +mutable struct ParaViewCatalystCallback interval::Int nvisnodes catalyst_pipeline @@ -15,18 +15,18 @@ end function Base.show(io::IO, cb::DiscreteCallback{Condition, Affect!}) where {Condition, Affect! <: - ParaviewCatalystCallback + ParaViewCatalystCallback } visualization_callback = cb.affect! @unpack interval = visualization_callback - print(io, "ParaviewCatalystCallback(", + print(io, "ParaViewCatalystCallback(", "interval=", interval,")") end function Base.show(io::IO, ::MIME"text/plain", cb::DiscreteCallback{Condition, Affect!}) where {Condition, Affect! <: - ParaviewCatalystCallback + ParaViewCatalystCallback } if get(io, :compact, false) show(io, cb) @@ -40,37 +40,37 @@ function Base.show(io::IO, ::MIME"text/plain", "interpolation" => visualization_callback.interpolation, ] - summary_box(io, "ParaviewCatalystCallback", setup) + summary_box(io, "ParaViewCatalystCallback", setup) end end """ - ParaviewCatalystCallback(; interval=0, nvisnodes = nothing, catalyst_pipeline = nothing + ParaViewCatalystCallback(; interval=0, nvisnodes = nothing, catalyst_pipeline = nothing ) Create a callback that visualizes results during a simulation using Paraview, also known as *in-situ visualization*. Make sure that your downloaded Paraview Installation includes the Catalyst library and make sure to set the PARAVIEW_CATALYST_PATH Environment Variable to the path of the Catalyst lib. -You can also specify a path for a custom catalyst pipeline to be used instead of the default by ParaviewCatalyst.jl +You can also specify a path for a custom catalyst pipeline to be used instead of the default by ParaViewCatalyst.jl !!! warning "Experimental implementation" This is an experimental feature and may change in any future releases. """ -function ParaviewCatalystCallback(; interval = 0, nvisnodes = nothing, catalyst_pipeline = nothing, interpolation = true +function ParaViewCatalystCallback(; interval = 0, nvisnodes = nothing, catalyst_pipeline = nothing, interpolation = true ) - # ParaviewCatalyst.catalyst_initialize(libpath="/home/nico/Paraview/ParaView-5.13.0-MPI-Linux-Python3.10-x86_64/lib/catalyst") + # ParaViewCatalyst.catalyst_initialize(libpath="/home/nico/Paraview/ParaView-5.13.0-MPI-Linux-Python3.10-x86_64/lib/catalyst") if catalyst_pipeline === nothing - ParaviewCatalyst.catalyst_initialize() + ParaViewCatalyst.catalyst_initialize() else - ParaviewCatalyst.catalyst_initialize(catalyst_pipeline=catalyst_pipeline) + ParaViewCatalyst.catalyst_initialize(catalyst_pipeline=catalyst_pipeline) end - visualization_callback = ParaviewCatalystCallback(interval, nvisnodes, catalyst_pipeline, interpolation) + visualization_callback = ParaViewCatalystCallback(interval, nvisnodes, catalyst_pipeline, interpolation) - # Warn users if they create a ParaviewCatalystCallback without having loaded the ParaviewCatalyst package - if !(:ParaviewCatalyst in nameof.(Base.loaded_modules |> values)) - @warn "Package `ParaviewCatalyst` not loaded but required by `ParaviewCatalystCallback` to visualize results" + # Warn users if they create a ParaViewCatalystCallback without having loaded the ParaViewCatalyst package + if !(:ParaViewCatalyst in nameof.(Base.loaded_modules |> values)) + @warn "Package `ParaViewCatalyst` not loaded but required by `ParaViewCatalystCallback` to visualize results" end DiscreteCallback(visualization_callback, visualization_callback, # the first one is the condition, the second the affect! @@ -79,7 +79,7 @@ function ParaviewCatalystCallback(; interval = 0, nvisnodes = nothing, catalyst_ end function initialize!(cb::DiscreteCallback{Condition, Affect!}, u, t, - integrator) where {Condition, Affect! <: ParaviewCatalystCallback} + integrator) where {Condition, Affect! <: ParaViewCatalystCallback} visualization_callback = cb.affect! visualization_callback(integrator) @@ -88,7 +88,7 @@ function initialize!(cb::DiscreteCallback{Condition, Affect!}, u, t, end # this method is called to determine whether the callback should be activated -function (visualization_callback::ParaviewCatalystCallback)(u, t, integrator) +function (visualization_callback::ParaViewCatalystCallback)(u, t, integrator) @unpack interval = visualization_callback # With error-based step size control, some steps can be rejected. Thus, @@ -102,7 +102,7 @@ end function create_conduit_node(integrator, mesh::TreeMesh, equations, solver, caches, nvisnodes) #creating the conduit node, that will later be passed to paraview - node = ParaviewCatalyst.ConduitNode() + node = ParaViewCatalyst.ConduitNode() #information about the problem being solved nvars = nvariables(equations) @@ -206,7 +206,7 @@ end function create_conduit_node(integrator, mesh::P4estMesh, equations, solver, cache, nvisnodes) #creating the conduit node, that will later be passed to paraview - node = ParaviewCatalyst.ConduitNode() + node = ParaViewCatalyst.ConduitNode() #information about the problem being solved n_visnodes = (nvisnodes === nothing) ? 2 * nnodes(solver) : nvisnodes @@ -312,7 +312,7 @@ end function create_conduit_node_no_interpolation(integrator, mesh::TreeMesh, equations, solver, cache) #creating the conduit node, that will later be passed to paraview - node = ParaviewCatalyst.ConduitNode() + node = ParaViewCatalyst.ConduitNode() #information about the problem being solved nvars = nvariables(equations) @@ -423,7 +423,7 @@ end function create_conduit_node_no_interpolation(integrator, mesh::P4estMesh, equations, solver, cache) #creating the conduit node, that will later be passed to paraview - node = ParaviewCatalyst.ConduitNode() + node = ParaViewCatalyst.ConduitNode() #information about the problem being solved n_visnodes = nnodes(solver) @@ -512,7 +512,7 @@ function create_conduit_node_no_interpolation(integrator, mesh::P4estMesh, equat end # this method is called when the callback is activated -function (visualization_callback::ParaviewCatalystCallback)(integrator) +function (visualization_callback::ParaViewCatalystCallback)(integrator) #extracting problem data from the integrator mesh, equations, solver, cache = mesh_equations_solver_cache(integrator.p) @@ -526,7 +526,7 @@ function (visualization_callback::ParaviewCatalystCallback)(integrator) create_conduit_node_no_interpolation(integrator, mesh, equations, solver, cache)) #passing the problem data to a function fitting the right mesh, to create a conduit node, which is then passed to paraview @trixi_timeit timer() "catalyst execute" begin - ParaviewCatalyst.catalyst_execute(node) + ParaViewCatalyst.catalyst_execute(node) end return nothing