mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move GridGlobalRefinements to TypeTag-free parameter system
This commit is contained in:
parent
b424c380fa
commit
b4f3e65740
@ -67,7 +67,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
static void registerParameters()
|
static void registerParameters()
|
||||||
{
|
{
|
||||||
Parameters::registerParam<TypeTag, Parameters::GridGlobalRefinements>
|
Parameters::Register<Parameters::GridGlobalRefinements>
|
||||||
("The number of global refinements of the grid "
|
("The number of global refinements of the grid "
|
||||||
"executed after it was loaded");
|
"executed after it was loaded");
|
||||||
Parameters::registerParam<TypeTag, Parameters::DomainSizeX>
|
Parameters::registerParam<TypeTag, Parameters::DomainSizeX>
|
||||||
@ -112,7 +112,7 @@ public:
|
|||||||
cellRes[2] = Parameters::get<TypeTag, Parameters::CellsZ>();
|
cellRes[2] = Parameters::get<TypeTag, Parameters::CellsZ>();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned numRefinements = Parameters::get<TypeTag, Parameters::GridGlobalRefinements>();
|
unsigned numRefinements = Parameters::Get<Parameters::GridGlobalRefinements>();
|
||||||
cubeGrid_ = Dune::StructuredGridFactory<Grid>::createCubeGrid(lowerLeft, upperRight, cellRes);
|
cubeGrid_ = Dune::StructuredGridFactory<Grid>::createCubeGrid(lowerLeft, upperRight, cellRes);
|
||||||
cubeGrid_->globalRefine(static_cast<int>(numRefinements));
|
cubeGrid_->globalRefine(static_cast<int>(numRefinements));
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public:
|
|||||||
{
|
{
|
||||||
Parameters::registerParam<TypeTag, Parameters::GridFile>
|
Parameters::registerParam<TypeTag, Parameters::GridFile>
|
||||||
("The file name of the DGF file to load");
|
("The file name of the DGF file to load");
|
||||||
Parameters::registerParam<TypeTag, Parameters::GridGlobalRefinements>
|
Parameters::Register<Parameters::GridGlobalRefinements>
|
||||||
("The number of global refinements of the grid "
|
("The number of global refinements of the grid "
|
||||||
"executed after it was loaded");
|
"executed after it was loaded");
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ public:
|
|||||||
: ParentType(simulator)
|
: ParentType(simulator)
|
||||||
{
|
{
|
||||||
const std::string dgfFileName = Parameters::get<TypeTag, Parameters::GridFile>();
|
const std::string dgfFileName = Parameters::get<TypeTag, Parameters::GridFile>();
|
||||||
unsigned numRefinments = Parameters::get<TypeTag, Parameters::GridGlobalRefinements>();
|
unsigned numRefinments = Parameters::Get<Parameters::GridGlobalRefinements>();
|
||||||
|
|
||||||
{
|
{
|
||||||
// create DGF GridPtr from a dgf file
|
// create DGF GridPtr from a dgf file
|
||||||
|
@ -62,7 +62,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
static void registerParameters()
|
static void registerParameters()
|
||||||
{
|
{
|
||||||
Parameters::registerParam<TypeTag, Parameters::GridGlobalRefinements>
|
Parameters::Register<Parameters::GridGlobalRefinements>
|
||||||
("The number of global refinements of the grid "
|
("The number of global refinements of the grid "
|
||||||
"executed after it was loaded");
|
"executed after it was loaded");
|
||||||
Parameters::registerParam<TypeTag, Parameters::DomainSizeX>
|
Parameters::registerParam<TypeTag, Parameters::DomainSizeX>
|
||||||
@ -111,7 +111,7 @@ public:
|
|||||||
upperRight,
|
upperRight,
|
||||||
cellRes);
|
cellRes);
|
||||||
|
|
||||||
unsigned numRefinments = Parameters::get<TypeTag, Parameters::GridGlobalRefinements>();
|
unsigned numRefinments = Parameters::Get<Parameters::GridGlobalRefinements>();
|
||||||
simplexGrid_->globalRefine(numRefinments);
|
simplexGrid_->globalRefine(numRefinments);
|
||||||
|
|
||||||
this->finalizeInit_();
|
this->finalizeInit_();
|
||||||
|
@ -108,7 +108,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
static void registerParameters()
|
static void registerParameters()
|
||||||
{
|
{
|
||||||
Parameters::registerParam<TypeTag, Parameters::GridGlobalRefinements>
|
Parameters::Register<Parameters::GridGlobalRefinements>
|
||||||
("The number of global refinements of the grid "
|
("The number of global refinements of the grid "
|
||||||
"executed after it was loaded");
|
"executed after it was loaded");
|
||||||
Parameters::registerParam<TypeTag, Parameters::DomainSizeX>
|
Parameters::registerParam<TypeTag, Parameters::DomainSizeX>
|
||||||
@ -167,7 +167,7 @@ public:
|
|||||||
// use DGF parser to create a grid from interval block
|
// use DGF parser to create a grid from interval block
|
||||||
gridPtr_.reset( Dune::GridPtr< Grid >( dgffile ).release() );
|
gridPtr_.reset( Dune::GridPtr< Grid >( dgffile ).release() );
|
||||||
|
|
||||||
unsigned numRefinements = Parameters::get<TypeTag, Parameters::GridGlobalRefinements>();
|
unsigned numRefinements = Parameters::Get<Parameters::GridGlobalRefinements>();
|
||||||
gridPtr_->globalRefine(static_cast<int>(numRefinements));
|
gridPtr_->globalRefine(static_cast<int>(numRefinements));
|
||||||
|
|
||||||
this->finalizeInit_();
|
this->finalizeInit_();
|
||||||
|
@ -52,7 +52,7 @@ class UnstructuredGridVanguard : public BaseVanguard<TypeTag> {
|
|||||||
* unstructured grid simulator vanguard.
|
* unstructured grid simulator vanguard.
|
||||||
*/
|
*/
|
||||||
static void registerParameters() {
|
static void registerParameters() {
|
||||||
Parameters::registerParam<TypeTag, Parameters::GridGlobalRefinements>
|
Parameters::Register<Parameters::GridGlobalRefinements>
|
||||||
("The number of global refinements of the grid "
|
("The number of global refinements of the grid "
|
||||||
"executed after it was loaded");
|
"executed after it was loaded");
|
||||||
Parameters::registerParam<TypeTag, Parameters::GridFile>,
|
Parameters::registerParam<TypeTag, Parameters::GridFile>,
|
||||||
@ -65,7 +65,7 @@ class UnstructuredGridVanguard : public BaseVanguard<TypeTag> {
|
|||||||
UnstructuredGridVanguard(Simulator& simulator) : ParentType(simulator){
|
UnstructuredGridVanguard(Simulator& simulator) : ParentType(simulator){
|
||||||
#ifdef HAVE_OPM_GRID
|
#ifdef HAVE_OPM_GRID
|
||||||
const std::string gridFileName = Parameters::get<TypeTag, Parameters::GridFile>();
|
const std::string gridFileName = Parameters::get<TypeTag, Parameters::GridFile>();
|
||||||
unsigned numRefinments = Parameters::get<TypeTag, Parameters::GridGlobalRefinements>();
|
unsigned numRefinments = Parameters::Get<Parameters::GridGlobalRefinements>();
|
||||||
|
|
||||||
const char* c_str = gridFileName.c_str();
|
const char* c_str = gridFileName.c_str();
|
||||||
|
|
||||||
|
@ -62,8 +62,7 @@ struct GridFile { using type = Properties::UndefinedProperty; };
|
|||||||
|
|
||||||
//! Property which tells the Vanguard how often the grid should be refined
|
//! Property which tells the Vanguard how often the grid should be refined
|
||||||
//! after creation.
|
//! after creation.
|
||||||
template<class TypeTag, class MyTypeTag>
|
struct GridGlobalRefinements { static constexpr unsigned value = 0; };
|
||||||
struct GridGlobalRefinements { using type = Properties::UndefinedProperty; };
|
|
||||||
|
|
||||||
//! The default value for the simulation's initial time step size
|
//! The default value for the simulation's initial time step size
|
||||||
template<class TypeTag, class MyTypeTag>
|
template<class TypeTag, class MyTypeTag>
|
||||||
|
@ -192,12 +192,6 @@ template<class TypeTag>
|
|||||||
struct GridFile<TypeTag, Properties::TTag::NumericModel>
|
struct GridFile<TypeTag, Properties::TTag::NumericModel>
|
||||||
{ static constexpr auto value = ""; };
|
{ static constexpr auto value = ""; };
|
||||||
|
|
||||||
//! Set the number of refinement levels of the grid to 0. This does not belong
|
|
||||||
//! here, strictly speaking.
|
|
||||||
template<class TypeTag>
|
|
||||||
struct GridGlobalRefinements<TypeTag, Properties::TTag::NumericModel>
|
|
||||||
{ static constexpr unsigned value = 0; };
|
|
||||||
|
|
||||||
//! The default value for the simulation's initial time step size
|
//! The default value for the simulation's initial time step size
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct InitialTimeStepSize<TypeTag, Properties::TTag::NumericModel>
|
struct InitialTimeStepSize<TypeTag, Properties::TTag::NumericModel>
|
||||||
|
Loading…
Reference in New Issue
Block a user