Loading...
Searching...
No Matches
fvbaseproblem.hh
Go to the documentation of this file.
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#ifndef EWOMS_FV_BASE_PROBLEM_HH
#define EWOMS_FV_BASE_PROBLEM_HH
#include <dune/common/fvector.hh>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <opm/models/discretization/common/restrictprolong.hh>
#include <opm/models/io/vtkmultiwriter.hh>
#include <opm/models/io/restart.hpp>
#include <opm/models/utils/simulatorutils.hpp>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <memory>
#include <string>
namespace Opm::Properties {
template <class TypeTag, class MyTypeTag>
struct NewtonMethod;
} // namespace Opm::Properties
namespace Opm {
template<class TypeTag>
class FvBaseProblem
{
private:
using Implementation = GetPropType<TypeTag, Properties::Problem>;
using GridView = GetPropType<TypeTag, Properties::GridView>;
static constexpr auto vtkOutputFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkOutputFormat>;
using Model = GetPropType<TypeTag, Properties::Model>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
using ThreadManager = GetPropType<TypeTag, Properties::ThreadManager>;
using NewtonMethod = GetPropType<TypeTag, Properties::NewtonMethod>;
using VertexMapper = GetPropType<TypeTag, Properties::VertexMapper>;
using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>;
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
using BoundaryRateVector = GetPropType<TypeTag, Properties::BoundaryRateVector>;
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
using Constraints = GetPropType<TypeTag, Properties::Constraints>;
enum {
dim = GridView::dimension,
dimWorld = GridView::dimensionworld
};
using Element = typename GridView::template Codim<0>::Entity;
using Vertex = typename GridView::template Codim<dim>::Entity;
using VertexIterator = typename GridView::template Codim<dim>::Iterator;
using CoordScalar = typename GridView::Grid::ctype;
using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
public:
// the default restriction and prolongation for adaptation is simply an empty one
using RestrictProlongOperator = EmptyRestrictProlong ;
private:
// copying a problem is not a good idea
FvBaseProblem(const FvBaseProblem&) = delete;
public:
explicit FvBaseProblem(Simulator& simulator)
: nextTimeStepSize_(0.0)
, gridView_(simulator.gridView())
, elementMapper_(gridView_, Dune::mcmgElementLayout())
, vertexMapper_(gridView_, Dune::mcmgVertexLayout())
, boundingBoxMin_(std::numeric_limits<double>::max())
, boundingBoxMax_(-std::numeric_limits<double>::max())
, simulator_(simulator)
{
// calculate the bounding box of the local partition of the grid view
for (const auto& vertex : vertices(gridView_)) {
for (unsigned i = 0; i < dim; ++i) {
boundingBoxMin_[i] = std::min(boundingBoxMin_[i], vertex.geometry().corner(0)[i]);
boundingBoxMax_[i] = std::max(boundingBoxMax_[i], vertex.geometry().corner(0)[i]);
}
}
// communicate to get the bounding box of the whole domain
for (unsigned i = 0; i < dim; ++i) {
boundingBoxMin_[i] = gridView_.comm().min(boundingBoxMin_[i]);
boundingBoxMax_[i] = gridView_.comm().max(boundingBoxMax_[i]);
}
if (enableVtkOutput_()) {
const bool asyncVtkOutput =
simulator_.gridView().comm().size() == 1 &&
Parameters::Get<Parameters::EnableAsyncVtkOutput>();
// asynchonous VTK output currently does not work in conjunction with grid
// adaptivity because the async-IO code assumes that the grid stays
// constant. complain about that case.
const bool enableGridAdaptation = Parameters::Get<Parameters::EnableGridAdaptation>();
if (asyncVtkOutput && enableGridAdaptation) {
throw std::runtime_error("Asynchronous VTK output currently cannot be used "
"at the same time as grid adaptivity");
}
defaultVtkWriter_ = std::make_unique<VtkMultiWriter>(asyncVtkOutput,
gridView_,
asImp_().outputDir(),
asImp_().name());
}
}
static void registerParameters()
{
Model::registerParameters();
Parameters::Register<Parameters::MaxTimeStepSize<Scalar>>
("The maximum size to which all time steps are limited to [s]");
Parameters::Register<Parameters::MinTimeStepSize<Scalar>>
("The minimum size to which all time steps are limited to [s]");
Parameters::Register<Parameters::MaxTimeStepDivisions>
("The maximum number of divisions by two of the timestep size "
"before the simulation bails out");
Parameters::Register<Parameters::EnableAsyncVtkOutput>
("Dispatch a separate thread to write the VTK output");
Parameters::Register<Parameters::ContinueOnConvergenceError>
("Continue with a non-converged solution instead of giving up "
"if we encounter a time step size smaller than the minimum time "
"step size.");
}
bool recycleFirstIterationStorage() const
{ return true; }
unsigned intensiveQuantityHistorySize() const
{
if (Parameters::Get<Parameters::EnableStorageCache>() && asImp_().recycleFirstIterationStorage()) {
return 1;
}
return 2;
}
std::string outputDir() const
{
return simulatorOutputDir();
}
static std::string helpPreamble(int, const char **argv)
{
std::string desc = Implementation::briefDescription();
if (!desc.empty()) {
desc = desc + "\n";
}
return "Usage: " + std::string(argv[0]) + " [OPTIONS]\n" + desc;
}
static std::string briefDescription()
{ return ""; }
// TODO (?): detailedDescription()
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)
{
errorMsg = std::string("Illegal parameter \"") + argv[paramIdx] + "\".";
return 0;
}
void finishInit()
{}
void prefetch(const Element&) const
{
// do nothing by default
}
void gridChanged()
{
elementMapper_.update(gridView_);
vertexMapper_.update(gridView_);
if (enableVtkOutput_()) {
defaultVtkWriter_->gridChanged();
}
}
template <class Context>
void boundary(BoundaryRateVector&,
const Context&,
unsigned,
unsigned) const
{ throw std::logic_error("Problem does not provide a boundary() method"); }
template <class Context>
void constraints(Constraints&,
const Context&,
unsigned,
unsigned) const
{ throw std::logic_error("Problem does not provide a constraints() method"); }
template <class Context>
void source(RateVector&,
const Context&,
unsigned,
unsigned) const
{ throw std::logic_error("Problem does not provide a source() method"); }
template <class Context>
void initial(PrimaryVariables&,
const Context&,
unsigned,
unsigned) const
{ throw std::logic_error("Problem does not provide a initial() method"); }
template <class Context>
Scalar extrusionFactor(const Context&,
unsigned,
unsigned) const
{ return asImp_().extrusionFactor(); }
Scalar extrusionFactor() const
{ return 1.0; }
void initialSolutionApplied()
{}
void beginEpisode()
{}
void beginTimeStep()
{}
void beginIteration()
{}
void endIteration()
{}
void endTimeStep()
{}
void endEpisode()
{
std::cerr << "The end of episode " << simulator().episodeIndex() + 1 << " has been "
<< "reached, but the problem does not override the endEpisode() method. "
<< "Doing nothing!\n";
}
void finalize()
{
const auto& executionTimer = simulator().executionTimer();
const Scalar executionTime = executionTimer.realTimeElapsed();
const Scalar setupTime = simulator().setupTimer().realTimeElapsed();
const Scalar prePostProcessTime = simulator().prePostProcessTimer().realTimeElapsed();
const Scalar localCpuTime = executionTimer.cpuTimeElapsed();
const Scalar globalCpuTime = executionTimer.globalCpuTimeElapsed();
const Scalar writeTime = simulator().writeTimer().realTimeElapsed();
const Scalar linearizeTime = simulator().linearizeTimer().realTimeElapsed();
const Scalar solveTime = simulator().solveTimer().realTimeElapsed();
const Scalar updateTime = simulator().updateTimer().realTimeElapsed();
const unsigned numProcesses = static_cast<unsigned>(this->gridView().comm().size());
const unsigned threadsPerProcess = ThreadManager::maxThreads();
if (gridView().comm().rank() == 0) {
std::cout << std::setprecision(3)
<< "Simulation of problem '" << asImp_().name() << "' finished.\n"
<< "\n"
<< "------------------------ Timing ------------------------\n"
<< "Setup time: " << setupTime << " seconds"
<< humanReadableTime(setupTime)
<< ", " << setupTime / (executionTime + setupTime) * 100 << "%\n"
<< "Simulation time: " << executionTime << " seconds"
<< humanReadableTime(executionTime)
<< ", " << executionTime / (executionTime + setupTime) * 100 << "%\n"
<< " Linearization time: " << linearizeTime << " seconds"
<< humanReadableTime(linearizeTime)
<< ", " << linearizeTime / executionTime * 100 << "%\n"
<< " Linear solve time: " << solveTime << " seconds"
<< humanReadableTime(solveTime)
<< ", " << solveTime / executionTime * 100 << "%\n"
<< " Newton update time: " << updateTime << " seconds"
<< humanReadableTime(updateTime)
<< ", " << updateTime / executionTime * 100 << "%\n"
<< " Pre/postprocess time: " << prePostProcessTime << " seconds"
<< humanReadableTime(prePostProcessTime)
<< ", " << prePostProcessTime / executionTime * 100 << "%\n"
<< " Output write time: " << writeTime << " seconds"
<< humanReadableTime(writeTime)
<< ", " << writeTime / executionTime * 100 << "%\n"
<< "First process' simulation CPU time: " << localCpuTime << " seconds"
<< humanReadableTime(localCpuTime) << "\n"
<< "Number of processes: " << numProcesses << "\n"
<< "Threads per processes: " << threadsPerProcess << "\n"
<< "Total CPU time: " << globalCpuTime << " seconds"
<< humanReadableTime(globalCpuTime) << "\n"
<< "\n"
<< "----------------------------------------------------------------\n"
<< std::endl;
}
}
void timeIntegration()
{
const unsigned maxFails = asImp_().maxTimeIntegrationFailures();
Scalar minTimeStep = asImp_().minTimeStepSize();
std::string errorMessage;
for (unsigned i = 0; i < maxFails; ++i) {
bool converged = model().update();
if (converged) {
return;
}
const Scalar dt = simulator().timeStepSize();
Scalar nextDt = dt / 2.0;
if (dt < minTimeStep * (1.0 + 1e-9)) {
if (asImp_().continueOnConvergenceError()) {
if (gridView().comm().rank() == 0) {
std::cout << "Newton solver did not converge with minimum time step of "
<< dt << " seconds. Continuing with unconverged solution!\n"
<< std::flush;
}
return;
}
else {
errorMessage = "Time integration did not succeed with the minumum time step size of " +
std::to_string(double(minTimeStep)) + " seconds. Giving up!";
break; // give up: we can't make the time step smaller anymore!
}
}
else if (nextDt < minTimeStep) {
nextDt = minTimeStep;
}
simulator().setTimeStepSize(nextDt);
// update failed
if (gridView().comm().rank() == 0) {
std::cout << "Newton solver did not converge with "
<< "dt=" << dt << " seconds. Retrying with time step of "
<< nextDt << " seconds\n" << std::flush;
}
}
if (errorMessage.empty()) {
errorMessage = "Newton solver didn't converge after " +
std::to_string(maxFails) + " time-step divisions. dt=" +
std::to_string(double(simulator().timeStepSize()));
}
throw std::runtime_error(errorMessage);
}
Scalar minTimeStepSize() const
{ return Parameters::Get<Parameters::MinTimeStepSize<Scalar>>(); }
unsigned maxTimeIntegrationFailures() const
{ return Parameters::Get<Parameters::MaxTimeStepDivisions>(); }
bool continueOnConvergenceError() const
{ return Parameters::Get<Parameters::ContinueOnConvergenceError>(); }
void setNextTimeStepSize(Scalar dt)
{ nextTimeStepSize_ = dt; }
Scalar nextTimeStepSize() const
{
if (nextTimeStepSize_ > 0.0) {
return nextTimeStepSize_;
}
Scalar dtNext = std::min(Parameters::Get<Parameters::MaxTimeStepSize<Scalar>>(),
newtonMethod().suggestTimeStepSize(simulator().timeStepSize()));
if (dtNext < simulator().maxTimeStepSize() &&
simulator().maxTimeStepSize() < dtNext * 2)
{
dtNext = simulator().maxTimeStepSize() / 2 * 1.01;
}
return dtNext;
}
bool shouldWriteRestartFile() const
{
return simulator().timeStepIndex() > 0 &&
(simulator().timeStepIndex() % 10 == 0);
}
bool shouldWriteOutput() const
{ return true; }
void advanceTimeLevel()
{ model().advanceTimeLevel(); }
std::string name() const
{ return "sim"; }
const GridView& gridView() const
{ return gridView_; }
const GlobalPosition& boundingBoxMin() const
{ return boundingBoxMin_; }
const GlobalPosition& boundingBoxMax() const
{ return boundingBoxMax_; }
const VertexMapper& vertexMapper() const
{ return vertexMapper_; }
const ElementMapper& elementMapper() const
{ return elementMapper_; }
Simulator& simulator()
{ return simulator_; }
const Simulator& simulator() const
{ return simulator_; }
Model& model()
{ return simulator_.model(); }
const Model& model() const
{ return simulator_.model(); }
NewtonMethod& newtonMethod()
{ return model().newtonMethod(); }
const NewtonMethod& newtonMethod() const
{ return model().newtonMethod(); }
// \}
RestrictProlongOperator restrictProlongOperator()
{
return RestrictProlongOperator();
}
unsigned markForGridAdaptation()
{
return 0;
}
template <class Restarter>
void serialize(Restarter& res)
{
if (enableVtkOutput_()) {
defaultVtkWriter_->serialize(res);
}
}
template <class Restarter>
void deserialize(Restarter& res)
{
if (enableVtkOutput_()) {
defaultVtkWriter_->deserialize(res);
}
}
void writeOutput(bool verbose = true)
{
if (!enableVtkOutput_()) {
return;
}
if (verbose && gridView().comm().rank() == 0) {
std::cout << "Writing visualization results for the current time step.\n"
<< std::flush;
}
// calculate the time _after_ the time was updated
const Scalar t = simulator().time() + simulator().timeStepSize();
defaultVtkWriter_->beginWrite(t);
model().prepareOutputFields();
model().appendOutputFields(*defaultVtkWriter_);
defaultVtkWriter_->endWrite(false);
}
VtkMultiWriter& defaultVtkWriter() const
{ return *defaultVtkWriter_; }
protected:
Scalar nextTimeStepSize_;
bool enableVtkOutput_() const
{ return Parameters::Get<Parameters::EnableVtkOutput>(); }
private:
Implementation& asImp_()
{ return *static_cast<Implementation*>(this); }
const Implementation& asImp_() const
{ return *static_cast<const Implementation*>(this); }
// Grid management stuff
const GridView gridView_;
ElementMapper elementMapper_;
VertexMapper vertexMapper_;
GlobalPosition boundingBoxMin_;
GlobalPosition boundingBoxMax_;
// Attributes required for the actual simulation
Simulator& simulator_;
std::unique_ptr<VtkMultiWriter> defaultVtkWriter_{};
};
} // namespace Opm
#endif
Opm::EmptyRestrictProlong
Definition restrictprolong.hh:142
Opm::FvBaseProblem::handlePositionalParameter
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:266
Opm::FvBaseProblem::name
std::string name() const
The problem name.
Definition fvbaseproblem.hh:654
Opm::FvBaseProblem::simulator
const Simulator & simulator() const
Returns Simulator object used by the simulation.
Definition fvbaseproblem.hh:698
Opm::FvBaseProblem::writeOutput
void writeOutput(bool verbose=true)
Write the relevant secondary variables of the current solution into an VTK output file.
Definition fvbaseproblem.hh:792
Opm::FvBaseProblem::boundary
void boundary(BoundaryRateVector &, const Context &, unsigned, unsigned) const
Evaluate the boundary conditions for a boundary segment.
Definition fvbaseproblem.hh:319
Opm::FvBaseProblem::finalize
void finalize()
Called after the simulation has been run sucessfully.
Definition fvbaseproblem.hh:457
Opm::FvBaseProblem::simulator
Simulator & simulator()
Returns Simulator object used by the simulation.
Definition fvbaseproblem.hh:692
Opm::FvBaseProblem::model
const Model & model() const
Returns numerical model used for the problem.
Definition fvbaseproblem.hh:710
Opm::FvBaseProblem::registerParameters
static void registerParameters()
Registers all available parameters for the problem and the model.
Definition fvbaseproblem.hh:167
Opm::FvBaseProblem::source
void source(RateVector &, const Context &, unsigned, unsigned) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition fvbaseproblem.hh:355
Opm::FvBaseProblem::recycleFirstIterationStorage
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:192
Opm::FvBaseProblem::maxTimeIntegrationFailures
unsigned maxTimeIntegrationFailures() const
Returns the maximum number of subsequent failures for the time integration before giving up.
Definition fvbaseproblem.hh:574
Opm::FvBaseProblem::markForGridAdaptation
unsigned markForGridAdaptation()
Mark grid cells for refinement or coarsening.
Definition fvbaseproblem.hh:742
Opm::FvBaseProblem::serialize
void serialize(Restarter &res)
This method writes the complete state of the problem to the harddisk.
Definition fvbaseproblem.hh:761
Opm::FvBaseProblem::beginIteration
void beginIteration()
Called by the simulator before each Newton-Raphson iteration.
Definition fvbaseproblem.hh:424
Opm::FvBaseProblem::intensiveQuantityHistorySize
unsigned intensiveQuantityHistorySize() const
Returns the required history size for intensive quantities cache.
Definition fvbaseproblem.hh:202
Opm::FvBaseProblem::endTimeStep
void endTimeStep()
Called by the simulator after each time integration.
Definition fvbaseproblem.hh:439
Opm::FvBaseProblem::FvBaseProblem
FvBaseProblem(Simulator &simulator)
Definition fvbaseproblem.hh:119
Opm::FvBaseProblem::boundingBoxMax
const GlobalPosition & boundingBoxMax() const
The coordinate of the corner of the GridView's bounding box with the largest values.
Definition fvbaseproblem.hh:674
Opm::FvBaseProblem::restrictProlongOperator
RestrictProlongOperator restrictProlongOperator()
return restriction and prolongation operator
Definition fvbaseproblem.hh:730
Opm::FvBaseProblem::timeIntegration
void timeIntegration()
Called by Opm::Simulator in order to do a time integration on the model.
Definition fvbaseproblem.hh:514
Opm::FvBaseProblem::model
Model & model()
Returns numerical model used for the problem.
Definition fvbaseproblem.hh:704
Opm::FvBaseProblem::endEpisode
void endEpisode()
Called when the end of an simulation episode is reached.
Definition fvbaseproblem.hh:447
Opm::FvBaseProblem::beginTimeStep
void beginTimeStep()
Called by the simulator before each time integration.
Definition fvbaseproblem.hh:418
Opm::FvBaseProblem::helpPreamble
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:229
Opm::FvBaseProblem::deserialize
void deserialize(Restarter &res)
This method restores the complete state of the problem from disk.
Definition fvbaseproblem.hh:779
Opm::FvBaseProblem::prefetch
void prefetch(const Element &) const
Allows to improve the performance by prefetching all data which is associated with a given element.
Definition fvbaseproblem.hh:291
Opm::FvBaseProblem::extrusionFactor
Scalar extrusionFactor(const Context &, unsigned, unsigned) const
Return how much the domain is extruded at a given sub-control volume.
Definition fvbaseproblem.hh:394
Opm::FvBaseProblem::shouldWriteRestartFile
bool shouldWriteRestartFile() const
Returns true if a restart file should be written to disk.
Definition fvbaseproblem.hh:622
Opm::FvBaseProblem::nextTimeStepSize
Scalar nextTimeStepSize() const
Called by Opm::Simulator whenever a solution for a time step has been computed and the simulation tim...
Definition fvbaseproblem.hh:596
Opm::FvBaseProblem::minTimeStepSize
Scalar minTimeStepSize() const
Returns the minimum allowable size of a time step.
Definition fvbaseproblem.hh:567
Opm::FvBaseProblem::beginEpisode
void beginEpisode()
Called at the beginning of an simulation episode.
Definition fvbaseproblem.hh:412
Opm::FvBaseProblem::initial
void initial(PrimaryVariables &, const Context &, unsigned, unsigned) const
Evaluate the initial value for a control volume.
Definition fvbaseproblem.hh:372
Opm::FvBaseProblem::outputDir
std::string outputDir() const
Determine the directory for simulation output.
Definition fvbaseproblem.hh:218
Opm::FvBaseProblem::vertexMapper
const VertexMapper & vertexMapper() const
Returns the mapper for vertices to indices.
Definition fvbaseproblem.hh:680
Opm::FvBaseProblem::gridChanged
void gridChanged()
Handle changes of the grid.
Definition fvbaseproblem.hh:299
Opm::FvBaseProblem::boundingBoxMin
const GlobalPosition & boundingBoxMin() const
The coordinate of the corner of the GridView's bounding box with the smallest values.
Definition fvbaseproblem.hh:667
Opm::FvBaseProblem::briefDescription
static std::string briefDescription()
Returns a human readable description of the problem for the help message.
Definition fvbaseproblem.hh:245
Opm::FvBaseProblem::endIteration
void endIteration()
Called by the simulator after each Newton-Raphson update.
Definition fvbaseproblem.hh:430
Opm::FvBaseProblem::setNextTimeStepSize
void setNextTimeStepSize(Scalar dt)
Impose the next time step size to be used externally.
Definition fvbaseproblem.hh:588
Opm::FvBaseProblem::continueOnConvergenceError
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:582
Opm::FvBaseProblem::constraints
void constraints(Constraints &, const Context &, unsigned, unsigned) const
Evaluate the constraints for a control volume.
Definition fvbaseproblem.hh:336
Opm::FvBaseProblem::finishInit
void finishInit()
Called by the Opm::Simulator in order to initialize the problem.
Definition fvbaseproblem.hh:284
Opm::FvBaseProblem::newtonMethod
const NewtonMethod & newtonMethod() const
Returns object which implements the Newton method.
Definition fvbaseproblem.hh:722
Opm::FvBaseProblem::gridView
const GridView & gridView() const
The GridView which used by the problem.
Definition fvbaseproblem.hh:660
Opm::FvBaseProblem::newtonMethod
NewtonMethod & newtonMethod()
Returns object which implements the Newton method.
Definition fvbaseproblem.hh:716
Opm::FvBaseProblem::shouldWriteOutput
bool shouldWriteOutput() const
Returns true if the current solution should be written to disk (i.e.
Definition fvbaseproblem.hh:636
Opm::FvBaseProblem::initialSolutionApplied
void initialSolutionApplied()
Callback used by the model to indicate that the initial solution has been determined for all degrees ...
Definition fvbaseproblem.hh:406
Opm::FvBaseProblem::advanceTimeLevel
void advanceTimeLevel()
Called by the simulator after everything which can be done about the current time step is finished an...
Definition fvbaseproblem.hh:644
Opm::FvBaseProblem::defaultVtkWriter
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:816
Opm::FvBaseProblem::elementMapper
const ElementMapper & elementMapper() const
Returns the mapper for elements to indices.
Definition fvbaseproblem.hh:686
Opm::ThreadManager::maxThreads
static unsigned maxThreads()
Return the maximum number of threads of the current process.
Definition threadmanager.hpp:66
Opm::VtkMultiWriter
Simplifies writing multi-file VTK datasets.
Definition vtkmultiwriter.hh:65
fvbaseparameters.hh
Declare the properties used by the infrastructure code of the finite volume discretizations.
fvbaseproperties.hh
Declare the properties used by the infrastructure code of the finite volume discretizations.
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
Opm::GetPropType
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
Opm::humanReadableTime
std::string humanReadableTime(double timeInSeconds, bool isAmendment)
Given a time step size in seconds, return it in a format which is more easily parsable by humans.
Definition simulatorutils.cpp:45
Opm::simulatorOutputDir
std::string simulatorOutputDir()
Determine and check the configured directory for simulation output.
Definition simulatorutils.cpp:119
Opm::getPropValue
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
Opm::Parameters::Register
void Register(const char *usageString)
Register a run-time parameter.
Definition parametersystem.hpp:292
Opm::Parameters::Get
auto Get(bool errorIfNotRegistered=true)
Retrieve a runtime parameter.
Definition parametersystem.hpp:187
restart.hpp
Load or save a state of a problem to/from the harddisk.
Opm::Parameters::MaxTimeStepSize
Specify the maximum size of a time integration [s].
Definition fvbaseparameters.hh:106
Opm::Properties::NewtonMethod
Specifies the type of the actual Newton method.
Definition newtonmethodproperties.hh:32
vtkmultiwriter.hh
Simplifies writing multi-file VTK datasets.