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>
47 using ParentType = BaseVanguard<TypeTag>;
52 using GridPointer = Dune::GridPtr<Grid>;
61 (
"The number of global refinements of the grid "
62 "executed after it was loaded");
64 (
"The file name of the file to load");
71 : ParentType(simulator)
77 UnstructuredGrid* ugrid = read_grid(gridFileName.c_str());
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_);
85 if (numRefinments > 0) {
86 gridPtr_->globalRefine(numRefinments);
88 this->finalizeInit_();
103 {
return *gridPtr_; }
106 GridPointer gridPtr_;
107 typename Grid::UnstructuredGridPtr ugPtr_;
Provides the base class for most (all?) simulator vanguards.
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
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.
void Register(const char *usageString)
Register a run-time parameter.
Definition parametersystem.hpp:292
auto Get(bool errorIfNotRegistered=true)
Retrieve a runtime parameter.
Definition parametersystem.hpp:187
The Opm property system, traits with inheritance.