Chi-Tech
test_framework_post_processors_solver_info_02_lua.h
Go to the documentation of this file.
1/** \page test_framework_post_processors_solver_info_02_lua test/framework/post_processors/solver_info_02.lua
2\ingroup LuaInputExamples
3
4\code
5-- Post-Processor test with lots of post-processors
6-- Testing table wrapping and getting the value of a post-processor by both
7-- handle and name
8
9-- Example Point-Reactor Kinetics solver
10phys0 = prk.TransientSolver.Create({ initial_source = 0.0 })
11
12for k = 1, 20 do
13 chi.SolverInfoPostProcessor.Create({
14 name = "neutron_population" .. tostring(k),
15 solver = phys0,
16 info = { name = "neutron_population" },
17 print_on = { "" }
18 })
19end
20pp21 = chi.SolverInfoPostProcessor.Create({
21 name = "neutron_population" .. tostring(21),
22 solver = phys0,
23 info = { name = "neutron_population" },
24 print_on = { "" }
25})
26
27chi.PostProcessorPrinterSetOptions({
28 time_history_limit = 5,
29})
30
31chiSolverInitialize(phys0)
32
33for t = 1, 20 do
34 chiSolverStep(phys0)
35 time = chiSolverGetInfo(phys0, "time_next")
36 print(t, string.format("%.3f %.5f",time, chiSolverGetInfo(phys0, "population_next")))
37
38 chiSolverAdvance(phys0)
39 if (time > 0.1) then
40 prk.SetParam(phys0, "rho", 0.8)
41 end
42end
43
44print("Manual neutron_population1=",
45 string.format("%.5f", chi.PostProcessorGetValue("neutron_population1")))
46print("Manual neutron_population1=",
47 string.format("%.5f", chi.PostProcessorGetValue(pp21)))\endcode
48*/
49
50