Commit 15ec339c authored by jclamber's avatar jclamber

still a bug on ramses when select all

git-svn-id: http://svn.oamp.fr/repos/unsio/trunk@113 ce2cc22f-6084-46ce-a062-084b172ee5dc
parent c9f3def7
......@@ -43,7 +43,7 @@ MESSAGE( STATUS "BUILD_TYPE =" ${RELEASE} )
FIND_PACKAGE(NEMO)
FIND_PACKAGE(SQLITE3)
set (NEMO_INSTALLED FALSE) # fore NEMO not installed
#set (NEMO_INSTALLED FALSE) # fore NEMO not installed
IF (NOT NEMO_INSTALLED)
MESSAGE(STATUS "NEMO LIGHT will be build")
......
......@@ -5,7 +5,7 @@
I) REQUIREMENTS
===============
Unsio should compile fine on Linux and MacOSX. You just need a recent
Unsio compile fine on Linux and MacOSX. You just need a recent
gcc/g++ compiler and cmake tools (version 2.6). Cmake tools can be
installed directly from your distribution or downloaded from here :
http://www.cmake.org/cmake/resources/software.html
......
......@@ -4,7 +4,7 @@ nemocvs:
rsync -CRav --exclude-from=exclude.txt build/CMakeLists.txt build/FindNEMO.cmake . ${NEMO}/usr/jcl/unsio
tar :
cd ..;tar czhvf unsio/unsio.tar.gz `ls unsio/src/*.{f,F,cc,h} unsio/test_src/*.{f,F,cc,h} unsio/CMakeLists.txt unsio/cmake/*.cmake unsio/doc/*.{odp,pdf,txt} unsio/HOWTO_INSTALL unsio/mmakefile unsio/man/man3/* unsio/3rdparty/nemolight/build/CMakeLists.txt unsio/3rdparty/nemolight/src/*.{c,h} unsio/3rdparty/nemolight/src/inc/*.{c,h} unsio/3rdparty/nemolight/src/inc/snapshot/*.{c,h} unsio/3rdparty/nemolight/src/fortran_old_gcc/*.{c,h} 2> /dev/null`
cd ..;tar czhvf unsio/unsio-`date "+%d%b-%Y-%H.%M"`.tar.gz `ls unsio/src/*.{f,F,cc,h} unsio/test_src/*.{f,F,cc,h} unsio/CMakeLists.txt unsio/cmake/*.cmake unsio/doc/*.{odp,pdf,txt} unsio/HOWTO_INSTALL unsio/mmakefile unsio/man/man3/* unsio/3rdparty/nemolight/build/CMakeLists.txt unsio/3rdparty/nemolight/src/*.{c,h} unsio/3rdparty/nemolight/src/inc/*.{c,h} unsio/3rdparty/nemolight/src/inc/snapshot/*.{c,h} unsio/3rdparty/nemolight/src/fortran_old_gcc/*.{c,h} 2> /dev/null`
#
......@@ -48,6 +48,7 @@ CAmr::CAmr(const std::string _indir, const bool _v)
s_run_index.erase(found,found);
}
infile = indir + "/amr_" + s_run_index + ".out00001";
testhydrofile = indir + "/hydro_" + s_run_index + ".out00001";
if (verbose)
std::cerr << "Run index = " << s_run_index << " infile=[" << infile << "]\n";
}
......@@ -63,10 +64,11 @@ CAmr::~CAmr()
//
bool CAmr::isValid()
{
if (amr.open(infile)) {
if (amr.open(infile) && hydro.open(testhydrofile)) {
valid=true;
readHeader();
amr.close();
hydro.close();
if (verbose)
std::cerr << "ncpu="<<ncpu<<" ndim="<<ndim<< "\n";// "npart=" << npart << "\n";
xbound[0] = nx/2;
......
......@@ -56,7 +56,7 @@ private:
// some variables
bool verbose,valid;
std::string infile,indir;
std::string infile,testhydrofile, indir;
int select,nselect;
int nbody;
std::string s_run_index,ordering;
......
......@@ -48,7 +48,7 @@ int CFortIO::open(const std::string myfile, bool fake,bool _swap)
in.clear();
in.open(myfile.c_str(),std::ios::in | std::ios::binary);
if ( ! in.is_open()) {
std::cerr << "Unable to open file ["<<myfile<<"], aborting...\n";
std::cerr << "Unable to open file ["<<myfile<<"]...\n";
ret=0;
}
}
......
......@@ -33,7 +33,7 @@ CSnapshotRamsesIn::CSnapshotRamsesIn(const std::string _name,
valid=false;
part = new ramses::CPart(filename,verbose);
amr = new ramses::CAmr(filename,verbose);
if (part->isValid() && amr->isValid()) {
if (part->isValid() || amr->isValid()) {
valid=true;
interface_type = "Ramses";
file_structure = "component";
......@@ -101,11 +101,11 @@ int CSnapshotRamsesIn::nextFrame(uns::UserSelection &user_select)
x[6]=std::numeric_limits<float>::max(); // level min
x[7]=0; // nlevelmax
if (comp_bits&HALO_BIT || comp_bits&STARS_BIT) {
if ((comp_bits&HALO_BIT || comp_bits&STARS_BIT) && part->isValid()) {
part->setBoundary(x);
part->loadData(particles,req_bits,comp_bits);
}
if (comp_bits&GAS_BIT) {
if (comp_bits&GAS_BIT && amr->isValid()) {
amr->setBoundary(x);
amr->loadData(particles,req_bits);
}
......
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