1
0
Fork 0
mirror of https://github.com/cosmo-sims/MUSIC.git synced 2024-09-19 17:03:46 +02:00

fixed a bug in the updated code for Gadget output, the correct number of coarse particle masses was not written out if more than 5 levels are present

This commit is contained in:
Oliver Hahn 2013-11-26 15:08:29 +01:00
parent 819ee62662
commit 89dbf91b67

View file

@ -637,7 +637,7 @@ protected:
//... particle masses .......................................................
if( bmorethan2bnd_ )//bmultimass_ && bmorethan2bnd_ && nc_per_file[ifile] > 0ul)
{
unsigned npcoarse = np_per_file[ifile][5];// nc_per_file[ifile];//header_.npart[5];
unsigned npcoarse = np_per_file[ifile][bndparticletype_];// nc_per_file[ifile];//header_.npart[5];
iffs1.open( fnm, np_per_type_[5], wrote_coarse*sizeof(T_store) );
npleft = npcoarse;
@ -896,7 +896,7 @@ public:
{
header_.mass[5] = 0.;
size_t npcoarse = np_per_type_[5];
size_t npcoarse = np_per_type_[bndparticletype_];
size_t nwritten = 0;
std::vector<T_store> temp_dat;
@ -910,7 +910,7 @@ public:
ofs_temp.write( (char *)&blksize, sizeof(size_t) );
for( int ilevel=gh.levelmax()-5; ilevel>=(int)gh.levelmin(); --ilevel )
for( int ilevel=gh.levelmax()-4; ilevel>=(int)gh.levelmin(); --ilevel )
{
// baryon particles live only on finest grid
// these particles here are total matter particles
@ -919,7 +919,6 @@ public:
for( unsigned i=0; i<gh.get_grid(ilevel)->size(0); ++i )
for( unsigned j=0; j<gh.get_grid(ilevel)->size(1); ++j )
for( unsigned k=0; k<gh.get_grid(ilevel)->size(2); ++k )
//if( ! gh.is_refined(ilevel,i,j,k) )
if( gh.is_in_mask(ilevel,i,j,k) && !gh.is_refined(ilevel,i,j,k) )
{
if( temp_dat.size() < block_buf_size_ )