CPP-snippets 0.0.1
A silly C++ project to use for demonstrating code integration
Loading...
Searching...
No Matches
run_postproc.py
1# this routine can be used to visualize the 1D solver results in the projects 'output' dir
2from postprocessor import PostProcessor
3
4csv_files = {
5 "time": "time_vec.csv", # single-column file with time values
6 "x": "nodes_vec.csv", # single-column file with node positions
7 "dx": "dx_vec.csv", # single-column file with cell sizes
8 "phi": "phi_mat.csv", # electric potential on nodes
9 "rho": "rho_mat.csv", # charge density on nodes
10 "efield": "efield_mat.csv", # electric field in cells
11 "currents": "currents_mat.csv", # multi-column file with electrode currents over time
12 "energy": "energy_mat.csv" # multi-column file with electron energy bins over time
13}
14cell_fields = []
15
16pp = PostProcessor(
17 folder="/shares/users/work/algl/IPPnextcloud/SIM/simple-mano/COARSE",
18 csv_dict=csv_files,
19 cell_fields=cell_fields
20 )
21
22# SANITY CHECK
23#Plot timestep 10 of phi (node-based)
24#pp.plot_timestep("phi", t=0)
25# Plot timestep 10 of efield (cell-based)
26#pp.plot_timestep("efield", t=0)
27
28# Animate density every 5th timestep
29pp.animate("rho", step=2)
30
31pp.animate("phi", step=2)
32
33pp.plot_columns_over_time("currents", [1,2])
34
35#pp.animate_histogram("energy")