mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Added timers.
This commit is contained in:
parent
70bf9f0373
commit
3828a2f630
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include <opm/core/utility/cart_grid.h>
|
#include <opm/core/utility/cart_grid.h>
|
||||||
#include <opm/core/utility/ErrorMacros.hpp>
|
#include <opm/core/utility/ErrorMacros.hpp>
|
||||||
|
#include <opm/core/utility/StopWatch.hpp>
|
||||||
#include <opm/core/utility/Units.hpp>
|
#include <opm/core/utility/Units.hpp>
|
||||||
#include <opm/core/utility/cpgpreprocess/cgridinterface.h>
|
#include <opm/core/utility/cpgpreprocess/cgridinterface.h>
|
||||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
@ -213,6 +214,12 @@ main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Main simulation loop.
|
// Main simulation loop.
|
||||||
|
Opm::time::StopWatch pressure_timer;
|
||||||
|
double ptime = 0.0;
|
||||||
|
Opm::time::StopWatch transport_timer;
|
||||||
|
double ttime = 0.0;
|
||||||
|
Opm::time::StopWatch total_timer;
|
||||||
|
total_timer.start();
|
||||||
std::cout << "\n\n================ Starting main simulation loop ===============" << std::endl;
|
std::cout << "\n\n================ Starting main simulation loop ===============" << std::endl;
|
||||||
for (int pstep = 0; pstep < num_psteps; ++pstep) {
|
for (int pstep = 0; pstep < num_psteps; ++pstep) {
|
||||||
std::cout << "\n\n--------------- Simulation step number " << pstep
|
std::cout << "\n\n--------------- Simulation step number " << pstep
|
||||||
@ -227,7 +234,12 @@ main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
compute_totmob(*props, state.saturation(), totmob);
|
compute_totmob(*props, state.saturation(), totmob);
|
||||||
|
pressure_timer.start();
|
||||||
psolver.solve(grid->c_grid(), totmob, src, state);
|
psolver.solve(grid->c_grid(), totmob, src, state);
|
||||||
|
pressure_timer.stop();
|
||||||
|
double pt = pressure_timer.secsSinceStart();
|
||||||
|
std::cout << "Pressure solver took: " << pt << " seconds." << std::endl;
|
||||||
|
ptime += pt;
|
||||||
|
|
||||||
Opm::toWaterSat(state.saturation(), reorder_sat);
|
Opm::toWaterSat(state.saturation(), reorder_sat);
|
||||||
// We must treat reorder_src here,
|
// We must treat reorder_src here,
|
||||||
@ -238,6 +250,7 @@ main(int argc, char** argv)
|
|||||||
// Also, for anything but noflow boundaries,
|
// Also, for anything but noflow boundaries,
|
||||||
// boundary flows must be accumulated into
|
// boundary flows must be accumulated into
|
||||||
// source term following the same convention.
|
// source term following the same convention.
|
||||||
|
transport_timer.start();
|
||||||
polymertransport(&porevol[0],
|
polymertransport(&porevol[0],
|
||||||
&reorder_src[0],
|
&reorder_src[0],
|
||||||
stepsize,
|
stepsize,
|
||||||
@ -248,9 +261,19 @@ main(int argc, char** argv)
|
|||||||
&reorder_sat[0],
|
&reorder_sat[0],
|
||||||
&state.concentration()[0]);
|
&state.concentration()[0]);
|
||||||
Opm::toBothSat(reorder_sat, state.saturation());
|
Opm::toBothSat(reorder_sat, state.saturation());
|
||||||
|
transport_timer.stop();
|
||||||
|
double tt = transport_timer.secsSinceStart();
|
||||||
|
std::cout << "Transport solver took: " << tt << " seconds." << std::endl;
|
||||||
|
ttime += tt;
|
||||||
|
|
||||||
current_time += stepsize;
|
current_time += stepsize;
|
||||||
}
|
}
|
||||||
|
total_timer.stop();
|
||||||
|
|
||||||
|
std::cout << "\n\n================ Starting main simulation loop ===============\n\n"
|
||||||
|
<< "Total time taken: " << total_timer.secsSinceStart()
|
||||||
|
<< "\n Pressure time: " << ptime
|
||||||
|
<< "\n Transport time: " << ttime << std::endl;
|
||||||
|
|
||||||
if (output) {
|
if (output) {
|
||||||
outputState(grid->c_grid(), state, num_psteps, output_dir);
|
outputState(grid->c_grid(), state, num_psteps, output_dir);
|
||||||
|
Loading…
Reference in New Issue
Block a user