24#ifndef EWOMS_UNSTRUCTURED_GRID_VANGUARD_HH
25#define EWOMS_UNSTRUCTURED_GRID_VANGUARD_HH
28#include <opm/models/utils/parametersystem.hh>
32#include "opm/grid/UnstructuredGrid.h"
40template <
class TypeTag>
47 using GridPointer = Dune::GridPtr< Grid >;
55 Parameters::Register<Parameters::GridGlobalRefinements>
56 (
"The number of global refinements of the grid "
57 "executed after it was loaded");
58 Parameters::Register<Parameters::GridFile>,
59 (
"The file name of the file to load");
67 const std::string
gridFileName = Parameters::Get<Parameters::GridFile>();
68 unsigned numRefinments = Parameters::Get<Parameters::GridGlobalRefinements>();
73 if (
grid ==
nullptr) {
75 "RuntimeError: UnstructuredGridVanguard could not read grid file: " +
76 gridFileName +
". Are you sure the filename is correct?";
77 throw std::runtime_error(
msg);
79 ugPtr_.reset(std::move(
grid ));
81 gridPtr_ =
new Grid(*ugPtr_);
85 this->finalizeInit_();
92 Grid&
grid() {
return *gridPtr_; }
98 const Grid&
grid()
const {
return *gridPtr_; }
101 GridPointer gridPtr_;
102 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:49
Provides a simulator vanguard which creates a grid by parsing an unstructured grid file.
Definition unstructuredgridvanguard.hh:41
static void registerParameters()
Register all run-time parameters for the unstructured grid simulator vanguard.
Definition unstructuredgridvanguard.hh:54
const Grid & grid() const
Return a constant reference to the grid object.
Definition unstructuredgridvanguard.hh:98
UnstructuredGridVanguard(Simulator &simulator)
Load the grid from the file.
Definition unstructuredgridvanguard.hh:65
Grid & grid()
Return a reference to the grid object.
Definition unstructuredgridvanguard.hh:92
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
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
The Opm property system, traits with inheritance.