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

added new parameter file options to specify the bounding ellipsoid directly,

the new options are region_ellipsoid_matrix[0-2] for the matrix and
region_ellipsoid_center for the ellipsoid center.

fixed a bug that caused velocity data to be used from region_point file
(need to check the units in all tools, so better to disable it atm)
This commit is contained in:
Oliver Hahn 2013-09-25 21:02:12 +02:00
parent 814247421b
commit ef46d58653
3 changed files with 28 additions and 2 deletions

View file

@ -9,6 +9,12 @@
struct point_reader{
int num_columns;
point_reader( void )
: num_columns( 0 )
{ }
bool isFloat( std::string myString )
{
std::istringstream iss(myString);
@ -118,6 +124,8 @@ struct point_reader{
}
else
LOGERR("Problem interpreting the region point file \'%s\'", fname.c_str() );
num_columns = colcount;
}

View file

@ -508,6 +508,21 @@ public:
point_reader pfr;
pfr.read_points_from_file( point_file, vfac_, pp );
// if file has more than three columns, just take first three
// at the moment...
if( pfr.num_columns > 3 )
{
std::vector<double> xx;
xx.reserve( 3 * pp.size()/pfr.num_columns );
for( size_t i=0; i<pp.size()/pfr.num_columns; ++i )
for( size_t j=0; j<3; ++j )
xx.push_back( pp[ pfr.num_columns * i + j ] );
pp.swap( xx );
}
if( cf.containsKey("setup","region_point_shift") )
{
std::string point_shift = cf.getValue<std::string>("setup","region_point_shift");

View file

@ -162,10 +162,10 @@ void rapid_proto_ngenic_rng( size_t res, long baseseed, random_numbers<T>& R )
// copy to array that holds the random numbers
#pragma omp parallel for
for( size_t i=0; i<res; ++i )
for( int i=0; i<(int)res; ++i )
for( size_t j=0; j<res; ++j )
for( size_t k=0; k<res; ++k )
R(i,j,k) = rnoise[ (i*res+j)*res+k ];
R(i,j,k) = rnoise[ ((size_t)i*res+j)*res+k ];
delete[] rnoise;
@ -194,6 +194,9 @@ random_numbers<T>::random_numbers( unsigned res, unsigned cubesize, long basesee
bool musicnoise = true;
if( !musicnoise )
cubesize_ = res_;
if( !musicnoise )
LOGERR("This currently breaks compatibility. Need to disable by hand! Make sure to not check into repo");
initialize();