import numpy
import sys
import string
import math
import glob
from pylab import *
from matplotlib.colors import LogNorm, Normalize,ListedColormap
from scipy.interpolate import CubicSpline
params = {
'axes.labelsize': 14,
'font.size': 12,
'mathtext.fontset' : 'cm',
'font.family' : 'sans-serif',
'legend.fontsize': 12,
'xtick.labelsize': 12,
'ytick.labelsize': 12,
'xtick.major.size' : 2.,
'ytick.major.size' : 2.,
'xtick.minor.size' : 1.,
'ytick.minor.size' : 1.,
'text.usetex': False,
# 'figure.figsize': [2.15,1.85],
'axes.linewidth' : 0.75,
'figure.subplot.left' : 0.1,
'figure.subplot.bottom' : 0.18,
'figure.subplot.right' : 0.96,
'figure.subplot.top' : 0.98,
'savefig.dpi' : 300,
}
rcParams.update(params)
fig, ax = plt.subplots(1, 2, figsize=(6.29921, 2.5), gridspec_kw={'wspace': 0.35})
datafile1 = "wave-64"
data1=numpy.loadtxt(datafile1)
datafile2 = "../capclsvof/wave-64"
data2=numpy.loadtxt(datafile2)
datafile3 = "../caphf/wave-64"
data3=numpy.loadtxt(datafile3)
datafile4 = "../prosperetti.dat"
data4=numpy.loadtxt(datafile4)
datafile5 = "../caphf2d/wave-64"
data5=numpy.loadtxt(datafile5)
datafile11 = "log"
data11=numpy.loadtxt(datafile11)
datafile21 = "../capclsvof/log"
data21=numpy.loadtxt(datafile21)
datafile31 = "../caphf/log"
data31=numpy.loadtxt(datafile31)
datafile51 = "../caphf2d/log"
data51=numpy.loadtxt(datafile51)
NUM = 400
ax[0].set_ylabel(''r'$a$',labelpad=0)
ax[0].set_xlabel(r'$\omega_0 t$',labelpad=2)
ax[0].set_xticks([0,5,10,15,20,25])
ax[0].set_yticks([0,0.002,0.004,0.006,0.008,0.01])
ax[0].set_xlim(0,25)
ax[0].set_ylim(0,0.01)
#plot(data1[:,0],data1[:,1],'-',markersize=1.5,color = cmap[0])
ax[0].plot(data2[:,0],data2[:,1],'-',linewidth=4.5,color = "#ce2d4f",label="CLSVOF")
ax[0].plot(data3[:,0],data3[:,1],'-',linewidth=3.5,color = "#5aae61",label="HF")
ax[0].plot(data5[:,0],data5[:,1],'-',linewidth=1.25,color = "#0000FF",label="HF2D")
ax[0].plot(data4[0:140:2,0],data4[0:140:2,1],'o',markersize=2,color = "#000000",label="Prosperetti")
ax[0].plot(data4[141::5,0],data4[141::5,1],'o',markersize=2,color = "#000000")
ax[0].legend(ncol = 1, loc=1,frameon=False,fontsize=10)
x = np.logspace(0,2,num=NUM)
ax[1].plot(data21[:,0],data21[:,1]/2.,'-+',markersize=4,linewidth=2,color = "#ce2d4f",label="CLSVOF")
ax[1].plot(data31[:,0],data31[:,1]/2.,'-*',markersize=4,linewidth=2,color = "#5aae61",label="HF")
ax[1].plot(data51[:,0],data51[:,1]/2.,'-o',markersize=4,linewidth=2,color = "#0000FF",label="HF2D")
ax[1].plot(x,30/x/x/2,'-',linewidth=2,color = "#000000",label="Order 2")
ax[1].set_xlim(3,100)
ax[1].set_ylim(0.001,1)
ax[1].set_xscale("log")
ax[1].set_yscale("log")
ax[1].legend(ncol = 1, loc=1,frameon=False,fontsize=10)
ax[1].set_ylabel(r'$\epsilon_{L2}$',labelpad=0)
ax[1].set_xlabel(r'$N/\lambda$',labelpad=2)
fig.text(-0.035, 0.98, '$(a)$', fontsize=14, fontweight='bold')
fig.text(0.49, 0.98, '$(b)$', fontsize=14, fontweight='bold')
savefig("capwave.pdf",bbox_inches='tight', pad_inches=1/2.54)