Commit 02b10071 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

fix lib64 -> lib

parent de622b13
......@@ -127,7 +127,7 @@ include_directories (${UNSIOPATH}/lib ${UNSIOPATH}/include ${UNSIOPATH}/include/
include_directories (/usr/include/malloc)
# Make sure the linker can find the Hello library once it is built.
link_directories ( ${UNSIOPATH}/lib64 ${DEHNEN}/falcON/lib ${DEHNEN}/utils/lib $ENV{PGPLOT_DIR} ${G2C_DIR} ${PROJECT_BINARY_DIR}/lib /usr/lib64 /usr/X11/lib ${FC_GFORT_PATH} ${FC_G77_PATH} ${EXTRA_LINK_DIRS})
link_directories ( ${UNSIOPATH}/lib ${UNSIOPATH}/lib64 ${DEHNEN}/falcON/lib ${DEHNEN}/utils/lib $ENV{PGPLOT_DIR} ${G2C_DIR} ${PROJECT_BINARY_DIR}/lib /usr/lib64 /usr/X11/lib ${FC_GFORT_PATH} ${FC_G77_PATH} ${EXTRA_LINK_DIRS})
# ----------------------------------------------------------
# Install SETUP
......
// ============================================================================
// Copyright Jean-Charles LAMBERT - 2011-2016
// Copyright Jean-Charles LAMBERT - 2011-2019
// e-mail: Jean-Charles.Lambert@oamp.fr
// address: Dynamique des galaxies
// Laboratoire d'Astrophysique de Marseille
......@@ -40,7 +40,7 @@ const char * defv[] = { // use `::'string because of 'using namespace std'
"offset=0.01\n +/- time offset",
"ds=_\n digit separator",
"verbose=f\n verbose mode "
"VERSION=1.0\n compiled on <" __DATE__ "> JCL ",
"VERSION=2.0\n compiled on <" __DATE__ "> JCL ",
NULL
};
const char * usage="A universal converting tool for UNS snapshots";
......@@ -221,7 +221,7 @@ template <class T> void processFromComp(std::string comp, uns::CunsIn2<T> * unsi
}
}
if (comp=="gas") {
T * rho, * hsml, * u , * temp, * metal;
T * rho, * hsml, * u , * temp, * metal, * nh, * sfr;
// Try to get Rho
ok = unsin->snapshot->getData(comp,"rho" ,&nbody,&rho );
if (ok) {
......@@ -239,6 +239,14 @@ template <class T> void processFromComp(std::string comp, uns::CunsIn2<T> * unsi
ok = unsin->snapshot->getData(comp,"temp" ,&nbody,&temp );
if (ok)
unsout->snapshot->setData(comp,"temp",nbody,temp,false);
// Try to get NH
ok = unsin->snapshot->getData(comp,"nh" ,&nbody,&nh );
if (ok)
unsout->snapshot->setData(comp,"nh",nbody,nh,false);
// Try to get SFR
ok = unsin->snapshot->getData(comp,"sfr" ,&nbody,&sfr );
if (ok)
unsout->snapshot->setData(comp,"sfr",nbody,sfr,false);
// Try to get gas metalicity
ok = unsin->snapshot->getData(comp,"metal" ,&nbody,&metal );
if (ok)
......
// ============================================================================
// Copyright Jean-Charles LAMBERT - 2010-2016
// Copyright Jean-Charles LAMBERT - 2010-2019
// Centre de donneeS Astrophysiques de Marseille (CeSAM)
// e-mail: Jean-Charles.Lambert@lam.fr
// address: Aix Marseille Universite, CNRS, LAM
......@@ -35,7 +35,7 @@ const char * defv[] = {
"maxline=2\n max lines per components",
"times=all\n selected time",
"verbose=f\n verbose on/off",
"VERSION=2.1\n compiled on <" __DATE__ "> JCL ",
"VERSION=2.2\n compiled on <"__DATE__"> JCL ",
NULL,
};
const char * usage="Print information about an UNS file";
......@@ -60,107 +60,156 @@ template <class T> void displayInfo(bool display,int maxlines, std::string comp,
std::cout<< setfill(' ');
std::cout<< left<< setw(8) << comp << ":" << setw(9) << right << nbody << "\n";
}
ok = uns->snapshot->getData(comp,"mass",&nbody,&mass);
if (ok && display) {
displayFormat(maxlines,"mass[1] = ",mass,1,nbody, 3);
}
ok = uns->snapshot->getData(comp,"pos" ,&nbody,&pos );
if (ok && display) {
displayFormat(maxlines,"pos [3] = ",pos ,3,nbody, 1);
if (uns->snapshot->getReqBits()&MASS_BIT) {
ok = uns->snapshot->getData(comp,"mass",&nbody,&mass);
if (ok && display) {
displayFormat(maxlines,"mass[1] = ",mass,1,nbody, 3);
}
}
ok = uns->snapshot->getData(comp,"vel" ,&nbody,&vel );
if (ok && display) {
displayFormat(maxlines,"vel [3] = ",vel ,3,nbody, 1);
if (uns->snapshot->getReqBits()&POS_BIT) {
ok = uns->snapshot->getData(comp,"pos" ,&nbody,&pos );
if (ok && display) {
displayFormat(maxlines,"pos [3] = ",pos ,3,nbody, 1);
}
}
ok = uns->snapshot->getData(comp,"pot" ,&nbody,&pot );
if (ok && display) {
displayFormat(maxlines,"pot [1] = ",pot ,1,nbody, 3);
if (uns->snapshot->getReqBits()&VEL_BIT) {
ok = uns->snapshot->getData(comp,"vel" ,&nbody,&vel );
if (ok && display) {
displayFormat(maxlines,"vel [3] = ",vel ,3,nbody, 1);
}
}
ok = uns->snapshot->getData(comp,"eps" ,&nbody,&eps );
if (ok && display) {
displayFormat(maxlines,"eps [1] = ",eps ,1,nbody, 3);
if (uns->snapshot->getReqBits()&POT_BIT) {
ok = uns->snapshot->getData(comp,"pot" ,&nbody,&pot );
if (ok && display) {
displayFormat(maxlines,"pot [1] = ",pot ,1,nbody, 3);
}
}
ok = uns->snapshot->getData(comp,"acc" ,&nbody,&acc );
if (ok && display) {
displayFormat(maxlines,"acc [3] = ",acc ,3,nbody, 1);
if (uns->snapshot->getReqBits()&EPS_BIT) {
ok = uns->snapshot->getData(comp,"eps" ,&nbody,&eps );
if (ok && display) {
displayFormat(maxlines,"eps [1] = ",eps ,1,nbody, 3);
}
}
if (uns->snapshot->getReqBits()&ACC_BIT) {
ok = uns->snapshot->getData(comp,"acc" ,&nbody,&acc );
if (ok && display) {
displayFormat(maxlines,"acc [3] = ",acc ,3,nbody, 1);
}
}
if (uns->snapshot->getReqBits()&ID_BIT) {
ok = uns->snapshot->getData(comp,"id" ,&nbody,&id);
if (ok && display) {
displayFormat(maxlines,"id [1] = ",id ,1,nbody, 3);
}
}
ok = uns->snapshot->getData(comp,"id" ,&nbody,&id);
if (ok && display) {
displayFormat(maxlines,"id [1] = ",id ,1,nbody, 3);
}
//if (comp == "gas") {
T * rho, * u, * hsml, * temp, * metal;
ok = uns->snapshot->getData(comp,"rho" ,&nbody,&rho );
if (ok && display) {
displayFormat(maxlines,"rho [1] = ",rho ,1,nbody, 3);
T * rho, * u, * hsml, * temp, * nh, * sfr, * metal;
if (uns->snapshot->getReqBits()&RHO_BIT) {
ok = uns->snapshot->getData(comp,"rho" ,&nbody,&rho );
if (ok && display) {
displayFormat(maxlines,"rho [1] = ",rho ,1,nbody, 3);
}
}
if (uns->snapshot->getReqBits()&U_BIT) {
ok = uns->snapshot->getData(comp,"u" ,&nbody,&u );
if (ok && display) {
displayFormat(maxlines,"u [1] = ",u ,1,nbody, 3);
}
}
ok = uns->snapshot->getData(comp,"u" ,&nbody,&u );
if (ok && display) {
displayFormat(maxlines,"u [1] = ",u ,1,nbody, 3);
if (uns->snapshot->getReqBits()&HSML_BIT) {
ok = uns->snapshot->getData(comp,"hsml",&nbody,&hsml);
if (ok && display) {
displayFormat(maxlines,"hsml[1] = ",hsml,1,nbody, 3);
}
}
if (uns->snapshot->getReqBits()&TEMP_BIT) {
ok = uns->snapshot->getData(comp,"temp",&nbody,&temp);
if (ok && display) {
displayFormat(maxlines,"temp[1] = ",temp,1,nbody, 3);
}
}
if (uns->snapshot->getReqBits()&METAL_BIT) {
ok = uns->snapshot->getData(comp,"metal",&nbody,&metal);
if (ok && display) {
displayFormat(maxlines,"metal[1]= ",metal,1,nbody, 3);
}
}
ok = uns->snapshot->getData(comp,"hsml",&nbody,&hsml);
if (ok && display) {
displayFormat(maxlines,"hsml[1] = ",hsml,1,nbody, 3);
if (uns->snapshot->getReqBits()&NH_BIT) {
ok = uns->snapshot->getData(comp,"nh",&nbody,&nh);
if (ok && display) {
displayFormat(maxlines,"nh [1]= ",nh,1,nbody, 3);
}
}
ok = uns->snapshot->getData(comp,"temp",&nbody,&temp);
if (ok && display) {
displayFormat(maxlines,"temp[1] = ",temp,1,nbody, 3);
if (uns->snapshot->getReqBits()&SFR_BIT) {
ok = uns->snapshot->getData(comp,"sfr",&nbody,&sfr);
if (ok && display) {
displayFormat(maxlines,"sfr [1]= ",sfr,1,nbody, 3);
}
}
ok = uns->snapshot->getData(comp,"metal",&nbody,&metal);
if (ok && display) {
displayFormat(maxlines,"metal[1] = ",metal,1,nbody, 3);
}
// RAMSES hydro
if (comp=="gas") {
int nvarh=0;
ok = uns->getData("nvarh",&nvarh);
std::cerr << "nvarh=" << nvarh << "\n";
for (int i=0; i<std::min(nvarh,20); i++) {
T * hydro;
stringstream s_int;
s_int << i;
ok = uns->snapshot->getData("hydro",s_int.str(),&nbody,&hydro);
if (ok && display) {
displayFormat(maxlines,"hydro["+s_int.str()+"] = ",hydro,1,nbody, 3);
if (ok) {
std::cerr << "nvarh=" << nvarh << "\n";
for (int i=0; i<std::min(nvarh,20); i++) {
T * hydro;
stringstream s_int;
s_int << i;
ok = uns->snapshot->getData("hydro",s_int.str(),&nbody,&hydro);
if (ok && display) {
displayFormat(maxlines,"hydro["+s_int.str()+"] = ",hydro,1,nbody, 3);
}
}
}
}
//}
//if (comp == "stars") {
T * age;//, * metal;
ok = uns->snapshot->getData(comp,"age" ,&nbody,&age );
if (ok && display) {
displayFormat(maxlines,"age [1] = ",age,1,nbody, 3);
}
if (uns->snapshot->getReqBits()&AGE_BIT) {
ok = uns->snapshot->getData(comp,"age" ,&nbody,&age );
if (ok && display) {
displayFormat(maxlines,"age [1] = ",age,1,nbody, 3);
}
}
T * im;
ok = uns->snapshot->getData(comp,"im" ,&nbody,&im );
if (ok && display) {
displayFormat(maxlines,"im [1] = ",im,1,nbody, 3);
if (uns->snapshot->getReqBits()&IM_BIT) {
ok = uns->snapshot->getData(comp,"im" ,&nbody,&im );
if (ok && display) {
displayFormat(maxlines,"im [1] = ",im,1,nbody, 3);
}
}
T * ssl;
ok = uns->snapshot->getData(comp,"ssl" ,&nbody,&ssl );
if (ok && display) {
displayFormat(maxlines,"ssl [1] = ",ssl,1,nbody, 3);
if (uns->snapshot->getReqBits()&SSL_BIT) {
ok = uns->snapshot->getData(comp,"ssl" ,&nbody,&ssl );
if (ok && display) {
displayFormat(maxlines,"ssl [1] = ",ssl,1,nbody, 3);
}
}
T * zs,* zsmt;
int czs, czsmt, nzs, nzsmt;
ok = uns->snapshot->getData(comp,"zs" ,&nzs,&zs );
if (ok && display) {
ok = uns->snapshot->getData("czs" ,&czs );
std::cerr << "nzs="<< nzs<<" czs ="<<czs<<"\n";
displayFormat(maxlines,"zs [1] = ",zs,1,nzs, 3);
if (uns->snapshot->getReqBits()&ZS_BIT) {
ok = uns->snapshot->getData(comp,"zs" ,&nzs,&zs );
if (ok && display) {
ok = uns->snapshot->getData("czs" ,&czs );
std::cerr << "nzs="<< nzs<<" czs ="<<czs<<"\n";
displayFormat(maxlines,"zs [1] = ",zs,1,nzs, 3);
}
}
ok = uns->snapshot->getData(comp,"zsmt" ,&nzsmt,&zsmt );
if (ok && display) {
ok = uns->snapshot->getData("czsmt" ,&czsmt );
std::cerr << "nzsmt="<< nzsmt<<" czsmt ="<<czsmt<<"\n";
displayFormat(maxlines,"zsmt[1] = ",zsmt,1,nzsmt, 3);
if (uns->snapshot->getReqBits()&ZSMT_BIT) {
ok = uns->snapshot->getData(comp,"zsmt" ,&nzsmt,&zsmt );
if (ok && display) {
ok = uns->snapshot->getData("czsmt" ,&czsmt );
std::cerr << "nzsmt="<< nzsmt<<" czsmt ="<<czsmt<<"\n";
displayFormat(maxlines,"zsmt[1] = ",zsmt,1,nzsmt, 3);
}
}
T * cm; int ncm;
ok = uns->snapshot->getData(comp,"cm" ,&ncm,&cm );
if (ok && display) {
displayFormat(maxlines,"cm [1] = ",cm,1,ncm, 3);
if (uns->snapshot->getReqBits()&CM_BIT) {
ok = uns->snapshot->getData(comp,"cm" ,&ncm,&cm );
if (ok && display) {
displayFormat(maxlines,"cm [1] = ",cm,1,ncm, 3);
}
}
// ok = uns->snapshot->getData(comp,"metal" ,&nbody,&metal );
// if (ok && display) {
......@@ -181,7 +230,7 @@ template <class T> void displayFormat(int maxlines,std::string text, T * array,
}
std::cout << "\n";
// other lines
for (int i=1; i<std::min(maxlines,size/min(size,np)); i+=min(size,np)) {
for (int i=1; i<std::min(maxlines,size/min(size,np)); i+=1) {
std::cout << left << setw(11) << "";
for (int k=0;k<std::min(size,np);k++) {
for (int j=0;j<dim;j++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment