plot_two_scalar_step.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
############################ WARNING ############################
# For running this script with Linux or MacOS, open a terminal in
# the subdirectory EXAMPLES, then type the command
#
# python plot_two_scalar_step.py
#
#################################################################
import sys
sys.path.insert(0, '../PYTHON')
# Import the module for plotting the contents of HDF5 files
from plots import *
# We aim to compare the contents of the following file:
inputh5 = ['../RESULTS/EXAMPLES/step_neumann/diags_10.h5', \
'../RESULTS/EXAMPLES/step_natural/diags_10.h5']
# ... and more precisely in terms of x-component of the velocity
field = 'Velocity_x'
# The difference between the input file lies in the use of different boundary conditions
list_alias_diff = ['Neumann BC', 'Natural BC']
# Simple comparating contour plot
plot_two_contour(inputh5, field, list_alias_diff, aliasfield='ux', outputpng='./ux_compare.png', forcesave=True)
# Same with a prescribed bounding box
plot_two_contour(inputh5, field, list_alias_diff, aliasfield='ux', list_bbox=[0., 30., 0., 3], outputpng='./ux_compare_bbox.png', forcesave=True)
# Same with prescribed isovalues
plot_two_contour(inputh5, field, list_alias_diff, aliasfield='ux', levels=[0., 0.5, 1., 1.5], outputpng='./ux_compare_levels.png', forcesave=True)