[ET Trac] [Einstein Toolkit] #2077: include RNSID in ET
Einstein Toolkit
trac-noreply at einsteintoolkit.org
Mon Nov 20 17:36:30 CST 2017
#2077: include RNSID in ET
------------------------------------+---------------------------------------
Reporter: rhaas | Owner:
Type: enhancement | Status: review
Priority: major | Milestone:
Component: EinsteinToolkit thorn | Version: development version
Resolution: | Keywords: Hydro_RNSID
------------------------------------+---------------------------------------
Comment (by jonah.maxwell.miller@…):
A few more comments.
I would really like to see a reader tool for data generated with RNSID,
just to show the user how it works (in case they want to output for some
reason.) It doesn't have to be fancy. For example, something like this
(with maybe a bit more boiler plate) would be cool:
{{{
import numpy as np
import matplotlib as mpl
from matplotlib import pyplot as plt
import h5py
import sys
filename = sys.argv[1]
with h5py.File(filename,'r') as f:
K=f.attrs['poly K'][0]
Gamma = f.attrs['poly Gamma'][0]
axis_ratio = f.attrs['axis_ratio'][0]
re = f.attrs['re'][0]
rhoc = f.attrs['rhoc'][0]
A_diff = f.attrs['A diff'][0]
Omega = f.attrs['Omega'][0]
Omega_e = f.attrs['Omega_e'][0]
SDIV=f.attrs['SDIV'][0]
MDIV=f.attrs['MDIV'][0]
rtype = f.attrs['rotation_type'][0]
eos_type=f.attrs['eos_type'][0]
eos_file = f.attrs['eos_file'][0]
Omega_diff = f['Omega_diff'][:]
alpha = f['alpha'][:]
energy = f['energy'][:]
enthalpy = f['enthalpy'][:]
gama = f['gama'][:]
mu = f['mu'][:]
omega = f['omega'][:]
pressure = f['pressure'][:]
rho_potential = f['rho_potential'][:]
s = f['s_qp'][:]
v2 = f['velocity_sq'][:]
S,MU = np.meshgrid(s,mu,indexing='ij')
NU = np.sqrt(1 - MU**2)
XC = S*MU
ZC = S*NU
plt.pcolor(XC,ZC,np.log(pressure))
plt.savefig('star_compactified.png',bbox_inches='tight')
plt.clf()
R = -re*S/(S-1)
rmax = 2*re
rmask = R <= rmax
X = R*MU
Y = R*NU
plt.pcolor(X[rmask],Y[rmask],np.log(pressure[rmask]))
plt.savefig('star_spherical_polar.png',bbox_inches='tight')
}}}
The tabulated EOS that RNSID expects is different from the tabulated
EOS that GRHydro expects. The former is a text file, the latter an hdf5
file. But it's not clear how to correctly extract the former from the
latter. Is there a utility to do this? If so, can it be packaged? And if
not can it be provided?
In a similar vein---the format for the tabulated EOS should be
documented in the thorndoc. What does RNSID need/expect? In what units
does it expect the table? Etc.
Compilation generates lots of warnings about unused and uninstantiated
variables. These warnings should be fixed if possible.
--
Ticket URL: <https://trac.einsteintoolkit.org/ticket/2077#comment:3>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit
More information about the Trac
mailing list