mirror of
https://github.com/cosmo-sims/MUSIC.git
synced 2024-09-19 17:03:46 +02:00
fix to TIPSY output plugin when running with baryons
also added more verbose error messages to TIPSY plugin
This commit is contained in:
parent
b0ee12aa8f
commit
e276a8a15c
1 changed files with 21 additions and 14 deletions
|
@ -763,6 +763,8 @@ public:
|
||||||
for( unsigned i=0; i<gh.get_grid(ilevel)->size(0); ++i )
|
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 j=0; j<gh.get_grid(ilevel)->size(1); ++j )
|
||||||
for( unsigned k=0; k<gh.get_grid(ilevel)->size(2); ++k )
|
for( unsigned k=0; k<gh.get_grid(ilevel)->size(2); ++k )
|
||||||
|
{
|
||||||
|
if( gh.is_in_mask(ilevel,i,j,k) && !gh.is_refined(ilevel,i,j,k) )
|
||||||
{
|
{
|
||||||
if( temp_dat.size() < block_buf_size_ )
|
if( temp_dat.size() < block_buf_size_ )
|
||||||
temp_dat.push_back( pmass );
|
temp_dat.push_back( pmass );
|
||||||
|
@ -774,6 +776,7 @@ public:
|
||||||
temp_dat.push_back( pmass );
|
temp_dat.push_back( pmass );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( temp_dat.size() > 0 )
|
if( temp_dat.size() > 0 )
|
||||||
{
|
{
|
||||||
|
@ -781,14 +784,18 @@ public:
|
||||||
nwritten+=temp_dat.size();
|
nwritten+=temp_dat.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( nwritten != nptot )
|
if( nwritten != nptot ){
|
||||||
|
LOGERR("TIPSY output plugin wrote %ld gas particles, should have %ld", nwritten, nptot);
|
||||||
throw std::runtime_error("Internal consistency error while writing temporary file for baryon masses");
|
throw std::runtime_error("Internal consistency error while writing temporary file for baryon masses");
|
||||||
|
}
|
||||||
|
|
||||||
ofs_temp.write( (char *)&blksize, sizeof(size_t) );
|
ofs_temp.write( (char *)&blksize, sizeof(size_t) );
|
||||||
|
|
||||||
if( ofs_temp.bad() )
|
if( ofs_temp.bad() ){
|
||||||
|
LOGERR("I/O error while writing temporary file for baryon masse");
|
||||||
throw std::runtime_error("I/O error while writing temporary file for baryon masses");
|
throw std::runtime_error("I/O error while writing temporary file for baryon masses");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue