Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear how to generate plots #19

Open
shredEngineer opened this issue Dec 31, 2022 · 0 comments
Open

Unclear how to generate plots #19

shredEngineer opened this issue Dec 31, 2022 · 0 comments

Comments

@shredEngineer
Copy link
Contributor

After the modifications done in #18, I have finally managed to run each of the Maxwell examples and getting the _output/ directories populated with files claw_aux.ptc0000, claw_aux.ptc0000.info, claw.pkl0000, claw.ptc0000, claw.ptc0000.info, etc.

However, at the moment, it is totally unclear to me how to generate plots from this data.

I do understand that there exists a module emclaw/utils/visualization.py.

After some minor changes to this module, I was able to run it and have it read the files in the _output/ directory (tested with the Maxwell 2D example). I did this by appending to following snippet to the end of the example code:

import os
os.system("python ../../emclaw/utils/visualization.py /home/$USER/emclaw/examples/maxwell_vc_2d/_output")

This generated the following console output:

{}
0
(16384, 3)
./_output/claw.ptc0000
(16384, 6)
./_output/claw_aux.ptc0000
1
(16384, 3)
./_output/claw.ptc0001
2
(16384, 3)
./_output/claw.ptc0002
3
(16384, 3)
./_output/claw.ptc0003
4
(16384, 3)
./_output/claw.ptc0004
5
(16384, 3)
./_output/claw.ptc0005
6
(16384, 3)
./_output/claw.ptc0006
7
(16384, 3)
./_output/claw.ptc0007
8
(16384, 3)
./_output/claw.ptc0008
9
(16384, 3)
./_output/claw.ptc0009
10
(16384, 3)
./_output/claw.ptc0010
aux_rage = range(0, 6)
aux_range = [0, 1, 2]
build_grid_vecs = <bound method toolbox.build_grid_vecs of <visualization.toolbox object at 0x7f1ecb45feb0>>
data_zero = {'t': 0.0, 'num_eqn': 3, 'nstates': 1, 'num_aux': 6, 'num_dim': 2, 'write_aux': True, 'problem_data': {'chi2': array([0., 0., 0.]), 'chi3': array([0., 0., 0.]), 'vac1': 1.0, 'vac2': 1.0, 'vac3': 1.0, 'co': 1.0, 'zo': 1.0, 'dx': 0.390625, 'dy': 0.390625, 'nl': False, 'psi': True}, 'mapc2p': <function identity_map_2d at 0x7f1eba588790>, 'file_format': 'binary', 'level': 1, 'names': ['x', 'y'], 'lower': [0.0, 0.0], 'num_cells': [128, 128], 'delta': [0.390625, 0.390625]}
delta = [0.390625 0.390625]
dump = <bound method toolbox.dump of <visualization.toolbox object at 0x7f1ecb45feb0>>
expand_2d = False
file_format = petsc
frame_range = range(0, 11)
get_info = <bound method toolbox.get_info of <visualization.toolbox object at 0x7f1ecb45feb0>>
grid = {}
lower = [0.0, 0.0]
mpi_split = True
names = ['x', 'y']
num_aux = 6
num_cells = [128, 128]
num_dim = 2
num_eqn = 3
num_frames = 11
num_mp = None
outdir = ./_output
p_range = None
ptc_read = <bound method toolbox.ptc_read of <visualization.toolbox object at 0x7f1ecb45feb0>>
ptc_split = <bound method toolbox.ptc_split of <visualization.toolbox object at 0x7f1ecb45feb0>>
q_range = [0, 1, 2]
read_aux = True
read_p = <bound method toolbox.read_p of <visualization.toolbox object at 0x7f1ecb45feb0>>
s_range = range(0, 2)
sampling = 1
set_dir = <bound method toolbox.set_dir of <visualization.toolbox object at 0x7f1ecb45feb0>>
split_solution = <bound method toolbox.split_solution of <visualization.toolbox object at 0x7f1ecb45feb0>>
update_aux = False
write_aux = False
write_split = <bound method toolbox.write_split of <visualization.toolbox object at 0x7f1ecb45feb0>>
xmf_base = claw.meta

The following files were added to the _output/ directory: n00.sol_aux0000, n00.sol_aux0000.info, s00.sol0000, s00.sol0000.info etc.

So, before attempting to fix anything further, I need to know the intended procedure or workflow for generating plots from the _output/ files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant