mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-29 20:43:49 -06:00
Added parameter 'output_interval'.
This commit is contained in:
parent
b120aa6c90
commit
6a6c039d8f
@ -346,11 +346,13 @@ main(int argc, char** argv)
|
|||||||
// Reading various control parameters.
|
// Reading various control parameters.
|
||||||
const bool output = param.getDefault("output", true);
|
const bool output = param.getDefault("output", true);
|
||||||
std::string output_dir;
|
std::string output_dir;
|
||||||
|
int output_interval = 1;
|
||||||
if (output) {
|
if (output) {
|
||||||
output_dir = param.getDefault("output_dir", std::string("output"));
|
output_dir = param.getDefault("output_dir", std::string("output"));
|
||||||
// Ensure that output dir exists
|
// Ensure that output dir exists
|
||||||
boost::filesystem::path fpath(output_dir);
|
boost::filesystem::path fpath(output_dir);
|
||||||
create_directories(fpath);
|
create_directories(fpath);
|
||||||
|
output_interval = param.getDefault("output_interval", output_interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have a "deck_filename", grid and props will be read from that.
|
// If we have a "deck_filename", grid and props will be read from that.
|
||||||
@ -650,7 +652,7 @@ main(int argc, char** argv)
|
|||||||
for (; !simtimer.done(); ++simtimer) {
|
for (; !simtimer.done(); ++simtimer) {
|
||||||
// Report timestep and (optionally) write state to disk.
|
// Report timestep and (optionally) write state to disk.
|
||||||
simtimer.report(std::cout);
|
simtimer.report(std::cout);
|
||||||
if (output) {
|
if (output && (simtimer.currentStepNum() % output_interval == 0)) {
|
||||||
outputState(*grid->c_grid(), state, simtimer.currentStepNum(), output_dir);
|
outputState(*grid->c_grid(), state, simtimer.currentStepNum(), output_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user