fvbaseproblem.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*/
28#ifndef EWOMS_FV_BASE_PROBLEM_HH
29#define EWOMS_FV_BASE_PROBLEM_HH
30
31#include <dune/common/fvector.hh>
32
36
38
41
43
44#include <functional>
45#include <iomanip>
46#include <iostream>
47#include <limits>
48#include <memory>
49#include <string>
50
51namespace Opm::Properties {
52
53template <class TypeTag, class MyTypeTag>
54struct NewtonMethod;
55
56} // namespace Opm::Properties
57
58namespace Opm {
59
69template<class TypeTag>
71{
72private:
73 using Implementation = GetPropType<TypeTag, Properties::Problem>;
75
76 static constexpr auto vtkOutputFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
78
84
87
92
93 enum {
94 dim = GridView::dimension,
95 dimWorld = GridView::dimensionworld
96 };
97
98 using Element = typename GridView::template Codim<0>::Entity;
99 using Vertex = typename GridView::template Codim<dim>::Entity;
100 using VertexIterator = typename GridView::template Codim<dim>::Iterator;
101
102 using CoordScalar = typename GridView::Grid::ctype;
103 using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
104
105public:
106 // the default restriction and prolongation for adaptation is simply an empty one
108
109private:
110 // copying a problem is not a good idea
111 FvBaseProblem(const FvBaseProblem&) = delete;
112
113public:
121 explicit FvBaseProblem(Simulator& simulator)
122 : nextTimeStepSize_(0.0)
123 , gridView_(simulator.gridView())
124 , elementMapper_(gridView_, Dune::mcmgElementLayout())
125 , vertexMapper_(gridView_, Dune::mcmgVertexLayout())
126 , boundingBoxMin_(std::numeric_limits<double>::max())
127 , boundingBoxMax_(-std::numeric_limits<double>::max())
128 , simulator_(simulator)
129 {
130 // calculate the bounding box of the local partition of the grid view
131 for (const auto& vertex : vertices(gridView_)) {
132 for (unsigned i = 0; i < dim; ++i) {
133 boundingBoxMin_[i] = std::min(boundingBoxMin_[i], vertex.geometry().corner(0)[i]);
134 boundingBoxMax_[i] = std::max(boundingBoxMax_[i], vertex.geometry().corner(0)[i]);
135 }
136 }
137
138 // communicate to get the bounding box of the whole domain
139 for (unsigned i = 0; i < dim; ++i) {
140 boundingBoxMin_[i] = gridView_.comm().min(boundingBoxMin_[i]);
141 boundingBoxMax_[i] = gridView_.comm().max(boundingBoxMax_[i]);
142 }
143
144 if (enableVtkOutput_()) {
145 const bool asyncVtkOutput =
146 simulator_.gridView().comm().size() == 1 &&
147 Parameters::Get<Parameters::EnableAsyncVtkOutput>();
148
149 // asynchonous VTK output currently does not work in conjunction with grid
150 // adaptivity because the async-IO code assumes that the grid stays
151 // constant. complain about that case.
152 const bool enableGridAdaptation = Parameters::Get<Parameters::EnableGridAdaptation>();
153 if (asyncVtkOutput && enableGridAdaptation) {
154 throw std::runtime_error("Asynchronous VTK output currently cannot be used "
155 "at the same time as grid adaptivity");
156 }
157
158 defaultVtkWriter_ = std::make_unique<VtkMultiWriter>(asyncVtkOutput,
159 gridView_,
160 asImp_().outputDir(),
161 asImp_().name());
162 }
163 }
164
165 virtual ~FvBaseProblem() = default;
166
171 static void registerParameters()
172 {
173 Model::registerParameters();
174 Parameters::Register<Parameters::MaxTimeStepSize<Scalar>>
175 ("The maximum size to which all time steps are limited to [s]");
176 Parameters::Register<Parameters::MinTimeStepSize<Scalar>>
177 ("The minimum size to which all time steps are limited to [s]");
178 Parameters::Register<Parameters::MaxTimeStepDivisions>
179 ("The maximum number of divisions by two of the timestep size "
180 "before the simulation bails out");
181 Parameters::Register<Parameters::EnableAsyncVtkOutput>
182 ("Dispatch a separate thread to write the VTK output");
183 Parameters::Register<Parameters::ContinueOnConvergenceError>
184 ("Continue with a non-converged solution instead of giving up "
185 "if we encounter a time step size smaller than the minimum time "
186 "step size.");
187 }
188
197 { return true; }
198
207 {
208 if (Parameters::Get<Parameters::EnableStorageCache>() && asImp_().recycleFirstIterationStorage()) {
209 return 1;
210 }
211 return 2;
212 }
213
222 std::string outputDir() const
223 {
224 return simulatorOutputDir();
225 }
226
233 static std::string helpPreamble(int, const char **argv)
234 {
235 std::string desc = Implementation::briefDescription();
236 if (!desc.empty()) {
237 desc = desc + "\n";
238 }
239
240 return "Usage: " + std::string(argv[0]) + " [OPTIONS]\n" + desc;
241 }
242
249 static std::string briefDescription()
250 { return ""; }
251
252 // TODO (?): detailedDescription()
253
270 static int handlePositionalParameter(std::function<void(const std::string&,
271 const std::string&)>,
272 std::set<std::string>&,
273 std::string& errorMsg,
274 int,
275 const char** argv,
276 int paramIdx,
277 int)
278 {
279 errorMsg = std::string("Illegal parameter \"") + argv[paramIdx] + "\".";
280 return 0;
281 }
282
289 {}
290
295 void prefetch(const Element&) const
296 {
297 // do nothing by default
298 }
299
304 {
305 elementMapper_.update(gridView_);
306 vertexMapper_.update(gridView_);
307
308 if (enableVtkOutput_()) {
309 defaultVtkWriter_->gridChanged();
310 }
311 }
312
322 template <class Context>
323 void boundary(BoundaryRateVector&,
324 const Context&,
325 unsigned,
326 unsigned) const
327 { throw std::logic_error("Problem does not provide a boundary() method"); }
328
339 template <class Context>
340 void constraints(Constraints&,
341 const Context&,
342 unsigned,
343 unsigned) const
344 { throw std::logic_error("Problem does not provide a constraints() method"); }
345
358 template <class Context>
359 void source(RateVector&,
360 const Context&,
361 unsigned,
362 unsigned) const
363 { throw std::logic_error("Problem does not provide a source() method"); }
364
375 template <class Context>
376 void initial(PrimaryVariables&,
377 const Context&,
378 unsigned,
379 unsigned) const
380 { throw std::logic_error("Problem does not provide a initial() method"); }
381
397 template <class Context>
398 Scalar extrusionFactor(const Context&,
399 unsigned,
400 unsigned) const
401 { return asImp_().extrusionFactor(); }
402
403 Scalar extrusionFactor() const
404 { return 1.0; }
405
411 {}
412
417 {}
418
423 {}
424
429 {}
430
435 {}
436
444 {}
445
452 {
453 std::cerr << "The end of episode " << simulator().episodeIndex() + 1 << " has been "
454 << "reached, but the problem does not override the endEpisode() method. "
455 << "Doing nothing!\n";
456 }
457
461 void finalize()
462 {
463 const auto& executionTimer = simulator().executionTimer();
464
465 const Scalar executionTime = executionTimer.realTimeElapsed();
466 const Scalar setupTime = simulator().setupTimer().realTimeElapsed();
467 const Scalar prePostProcessTime = simulator().prePostProcessTimer().realTimeElapsed();
468 const Scalar localCpuTime = executionTimer.cpuTimeElapsed();
469 const Scalar globalCpuTime = executionTimer.globalCpuTimeElapsed();
470 const Scalar writeTime = simulator().writeTimer().realTimeElapsed();
471 const Scalar linearizeTime = simulator().linearizeTimer().realTimeElapsed();
472 const Scalar solveTime = simulator().solveTimer().realTimeElapsed();
473 const Scalar updateTime = simulator().updateTimer().realTimeElapsed();
474 const unsigned numProcesses = static_cast<unsigned>(this->gridView().comm().size());
475 const unsigned threadsPerProcess = ThreadManager::maxThreads();
476 if (gridView().comm().rank() == 0) {
477 std::cout << std::setprecision(3)
478 << "Simulation of problem '" << asImp_().name() << "' finished.\n"
479 << "\n"
480 << "------------------------ Timing ------------------------\n"
481 << "Setup time: " << setupTime << " seconds"
482 << humanReadableTime(setupTime)
483 << ", " << setupTime / (executionTime + setupTime) * 100 << "%\n"
484 << "Simulation time: " << executionTime << " seconds"
485 << humanReadableTime(executionTime)
486 << ", " << executionTime / (executionTime + setupTime) * 100 << "%\n"
487 << " Linearization time: " << linearizeTime << " seconds"
488 << humanReadableTime(linearizeTime)
489 << ", " << linearizeTime / executionTime * 100 << "%\n"
490 << " Linear solve time: " << solveTime << " seconds"
491 << humanReadableTime(solveTime)
492 << ", " << solveTime / executionTime * 100 << "%\n"
493 << " Newton update time: " << updateTime << " seconds"
494 << humanReadableTime(updateTime)
495 << ", " << updateTime / executionTime * 100 << "%\n"
496 << " Pre/postprocess time: " << prePostProcessTime << " seconds"
497 << humanReadableTime(prePostProcessTime)
498 << ", " << prePostProcessTime / executionTime * 100 << "%\n"
499 << " Output write time: " << writeTime << " seconds"
500 << humanReadableTime(writeTime)
501 << ", " << writeTime / executionTime * 100 << "%\n"
502 << "First process' simulation CPU time: " << localCpuTime << " seconds"
503 << humanReadableTime(localCpuTime) << "\n"
504 << "Number of processes: " << numProcesses << "\n"
505 << "Threads per processes: " << threadsPerProcess << "\n"
506 << "Total CPU time: " << globalCpuTime << " seconds"
507 << humanReadableTime(globalCpuTime) << "\n"
508 << "\n"
509 << "----------------------------------------------------------------\n"
510 << std::endl;
511 }
512 }
513
519 {
520 const unsigned maxFails = asImp_().maxTimeIntegrationFailures();
521 Scalar minTimeStep = asImp_().minTimeStepSize();
522
523 std::string errorMessage;
524 for (unsigned i = 0; i < maxFails; ++i) {
525 bool converged = model().update();
526 if (converged) {
527 return;
528 }
529
530 const Scalar dt = simulator().timeStepSize();
531 Scalar nextDt = dt / 2.0;
532 if (dt < minTimeStep * (1.0 + 1e-9)) {
533 if (asImp_().continueOnConvergenceError()) {
534 if (gridView().comm().rank() == 0) {
535 std::cout << "Newton solver did not converge with minimum time step of "
536 << dt << " seconds. Continuing with unconverged solution!\n"
537 << std::flush;
538 }
539 return;
540 }
541 else {
542 errorMessage = "Time integration did not succeed with the minumum time step size of " +
543 std::to_string(double(minTimeStep)) + " seconds. Giving up!";
544 break; // give up: we can't make the time step smaller anymore!
545 }
546 }
547 else if (nextDt < minTimeStep) {
548 nextDt = minTimeStep;
549 }
550 simulator().setTimeStepSize(nextDt);
551
552 // update failed
553 if (gridView().comm().rank() == 0) {
554 std::cout << "Newton solver did not converge with "
555 << "dt=" << dt << " seconds. Retrying with time step of "
556 << nextDt << " seconds\n" << std::flush;
557 }
558 }
559
560 if (errorMessage.empty()) {
561 errorMessage = "Newton solver didn't converge after " +
562 std::to_string(maxFails) + " time-step divisions. dt=" +
563 std::to_string(double(simulator().timeStepSize()));
564 }
565 throw std::runtime_error(errorMessage);
566 }
567
571 Scalar minTimeStepSize() const
572 { return Parameters::Get<Parameters::MinTimeStepSize<Scalar>>(); }
573
583 virtual double maxNextTimeStepSize() const
584 { return std::numeric_limits<double>::max(); }
585
591 { return Parameters::Get<Parameters::MaxTimeStepDivisions>(); }
592
599 { return Parameters::Get<Parameters::ContinueOnConvergenceError>(); }
600
604 void setNextTimeStepSize(Scalar dt)
605 { nextTimeStepSize_ = dt; }
606
612 Scalar nextTimeStepSize() const
613 {
614 if (nextTimeStepSize_ > 0.0) {
615 return nextTimeStepSize_;
616 }
617
618 Scalar dtNext = std::min(Parameters::Get<Parameters::MaxTimeStepSize<Scalar>>(),
619 newtonMethod().suggestTimeStepSize(simulator().timeStepSize()));
620
621 if (dtNext < simulator().maxTimeStepSize() &&
622 simulator().maxTimeStepSize() < dtNext * 2)
623 {
624 dtNext = simulator().maxTimeStepSize() / 2 * 1.01;
625 }
626
627 return dtNext;
628 }
629
639 {
640 return simulator().timeStepIndex() > 0 &&
641 (simulator().timeStepIndex() % 10 == 0);
642 }
643
652 bool shouldWriteOutput() const
653 { return true; }
654
661 { model().advanceTimeLevel(); }
662
670 std::string name() const
671 { return "sim"; }
672
676 const GridView& gridView() const
677 { return gridView_; }
678
683 const GlobalPosition& boundingBoxMin() const
684 { return boundingBoxMin_; }
685
690 const GlobalPosition& boundingBoxMax() const
691 { return boundingBoxMax_; }
692
696 const VertexMapper& vertexMapper() const
697 { return vertexMapper_; }
698
702 const ElementMapper& elementMapper() const
703 { return elementMapper_; }
704
708 Simulator& simulator()
709 { return simulator_; }
710
714 const Simulator& simulator() const
715 { return simulator_; }
716
720 Model& model()
721 { return simulator_.model(); }
722
726 const Model& model() const
727 { return simulator_.model(); }
728
732 NewtonMethod& newtonMethod()
733 { return model().newtonMethod(); }
734
738 const NewtonMethod& newtonMethod() const
739 { return model().newtonMethod(); }
740 // \}
741
747 {
749 }
750
759 {
760 return 0;
761 }
762
776 template <class Restarter>
777 void serialize(Restarter& res)
778 {
779 if (enableVtkOutput_()) {
780 defaultVtkWriter_->serialize(res);
781 }
782 }
783
794 template <class Restarter>
795 void deserialize(Restarter& res)
796 {
797 if (enableVtkOutput_()) {
798 defaultVtkWriter_->deserialize(res);
799 }
800 }
801
808 void writeOutput(bool verbose = true)
809 {
810 if (!enableVtkOutput_()) {
811 return;
812 }
813
814 if (verbose && gridView().comm().rank() == 0) {
815 std::cout << "Writing visualization results for the current time step.\n"
816 << std::flush;
817 }
818
819 // calculate the time _after_ the time was updated
820 const Scalar t = simulator().time() + simulator().timeStepSize();
821
822 defaultVtkWriter_->beginWrite(t);
823 model().prepareOutputFields();
824 model().appendOutputFields(*defaultVtkWriter_);
825 defaultVtkWriter_->endWrite(false);
826 }
827
833 { return *defaultVtkWriter_; }
834
839 { return iterationContext_; }
840
846
852
858
859private:
860 // LocalContextGuard needs mutable access to save/restore the context
861 // during NLDD domain-local solves; SetupIterationContextGuard likewise
862 // for mid-step re-initialization passes.
863 template<class P> friend class LocalContextGuard;
864 template<class P> friend class SetupIterationContextGuard;
865
869 NewtonIterationContext& mutableIterationContext()
870 { return iterationContext_; }
871
872public:
873
874protected:
877
878 bool enableVtkOutput_() const
879 { return Parameters::Get<Parameters::EnableVtkOutput>(); }
880
881private:
883 Implementation& asImp_()
884 { return *static_cast<Implementation*>(this); }
885
887 const Implementation& asImp_() const
888 { return *static_cast<const Implementation*>(this); }
889
890 // Grid management stuff
891 const GridView gridView_;
892 ElementMapper elementMapper_;
893 VertexMapper vertexMapper_;
894 GlobalPosition boundingBoxMin_;
895 GlobalPosition boundingBoxMax_;
896
897 // Attributes required for the actual simulation
898 Simulator& simulator_;
899 std::unique_ptr<VtkMultiWriter> defaultVtkWriter_{};
900};
901
902} // namespace Opm
903
904#endif
Definition: restrictprolong.hh:142
Base class for all problems which use a finite volume spatial discretization.
Definition: fvbaseproblem.hh:71
static int handlePositionalParameter(std::function< void(const std::string &, const std::string &)>, std::set< std::string > &, std::string &errorMsg, int, const char **argv, int paramIdx, int)
Handles positional command line parameters.
Definition: fvbaseproblem.hh:270
std::string name() const
The problem name.
Definition: fvbaseproblem.hh:670
const Simulator & simulator() const
Returns Simulator object used by the simulation.
Definition: fvbaseproblem.hh:714
void writeOutput(bool verbose=true)
Write the relevant secondary variables of the current solution into an VTK output file.
Definition: fvbaseproblem.hh:808
void boundary(BoundaryRateVector &, const Context &, unsigned, unsigned) const
Evaluate the boundary conditions for a boundary segment.
Definition: fvbaseproblem.hh:323
void finalize()
Called after the simulation has been run sucessfully.
Definition: fvbaseproblem.hh:461
Simulator & simulator()
Returns Simulator object used by the simulation.
Definition: fvbaseproblem.hh:708
const Model & model() const
Returns numerical model used for the problem.
Definition: fvbaseproblem.hh:726
static void registerParameters()
Registers all available parameters for the problem and the model.
Definition: fvbaseproblem.hh:171
void source(RateVector &, const Context &, unsigned, unsigned) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: fvbaseproblem.hh:359
bool recycleFirstIterationStorage() const
Return if the storage term of the first iteration is identical to the storage term for the solution o...
Definition: fvbaseproblem.hh:196
unsigned maxTimeIntegrationFailures() const
Returns the maximum number of subsequent failures for the time integration before giving up.
Definition: fvbaseproblem.hh:590
unsigned markForGridAdaptation()
Mark grid cells for refinement or coarsening.
Definition: fvbaseproblem.hh:758
void advanceIteration()
Advance the iteration counter.
Definition: fvbaseproblem.hh:850
void serialize(Restarter &res)
This method writes the complete state of the problem to the harddisk.
Definition: fvbaseproblem.hh:777
void beginIteration()
Called by the simulator before each Newton-Raphson iteration.
Definition: fvbaseproblem.hh:428
void markTimestepInitialized()
Mark timestep initialization as complete.
Definition: fvbaseproblem.hh:856
unsigned intensiveQuantityHistorySize() const
Returns the required history size for intensive quantities cache.
Definition: fvbaseproblem.hh:206
void endTimeStep()
Called by the simulator after each time integration.
Definition: fvbaseproblem.hh:443
NewtonIterationContext iterationContext_
Definition: fvbaseproblem.hh:876
FvBaseProblem(Simulator &simulator)
Definition: fvbaseproblem.hh:121
const GlobalPosition & boundingBoxMax() const
The coordinate of the corner of the GridView's bounding box with the largest values.
Definition: fvbaseproblem.hh:690
RestrictProlongOperator restrictProlongOperator()
return restriction and prolongation operator
Definition: fvbaseproblem.hh:746
const NewtonIterationContext & iterationContext() const
Returns the iteration context for iteration-dependent decisions.
Definition: fvbaseproblem.hh:838
void timeIntegration()
Called by Opm::Simulator in order to do a time integration on the model.
Definition: fvbaseproblem.hh:518
Model & model()
Returns numerical model used for the problem.
Definition: fvbaseproblem.hh:720
Scalar extrusionFactor() const
Definition: fvbaseproblem.hh:403
virtual double maxNextTimeStepSize() const
Upper bound for the next time step imposed by the problem.
Definition: fvbaseproblem.hh:583
void endEpisode()
Called when the end of an simulation episode is reached.
Definition: fvbaseproblem.hh:451
void beginTimeStep()
Called by the simulator before each time integration.
Definition: fvbaseproblem.hh:422
static std::string helpPreamble(int, const char **argv)
Returns the string that is printed before the list of command line parameters in the help message.
Definition: fvbaseproblem.hh:233
void deserialize(Restarter &res)
This method restores the complete state of the problem from disk.
Definition: fvbaseproblem.hh:795
void prefetch(const Element &) const
Allows to improve the performance by prefetching all data which is associated with a given element.
Definition: fvbaseproblem.hh:295
Scalar extrusionFactor(const Context &, unsigned, unsigned) const
Return how much the domain is extruded at a given sub-control volume.
Definition: fvbaseproblem.hh:398
bool shouldWriteRestartFile() const
Returns true if a restart file should be written to disk.
Definition: fvbaseproblem.hh:638
Scalar nextTimeStepSize() const
Called by Opm::Simulator whenever a solution for a time step has been computed and the simulation tim...
Definition: fvbaseproblem.hh:612
Scalar minTimeStepSize() const
Returns the minimum allowable size of a time step.
Definition: fvbaseproblem.hh:571
void resetIterationForNewTimestep()
Reset the iteration context for a new timestep.
Definition: fvbaseproblem.hh:844
void beginEpisode()
Called at the beginning of an simulation episode.
Definition: fvbaseproblem.hh:416
void initial(PrimaryVariables &, const Context &, unsigned, unsigned) const
Evaluate the initial value for a control volume.
Definition: fvbaseproblem.hh:376
std::string outputDir() const
Determine the directory for simulation output.
Definition: fvbaseproblem.hh:222
Scalar nextTimeStepSize_
Definition: fvbaseproblem.hh:875
const VertexMapper & vertexMapper() const
Returns the mapper for vertices to indices.
Definition: fvbaseproblem.hh:696
void gridChanged()
Handle changes of the grid.
Definition: fvbaseproblem.hh:303
const GlobalPosition & boundingBoxMin() const
The coordinate of the corner of the GridView's bounding box with the smallest values.
Definition: fvbaseproblem.hh:683
static std::string briefDescription()
Returns a human readable description of the problem for the help message.
Definition: fvbaseproblem.hh:249
void endIteration()
Called by the simulator after each Newton-Raphson update.
Definition: fvbaseproblem.hh:434
void setNextTimeStepSize(Scalar dt)
Impose the next time step size to be used externally.
Definition: fvbaseproblem.hh:604
bool continueOnConvergenceError() const
Returns if we should continue with a non-converged solution instead of giving up if we encounter a ti...
Definition: fvbaseproblem.hh:598
void constraints(Constraints &, const Context &, unsigned, unsigned) const
Evaluate the constraints for a control volume.
Definition: fvbaseproblem.hh:340
void finishInit()
Called by the Opm::Simulator in order to initialize the problem.
Definition: fvbaseproblem.hh:288
const NewtonMethod & newtonMethod() const
Returns object which implements the Newton method.
Definition: fvbaseproblem.hh:738
const GridView & gridView() const
The GridView which used by the problem.
Definition: fvbaseproblem.hh:676
bool enableVtkOutput_() const
Definition: fvbaseproblem.hh:878
EmptyRestrictProlong RestrictProlongOperator
Definition: fvbaseproblem.hh:107
virtual ~FvBaseProblem()=default
NewtonMethod & newtonMethod()
Returns object which implements the Newton method.
Definition: fvbaseproblem.hh:732
bool shouldWriteOutput() const
Returns true if the current solution should be written to disk (i.e. as a VTK file)
Definition: fvbaseproblem.hh:652
void initialSolutionApplied()
Callback used by the model to indicate that the initial solution has been determined for all degrees ...
Definition: fvbaseproblem.hh:410
void advanceTimeLevel()
Called by the simulator after everything which can be done about the current time step is finished an...
Definition: fvbaseproblem.hh:660
VtkMultiWriter & defaultVtkWriter() const
Method to retrieve the VTK writer which should be used to write the default ouput after each time ste...
Definition: fvbaseproblem.hh:832
const ElementMapper & elementMapper() const
Returns the mapper for elements to indices.
Definition: fvbaseproblem.hh:702
Definition: NewtonIterationContext.hpp:152
Definition: NewtonIterationContext.hpp:185
static unsigned maxThreads()
Return the maximum number of threads of the current process.
Definition: threadmanager.hpp:66
Simplifies writing multi-file VTK datasets.
Definition: vtkmultiwriter.hh:65
Declare the properties used by the infrastructure code of the finite volume discretizations.
Declare the properties used by the infrastructure code of the finite volume discretizations.
Definition: fvbaseprimaryvariables.hh:161
auto Get(bool errorIfNotRegistered=true)
Retrieve a runtime parameter.
Definition: parametersystem.hpp:191
Definition: blackoilmodel.hh:74
Definition: blackoilbioeffectsmodules.hh:45
std::string humanReadableTime(double timeInSeconds, bool isAmendment=true)
Given a time step size in seconds, return it in a format which is more easily parsable by humans.
std::string simulatorOutputDir()
Determine and check the configured directory for simulation output.
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:233
std::string to_string(const ConvergenceReport::ReservoirFailure::Type t)
Context for iteration-dependent decisions in the Newton solver.
Definition: NewtonIterationContext.hpp:43
void markTimestepInitialized()
State Mutations.
Definition: NewtonIterationContext.hpp:104
void advanceIteration()
Definition: NewtonIterationContext.hpp:112
void resetForNewTimestep()
Reset all state for a new timestep.
Definition: NewtonIterationContext.hpp:122
Specify the maximum size of a time integration [s].
Definition: fvbaseparameters.hh:106