Skip to content
Snippets Groups Projects
Commit 172c07d4 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

switches to long long int for nparticles

parent 2259b359
No related branches found
No related tags found
No related merge requests found
......@@ -213,7 +213,7 @@ int NSVE_Stokes_particles<rnumber>::read_parameters(void)
this->niter_part = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part");
this->niter_part_fine_period = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part_fine_period");
this->niter_part_fine_duration = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part_fine_duration");
this->nparticles = hdf5_tools::read_value<int>(parameter_file, "parameters/nparticles");
this->nparticles = hdf5_tools::read_value<long long int>(parameter_file, "parameters/nparticles");
this->tracers0_integration_steps = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_integration_steps");
this->tracers0_neighbours = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_neighbours");
this->tracers0_smoothness = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_smoothness");
......
......@@ -53,7 +53,7 @@ class NSVE_Stokes_particles: public NSVE<rnumber>
int niter_part;
int niter_part_fine_period;
int niter_part_fine_duration;
int nparticles;
long long int nparticles;
int tracers0_integration_steps;
int tracers0_neighbours;
int tracers0_smoothness;
......
......@@ -243,7 +243,7 @@ int NSVEcomplex_particles<rnumber>::read_parameters(void)
this->NSVE<rnumber>::read_parameters();
hid_t parameter_file = H5Fopen((this->simname + ".h5").c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
this->niter_part = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part");
this->nparticles = hdf5_tools::read_value<int>(parameter_file, "parameters/nparticles");
this->nparticles = hdf5_tools::read_value<long long int>(parameter_file, "parameters/nparticles");
this->tracers0_integration_steps = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_integration_steps");
this->tracers0_neighbours = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_neighbours");
this->tracers0_smoothness = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_smoothness");
......
......@@ -54,7 +54,7 @@ class NSVEcomplex_particles: public NSVE<rnumber>
/* parameters that are read in read_parameters */
int niter_part;
int nparticles;
long long int nparticles;
int tracers0_integration_steps;
int tracers0_neighbours;
int tracers0_smoothness;
......
......@@ -256,7 +256,7 @@ int NSVEparticles<rnumber>::read_parameters(void)
this->niter_part = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part");
this->niter_part_fine_period = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part_fine_period");
this->niter_part_fine_duration = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part_fine_duration");
this->nparticles = hdf5_tools::read_value<int>(parameter_file, "parameters/nparticles");
this->nparticles = hdf5_tools::read_value<long long int>(parameter_file, "parameters/nparticles");
this->cpp_random_particles = hdf5_tools::read_value<int>(parameter_file, "parameters/cpp_random_particles");
this->tracers0_integration_steps = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_integration_steps");
this->tracers0_neighbours = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_neighbours");
......
......@@ -53,7 +53,7 @@ class NSVEparticles: public NSVE<rnumber>
int niter_part;
int niter_part_fine_period;
int niter_part_fine_duration;
int nparticles;
long long int nparticles;
int tracers0_integration_steps;
int tracers0_neighbours;
int tracers0_smoothness;
......
......@@ -294,7 +294,7 @@ int kraichnan_field<rnumber>::read_parameters(void)
this->niter_part = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part");
this->niter_part_fine_period = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part_fine_period");
this->niter_part_fine_duration = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part_fine_duration");
this->nparticles = hdf5_tools::read_value<int>(parameter_file, "parameters/nparticles");
this->nparticles = hdf5_tools::read_value<long long int>(parameter_file, "parameters/nparticles");
this->tracers0_integration_steps = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_integration_steps");
this->tracers0_neighbours = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_neighbours");
this->tracers0_smoothness = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_smoothness");
......
......@@ -51,7 +51,7 @@ class kraichnan_field: public direct_numerical_simulation
int niter_part;
int niter_part_fine_period;
int niter_part_fine_duration;
int nparticles;
long long int nparticles;
int tracers0_integration_steps;
int tracers0_neighbours;
int tracers0_smoothness;
......
......@@ -232,7 +232,7 @@ int static_field<rnumber>::read_parameters(void)
this->niter_part = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part");
this->niter_part_fine_period = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part_fine_period");
this->niter_part_fine_duration = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part_fine_duration");
this->nparticles = hdf5_tools::read_value<int>(parameter_file, "parameters/nparticles");
this->nparticles = hdf5_tools::read_value<long long int>(parameter_file, "parameters/nparticles");
this->tracers0_integration_steps = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_integration_steps");
this->tracers0_neighbours = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_neighbours");
this->tracers0_smoothness = hdf5_tools::read_value<int>(parameter_file, "parameters/tracers0_smoothness");
......
......@@ -51,7 +51,7 @@ class static_field: public direct_numerical_simulation
int niter_part;
int niter_part_fine_period;
int niter_part_fine_duration;
int nparticles;
long long int nparticles;
int tracers0_integration_steps;
int tracers0_neighbours;
int tracers0_smoothness;
......
......@@ -35,7 +35,7 @@ int test_interpolation<rnumber>::read_parameters(void)
(this->simname + std::string(".h5")).c_str(),
H5F_ACC_RDONLY,
H5P_DEFAULT);
this->nparticles = hdf5_tools::read_value<int>(
this->nparticles = hdf5_tools::read_value<long long int>(
parameter_file, "/parameters/nparticles");
this->tracers0_integration_steps = hdf5_tools::read_value<int>(
parameter_file, "/parameters/tracers0_integration_steps");
......
......@@ -44,7 +44,7 @@ template <typename rnumber>
class test_interpolation: public test
{
public:
int nparticles;
long long int nparticles;
int tracers0_integration_steps;
int tracers0_neighbours;
int tracers0_smoothness;
......
......@@ -214,6 +214,8 @@ number hdf5_tools::read_value(
hid_t mem_dtype;
if (typeid(number) == typeid(int))
mem_dtype = H5Tcopy(H5T_NATIVE_INT);
else if (typeid(number) == typeid(long long int))
mem_dtype = H5Tcopy(H5T_NATIVE_LLONG);
else if (typeid(number) == typeid(double))
mem_dtype = H5Tcopy(H5T_NATIVE_DOUBLE);
if (H5Lexists(group, dset_name.c_str(), H5P_DEFAULT))
......@@ -232,6 +234,8 @@ number hdf5_tools::read_value(
dset_name.c_str());
if (typeid(number) == typeid(int))
result = INT_MAX;
else if (typeid(number) == typeid(long long int))
result = -1;
else if (typeid(number) == typeid(double))
result = number(DBL_MAX);
}
......@@ -439,6 +443,11 @@ int hdf5_tools::read_value<int>(
const hid_t,
const std::string);
template
long long int hdf5_tools::read_value<long long int>(
const hid_t,
const std::string);
template
double hdf5_tools::read_value<double>(
const hid_t,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment