From 2f4b835a16f62d3dd3e0226aee98d105e47b3b19 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Thu, 1 Feb 2018 16:26:58 +0100 Subject: [PATCH 1/2] rename the "grid manager" to "vanguard" IMO the term "vanguard" expresses better what these classes are supposed to do: level the ground for the cavalry. Normally this simply means to create and distribute a grid object, but it can become quite a bit more complicated, as exemplified by the vanguard classes of ebos.. --- examples/problems/diffusionproblem.hh | 6 +-- examples/problems/fingerproblem.hh | 6 +-- examples/problems/fractureproblem.hh | 8 +-- examples/problems/lensproblem.hh | 4 +- examples/problems/powerinjectionproblem.hh | 8 +-- examples/tutorial1problem.hh | 4 +- tests/test_equil.cc | 58 +++++++++++----------- 7 files changed, 47 insertions(+), 47 deletions(-) diff --git a/examples/problems/diffusionproblem.hh b/examples/problems/diffusionproblem.hh index d22083745..20945ade4 100644 --- a/examples/problems/diffusionproblem.hh +++ b/examples/problems/diffusionproblem.hh @@ -30,7 +30,7 @@ #include -#include +#include #include #include @@ -60,8 +60,8 @@ NEW_TYPE_TAG(DiffusionBaseProblem); // Set the grid implementation to be used SET_TYPE_PROP(DiffusionBaseProblem, Grid, Dune::YaspGrid); -// set the GridManager property -SET_TYPE_PROP(DiffusionBaseProblem, GridManager, Ewoms::CubeGridManager); +// set the Vanguard property +SET_TYPE_PROP(DiffusionBaseProblem, Vanguard, Ewoms::CubeGridVanguard); // Set the problem property SET_TYPE_PROP(DiffusionBaseProblem, Problem, Ewoms::DiffusionProblem); diff --git a/examples/problems/fingerproblem.hh b/examples/problems/fingerproblem.hh index 2514060d0..372f1d3ca 100644 --- a/examples/problems/fingerproblem.hh +++ b/examples/problems/fingerproblem.hh @@ -28,7 +28,7 @@ #ifndef EWOMS_FINGER_PROBLEM_HH #define EWOMS_FINGER_PROBLEM_HH -#include +#include #include #include @@ -61,7 +61,7 @@ template class FingerProblem; namespace Properties { -NEW_TYPE_TAG(FingerBaseProblem, INHERITS_FROM(StructuredGridManager)); +NEW_TYPE_TAG(FingerBaseProblem, INHERITS_FROM(StructuredGridVanguard)); #if HAVE_DUNE_ALUGRID // use dune-alugrid if available @@ -219,7 +219,7 @@ public: */ FingerProblem(Simulator& simulator) : ParentType(simulator), - materialParams_( simulator.gridManager().grid(), codim ) + materialParams_( simulator.vanguard().grid(), codim ) { } diff --git a/examples/problems/fractureproblem.hh b/examples/problems/fractureproblem.hh index 75cd16352..4e3b27c88 100644 --- a/examples/problems/fractureproblem.hh +++ b/examples/problems/fractureproblem.hh @@ -38,7 +38,7 @@ #endif #include -#include +#include #include #include @@ -75,8 +75,8 @@ SET_TYPE_PROP( FractureProblem, Grid, Dune::ALUGrid); -// Set the GridManager property -SET_TYPE_PROP(FractureProblem, GridManager, Ewoms::DgfGridManager); +// Set the Vanguard property +SET_TYPE_PROP(FractureProblem, Vanguard, Ewoms::DgfVanguard); // Set the problem property SET_TYPE_PROP(FractureProblem, Problem, Ewoms::FractureProblem); @@ -398,7 +398,7 @@ public: * \brief Returns the object representating the fracture topology. */ const FractureMapper& fractureMapper() const - { return this->simulator().gridManager().fractureMapper(); } + { return this->simulator().vanguard().fractureMapper(); } /*! * \brief Returns the width of the fracture. diff --git a/examples/problems/lensproblem.hh b/examples/problems/lensproblem.hh index 99c96ea00..a6eb6dd6e 100644 --- a/examples/problems/lensproblem.hh +++ b/examples/problems/lensproblem.hh @@ -28,7 +28,7 @@ #ifndef EWOMS_LENS_PROBLEM_HH #define EWOMS_LENS_PROBLEM_HH -#include +#include #include #include @@ -55,7 +55,7 @@ template class LensProblem; namespace Properties { -NEW_TYPE_TAG(LensBaseProblem, INHERITS_FROM(StructuredGridManager)); +NEW_TYPE_TAG(LensBaseProblem, INHERITS_FROM(StructuredGridVanguard)); // declare the properties specific for the lens problem NEW_PROP_TAG(LensLowerLeftX); diff --git a/examples/problems/powerinjectionproblem.hh b/examples/problems/powerinjectionproblem.hh index 87175aed3..ea156c54b 100644 --- a/examples/problems/powerinjectionproblem.hh +++ b/examples/problems/powerinjectionproblem.hh @@ -29,7 +29,7 @@ #define EWOMS_POWER_INJECTION_PROBLEM_HH #include -#include +#include #include #include @@ -64,9 +64,9 @@ NEW_TYPE_TAG(PowerInjectionBaseProblem); // Set the grid implementation to be used SET_TYPE_PROP(PowerInjectionBaseProblem, Grid, Dune::YaspGrid); -// set the GridManager property -SET_TYPE_PROP(PowerInjectionBaseProblem, GridManager, - Ewoms::CubeGridManager); +// set the Vanguard property +SET_TYPE_PROP(PowerInjectionBaseProblem, Vanguard, + Ewoms::CubeGridVanguard); // Set the problem property SET_TYPE_PROP(PowerInjectionBaseProblem, Problem, diff --git a/examples/tutorial1problem.hh b/examples/tutorial1problem.hh index e76e1e67c..2c40e8ba8 100644 --- a/examples/tutorial1problem.hh +++ b/examples/tutorial1problem.hh @@ -45,7 +45,7 @@ // For the DUNE grid #include /*@\label{tutorial1:include-grid-manager}@*/ -#include /*@\label{tutorial1:include-grid-manager}@*/ +#include /*@\label{tutorial1:include-grid-manager}@*/ // For Dune::FieldMatrix #include @@ -72,7 +72,7 @@ SET_TYPE_PROP(Tutorial1Problem, Problem, // Set grid and the grid manager to be used SET_TYPE_PROP(Tutorial1Problem, Grid, Dune::YaspGrid); /*@\label{tutorial1:set-grid}@*/ -SET_TYPE_PROP(Tutorial1Problem, GridManager, Ewoms::CubeGridManager); /*@\label{tutorial1:set-grid-manager}@*/ +SET_TYPE_PROP(Tutorial1Problem, Vanguard, Ewoms::CubeGridVanguard); /*@\label{tutorial1:set-grid-manager}@*/ // Set the wetting phase /*@\label{tutorial1:2p-system-start}@*/ SET_TYPE_PROP(Tutorial1Problem, diff --git a/tests/test_equil.cc b/tests/test_equil.cc index 8de0a3a69..a30c38b2c 100644 --- a/tests/test_equil.cc +++ b/tests/test_equil.cc @@ -231,13 +231,13 @@ void test_PhasePressure() std::make_shared(), 0); - std::vector cells(simulator->gridManager().grid().size(0)); + std::vector cells(simulator->vanguard().grid().size(0)); std::iota(cells.begin(), cells.end(), 0); const double grav = 10; - const PPress ppress = Ewoms::EQUIL::phasePressures(simulator->gridManager().grid(), region, cells, grav); + const PPress ppress = Ewoms::EQUIL::phasePressures(simulator->vanguard().grid(), region, cells, grav); - const int first = 0, last = simulator->gridManager().grid().size(0) - 1; + const int first = 0, last = simulator->vanguard().grid().size(0) - 1; const double reltol = 1.0e-8; CHECK_CLOSE(ppress[0][first] , 90e3 , reltol); CHECK_CLOSE(ppress[0][last ] , 180e3 , reltol); @@ -253,7 +253,7 @@ void test_CellSubset() typedef TTAG(TestEquilTypeTag) TypeTag; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; auto simulator = initSimulator("data/equil_base.DATA"); - const auto& eclipseState = simulator->gridManager().eclState(); + const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); initDefaultFluidSystem(); @@ -289,7 +289,7 @@ void test_CellSubset() for (std::size_t d = 1; d < 3; ++d) { ncoarse *= cdim[d]; } std::vector< std::vector > cells(ncoarse); - for (int c = 0; c < simulator->gridManager().grid().size(0); ++c) { + for (int c = 0; c < simulator->vanguard().grid().size(0); ++c) { int ci = c; const int i = ci % grid.cartdims[0]; ci /= grid.cartdims[0]; const int j = ci % grid.cartdims[1]; @@ -304,7 +304,7 @@ void test_CellSubset() cells[ix].push_back(c); } - PPress ppress(2, PVal(simulator->gridManager().grid().size(0), 0)); + PPress ppress(2, PVal(simulator->vanguard().grid().size(0), 0)); for (std::vector< std::vector >::const_iterator r = cells.begin(), e = cells.end(); r != e; ++r) @@ -312,7 +312,7 @@ void test_CellSubset() const int rno = int(r - cells.begin()); const double grav = 10; const PPress p = - Ewoms::EQUIL::phasePressures(simulator->gridManager().grid(), region[rno], *r, grav); + Ewoms::EQUIL::phasePressures(simulator->vanguard().grid(), region[rno], *r, grav); PVal::size_type i = 0; for (std::vector::const_iterator @@ -326,7 +326,7 @@ void test_CellSubset() } } - const int first = 0, last = simulator->gridManager().grid().size(0) - 1; + const int first = 0, last = simulator->vanguard().grid().size(0) - 1; const double reltol = 1.0e-8; CHECK_CLOSE(ppress[0][first] , 105e3 , reltol); CHECK_CLOSE(ppress[0][last ] , 195e3 , reltol); @@ -370,7 +370,7 @@ void test_RegMapping() 0) }; - std::vector eqlnum(simulator->gridManager().grid().size(0)); + std::vector eqlnum(simulator->vanguard().grid().size(0)); // [ 0 1; 2 3] { for (int i = 0; i < 5; ++i) { @@ -393,14 +393,14 @@ void test_RegMapping() Ewoms::RegionMapping<> eqlmap(eqlnum); - PPress ppress(2, PVal(simulator->gridManager().grid().size(0), 0)); + PPress ppress(2, PVal(simulator->vanguard().grid().size(0), 0)); for (const auto& r : eqlmap.activeRegions()) { const auto& rng = eqlmap.cells(r); const int rno = r; const double grav = 10; const PPress p = - Ewoms::EQUIL::phasePressures(simulator->gridManager().grid(), region[rno], rng, grav); + Ewoms::EQUIL::phasePressures(simulator->vanguard().grid(), region[rno], rng, grav); PVal::size_type i = 0; for (const auto& c : rng) { @@ -413,7 +413,7 @@ void test_RegMapping() } } - const int first = 0, last = simulator->gridManager().grid().size(0) - 1; + const int first = 0, last = simulator->vanguard().grid().size(0) - 1; const double reltol = 1.0e-8; CHECK_CLOSE(ppress[0][first] , 105e3 , reltol); CHECK_CLOSE(ppress[0][last ] , 195e3 , reltol); @@ -425,11 +425,11 @@ void test_DeckAllDead() { typedef TTAG(TestEquilTypeTag) TypeTag; auto simulator = initSimulator("data/equil_deadfluids.DATA"); - const auto& eclipseState = simulator->gridManager().eclState(); + const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 10.0); + Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 10.0); const auto& pressures = comp.press(); REQUIRE(pressures.size() == 3); REQUIRE(int(pressures[0].size()) == grid.number_of_cells); @@ -500,11 +500,11 @@ void test_DeckWithCapillary() { typedef typename TTAG(TestEquilTypeTag) TypeTag; auto simulator = initSimulator("data/equil_capillary.DATA"); - auto& eclipseState = simulator->gridManager().eclState(); + auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 10.0); + Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 10.0); const auto& pressures = comp.press(); REQUIRE(pressures.size() == 3); @@ -538,11 +538,11 @@ void test_DeckWithCapillaryOverlap() { typedef typename TTAG(TestEquilTypeTag) TypeTag; auto simulator = initSimulator("data/equil_capillary_overlap.DATA"); - const auto& eclipseState = simulator->gridManager().eclState(); + const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665); + Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665); const auto& pressures = comp.press(); REQUIRE(pressures.size() == 3); REQUIRE(int(pressures[0].size()) == grid.number_of_cells); @@ -597,12 +597,12 @@ void test_DeckWithLiveOil() { typedef typename TTAG(TestEquilTypeTag) TypeTag; auto simulator = initSimulator("data/equil_liveoil.DATA"); - const auto& eclipseState = simulator->gridManager().eclState(); + const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); // Initialize the fluid system - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665); + Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665); const auto& pressures = comp.press(); REQUIRE(pressures.size() == 3); REQUIRE(int(pressures[0].size()) == grid.number_of_cells); @@ -674,11 +674,11 @@ void test_DeckWithLiveGas() { typedef typename TTAG(TestEquilTypeTag) TypeTag; auto simulator = initSimulator("data/equil_livegas.DATA"); - const auto& eclipseState = simulator->gridManager().eclState(); + const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665); + Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665); const auto& pressures = comp.press(); REQUIRE(pressures.size() == 3); REQUIRE(int(pressures[0].size()) == grid.number_of_cells); @@ -754,11 +754,11 @@ void test_DeckWithRSVDAndRVVD() { typedef typename TTAG(TestEquilTypeTag) TypeTag; auto simulator = initSimulator("data/equil_rsvd_and_rvvd.DATA"); - const auto& eclipseState = simulator->gridManager().eclState(); + const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665); + Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665); const auto& pressures = comp.press(); REQUIRE(pressures.size() == 3); REQUIRE(int(pressures[0].size()) == grid.number_of_cells); @@ -854,11 +854,11 @@ void test_DeckWithPBVDAndPDVD() { typedef typename TTAG(TestEquilTypeTag) TypeTag; auto simulator = initSimulator("data/equil_pbvd_and_pdvd.DATA"); - const auto& eclipseState = simulator->gridManager().eclState(); + const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665); + Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665); const auto& pressures = comp.press(); REQUIRE(pressures.size() == 3); REQUIRE(int(pressures[0].size()) == grid.number_of_cells); @@ -945,7 +945,7 @@ void test_DeckWithSwatinit() #if 0 typedef typename TTAG(TestEquilTypeTag) TypeTag; auto simulator = initSimulator("data/equil_capillary_swatinit.DATA"); - const auto& eclipseState = simulator->gridManager().eclState(); + const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); @@ -1029,9 +1029,9 @@ void test_DeckWithSwatinit() // compute the initial state // apply swatinit - Ewoms::EQUIL::DeckDependent::InitialStateComputer compScaled(materialLawManagerScaled, eclipseState, simulator->gridManager().grid(), 9.81, true); + Ewoms::EQUIL::DeckDependent::InitialStateComputer compScaled(materialLawManagerScaled, eclipseState, simulator->vanguard().grid(), 9.81, true); // don't apply swatinit - Ewoms::EQUIL::DeckDependent::InitialStateComputer compUnscaled(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.81, false); + Ewoms::EQUIL::DeckDependent::InitialStateComputer compUnscaled(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.81, false); // compute pc std::vector pc_scaled(numCells * FluidSystem::numPhases); From 7afb963fdd053ca9c697e3826345ed5abd7b81b1 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Thu, 8 Feb 2018 17:07:32 +0100 Subject: [PATCH 2/2] change gridManager -> vanguard in new file test_ecl_output.cpp --- tests/test_ecl_output.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_ecl_output.cpp b/tests/test_ecl_output.cpp index b6e65b877..ba6117800 100644 --- a/tests/test_ecl_output.cpp +++ b/tests/test_ecl_output.cpp @@ -115,10 +115,10 @@ void test_summary() const std::string casename = "summary_deck_non_constant_porosity"; auto simulator = initSimulator(filename.data()); - typedef typename GET_PROP_TYPE(TypeTag, GridManager) GridManager; + typedef typename GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - typedef Ewoms::CollectDataToIORank< GridManager > CollectDataToIORankType; - CollectDataToIORankType collectToIORank(simulator->gridManager()); + typedef Ewoms::CollectDataToIORank< Vanguard > CollectDataToIORankType; + CollectDataToIORankType collectToIORank(simulator->vanguard()); Ewoms::EclOutputBlackOilModule eclOutputModule(*simulator, collectToIORank); typedef Ewoms::EclWriter EclWriterType;