Example #1
0
###############################################################################

###############################################################################
#      WRITE THE INITAL CONDITIONS                                            #
###############################################################################
print ("Writing Initial Conditions")
# !!! Do not modify this part !!! #
fw.write1D( "Alfven.dat", nx=nx, ne=ne, variable=VA.T, path=nml.total_path+"/data_ini/") 
fw.write1D("DCRpara.dat", nx=nx, ne=ne,  variable=D.T, path=nml.total_path+"/data_ini/")
fw.write1D(  "DBohm.dat", nx=nx, ne=ne, variable=Db.T, path=nml.total_path+"/data_ini/")
fw.write1D(     "Ip.dat", nx=nx, ne=ne,  variable=Ip.T, path=nml.total_path+"/data_ini/")   
fw.write1D(     "Im.dat", nx=nx, ne=ne,  variable=Im.T, path=nml.total_path+"/data_ini/")  
fw.write1D(    "Pcr.dat", nx=nx, ne=ne,variable=Pcr.T, path=nml.total_path+"/data_ini/")    
fw.write1D(    "Pe.dat", nx=nx, ne=ne,variable=Pe.T, path=nml.total_path+"/data_ini/")   
fw.write1D("damping.dat", nx=nx, ne=ne, variable=gamma_tot.T, path=nml.total_path+"/data_ini/")  
fw.write1Daxis("X.dat", variable=X, nx=nx, path=nml.total_path+"/data_ini/")
fw.write1Daxis("E.dat", variable=E, nx=ne, path=nml.total_path+"/data_ini/")
fw.write1Daxis("B.dat", variable=B, nx=nx, path=nml.total_path+"/data_ini/")

variables = {"NX"       : nx,
             "NE"       : ne,
             "ni"       : ni[x_center_index],
             "X"        : Xi[x_center_index],
             "mn"       : mn[x_center_index],
             "T"        : T[x_center_index],
             "center"   :x_center,
             "center_index":x_center_index,
             "B"        : B[x_center_index]}

fw.fileWrite("parameters", variables = variables, path=nml.total_path+"/", ext='.dat') 
###############################################################################
Example #2
0
fw.write1D("Pcr.dat",
           nx=nx,
           ne=ne,
           variable=Pcr.T,
           path=nml.total_path + "/data_ini/")
fw.write1D("Pe.dat",
           nx=nx,
           ne=ne,
           variable=Pe.T,
           path=nml.total_path + "/data_ini/")
fw.write1D("damping.dat",
           nx=nx,
           ne=ne,
           variable=gamma_tot.T,
           path=nml.total_path + "/data_ini/")
fw.write1Daxis("X.dat", variable=X, nx=nx, path=nml.total_path + "/data_ini/")
fw.write1Daxis("E.dat", variable=E, nx=ne, path=nml.total_path + "/data_ini/")
fw.write1Daxis("T.dat", variable=T, nx=nx, path=nml.total_path + "/data_ini/")
fw.write1Daxis("B.dat", variable=B, nx=nx, path=nml.total_path + "/data_ini/")
fw.write1Daxis("nn.dat",
               variable=nn,
               nx=nx,
               path=nml.total_path + "/data_ini/")
fw.write1Daxis("ni.dat",
               variable=ni,
               nx=nx,
               path=nml.total_path + "/data_ini/")
fw.write1Daxis("mn.dat",
               variable=mn,
               nx=nx,
               path=nml.total_path + "/data_ini/")