Chi-Tech
test_framework_post_processors_solver_info_01_lua.h
Go to the documentation of this file.
1/** \page test_framework_post_processors_solver_info_01_lua test/framework/post_processors/solver_info_01.lua
2\ingroup LuaInputExamples
3
4\code
5-- Post-Processor test with basic information
6-- Also tests the .csv output and manual printing
7
8-- Example Point-Reactor Kinetics solver
9phys0 = prk.TransientSolver.Create({ initial_source = 0.0 })
10
11pp0 = chi.SolverInfoPostProcessor.Create
12({
13 name = "neutron_population",
14 solver = phys0,
15 info = {name = "neutron_population"},
16 print_on = { "ProgramExecuted" }
17})
18
19chi.PostProcessorPrinterSetOptions
20({
21 csv_filename = "solver_info_01.csv"
22})
23
24chiSolverInitialize(phys0)
25
26for t=1,20 do
27 chiSolverStep(phys0)
28 time = chiSolverGetInfo(phys0, "time_next")
29 print(t, string.format("%.3f %.5f",time, chiSolverGetInfo(phys0, "population_next")))
30
31 chiSolverAdvance(phys0)
32 if (time > 0.1) then
33 prk.SetParam(phys0, "rho", 0.8)
34 end
35end
36
37print("Manually printing Post-Processor:")
38chi.PrintPostProcessors({pp0, pp1})\endcode
39*/
40
41