newtonmethod.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
27#ifndef EWOMS_NEWTON_METHOD_HH
28#define EWOMS_NEWTON_METHOD_HH
29
30#include <dune/istl/istlexception.hh>
31#include <dune/common/classname.hh>
32#include <dune/common/parallel/mpihelper.hh>
33
34#include <opm/common/Exceptions.hpp>
35
36#include <opm/material/densead/Math.hpp>
37
39
43
46
48
49#include <iostream>
50#include <sstream>
51
52#include <unistd.h>
53
54namespace Opm {
55// forward declaration of classes
56template <class TypeTag>
57class NewtonMethod;
58}
59
60namespace Opm {
61// forward declaration of property tags
62} // namespace Opm
63
64namespace Opm::Properties {
65
66namespace TTag {
67
70struct NewtonMethod {};
71
72} // namespace TTag
73
74// set default values for the properties
75template<class TypeTag>
76struct NewtonMethod<TypeTag, TTag::NewtonMethod> { using type = ::Opm::NewtonMethod<TypeTag>; };
77template<class TypeTag>
79
80} // namespace Opm::Properties
81
82namespace Opm {
90template <class TypeTag>
92{
98
107
108 using Communicator = typename Dune::MPIHelper::MPICommunicator;
109 using CollectiveCommunication = typename Dune::Communication<typename Dune::MPIHelper::MPICommunicator>;
110
111public:
112 NewtonMethod(Simulator& simulator)
113 : simulator_(simulator)
114 , endIterMsgStream_(std::ostringstream::out)
115 , linearSolver_(simulator)
116 , comm_(Dune::MPIHelper::getCommunicator())
117 , convergenceWriter_(asImp_())
118 {
119 lastError_ = 1e100;
120 error_ = 1e100;
121
122 numIterations_ = 0;
123 params_.read();
124 }
125
129 static void registerParameters()
130 {
131 LinearSolverBackend::registerParameters();
133 }
134
142 { }
143
148 bool converged() const
149 { return error_ <= tolerance(); }
150
154 Problem& problem()
155 { return simulator_.problem(); }
156
160 const Problem& problem() const
161 { return simulator_.problem(); }
162
166 Model& model()
167 { return simulator_.model(); }
168
172 const Model& model() const
173 { return simulator_.model(); }
174
179 int numIterations() const
180 { return numIterations_; }
181
189 void setIterationIndex(int value)
190 { numIterations_ = value; }
191
196 Scalar tolerance() const
197 { return params_.tolerance_; }
198
203 void setTolerance(Scalar value)
204 { params_.tolerance_ = value; }
205
212 bool apply()
213 {
214 // Clear the current line using an ansi escape
215 // sequence. For an explanation see
216 // http://en.wikipedia.org/wiki/ANSI_escape_code
217 const char *clearRemainingLine = "\n";
218 if (isatty(fileno(stdout))) {
219 static const char blubb[] = { 0x1b, '[', 'K', '\r', 0 };
220 clearRemainingLine = blubb;
221 }
222
223 // make sure all timers are prestine
228
229 SolutionVector& nextSolution = model().solution(/*historyIdx=*/0);
230 SolutionVector currentSolution(nextSolution);
231 GlobalEqVector solutionUpdate(nextSolution.size());
232
233 Linearizer& linearizer = model().linearizer();
234
235 TimerGuard prePostProcessTimerGuard(prePostProcessTimer_);
236
237 // tell the implementation that we begin solving
239 asImp_().begin_(nextSolution);
241
242 try {
243 TimerGuard innerPrePostProcessTimerGuard(prePostProcessTimer_);
244 TimerGuard linearizeTimerGuard(linearizeTimer_);
245 TimerGuard updateTimerGuard(updateTimer_);
246 TimerGuard solveTimerGuard(solveTimer_);
247
248 // execute the method as long as the implementation thinks
249 // that we should do another iteration
250 while (asImp_().proceed_()) {
251 // linearize the problem at the current solution
252
253 // notify the implementation that we're about to start
254 // a new iteration
256 asImp_().beginIteration_();
258
259 // make the current solution to the old one
260 currentSolution = nextSolution;
261
262 if (asImp_().verbose_()) {
263 std::cout << "Linearize: r(x^k) = dS/dt + div F - q; M = grad r"
264 << clearRemainingLine
265 << std::flush;
266 }
267
268 // do the actual linearization
270 asImp_().linearizeDomain_();
271 asImp_().linearizeAuxiliaryEquations_();
273
275 auto& residual = linearizer.residual();
276 const auto& jacobian = linearizer.jacobian();
277 linearSolver_.prepare(jacobian, residual);
278 linearSolver_.setResidual(residual);
279 linearSolver_.getResidual(residual);
281
282 // The preSolve_() method usually computes the errors, but it can do
283 // something else in addition. TODO: should its costs be counted to
284 // the linearization or to the update?
286 asImp_().preSolve_(currentSolution, residual);
288
289 if (!asImp_().proceed_()) {
290 if (asImp_().verbose_() && isatty(fileno(stdout)))
291 std::cout << clearRemainingLine
292 << std::flush;
293
294 // tell the implementation that we're done with this iteration
296 asImp_().endIteration_(nextSolution, currentSolution);
298
299 break;
300 }
301
302 // solve the resulting linear equation system
303 if (asImp_().verbose_()) {
304 std::cout << "Solve: M deltax^k = r"
305 << clearRemainingLine
306 << std::flush;
307 }
308
310 // solve A x = b, where b is the residual, A is its Jacobian and x is the
311 // update of the solution
312 linearSolver_.setMatrix(jacobian);
313 solutionUpdate = 0.0;
314 bool converged = linearSolver_.solve(solutionUpdate);
316
317 if (!converged) {
319 if (asImp_().verbose_())
320 std::cout << "Newton: Linear solver did not converge\n" << std::flush;
321
323 asImp_().failed_();
325
326 return false;
327 }
328
329 // update the solution
330 if (asImp_().verbose_()) {
331 std::cout << "Update: x^(k+1) = x^k - deltax^k"
332 << clearRemainingLine
333 << std::flush;
334 }
335
336 // update the current solution (i.e. uOld) with the delta
337 // (i.e. u). The result is stored in u
339 asImp_().postSolve_(currentSolution,
340 residual,
341 solutionUpdate);
342 asImp_().update_(nextSolution, currentSolution, solutionUpdate, residual);
344
345 if (asImp_().verbose_() && isatty(fileno(stdout)))
346 // make sure that the line currently holding the cursor is prestine
347 std::cout << clearRemainingLine
348 << std::flush;
349
350 // tell the implementation that we're done with this iteration
352 asImp_().endIteration_(nextSolution, currentSolution);
354 }
355 }
356 catch (const Dune::Exception& e)
357 {
358 if (asImp_().verbose_())
359 std::cout << "Newton method caught exception: \""
360 << e.what() << "\"\n" << std::flush;
361
363 asImp_().failed_();
365
366 return false;
367 }
368 catch (const NumericalProblem& e)
369 {
370 if (asImp_().verbose_())
371 std::cout << "Newton method caught exception: \""
372 << e.what() << "\"\n" << std::flush;
373
375 asImp_().failed_();
377
378 return false;
379 }
380
381 // clear current line on terminal
382 if (asImp_().verbose_() && isatty(fileno(stdout)))
383 std::cout << clearRemainingLine
384 << std::flush;
385
386 // tell the implementation that we're done
388 asImp_().end_();
390
391 // print the timing summary of the time step
392 if (asImp_().verbose_()) {
393 Scalar elapsedTot =
397 std::cout << "Linearization/solve/update time: "
399 << 100 * linearizeTimer_.realTimeElapsed()/elapsedTot << "%)/"
400 << solveTimer_.realTimeElapsed() << "("
401 << 100 * solveTimer_.realTimeElapsed()/elapsedTot << "%)/"
402 << updateTimer_.realTimeElapsed() << "("
403 << 100 * updateTimer_.realTimeElapsed()/elapsedTot << "%)"
404 << "\n" << std::flush;
405 }
406
407
408 // if we're not converged, tell the implementation that we've failed
409 if (!asImp_().converged()) {
411 asImp_().failed_();
413 return false;
414 }
415
416 // if we converged, tell the implementation that we've succeeded
418 asImp_().succeeded_();
420
421 return true;
422 }
423
432 Scalar suggestTimeStepSize(Scalar oldDt) const
433 {
434 // be aggressive reducing the time-step size but
435 // conservative when increasing it. the rationale is
436 // that we want to avoid failing in the next time
437 // integration which would be quite expensive
438 if (numIterations_ > params_.targetIterations_) {
439 Scalar percent = Scalar(numIterations_ - params_.targetIterations_) / params_.targetIterations_;
440 Scalar nextDt = std::max(problem().minTimeStepSize(),
441 oldDt / (Scalar{1.0} + percent));
442 return nextDt;
443 }
444
445 Scalar percent = Scalar(params_.targetIterations_ - numIterations_) / params_.targetIterations_;
446 Scalar nextDt = std::max(problem().minTimeStepSize(),
447 oldDt*(Scalar{1.0} + percent / Scalar{1.2}));
448 return nextDt;
449 }
450
455 std::ostringstream& endIterMsg()
456 { return endIterMsgStream_; }
457
463 { linearSolver_.eraseMatrix(); }
464
468 LinearSolverBackend& linearSolver()
469 { return linearSolver_; }
470
474 const LinearSolverBackend& linearSolver() const
475 { return linearSolver_; }
476
478 { return prePostProcessTimer_; }
479
480 const Timer& linearizeTimer() const
481 { return linearizeTimer_; }
482
483 const Timer& solveTimer() const
484 { return solveTimer_; }
485
486 const Timer& updateTimer() const
487 { return updateTimer_; }
488
489protected:
493 bool verbose_() const
494 {
495 return params_.verbose_ && (comm_.rank() == 0);
496 }
497
504 void begin_(const SolutionVector&)
505 {
506 numIterations_ = 0;
507
508 if (params_.writeConvergence_) {
509 convergenceWriter_.beginTimeStep();
510 }
511 }
512
517 {
518 // start with a clean message stream
519 endIterMsgStream_.str("");
520 const auto& comm = simulator_.gridView().comm();
521 bool succeeded = true;
522 try {
523 problem().beginIteration();
524 }
525 catch (const std::exception& e) {
526 succeeded = false;
527
528 std::cout << "rank " << simulator_.gridView().comm().rank()
529 << " caught an exception while pre-processing the problem:" << e.what()
530 << "\n" << std::flush;
531 }
532
533 succeeded = comm.min(succeeded);
534
535 if (!succeeded)
536 throw NumericalProblem("pre processing of the problem failed");
537
539 }
540
546 {
547 model().linearizer().linearizeDomain();
548 }
549
551 {
552 model().linearizer().linearizeAuxiliaryEquations();
553 model().linearizer().finalize();
554 }
555
556 void preSolve_(const SolutionVector&,
557 const GlobalEqVector& currentResidual)
558 {
559 const auto& constraintsMap = model().linearizer().constraintsMap();
561 Scalar newtonMaxError = params_.maxError_;
562
563 // calculate the error as the maximum weighted tolerance of
564 // the solution's residual
565 error_ = 0;
566 for (unsigned dofIdx = 0; dofIdx < currentResidual.size(); ++dofIdx) {
567 // do not consider auxiliary DOFs for the error
568 if (dofIdx >= model().numGridDof() || model().dofTotalVolume(dofIdx) <= 0.0)
569 continue;
570
571 // also do not consider DOFs which are constraint
572 if (enableConstraints_()) {
573 if (constraintsMap.count(dofIdx) > 0)
574 continue;
575 }
576
577 const auto& r = currentResidual[dofIdx];
578 for (unsigned eqIdx = 0; eqIdx < r.size(); ++eqIdx)
579 error_ = max(std::abs(r[eqIdx] * model().eqWeight(dofIdx, eqIdx)), error_);
580 }
581
582 // take the other processes into account
583 error_ = comm_.max(error_);
584
585 // make sure that the error never grows beyond the maximum
586 // allowed one
587 if (error_ > newtonMaxError)
588 throw NumericalProblem("Newton: Error "+std::to_string(double(error_))
589 + " is larger than maximum allowed error of "
590 + std::to_string(double(newtonMaxError)));
591 }
592
605 void postSolve_(const SolutionVector&,
606 const GlobalEqVector&,
607 GlobalEqVector& solutionUpdate)
608 {
609 // loop over the auxiliary modules and ask them to post process the solution
610 // vector.
611 auto& model = simulator_.model();
612 const auto& comm = simulator_.gridView().comm();
613 for (unsigned i = 0; i < model.numAuxiliaryModules(); ++i) {
614 auto& auxMod = *model.auxiliaryModule(i);
615
616 bool succeeded = true;
617 try {
618 auxMod.postSolve(solutionUpdate);
619 }
620 catch (const std::exception& e) {
621 succeeded = false;
622
623 std::cout << "rank " << simulator_.gridView().comm().rank()
624 << " caught an exception while post processing an auxiliary module:" << e.what()
625 << "\n" << std::flush;
626 }
627
628 succeeded = comm.min(succeeded);
629
630 if (!succeeded)
631 throw NumericalProblem("post processing of an auxilary equation failed");
632 }
633 }
634
649 void update_(SolutionVector& nextSolution,
650 const SolutionVector& currentSolution,
651 const GlobalEqVector& solutionUpdate,
652 const GlobalEqVector& currentResidual)
653 {
654 const auto& constraintsMap = model().linearizer().constraintsMap();
655
656 // first, write out the current solution to make convergence
657 // analysis possible
658 asImp_().writeConvergence_(currentSolution, solutionUpdate);
659
660 // make sure not to swallow non-finite values at this point
661 if (!std::isfinite(solutionUpdate.one_norm()))
662 throw NumericalProblem("Non-finite update!");
663
664 size_t numGridDof = model().numGridDof();
665 for (unsigned dofIdx = 0; dofIdx < numGridDof; ++dofIdx) {
666 if (enableConstraints_()) {
667 if (constraintsMap.count(dofIdx) > 0) {
668 const auto& constraints = constraintsMap.at(dofIdx);
669 asImp_().updateConstraintDof_(dofIdx,
670 nextSolution[dofIdx],
671 constraints);
672 }
673 else
674 asImp_().updatePrimaryVariables_(dofIdx,
675 nextSolution[dofIdx],
676 currentSolution[dofIdx],
677 solutionUpdate[dofIdx],
678 currentResidual[dofIdx]);
679 }
680 else
681 asImp_().updatePrimaryVariables_(dofIdx,
682 nextSolution[dofIdx],
683 currentSolution[dofIdx],
684 solutionUpdate[dofIdx],
685 currentResidual[dofIdx]);
686 }
687
688 // update the DOFs of the auxiliary equations
689 size_t numDof = model().numTotalDof();
690 for (size_t dofIdx = numGridDof; dofIdx < numDof; ++dofIdx) {
691 nextSolution[dofIdx] = currentSolution[dofIdx];
692 nextSolution[dofIdx] -= solutionUpdate[dofIdx];
693 }
694 }
695
699 void updateConstraintDof_(unsigned,
700 PrimaryVariables& nextValue,
701 const Constraints& constraints)
702 { nextValue = constraints; }
703
708 PrimaryVariables& nextValue,
709 const PrimaryVariables& currentValue,
710 const EqVector& update,
711 const EqVector&)
712 {
713 nextValue = currentValue;
714 nextValue -= update;
715 }
716
723 void writeConvergence_(const SolutionVector& currentSolution,
724 const GlobalEqVector& solutionUpdate)
725 {
726 if (params_.writeConvergence_) {
727 convergenceWriter_.beginIteration();
728 convergenceWriter_.writeFields(currentSolution, solutionUpdate);
729 convergenceWriter_.endIteration();
730 }
731 }
732
739 void endIteration_(const SolutionVector&,
740 const SolutionVector&)
741 {
743
744 const auto& comm = simulator_.gridView().comm();
745 bool succeeded = true;
746 try {
747 problem().endIteration();
748 }
749 catch (const std::exception& e) {
750 succeeded = false;
751
752 std::cout << "rank " << simulator_.gridView().comm().rank()
753 << " caught an exception while letting the problem post-process:" << e.what()
754 << "\n" << std::flush;
755 }
756
757 succeeded = comm.min(succeeded);
758
759 if (!succeeded)
760 throw NumericalProblem("post processing of the problem failed");
761
762 if (asImp_().verbose_()) {
763 std::cout << "Newton iteration " << numIterations_ << ""
764 << " error: " << error_
765 << endIterMsg().str() << "\n" << std::flush;
766 }
767 }
768
772 bool proceed_() const
773 {
774 if (asImp_().numIterations() < 1)
775 return true; // we always do at least one full iteration
776 else if (asImp_().converged()) {
777 // we are below the specified tolerance, so we don't have to
778 // do more iterations
779 return false;
780 }
781 else if (asImp_().numIterations() >= params_.maxIterations_) {
782 // we have exceeded the allowed number of steps. If the
783 // error was reduced by a factor of at least 4,
784 // in the last iterations we proceed even if we are above
785 // the maximum number of steps
786 return error_ * 4.0 < lastError_;
787 }
788
789 return true;
790 }
791
796 void end_()
797 {
798 if (params_.writeConvergence_) {
799 convergenceWriter_.endTimeStep();
800 }
801 }
802
808 void failed_()
809 { numIterations_ = params_.targetIterations_ * 2; }
810
817 {}
818
819 static bool enableConstraints_()
820 { return getPropValue<TypeTag, Properties::EnableConstraints>(); }
821
822 Simulator& simulator_;
823
828
829 std::ostringstream endIterMsgStream_;
830
831 Scalar error_;
834
835 // actual number of iterations done so far
837
838 // the linear solver
839 LinearSolverBackend linearSolver_;
840
841 // the collective communication used by the simulation (i.e. fake
842 // or MPI)
843 CollectiveCommunication comm_;
844
845 // the object which writes the convergence behaviour of the Newton
846 // method to disk
847 ConvergenceWriter convergenceWriter_;
848
849private:
850 Implementation& asImp_()
851 { return *static_cast<Implementation *>(this); }
852 const Implementation& asImp_() const
853 { return *static_cast<const Implementation *>(this); }
854};
855
856} // namespace Opm
857
858#endif
The multi-dimensional Newton method.
Definition: newtonmethod.hh:92
bool verbose_() const
Returns true if the Newton method ought to be chatty.
Definition: newtonmethod.hh:493
Timer linearizeTimer_
Definition: newtonmethod.hh:825
void end_()
Indicates that we're done solving the non-linear system of equations.
Definition: newtonmethod.hh:796
const Timer & updateTimer() const
Definition: newtonmethod.hh:486
const Timer & linearizeTimer() const
Definition: newtonmethod.hh:480
Timer solveTimer_
Definition: newtonmethod.hh:826
const Timer & solveTimer() const
Definition: newtonmethod.hh:483
bool proceed_() const
Returns true iff another Newton iteration should be done.
Definition: newtonmethod.hh:772
int numIterations() const
Returns the number of iterations done since the Newton method was invoked.
Definition: newtonmethod.hh:179
static bool enableConstraints_()
Definition: newtonmethod.hh:819
const LinearSolverBackend & linearSolver() const
Returns the linear solver backend object for external use.
Definition: newtonmethod.hh:474
void updatePrimaryVariables_(unsigned, PrimaryVariables &nextValue, const PrimaryVariables &currentValue, const EqVector &update, const EqVector &)
Update a single primary variables object.
Definition: newtonmethod.hh:707
void setTolerance(Scalar value)
Set the current tolerance at which the Newton method considers itself to be converged.
Definition: newtonmethod.hh:203
std::ostringstream & endIterMsg()
Message that should be printed for the user after the end of an iteration.
Definition: newtonmethod.hh:455
static void registerParameters()
Register all run-time parameters for the Newton method.
Definition: newtonmethod.hh:129
Timer prePostProcessTimer_
Definition: newtonmethod.hh:824
void postSolve_(const SolutionVector &, const GlobalEqVector &, GlobalEqVector &solutionUpdate)
Update the error of the solution given the previous iteration.
Definition: newtonmethod.hh:605
const Timer & prePostProcessTimer() const
Definition: newtonmethod.hh:477
Scalar lastError_
Definition: newtonmethod.hh:832
bool apply()
Run the Newton method.
Definition: newtonmethod.hh:212
void writeConvergence_(const SolutionVector &currentSolution, const GlobalEqVector &solutionUpdate)
Write the convergence behaviour of the newton method to disk.
Definition: newtonmethod.hh:723
Scalar error_
Definition: newtonmethod.hh:831
void begin_(const SolutionVector &)
Called before the Newton method is applied to an non-linear system of equations.
Definition: newtonmethod.hh:504
void failed_()
Called if the Newton method broke down.
Definition: newtonmethod.hh:808
void update_(SolutionVector &nextSolution, const SolutionVector &currentSolution, const GlobalEqVector &solutionUpdate, const GlobalEqVector &currentResidual)
Update the current solution with a delta vector.
Definition: newtonmethod.hh:649
void preSolve_(const SolutionVector &, const GlobalEqVector &currentResidual)
Definition: newtonmethod.hh:556
Timer updateTimer_
Definition: newtonmethod.hh:827
const Model & model() const
Returns a reference to the numeric model.
Definition: newtonmethod.hh:172
int numIterations_
Definition: newtonmethod.hh:836
LinearSolverBackend linearSolver_
Definition: newtonmethod.hh:839
void succeeded_()
Called if the Newton method was successful.
Definition: newtonmethod.hh:816
Scalar tolerance() const
Return the current tolerance at which the Newton method considers itself to be converged.
Definition: newtonmethod.hh:196
LinearSolverBackend & linearSolver()
Returns the linear solver backend object for external use.
Definition: newtonmethod.hh:468
void linearizeDomain_()
Linearize the global non-linear system of equations associated with the spatial domain.
Definition: newtonmethod.hh:545
const Problem & problem() const
Returns a reference to the object describing the current physical problem.
Definition: newtonmethod.hh:160
Scalar suggestTimeStepSize(Scalar oldDt) const
Suggest a new time-step size based on the old time-step size.
Definition: newtonmethod.hh:432
bool converged() const
Returns true if the error of the solution is below the tolerance.
Definition: newtonmethod.hh:148
CollectiveCommunication comm_
Definition: newtonmethod.hh:843
Problem & problem()
Returns a reference to the object describing the current physical problem.
Definition: newtonmethod.hh:154
NewtonMethodParams< Scalar > params_
Definition: newtonmethod.hh:833
void eraseMatrix()
Causes the solve() method to discared the structure of the linear system of equations the next time i...
Definition: newtonmethod.hh:462
void updateConstraintDof_(unsigned, PrimaryVariables &nextValue, const Constraints &constraints)
Update the primary variables for a degree of freedom which is constraint.
Definition: newtonmethod.hh:699
std::ostringstream endIterMsgStream_
Definition: newtonmethod.hh:829
ConvergenceWriter convergenceWriter_
Definition: newtonmethod.hh:847
NewtonMethod(Simulator &simulator)
Definition: newtonmethod.hh:112
void finishInit()
Finialize the construction of the object.
Definition: newtonmethod.hh:141
void linearizeAuxiliaryEquations_()
Definition: newtonmethod.hh:550
Model & model()
Returns a reference to the numeric model.
Definition: newtonmethod.hh:166
Simulator & simulator_
Definition: newtonmethod.hh:822
void beginIteration_()
Indicates the beginning of a Newton iteration.
Definition: newtonmethod.hh:516
void endIteration_(const SolutionVector &, const SolutionVector &)
Indicates that one Newton iteration was finished.
Definition: newtonmethod.hh:739
void setIterationIndex(int value)
Set the index of current iteration.
Definition: newtonmethod.hh:189
A convergence writer for the Newton method which does nothing.
Definition: nullconvergencewriter.hh:51
A simple class which makes sure that a timer gets stopped if an exception is thrown.
Definition: timerguard.hh:41
Provides an encapsulation to measure the system time.
Definition: timer.hpp:46
void start()
Start counting the time resources used by the simulation.
void halt()
Stop the measurement reset all timing values.
double realTimeElapsed() const
Return the real time [s] elapsed during the periods the timer was active since the last reset.
double stop()
Stop counting the time resources.
Declare the properties used by the infrastructure code of the finite volume discretizations.
Declares the properties required by the black oil model.
Definition: fvbaseprimaryvariables.hh:141
Definition: blackoilmodel.hh:72
Definition: blackoilboundaryratevector.hh:37
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:235
std::string to_string(const ConvergenceReport::ReservoirFailure::Type t)
Struct holding the parameters for NewtonMethod.
Definition: newtonmethodparams.hpp:71
static void registerParameters()
Registers the parameters in parameter system.
Specifies the type of the class which writes out the Newton convergence.
Definition: newtonmethodproperties.hh:40
Specifies the type of the actual Newton method.
Definition: newtonmethodproperties.hh:32
Definition: newtonmethod.hh:70