Commit da7480f6 authored by Lukas Bentkamp's avatar Lukas Bentkamp
Browse files

Bugfix: Do not attempt to read the velocity field when it's not written.

parent 166ea083
......@@ -104,26 +104,17 @@ int kraichnan_field<rnumber>::initialize(void)
DEBUG_MSG("Coefficient: %g\n",
this->spectrum_coefficient);
this->generate_random_velocity();
// is this the first iteration?
if ((this->iteration == 0) and (this->output_velocity == 1))
{
// if yes, generate random field and save it
this->generate_random_velocity();
this->velocity->io(
this->get_current_fname(),
"velocity",
this->iteration,
false);
}
else
{
// if not, read the random field that exists in the checkpoint file
this->velocity->io(
this->get_current_fname(),
"velocity",
this->iteration,
true);
}
return EXIT_SUCCESS;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment