Skip to content
Snippets Groups Projects
Commit 201e6358 authored by sniklas142's avatar sniklas142
Browse files

saves spectrum to output hdf5 file

parent 31d26c09
No related branches found
No related tags found
No related merge requests found
......@@ -41,19 +41,20 @@ int ornstein_uhlenbeck_test<rnumber>::read_parameters()
{
TIMEZONE("ornstein_uhlenbeck_test::read_parameters");
this->test::read_parameters();
hid_t parameter_file = H5Fopen(
(this->simname + std::string(".h5")).c_str(),
H5F_ACC_RDONLY,
H5P_DEFAULT);
// hid_t parameter_file = H5Fopen(
// (this->simname + std::string(".h5")).c_str(),
// H5F_ACC_RDONLY,
// H5P_DEFAULT);
// this->ou_kmin = hdf5_tools::read_value<double>(parameter_file, "/parameters/ou_kmin");
// this->ou_kmax = hdf5_tools::read_value<double>(parameter_file, "/parameters/ou_kmax");
// this->ou_energy_amplitude = hdf5_tools::read_value<double>(parameter_file, "/parameters/ou_energy_amplitude");
// H5Fclose(parameter_file);
//TODO
this->ou_kmin = 0;
this->ou_kmax = 10;
this->ou_kmin = 3;
this->ou_kmax = 14;
this->ou_energy_amplitude = 1;
H5Fclose(parameter_file);
return EXIT_SUCCESS;
}
......@@ -62,10 +63,23 @@ int ornstein_uhlenbeck_test<rnumber>::do_work(void)
{
TIMEZONE("ornstein_uhlenbeck_test::do_work");
std::string filename = this->simname + std::string("_fields.h5");
for (int step = 0; step < 1000; step++)
for (int step = 0; step < 10000; step++)
{
this->ou->step(1e-3);
}
hid_t gg;
if (this->myrank == 0) {
gg = H5Fopen("test_ou_output.h5", H5F_ACC_RDWR, H5P_DEFAULT);
std::cerr << "peep" << std::endl; //DELETE
}
// if (this->myrank == 0) gt = H5Fopen((this->simname + std::string(".h5")).c_str(), H5F_ACC_RDWR, H5P_DEFAULT);
// this->ou->kk->store(gt);
this->ou->kk->template cospectrum<rnumber,THREE>(
this->ou->ou_field->get_cdata(),
this->ou->ou_field->get_cdata(),
gg,"ou_spectra",0);
return EXIT_SUCCESS;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment