mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-26 07:30:08 -05:00
AdaptiveTimeStepping: reformat some clang-format mess
This commit is contained in:
1 parent
4d2c6e80d5
commit
58fff147ee
2 files changed
+52
-60
No files matched your search
@@ -60,7 +60,9 @@ struct StepReport;
|
||||
namespace detail {
|
||||
void logTimer(const AdaptiveSimulatorTimer& substep_timer);
|
||||
|
||||
std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& sr, bool requireRepeatedFailures);
|
||||
std::set<std::string>
|
||||
consistentlyFailingWells(const std::vector<StepReport>& sr,
|
||||
bool requireRepeatedFailures);
|
||||
void registerAdaptiveParameters();
|
||||
|
||||
std::tuple<TimeStepControlType, std::unique_ptr<TimeStepControlInterface>, bool>
|
||||
@@ -91,13 +93,11 @@ private:
|
||||
template <class Solver>
|
||||
class SubStepper {
|
||||
public:
|
||||
SubStepper(
|
||||
AdaptiveTimeStepping<TypeTag>& adaptive_time_stepping,
|
||||
const SimulatorTimer& simulator_timer,
|
||||
Solver& solver,
|
||||
const bool is_event,
|
||||
const std::function<bool(const double, const double, const int)>& tuning_updater
|
||||
);
|
||||
SubStepper(AdaptiveTimeStepping<TypeTag>& adaptive_time_stepping,
|
||||
const SimulatorTimer& simulator_timer,
|
||||
Solver& solver,
|
||||
const bool is_event,
|
||||
const std::function<bool(const double, const double, const int)>& tuning_updater);
|
||||
|
||||
AdaptiveTimeStepping<TypeTag>& getAdaptiveTimerStepper();
|
||||
SimulatorReport run();
|
||||
@@ -128,12 +128,10 @@ private:
|
||||
template <class Solver>
|
||||
class SubStepIteration {
|
||||
public:
|
||||
SubStepIteration(
|
||||
SubStepper<Solver>& substepper,
|
||||
AdaptiveSimulatorTimer& substep_timer,
|
||||
const double original_time_step,
|
||||
const bool final_step
|
||||
);
|
||||
SubStepIteration(SubStepper<Solver>& substepper,
|
||||
AdaptiveSimulatorTimer& substep_timer,
|
||||
const double original_time_step,
|
||||
const bool final_step);
|
||||
|
||||
SimulatorReport run();
|
||||
|
||||
@@ -144,12 +142,13 @@ private:
|
||||
void chopTimeStep_(const double new_time_step);
|
||||
bool chopTimeStepOrCloseFailingWells_(const double new_time_step);
|
||||
boost::posix_time::ptime currentDateTime_() const;
|
||||
int getNumIterations_(const SimulatorReportSingle &substep_report) const;
|
||||
int getNumIterations_(const SimulatorReportSingle& substep_report) const;
|
||||
double growthFactor_() const;
|
||||
bool ignoreConvergenceFailure_() const;
|
||||
void maybeReportSubStep_(SimulatorReportSingle substep_report) const;
|
||||
double maybeRestrictTimeStepGrowth_(
|
||||
const double dt, double dt_estimate, const int restarts) const;
|
||||
double maybeRestrictTimeStepGrowth_(const double dt,
|
||||
double dt_estimate,
|
||||
const int restarts) const;
|
||||
void maybeUpdateTuningAndTimeStep_();
|
||||
double maxGrowth_() const;
|
||||
double minTimeStepBeforeClosingWells_() const;
|
||||
@@ -183,20 +182,17 @@ private:
|
||||
public:
|
||||
AdaptiveTimeStepping() = default;
|
||||
|
||||
AdaptiveTimeStepping(
|
||||
const UnitSystem& unitSystem,
|
||||
const SimulatorReport& full_report,
|
||||
const double max_next_tstep = -1.0,
|
||||
const bool terminalOutput = true
|
||||
);
|
||||
AdaptiveTimeStepping(const UnitSystem& unitSystem,
|
||||
const SimulatorReport& full_report,
|
||||
const double max_next_tstep = -1.0,
|
||||
const bool terminalOutput = true);
|
||||
|
||||
AdaptiveTimeStepping(double max_next_tstep,
|
||||
const Tuning& tuning,
|
||||
const UnitSystem& unitSystem,
|
||||
const SimulatorReport& full_report,
|
||||
const bool terminalOutput = true);
|
||||
|
||||
AdaptiveTimeStepping(
|
||||
double max_next_tstep,
|
||||
const Tuning& tuning,
|
||||
const UnitSystem& unitSystem,
|
||||
const SimulatorReport& full_report,
|
||||
const bool terminalOutput = true
|
||||
);
|
||||
bool operator==(const AdaptiveTimeStepping<TypeTag>& rhs);
|
||||
|
||||
static void registerParameters();
|
||||
|
||||
@@ -62,11 +62,11 @@ namespace Opm {
|
||||
|
||||
//! \brief contructor taking parameter object
|
||||
template<class TypeTag>
|
||||
AdaptiveTimeStepping<TypeTag>::AdaptiveTimeStepping(
|
||||
const UnitSystem& unit_system,
|
||||
const SimulatorReport& report,
|
||||
const double max_next_tstep,
|
||||
const bool terminal_output
|
||||
AdaptiveTimeStepping<TypeTag>::
|
||||
AdaptiveTimeStepping(const UnitSystem& unit_system,
|
||||
const SimulatorReport& report,
|
||||
const double max_next_tstep,
|
||||
const bool terminal_output
|
||||
)
|
||||
: time_step_control_{}
|
||||
, restart_factor_{Parameters::Get<Parameters::SolverRestartFactor<Scalar>>()} // 0.33
|
||||
@@ -99,11 +99,12 @@ AdaptiveTimeStepping<TypeTag>::AdaptiveTimeStepping(
|
||||
//! \brief contructor
|
||||
//! \param tuning Pointer to ecl TUNING keyword
|
||||
template<class TypeTag>
|
||||
AdaptiveTimeStepping<TypeTag>::AdaptiveTimeStepping(double max_next_tstep,
|
||||
const Tuning& tuning,
|
||||
const UnitSystem& unit_system,
|
||||
const SimulatorReport& report,
|
||||
const bool terminal_output
|
||||
AdaptiveTimeStepping<TypeTag>::
|
||||
AdaptiveTimeStepping(double max_next_tstep,
|
||||
const Tuning& tuning,
|
||||
const UnitSystem& unit_system,
|
||||
const SimulatorReport& report,
|
||||
const bool terminal_output
|
||||
)
|
||||
: time_step_control_{}
|
||||
, restart_factor_{tuning.TSFCNV}
|
||||
@@ -459,17 +460,14 @@ init_(const UnitSystem& unitSystem)
|
||||
template<class TypeTag>
|
||||
template<class Solver>
|
||||
AdaptiveTimeStepping<TypeTag>::SubStepper<Solver>::
|
||||
SubStepper(
|
||||
AdaptiveTimeStepping<TypeTag>& adaptive_time_stepping,
|
||||
const SimulatorTimer& simulator_timer,
|
||||
Solver& solver,
|
||||
const bool is_event,
|
||||
const std::function<bool(const double /*current_time*/,
|
||||
const double /*dt*/,
|
||||
const int /*substep_number*/
|
||||
)>& tuning_updater
|
||||
|
||||
)
|
||||
SubStepper(AdaptiveTimeStepping<TypeTag>& adaptive_time_stepping,
|
||||
const SimulatorTimer& simulator_timer,
|
||||
Solver& solver,
|
||||
const bool is_event,
|
||||
const std::function<bool(const double /*current_time*/,
|
||||
const double /*dt*/,
|
||||
const int /*substep_number*/
|
||||
)>& tuning_updater)
|
||||
: adaptive_time_stepping_{adaptive_time_stepping}
|
||||
, simulator_timer_{simulator_timer}
|
||||
, solver_{solver}
|
||||
@@ -750,12 +748,10 @@ suggestedNextTimestep_() const
|
||||
template<class TypeTag>
|
||||
template<class Solver>
|
||||
AdaptiveTimeStepping<TypeTag>::SubStepIteration<Solver>::
|
||||
SubStepIteration(
|
||||
SubStepper<Solver>& substepper,
|
||||
AdaptiveSimulatorTimer& substep_timer,
|
||||
const double original_time_step,
|
||||
bool final_step
|
||||
)
|
||||
SubStepIteration(SubStepper<Solver>& substepper,
|
||||
AdaptiveSimulatorTimer& substep_timer,
|
||||
const double original_time_step,
|
||||
bool final_step)
|
||||
: substepper_{substepper}
|
||||
, substep_timer_{substep_timer}
|
||||
, original_time_step_{original_time_step}
|
||||
@@ -1328,9 +1324,9 @@ writeOutput_() const
|
||||
|
||||
template<class TypeTag>
|
||||
template<class Solver>
|
||||
AdaptiveTimeStepping<TypeTag>::SolutionTimeErrorSolverWrapper<Solver>::SolutionTimeErrorSolverWrapper(
|
||||
const Solver& solver
|
||||
)
|
||||
AdaptiveTimeStepping<TypeTag>::
|
||||
SolutionTimeErrorSolverWrapper<Solver>::
|
||||
SolutionTimeErrorSolverWrapper(const Solver& solver)
|
||||
: solver_{solver}
|
||||
{}
|
||||
|
||||
|
||||
Reference in new issue
Block a user