QuazarTech/DG_Maxwell

Running time evolution of wave equation gives an error if **results** directory not present.

Closed this issue · 7 comments

Commit: c04ced5

Issue:
On running the dg_maxwell.wave_equation.time_evolution() function, the function tries to store the result images in the results/1D_Wave_images directory. However, if the directory is not present, it exits with
an error.

Possible Solution: Creating the directory in the dg_maxwell.wave_equation.time_evolution() function. Add this code before accessing the directory from the function.

    results_directory = 'results/1D_Wave_images'
    
    if not os.path.exists(results_directory):
        os.makedirs(results_directory)

This will create the directory results/1D_Wave_images if it is already not present.

Fixed in 6140081

Also I think the movie can be made and stored in a folder titled '1D_Advection_movie' . I had implemented a similar procedure in the notebook.

The folder name is not relevant here.

Is making the movie automatically a good idea or not?

I don't think that it's a good idea. I was actually thinking that since you are already storing the data in hdf5 files, we should stop creating images. Instead of doing that we can write a code which reads the hdf5 results and gives options to make videos or create images.

Then this issue is pointless. I think that should be raised as a new Issue

yeah. We can do that. This issue was related to the existing system.

This issue has been fixed - 8759c94

The images are no longer created inside wave_equation.py, Instead the h5py files are stored (The suggestion by Aman is implemented so this error doesn't happen while storinng these h5py files) and the post_processing.py file is to be run to obtain the images.