24#ifndef EWOMS_UNSTRUCTURED_GRID_VANGUARD_HH
25#define EWOMS_UNSTRUCTURED_GRID_VANGUARD_HH
27#include <dune/grid/io/file/dgfparser/gridptr.hh>
34#include <opm/grid/UnstructuredGrid.h>
44template <
class TypeTag>
52 using GridPointer = Dune::GridPtr<Grid>;
60 Parameters::Register<Parameters::GridGlobalRefinements>
61 (
"The number of global refinements of the grid "
62 "executed after it was loaded");
63 Parameters::Register<Parameters::GridFile>
64 (
"The file name of the file to load");
74 const std::string
gridFileName = Parameters::Get<Parameters::GridFile>();
75 const int numRefinments = Parameters::Get<Parameters::GridGlobalRefinements>();
78 if (
ugrid ==
nullptr) {
79 throw std::runtime_error(
"RuntimeError: UnstructuredGridVanguard could not read grid file: " +
80 gridFileName +
". Are you sure the filename is correct?");
82 ugPtr_.reset(std::move(
ugrid));
84 gridPtr_ =
new Grid(*ugPtr_);
88 this->finalizeInit_();
103 {
return *gridPtr_; }
106 GridPointer gridPtr_;
107 typename Grid::UnstructuredGridPtr ugPtr_;
Provides the base class for most (all?) simulator vanguards.
Provides the base class for most (all?) simulator vanguards.
Definition basevanguard.hh:50
Provides a simulator vanguard which creates a grid by parsing an unstructured grid file.
Definition unstructuredgridvanguard.hh:46
static void registerParameters()
Register all run-time parameters for the unstructured grid simulator vanguard.
Definition unstructuredgridvanguard.hh:59
const Grid & grid() const
Return a constant reference to the grid object.
Definition unstructuredgridvanguard.hh:102
UnstructuredGridVanguard(Simulator &simulator)
Load the grid from the file.
Definition unstructuredgridvanguard.hh:70
Grid & grid()
Return a reference to the grid object.
Definition unstructuredgridvanguard.hh:95
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
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
This file provides the infrastructure to retrieve run-time parameters.
The Opm property system, traits with inheritance.