From ae537f536d4539036bb4743e9307c16e88d7d66b Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 5 May 2021 09:50:05 +0200 Subject: [PATCH] fixed: do not use Opm:: prefix when inside namespace Opm --- .../blackoil/blackoilboundaryratevector.hh | 18 ++--- opm/models/blackoil/blackoilbrinemodules.hh | 14 ++-- .../blackoil/blackoildiffusionmodule.hh | 9 +-- opm/models/blackoil/blackoilenergymodules.hh | 40 +++++------ opm/models/blackoil/blackoilextbomodules.hh | 24 +++---- .../blackoil/blackoilextensivequantities.hh | 2 +- opm/models/blackoil/blackoilfoammodules.hh | 24 +++---- .../blackoil/blackoilintensivequantities.hh | 42 ++++++------ opm/models/blackoil/blackoillocalresidual.hh | 12 ++-- opm/models/blackoil/blackoilmodel.hh | 50 +++++++------- opm/models/blackoil/blackoilnewtonmethod.hh | 8 +-- opm/models/blackoil/blackoilpolymermodules.hh | 66 +++++++++---------- .../blackoil/blackoilprimaryvariables.hh | 52 +++++++-------- opm/models/blackoil/blackoilratevector.hh | 4 +- opm/models/blackoil/blackoilsolventmodules.hh | 48 +++++++------- opm/models/common/darcyfluxmodule.hh | 52 +++++++-------- opm/models/common/forchheimerfluxmodule.hh | 36 +++++----- .../multiphasebaseextensivequantities.hh | 4 +- opm/models/common/multiphasebasemodel.hh | 20 +++--- opm/models/common/multiphasebaseproblem.hh | 6 +- opm/models/common/quantitycallbacks.hh | 52 +++++++-------- .../common/fvbaseadlocallinearizer.hh | 6 +- .../common/fvbasediscretization.hh | 58 ++++++++-------- .../common/fvbaseelementcontext.hh | 8 +-- .../common/fvbaseextensivequantities.hh | 4 +- .../common/fvbasefdlocallinearizer.hh | 8 +-- .../common/fvbasegradientcalculator.hh | 22 +++---- .../discretization/common/fvbaselinearizer.hh | 6 +- .../common/fvbaselocalresidual.hh | 66 +++++++++---------- .../common/fvbasenewtonconvergencewriter.hh | 2 +- .../common/fvbasenewtonmethod.hh | 9 ++- .../common/fvbaseprimaryvariables.hh | 6 +- .../discretization/common/fvbaseproblem.hh | 2 +- .../vcfv/p1fegradientcalculator.hh | 6 +- .../discretization/vcfv/vcfvdiscretization.hh | 12 ++-- opm/models/discretization/vcfv/vcfvstencil.hh | 14 ++-- opm/models/io/vtkblackoilenergymodule.hh | 10 +-- opm/models/io/vtkblackoilmodule.hh | 12 ++-- opm/models/io/vtkblackoilpolymermodule.hh | 14 ++-- opm/models/io/vtkblackoilsolventmodule.hh | 4 +- opm/models/io/vtkcompositionmodule.hh | 4 +- opm/models/io/vtkdiffusionmodule.hh | 4 +- opm/models/io/vtkmultiphasemodule.hh | 26 ++++---- opm/models/io/vtkprimaryvarsmodule.hh | 2 +- opm/models/io/vtktemperaturemodule.hh | 4 +- opm/models/nonlinear/newtonmethod.hh | 48 +++++++------- opm/models/utils/simulator.hh | 38 +++++------ 47 files changed, 489 insertions(+), 489 deletions(-) diff --git a/opm/models/blackoil/blackoilboundaryratevector.hh b/opm/models/blackoil/blackoilboundaryratevector.hh index a32dde4d9..ac4f43160 100644 --- a/opm/models/blackoil/blackoilboundaryratevector.hh +++ b/opm/models/blackoil/blackoilboundaryratevector.hh @@ -65,7 +65,7 @@ class BlackOilBoundaryRateVector : public GetPropType(); - using EnergyModule = Opm::BlackOilEnergyModule; + using EnergyModule = BlackOilEnergyModule; public: /*! @@ -146,8 +146,8 @@ public: specificEnthalpy = fluidState.enthalpy(phaseIdx); } else { - density = Opm::getValue(fluidState.density(phaseIdx)); - specificEnthalpy = Opm::getValue(fluidState.enthalpy(phaseIdx)); + density = getValue(fluidState.density(phaseIdx)); + specificEnthalpy = getValue(fluidState.enthalpy(phaseIdx)); } } else if (focusDofIdx == interiorDofIdx) { @@ -155,8 +155,8 @@ public: specificEnthalpy = insideIntQuants.fluidState().enthalpy(phaseIdx); } else { - density = Opm::getValue(insideIntQuants.fluidState().density(phaseIdx)); - specificEnthalpy = Opm::getValue(insideIntQuants.fluidState().enthalpy(phaseIdx)); + density = getValue(insideIntQuants.fluidState().density(phaseIdx)); + specificEnthalpy = getValue(insideIntQuants.fluidState().enthalpy(phaseIdx)); } Evaluation enthalpyRate = density*extQuants.volumeFlux(phaseIdx)*specificEnthalpy; @@ -186,9 +186,9 @@ public: #ifndef NDEBUG for (unsigned i = 0; i < numEq; ++i) { - Opm::Valgrind::CheckDefined((*this)[i]); + Valgrind::CheckDefined((*this)[i]); } - Opm::Valgrind::CheckDefined(*this); + Valgrind::CheckDefined(*this); #endif } @@ -263,8 +263,8 @@ public: #ifndef NDEBUG for (unsigned i = 0; i < numEq; ++i) - Opm::Valgrind::CheckDefined((*this)[i]); - Opm::Valgrind::CheckDefined(*this); + Valgrind::CheckDefined((*this)[i]); + Valgrind::CheckDefined(*this); #endif } }; diff --git a/opm/models/blackoil/blackoilbrinemodules.hh b/opm/models/blackoil/blackoilbrinemodules.hh index dc8e9ef2e..8b303afa7 100644 --- a/opm/models/blackoil/blackoilbrinemodules.hh +++ b/opm/models/blackoil/blackoilbrinemodules.hh @@ -70,10 +70,10 @@ class BlackOilBrineModule using RateVector = GetPropType; using Indices = GetPropType; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; - using TabulatedFunction = typename Opm::Tabulated1DFunction; - using TabulatedTwoDFunction = typename Opm::IntervalTabulated2DFunction; + using TabulatedFunction = Tabulated1DFunction; + using TabulatedTwoDFunction = IntervalTabulated2DFunction; static constexpr unsigned saltConcentrationIdx = Indices::saltConcentrationIdx; static constexpr unsigned contiBrineEqIdx = Indices::contiBrineEqIdx; @@ -90,7 +90,7 @@ public: /*! * \brief Initialize all internal data structures needed by the brine module */ - static void initFromState(const Opm::EclipseState& eclState) + static void initFromState(const EclipseState& eclState) { // some sanity checks: if brine are enabled, the BRINE keyword must be // present, if brine are disabled the keyword must not be present. @@ -216,7 +216,7 @@ public: * Toolbox::template decay(intQuants.porosity()); // avoid singular matrix if no water is present. - surfaceVolumeWater = Opm::max(surfaceVolumeWater, 1e-10); + surfaceVolumeWater = max(surfaceVolumeWater, 1e-10); // Brine in water phase const LhsEval massBrine = surfaceVolumeWater @@ -249,8 +249,8 @@ public: else { flux[contiBrineEqIdx] = extQuants.volumeFlux(waterPhaseIdx) - *Opm::decay(up.fluidState().invB(waterPhaseIdx)) - *Opm::decay(up.fluidState().saltConcentration()); + *decay(up.fluidState().invB(waterPhaseIdx)) + *decay(up.fluidState().saltConcentration()); } } diff --git a/opm/models/blackoil/blackoildiffusionmodule.hh b/opm/models/blackoil/blackoildiffusionmodule.hh index 121e52f06..6f47d9040 100644 --- a/opm/models/blackoil/blackoildiffusionmodule.hh +++ b/opm/models/blackoil/blackoildiffusionmodule.hh @@ -36,6 +36,7 @@ #include #include + namespace Opm { /*! @@ -92,7 +93,7 @@ class BlackOilDiffusionModule enum { numComponents = FluidSystem::numComponents }; enum { conti0EqIdx = Indices::conti0EqIdx }; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; public: /*! @@ -270,7 +271,7 @@ protected: if(!FluidSystem::enableDiffusion()) return; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, timeIdx); for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { if (!FluidSystem::phaseIsActive(phaseIdx)) { @@ -424,7 +425,7 @@ protected: - intQuantsInside.fluidState().moleFraction(phaseIdx, compIdx)) * diffusivity / faceArea; //opm-models expects pr area flux - Opm::Valgrind::CheckDefined(moleFractionGradientNormal_[phaseIdx][compIdx]); + Valgrind::CheckDefined(moleFractionGradientNormal_[phaseIdx][compIdx]); // use the arithmetic average for the effective // diffusion coefficients. @@ -434,7 +435,7 @@ protected: intQuantsOutside.effectiveDiffusionCoefficient(phaseIdx, compIdx)) / 2; - Opm::Valgrind::CheckDefined(effectiveDiffusionCoefficient_[phaseIdx][compIdx]); + Valgrind::CheckDefined(effectiveDiffusionCoefficient_[phaseIdx][compIdx]); } } } diff --git a/opm/models/blackoil/blackoilenergymodules.hh b/opm/models/blackoil/blackoilenergymodules.hh index d5109ec85..2c977f84e 100644 --- a/opm/models/blackoil/blackoilenergymodules.hh +++ b/opm/models/blackoil/blackoilenergymodules.hh @@ -80,7 +80,7 @@ public: // energys have been disabled at compile time return; - Opm::VtkBlackOilEnergyModule::registerParameters(); + VtkBlackOilEnergyModule::registerParameters(); } /*! @@ -93,7 +93,7 @@ public: // energys have been disabled at compile time return; - model.addOutputModule(new Opm::VtkBlackOilEnergyModule(simulator)); + model.addOutputModule(new VtkBlackOilEnergyModule(simulator)); } static bool primaryVarApplies(unsigned pvIdx) @@ -150,7 +150,7 @@ public: if (!enableEnergy) return; - const auto& poro = Opm::decay(intQuants.porosity()); + const auto& poro = decay(intQuants.porosity()); // accumulate the internal energy of the fluids const auto& fs = intQuants.fluidState(); @@ -158,16 +158,16 @@ public: if (!FluidSystem::phaseIsActive(phaseIdx)) continue; - const auto& u = Opm::decay(fs.internalEnergy(phaseIdx)); - const auto& S = Opm::decay(fs.saturation(phaseIdx)); - const auto& rho = Opm::decay(fs.density(phaseIdx)); + const auto& u = decay(fs.internalEnergy(phaseIdx)); + const auto& S = decay(fs.saturation(phaseIdx)); + const auto& rho = decay(fs.density(phaseIdx)); storage[contiEnergyEqIdx] += poro*S*u*rho; } // add the internal energy of the rock Scalar refPoro = intQuants.referencePorosity(); - const auto& uRock = Opm::decay(intQuants.rockInternalEnergy()); + const auto& uRock = decay(intQuants.rockInternalEnergy()); storage[contiEnergyEqIdx] += (1.0 - refPoro)*uRock; storage[contiEnergyEqIdx] *= getPropValue(); } @@ -214,8 +214,8 @@ public: const auto& volFlux = extQuants.volumeFlux(phaseIdx); flux[contiEnergyEqIdx] += - Opm::decay(fs.enthalpy(phaseIdx)) - * Opm::decay(fs.density(phaseIdx)) + decay(fs.enthalpy(phaseIdx)) + * decay(fs.density(phaseIdx)) * volFlux; } @@ -285,7 +285,7 @@ public: static Scalar computeResidualError(const EqVector& resid) { // do not weight the residual of energy when it comes to convergence - return std::abs(Opm::scalarValue(resid[contiEnergyEqIdx])); + return std::abs(scalarValue(resid[contiEnergyEqIdx])); } template @@ -469,7 +469,7 @@ class BlackOilEnergyExtensiveQuantities using FluidSystem = GetPropType; using GridView = GetPropType; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; using EnergyModule = BlackOilEnergyModule; @@ -496,28 +496,28 @@ public: Evaluation deltaT; if (elemCtx.focusDofIndex() == inIdx) deltaT = - Opm::decay(exFs.temperature(/*phaseIdx=*/0)) + decay(exFs.temperature(/*phaseIdx=*/0)) - inFs.temperature(/*phaseIdx=*/0); else if (elemCtx.focusDofIndex() == exIdx) deltaT = exFs.temperature(/*phaseIdx=*/0) - - Opm::decay(inFs.temperature(/*phaseIdx=*/0)); + - decay(inFs.temperature(/*phaseIdx=*/0)); else deltaT = - Opm::decay(exFs.temperature(/*phaseIdx=*/0)) - - Opm::decay(inFs.temperature(/*phaseIdx=*/0)); + decay(exFs.temperature(/*phaseIdx=*/0)) + - decay(inFs.temperature(/*phaseIdx=*/0)); Evaluation inLambda; if (elemCtx.focusDofIndex() == inIdx) inLambda = inIq.totalThermalConductivity(); else - inLambda = Opm::decay(inIq.totalThermalConductivity()); + inLambda = decay(inIq.totalThermalConductivity()); Evaluation exLambda; if (elemCtx.focusDofIndex() == exIdx) exLambda = exIq.totalThermalConductivity(); else - exLambda = Opm::decay(exIq.totalThermalConductivity()); + exLambda = decay(exIq.totalThermalConductivity()); auto distVec = elemCtx.pos(exIdx, timeIdx); distVec -= elemCtx.pos(inIdx, timeIdx); @@ -560,14 +560,14 @@ public: - inFs.temperature(/*phaseIdx=*/0); else deltaT = - Opm::decay(boundaryFs.temperature(/*phaseIdx=*/0)) - - Opm::decay(inFs.temperature(/*phaseIdx=*/0)); + decay(boundaryFs.temperature(/*phaseIdx=*/0)) + - decay(inFs.temperature(/*phaseIdx=*/0)); Evaluation lambda; if (ctx.focusDofIndex() == inIdx) lambda = inIq.totalThermalConductivity(); else - lambda = Opm::decay(inIq.totalThermalConductivity()); + lambda = decay(inIq.totalThermalConductivity()); auto distVec = scvf.integrationPos(); distVec -= ctx.pos(inIdx, timeIdx); diff --git a/opm/models/blackoil/blackoilextbomodules.hh b/opm/models/blackoil/blackoilextbomodules.hh index 1ac75bcfc..030e2f46d 100644 --- a/opm/models/blackoil/blackoilextbomodules.hh +++ b/opm/models/blackoil/blackoilextbomodules.hh @@ -83,10 +83,10 @@ class BlackOilExtboModule using RateVector = GetPropType; using Indices = GetPropType; - typedef Opm::MathToolbox Toolbox; + using Toolbox = MathToolbox; - typedef typename Opm::Tabulated1DFunction TabulatedFunction; - typedef typename Opm::UniformXTabulated2DFunction Tabulated2DFunction; + using TabulatedFunction = Tabulated1DFunction; + using Tabulated2DFunction = UniformXTabulated2DFunction; static constexpr unsigned zFractionIdx = Indices::zFractionIdx; static constexpr unsigned contiZfracEqIdx = Indices::contiZfracEqIdx; @@ -103,7 +103,7 @@ public: /*! * \brief Initialize all internal data structures needed by the solvent module */ - static void initFromState(const Opm::EclipseState& eclState) + static void initFromState(const EclipseState& eclState) { // some sanity checks: if extended BO is enabled, the PVTSOL keyword must be // present, if extended BO is disabled the keyword must not be present. @@ -267,7 +267,7 @@ public: // extBO have disabled at compile time return; - //Opm::VtkBlackOilExtboModule::registerParameters(); + //VtkBlackOilExtboModule::registerParameters(); } /*! @@ -280,7 +280,7 @@ public: // extBO have disabled at compile time return; - //model.addOutputModule(new Opm::VtkBlackOilExtboModule(simulator)); + //model.addOutputModule(new VtkBlackOilExtboModule(simulator)); } static bool primaryVarApplies(unsigned pvIdx) @@ -393,8 +393,8 @@ public: else { flux[contiZfracEqIdx] = extQuants.volumeFlux(gasPhaseIdx) - * (Opm::decay(upGas.yVolume())) - * Opm::decay(fsGas.invB(gasPhaseIdx)); + * (decay(upGas.yVolume())) + * decay(fsGas.invB(gasPhaseIdx)); } if (FluidSystem::enableDissolvedGas()) { // account for dissolved z in oil phase unsigned upIdxOil = static_cast(extQuants.upstreamIndex(oilPhaseIdx)); @@ -410,9 +410,9 @@ public: else { flux[contiZfracEqIdx] += extQuants.volumeFlux(oilPhaseIdx) - * Opm::decay(upOil.xVolume()) - * Opm::decay(fsOil.Rs()) - * Opm::decay(fsOil.invB(oilPhaseIdx)); + * decay(upOil.xVolume()) + * decay(fsOil.Rs()) + * decay(fsOil.invB(oilPhaseIdx)); } } } @@ -898,7 +898,7 @@ class BlackOilExtboExtensiveQuantities using FluidSystem = GetPropType; using GridView = GetPropType; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx; static constexpr int dimWorld = GridView::dimensionworld; diff --git a/opm/models/blackoil/blackoilextensivequantities.hh b/opm/models/blackoil/blackoilextensivequantities.hh index b482d2469..9e741f9df 100644 --- a/opm/models/blackoil/blackoilextensivequantities.hh +++ b/opm/models/blackoil/blackoilextensivequantities.hh @@ -63,7 +63,7 @@ class BlackOilExtensiveQuantities using FluidSystem = GetPropType; enum { enableDiffusion = getPropValue() }; - using DiffusionExtensiveQuantities = Opm::BlackOilDiffusionExtensiveQuantities; + using DiffusionExtensiveQuantities = BlackOilDiffusionExtensiveQuantities; public: diff --git a/opm/models/blackoil/blackoilfoammodules.hh b/opm/models/blackoil/blackoilfoammodules.hh index 613f933dc..464e86ada 100644 --- a/opm/models/blackoil/blackoilfoammodules.hh +++ b/opm/models/blackoil/blackoilfoammodules.hh @@ -72,9 +72,9 @@ class BlackOilFoamModule using RateVector = GetPropType; using Indices = GetPropType; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; - using TabulatedFunction = typename Opm::Tabulated1DFunction; + using TabulatedFunction = Tabulated1DFunction; static constexpr unsigned foamConcentrationIdx = Indices::foamConcentrationIdx; static constexpr unsigned contiFoamEqIdx = Indices::contiFoamEqIdx; @@ -114,7 +114,7 @@ public: /*! * \brief Initialize all internal data structures needed by the foam module */ - static void initFromState(const Opm::EclipseState& eclState) + static void initFromState(const EclipseState& eclState) { // some sanity checks: if foam is enabled, the FOAM keyword must be // present, if foam is disabled the keyword must not be present. @@ -147,7 +147,7 @@ public: setNumPvtRegions(numPvtRegions); // Get and check FOAMROCK data. - const Opm::FoamConfig& foamConf = eclState.getInitConfig().getFoamConfig(); + const FoamConfig& foamConf = eclState.getInitConfig().getFoamConfig(); if (numSatRegions != foamConf.size()) { throw std::runtime_error("Inconsistent sizes, number of saturation regions differ from the number of elements " "in FoamConfig, which typically corresponds to the number of records in FOAMROCK."); @@ -172,7 +172,7 @@ public: foamCoefficients_[satReg].ep_surf = rec.exponent(); foamRockDensity_[satReg] = rec.rockDensity(); foamAllowDesorption_[satReg] = rec.allowDesorption(); - const auto& foamadsTable = foamadsTables.template getTable(satReg); + const auto& foamadsTable = foamadsTables.template getTable(satReg); const auto& conc = foamadsTable.getFoamConcentrationColumn(); const auto& ads = foamadsTable.getAdsorbedFoamColumn(); adsorbedFoamTable_[satReg].setXYContainers(conc, ads); @@ -193,7 +193,7 @@ public: // Set data that vary with PVT region. for (std::size_t pvtReg = 0; pvtReg < numPvtRegions; ++pvtReg) { - const auto& foammobTable = foammobTables.template getTable(pvtReg); + const auto& foammobTable = foammobTables.template getTable(pvtReg); const auto& conc = foammobTable.getFoamConcentrationColumn(); const auto& mobMult = foammobTable.getMobilityMultiplierColumn(); gasMobilityMultiplierTable_[pvtReg].setXYContainers(conc, mobMult); @@ -231,7 +231,7 @@ public: // foam has been disabled at compile time return; - //Opm::VtkBlackOilFoamModule::registerParameters(); + //VtkBlackOilFoamModule::registerParameters(); } /*! @@ -245,9 +245,9 @@ public: return; if (enableVtkOutput) { - Opm::OpmLog::warning("VTK output requested, currently unsupported by the foam module."); + OpmLog::warning("VTK output requested, currently unsupported by the foam module."); } - //model.addOutputModule(new Opm::VtkBlackOilFoamModule(simulator)); + //model.addOutputModule(new VtkBlackOilFoamModule(simulator)); } static bool primaryVarApplies(unsigned pvIdx) @@ -313,7 +313,7 @@ public: * Toolbox::template decay(intQuants.porosity()); // Avoid singular matrix if no gas is present. - surfaceVolumeFreeGas = Opm::max(surfaceVolumeFreeGas, 1e-10); + surfaceVolumeFreeGas = max(surfaceVolumeFreeGas, 1e-10); // Foam/surfactant in gas phase. const LhsEval gasFoam = surfaceVolumeFreeGas @@ -355,8 +355,8 @@ public: } else { flux[contiFoamEqIdx] = extQuants.volumeFlux(gasPhaseIdx) - *Opm::decay(up.fluidState().invB(gasPhaseIdx)) - *Opm::decay(up.foamConcentration()); + *decay(up.fluidState().invB(gasPhaseIdx)) + *decay(up.foamConcentration()); } } diff --git a/opm/models/blackoil/blackoilintensivequantities.hh b/opm/models/blackoil/blackoilintensivequantities.hh index 3ba99b74d..bd745a15c 100644 --- a/opm/models/blackoil/blackoilintensivequantities.hh +++ b/opm/models/blackoil/blackoilintensivequantities.hh @@ -99,11 +99,11 @@ class BlackOilIntensiveQuantities static const bool compositionSwitchEnabled = Indices::gasEnabled; static const bool waterEnabled = Indices::waterEnabled; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; using DimMatrix = Dune::FieldMatrix; using FluxIntensiveQuantities = typename FluxModule::FluxIntensiveQuantities; - using FluidState = Opm::BlackOilFluidState; - using DiffusionIntensiveQuantities = Opm::BlackOilDiffusionIntensiveQuantities; + using FluidState = BlackOilFluidState; + using DiffusionIntensiveQuantities = BlackOilDiffusionIntensiveQuantities; public: BlackOilIntensiveQuantities() @@ -168,8 +168,8 @@ public: } } - Opm::Valgrind::CheckDefined(Sg); - Opm::Valgrind::CheckDefined(Sw); + Valgrind::CheckDefined(Sg); + Valgrind::CheckDefined(Sw); Evaluation So = 1.0 - Sw - Sg; @@ -211,7 +211,7 @@ public: // calculate relative permeabilities. note that we store the result into the // mobility_ class attribute. the division by the phase viscosity happens later. MaterialLaw::relativePermeabilities(mobility_, materialParams, fluidState_); - Opm::Valgrind::CheckDefined(mobility_); + Valgrind::CheckDefined(mobility_); // update the Saturation functions for the blackoil solvent module. asImp_().solventPostSatFuncUpdate_(elemCtx, dofIdx, timeIdx); @@ -221,8 +221,8 @@ public: Evaluation SoMax = 0.0; if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) { - SoMax = Opm::max(fluidState_.saturation(oilPhaseIdx), - elemCtx.problem().maxOilSaturation(globalSpaceIdx)); + SoMax = max(fluidState_.saturation(oilPhaseIdx), + elemCtx.problem().maxOilSaturation(globalSpaceIdx)); } // take the meaning of the switiching primary variable into account for the gas @@ -237,7 +237,7 @@ public: oilPhaseIdx, pvtRegionIdx, SoMax); - fluidState_.setRs(Opm::min(RsMax, RsSat)); + fluidState_.setRs(min(RsMax, RsSat)); } else if (compositionSwitchEnabled) fluidState_.setRs(0.0); @@ -249,7 +249,7 @@ public: gasPhaseIdx, pvtRegionIdx, SoMax); - fluidState_.setRv(Opm::min(RvMax, RvSat)); + fluidState_.setRv(min(RvMax, RvSat)); } else if (compositionSwitchEnabled) fluidState_.setRv(0.0); @@ -260,7 +260,7 @@ public: // oil phase, we can directly set the composition of the oil phase const auto& Rs = priVars.makeEvaluation(Indices::compositionSwitchIdx, timeIdx); - fluidState_.setRs(Opm::min(RsMax, Rs)); + fluidState_.setRs(min(RsMax, Rs)); if (FluidSystem::enableVaporizedOil()) { // the gas phase is not present, but we need to compute its "composition" @@ -272,7 +272,7 @@ public: pvtRegionIdx, SoMax); - fluidState_.setRv(Opm::min(RvMax, RvSat)); + fluidState_.setRv(min(RvMax, RvSat)); } else fluidState_.setRv(0.0); @@ -291,7 +291,7 @@ public: pvtRegionIdx, SoMax); - fluidState_.setRs(Opm::min(RsMax, RsSat)); + fluidState_.setRs(min(RsMax, RsSat)); } else { fluidState_.setRs(0.0); } @@ -322,7 +322,7 @@ public: else mobility_[phaseIdx] /= mu; } - Opm::Valgrind::CheckDefined(mobility_); + Valgrind::CheckDefined(mobility_); // calculate the phase densities Evaluation rho; @@ -398,14 +398,14 @@ public: if (!FluidSystem::phaseIsActive(phaseIdx)) continue; - assert(Opm::isfinite(fluidState_.density(phaseIdx))); - assert(Opm::isfinite(fluidState_.saturation(phaseIdx))); - assert(Opm::isfinite(fluidState_.temperature(phaseIdx))); - assert(Opm::isfinite(fluidState_.pressure(phaseIdx))); - assert(Opm::isfinite(fluidState_.invB(phaseIdx))); + assert(isfinite(fluidState_.density(phaseIdx))); + assert(isfinite(fluidState_.saturation(phaseIdx))); + assert(isfinite(fluidState_.temperature(phaseIdx))); + assert(isfinite(fluidState_.pressure(phaseIdx))); + assert(isfinite(fluidState_.invB(phaseIdx))); } - assert(Opm::isfinite(fluidState_.Rs())); - assert(Opm::isfinite(fluidState_.Rv())); + assert(isfinite(fluidState_.Rs())); + assert(isfinite(fluidState_.Rv())); #endif } diff --git a/opm/models/blackoil/blackoillocalresidual.hh b/opm/models/blackoil/blackoillocalresidual.hh index aa0f51086..c818c3422 100644 --- a/opm/models/blackoil/blackoillocalresidual.hh +++ b/opm/models/blackoil/blackoillocalresidual.hh @@ -80,14 +80,14 @@ class BlackOilLocalResidual : public GetPropType(); static constexpr bool enableDiffusion = getPropValue(); - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; using SolventModule = BlackOilSolventModule; using ExtboModule = BlackOilExtboModule; using PolymerModule = BlackOilPolymerModule; using EnergyModule = BlackOilEnergyModule; using FoamModule = BlackOilFoamModule; using BrineModule = BlackOilBrineModule; - using DiffusionModule = Opm::BlackOilDiffusionModule; + using DiffusionModule = BlackOilDiffusionModule; public: /*! @@ -110,7 +110,7 @@ public: if (Indices::numPhases == 3) { // add trivial equation for the pseudo phase unsigned activeCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::solventComponentIndex(phaseIdx)); if (timeIdx == 0) - storage[conti0EqIdx + activeCompIdx] = Opm::variable(0.0, conti0EqIdx + activeCompIdx); + storage[conti0EqIdx + activeCompIdx] = variable(0.0, conti0EqIdx + activeCompIdx); else storage[conti0EqIdx + activeCompIdx] = 0.0; } @@ -238,7 +238,7 @@ public: const ExtensiveQuantities& extQuants, const FluidState& upFs) { - const auto& invB = Opm::getInvB_(upFs, phaseIdx, pvtRegionIdx); + const auto& invB = getInvB_(upFs, phaseIdx, pvtRegionIdx); const auto& surfaceVolumeFlux = invB*extQuants.volumeFlux(phaseIdx); unsigned activeCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::solventComponentIndex(phaseIdx)); @@ -250,7 +250,7 @@ public: if (phaseIdx == oilPhaseIdx) { // dissolved gas (in the oil phase). if (FluidSystem::enableDissolvedGas()) { - const auto& Rs = Opm::BlackOil::getRs_(upFs, pvtRegionIdx); + const auto& Rs = BlackOil::getRs_(upFs, pvtRegionIdx); unsigned activeGasCompIdx = Indices::canonicalToActiveComponentIndex(gasCompIdx); if (blackoilConserveSurfaceVolume) @@ -262,7 +262,7 @@ public: else if (phaseIdx == gasPhaseIdx) { // vaporized oil (in the gas phase). if (FluidSystem::enableVaporizedOil()) { - const auto& Rv = Opm::BlackOil::getRv_(upFs, pvtRegionIdx); + const auto& Rv = BlackOil::getRv_(upFs, pvtRegionIdx); unsigned activeOilCompIdx = Indices::canonicalToActiveComponentIndex(oilCompIdx); if (blackoilConserveSurfaceVolume) diff --git a/opm/models/blackoil/blackoilmodel.hh b/opm/models/blackoil/blackoilmodel.hh index 47bd81b54..e8211c1a3 100644 --- a/opm/models/blackoil/blackoilmodel.hh +++ b/opm/models/blackoil/blackoilmodel.hh @@ -83,55 +83,55 @@ struct BlackOilModel { using InheritsFrom = std::tuple -struct LocalResidual { using type = Opm::BlackOilLocalResidual; }; +struct LocalResidual { using type = BlackOilLocalResidual; }; //! Use the black-oil specific newton method template -struct NewtonMethod { using type = Opm::BlackOilNewtonMethod; }; +struct NewtonMethod { using type = BlackOilNewtonMethod; }; //! The Model property template -struct Model { using type = Opm::BlackOilModel; }; +struct Model { using type = BlackOilModel; }; //! The Problem property template -struct BaseProblem { using type = Opm::BlackOilProblem; }; +struct BaseProblem { using type = BlackOilProblem; }; //! the RateVector property template -struct RateVector { using type = Opm::BlackOilRateVector; }; +struct RateVector { using type = BlackOilRateVector; }; //! the BoundaryRateVector property template -struct BoundaryRateVector { using type = Opm::BlackOilBoundaryRateVector; }; +struct BoundaryRateVector { using type = BlackOilBoundaryRateVector; }; //! the PrimaryVariables property template -struct PrimaryVariables { using type = Opm::BlackOilPrimaryVariables; }; +struct PrimaryVariables { using type = BlackOilPrimaryVariables; }; //! the IntensiveQuantities property template -struct IntensiveQuantities { using type = Opm::BlackOilIntensiveQuantities; }; +struct IntensiveQuantities { using type = BlackOilIntensiveQuantities; }; //! the ExtensiveQuantities property template -struct ExtensiveQuantities { using type = Opm::BlackOilExtensiveQuantities; }; +struct ExtensiveQuantities { using type = BlackOilExtensiveQuantities; }; //! Use the the velocity module which is aware of the black-oil specific model extensions //! (i.e., the polymer and solvent extensions) template -struct FluxModule { using type = Opm::BlackOilDarcyFluxModule; }; +struct FluxModule { using type = BlackOilDarcyFluxModule; }; //! The indices required by the model template struct Indices -{ using type = Opm::BlackOilIndices(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - /*PVOffset=*/0>; }; +{ using type = BlackOilIndices(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + /*PVOffset=*/0>; }; //! Set the fluid system to the black-oil fluid system by default template @@ -142,7 +142,7 @@ private: using Evaluation = GetPropType; public: - using type = Opm::BlackOilFluidSystem; + using type = BlackOilFluidSystem; }; // by default, all ECL extension modules are disabled @@ -286,7 +286,7 @@ class BlackOilModel using ExtboModule = BlackOilExtboModule; using PolymerModule = BlackOilPolymerModule; using EnergyModule = BlackOilEnergyModule; - using DiffusionModule = Opm::BlackOilDiffusionModule; + using DiffusionModule = BlackOilDiffusionModule; public: BlackOilModel(Simulator& simulator) @@ -307,11 +307,11 @@ public: DiffusionModule::registerParameters(); // register runtime parameters of the VTK output modules - Opm::VtkBlackOilModule::registerParameters(); - Opm::VtkCompositionModule::registerParameters(); + VtkBlackOilModule::registerParameters(); + VtkCompositionModule::registerParameters(); if (enableDiffusion) - Opm::VtkDiffusionModule::registerParameters(); + VtkDiffusionModule::registerParameters(); } /*! @@ -596,11 +596,11 @@ protected: PolymerModule::registerOutputModules(*this, this->simulator_); EnergyModule::registerOutputModules(*this, this->simulator_); - this->addOutputModule(new Opm::VtkBlackOilModule(this->simulator_)); - this->addOutputModule(new Opm::VtkCompositionModule(this->simulator_)); + this->addOutputModule(new VtkBlackOilModule(this->simulator_)); + this->addOutputModule(new VtkCompositionModule(this->simulator_)); if (enableDiffusion) - this->addOutputModule(new Opm::VtkDiffusionModule(this->simulator_)); + this->addOutputModule(new VtkDiffusionModule(this->simulator_)); } private: diff --git a/opm/models/blackoil/blackoilnewtonmethod.hh b/opm/models/blackoil/blackoilnewtonmethod.hh index f761df5d6..1e49e796b 100644 --- a/opm/models/blackoil/blackoilnewtonmethod.hh +++ b/opm/models/blackoil/blackoilnewtonmethod.hh @@ -225,7 +225,7 @@ public: succeeded = comm.min(succeeded); if (!succeeded) - throw Opm::NumericalIssue("A process did not succeed in adapting the primary variables"); + throw NumericalIssue("A process did not succeed in adapting the primary variables"); numPriVarsSwitched_ = comm.sum(numPriVarsSwitched_); } @@ -249,8 +249,8 @@ protected: static constexpr bool enableBrine = Indices::saltConcentrationIdx >= 0; currentValue.checkDefined(); - Opm::Valgrind::CheckDefined(update); - Opm::Valgrind::CheckDefined(currentResidual); + Valgrind::CheckDefined(update); + Valgrind::CheckDefined(currentResidual); // saturation delta for each phase Scalar deltaSw = 0.0; @@ -296,7 +296,7 @@ protected: // limit pressure delta if (pvIdx == Indices::pressureSwitchIdx) { if (std::abs(delta) > dpMaxRel_*currentValue[pvIdx]) - delta = Opm::signum(delta)*dpMaxRel_*currentValue[pvIdx]; + delta = signum(delta)*dpMaxRel_*currentValue[pvIdx]; } // water saturation delta else if (pvIdx == Indices::waterSaturationIdx) diff --git a/opm/models/blackoil/blackoilpolymermodules.hh b/opm/models/blackoil/blackoilpolymermodules.hh index d3fdd1955..be8898383 100644 --- a/opm/models/blackoil/blackoilpolymermodules.hh +++ b/opm/models/blackoil/blackoilpolymermodules.hh @@ -75,10 +75,10 @@ class BlackOilPolymerModule using RateVector = GetPropType; using Indices = GetPropType; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; - using TabulatedFunction = typename Opm::Tabulated1DFunction; - using TabulatedTwoDFunction = typename Opm::IntervalTabulated2DFunction; + using TabulatedFunction = Tabulated1DFunction; + using TabulatedTwoDFunction = IntervalTabulated2DFunction; static constexpr unsigned polymerConcentrationIdx = Indices::polymerConcentrationIdx; static constexpr unsigned polymerMoleWeightIdx = Indices::polymerMoleWeightIdx; @@ -115,7 +115,7 @@ public: /*! * \brief Initialize all internal data structures needed by the polymer module */ - static void initFromState(const Opm::EclipseState& eclState) + static void initFromState(const EclipseState& eclState) { // some sanity checks: if polymers are enabled, the POLYMER keyword must be // present, if polymers are disabled the keyword must not be present. @@ -155,7 +155,7 @@ public: if (!plyrockTables.empty()) { assert(numSatRegions == plyrockTables.size()); for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) { - const auto& plyrockTable = plyrockTables.template getTable(satRegionIdx); + const auto& plyrockTable = plyrockTables.template getTable(satRegionIdx); setPlyrock(satRegionIdx, plyrockTable.getDeadPoreVolumeColumn()[0], plyrockTable.getResidualResistanceFactorColumn()[0], @@ -173,7 +173,7 @@ public: if (!plyadsTables.empty()) { assert(numSatRegions == plyadsTables.size()); for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) { - const auto& plyadsTable = plyadsTables.template getTable(satRegionIdx); + const auto& plyadsTable = plyadsTables.template getTable(satRegionIdx); // Copy data const auto& c = plyadsTable.getPolymerConcentrationColumn(); const auto& ads = plyadsTable.getAdsorbedPolymerColumn(); @@ -193,14 +193,14 @@ public: if (!plyviscTables.empty()) { // different viscosity model is used for POLYMW if (enablePolymerMolarWeight) { - Opm::OpmLog::warning("PLYVISC should not be used in POLYMW runs, " + OpmLog::warning("PLYVISC should not be used in POLYMW runs, " "it will have no effect. A viscosity model based on PLYVMH is used instead.\n"); } else { assert(numPvtRegions == plyviscTables.size()); for (unsigned pvtRegionIdx = 0; pvtRegionIdx < numPvtRegions; ++ pvtRegionIdx) { - const auto& plyadsTable = plyviscTables.template getTable(pvtRegionIdx); + const auto& plyadsTable = plyviscTables.template getTable(pvtRegionIdx); // Copy data const auto& c = plyadsTable.getPolymerConcentrationColumn(); const auto& visc = plyadsTable.getViscosityMultiplierColumn(); @@ -218,7 +218,7 @@ public: setNumMixRegions(numMixRegions); if (!plymaxTables.empty()) { for (unsigned mixRegionIdx = 0; mixRegionIdx < numMixRegions; ++ mixRegionIdx) { - const auto& plymaxTable = plymaxTables.template getTable(mixRegionIdx); + const auto& plymaxTable = plymaxTables.template getTable(mixRegionIdx); setPlymax(mixRegionIdx, plymaxTable.getPolymerConcentrationColumn()[0]); } } @@ -228,7 +228,7 @@ public: if (!eclState.getTableManager().getPlmixparTable().empty()) { if (enablePolymerMolarWeight) { - Opm::OpmLog::warning("PLMIXPAR should not be used in POLYMW runs, it will have no effect.\n"); + OpmLog::warning("PLMIXPAR should not be used in POLYMW runs, it will have no effect.\n"); } else { const auto& plmixparTable = eclState.getTableManager().getPlmixparTable(); @@ -246,7 +246,7 @@ public: hasShrate_ = eclState.getTableManager().useShrate(); if ((hasPlyshlog_ || hasShrate_) && enablePolymerMolarWeight) { - Opm::OpmLog::warning("PLYSHLOG and SHRATE should not be used in POLYMW runs, they will have no effect.\n"); + OpmLog::warning("PLYSHLOG and SHRATE should not be used in POLYMW runs, they will have no effect.\n"); } if (hasPlyshlog_ && !enablePolymerMolarWeight) { @@ -255,14 +255,14 @@ public: plyshlogShearEffectRefMultiplier_.resize(numPvtRegions); plyshlogShearEffectRefLogVelocity_.resize(numPvtRegions); for (unsigned pvtRegionIdx = 0; pvtRegionIdx < numPvtRegions; ++ pvtRegionIdx) { - const auto& plyshlogTable = plyshlogTables.template getTable(pvtRegionIdx); + const auto& plyshlogTable = plyshlogTables.template getTable(pvtRegionIdx); Scalar plyshlogRefPolymerConcentration = plyshlogTable.getRefPolymerConcentration(); auto waterVelocity = plyshlogTable.getWaterVelocityColumn().vectorCopy(); auto shearMultiplier = plyshlogTable.getShearMultiplierColumn().vectorCopy(); // do the unit version here for the waterVelocity - Opm::UnitSystem unitSystem = eclState.getDeckUnitSystem(); + UnitSystem unitSystem = eclState.getDeckUnitSystem(); double siFactor = hasShrate_? unitSystem.parse("1/Time").getSIScaling() : unitSystem.parse("Length/Time").getSIScaling(); for (size_t i = 0; i < waterVelocity.size(); ++i) { waterVelocity[i] *= siFactor; @@ -507,7 +507,7 @@ public: // polymers have been disabled at compile time return; - Opm::VtkBlackOilPolymerModule::registerParameters(); + VtkBlackOilPolymerModule::registerParameters(); } /*! @@ -520,7 +520,7 @@ public: // polymers have been disabled at compile time return; - model.addOutputModule(new Opm::VtkBlackOilPolymerModule(simulator)); + model.addOutputModule(new VtkBlackOilPolymerModule(simulator)); } static bool primaryVarApplies(unsigned pvIdx) @@ -602,7 +602,7 @@ public: * Toolbox::template decay(intQuants.porosity()); // avoid singular matrix if no water is present. - surfaceVolumeWater = Opm::max(surfaceVolumeWater, 1e-10); + surfaceVolumeWater = max(surfaceVolumeWater, 1e-10); // polymer in water phase const LhsEval massPolymer = surfaceVolumeWater @@ -621,7 +621,7 @@ public: // tracking the polymer molecular weight if (enablePolymerMolarWeight) { - accumulationPolymer = Opm::max(accumulationPolymer, 1e-10); + accumulationPolymer = max(accumulationPolymer, 1e-10); storage[contiPolymerMolarWeightEqIdx] += accumulationPolymer * Toolbox::template decay (intQuants.polymerMoleWeight()); @@ -660,14 +660,14 @@ public: else { flux[contiPolymerEqIdx] = extQuants.volumeFlux(waterPhaseIdx) - *Opm::decay(up.fluidState().invB(waterPhaseIdx)) - *Opm::decay(up.polymerViscosityCorrection()) - /Opm::decay(extQuants.polymerShearFactor()) - *Opm::decay(up.polymerConcentration()); + *decay(up.fluidState().invB(waterPhaseIdx)) + *decay(up.polymerViscosityCorrection()) + /decay(extQuants.polymerShearFactor()) + *decay(up.polymerConcentration()); // modify water flux[contiWaterEqIdx] /= - Opm::decay(extQuants.waterShearFactor()); + decay(extQuants.waterShearFactor()); } // flux related to transport of polymer molecular weight @@ -677,7 +677,7 @@ public: flux[contiPolymerEqIdx]*up.polymerMoleWeight(); else flux[contiPolymerMolarWeightEqIdx] = - flux[contiPolymerEqIdx]*Opm::decay(up.polymerMoleWeight()); + flux[contiPolymerEqIdx]*decay(up.polymerMoleWeight()); } } @@ -835,10 +835,10 @@ public: unsigned pvtnumRegionIdx, const Evaluation& v0) { - using ToolboxLocal = Opm::MathToolbox; + using ToolboxLocal = MathToolbox; const auto& viscosityMultiplierTable = plyviscViscosityMultiplierTable_[pvtnumRegionIdx]; - Scalar viscosityMultiplier = viscosityMultiplierTable.eval(Opm::scalarValue(polymerConcentration), /*extrapolate=*/true); + Scalar viscosityMultiplier = viscosityMultiplierTable.eval(scalarValue(polymerConcentration), /*extrapolate=*/true); const Scalar eps = 1e-14; // return 1.0 if the polymer has no effect on the water. @@ -846,7 +846,7 @@ public: return ToolboxLocal::createConstant(v0, 1.0); const std::vector& shearEffectRefLogVelocity = plyshlogShearEffectRefLogVelocity_[pvtnumRegionIdx]; - auto v0AbsLog = Opm::log(Opm::abs(v0)); + auto v0AbsLog = log(abs(v0)); // return 1.0 if the velocity /sharte is smaller than the first velocity entry. if (v0AbsLog < shearEffectRefLogVelocity[0]) return ToolboxLocal::createConstant(v0, 1.0); @@ -862,7 +862,7 @@ public: std::vector shearEffectMultiplier(numTableEntries, 1.0); for (size_t i = 0; i < numTableEntries; ++i) { shearEffectMultiplier[i] = (1.0 + (viscosityMultiplier - 1.0)*shearEffectRefMultiplier[i]) / viscosityMultiplier; - shearEffectMultiplier[i] = Opm::log(shearEffectMultiplier[i]); + shearEffectMultiplier[i] = log(shearEffectMultiplier[i]); } // store the logarithmic velocity and logarithmic multipliers in a table for easy look up and // linear interpolation in the logarithmic space. @@ -890,7 +890,7 @@ public: auto f = F(u); auto df = dF(u); u -= f/df; - if (std::abs(Opm::scalarValue(f)) < 1e-12) { + if (std::abs(scalarValue(f)) < 1e-12) { converged = true; break; } @@ -900,7 +900,7 @@ public: } // return the shear factor - return Opm::exp(logShearEffectMultiplier.eval(u, /*extrapolate=*/true)); + return exp(logShearEffectMultiplier.eval(u, /*extrapolate=*/true)); } @@ -1214,7 +1214,7 @@ class BlackOilPolymerExtensiveQuantities static constexpr int dimWorld = GridView::dimensionworld; static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; using PolymerModule = BlackOilPolymerModule; using DimVector = Dune::FieldVector; using DimEvalVector = Dune::FieldVector; @@ -1274,7 +1274,7 @@ public: const Scalar& Swcr = scaledDrainageInfo.Swcr; // guard against zero porosity and no mobile water - Evaluation denom = Opm::max(poroAvg * (Sw - Swcr), 1e-12); + Evaluation denom = max(poroAvg * (Sw - Swcr), 1e-12); Evaluation waterVolumeVelocity = extQuants.volumeFlux(waterPhaseIdx) / denom; // if shrate is specified. Compute shrate based on the water velocity @@ -1287,8 +1287,8 @@ public: // compute permeability from transmissibility. Scalar absPerm = trans / faceArea * dist.two_norm(); waterVolumeVelocity *= - PolymerModule::shrate(pvtnumRegionIdx)*Opm::sqrt(poroAvg*Sw / (relWater*absPerm)); - assert(Opm::isfinite(waterVolumeVelocity)); + PolymerModule::shrate(pvtnumRegionIdx)*sqrt(poroAvg*Sw / (relWater*absPerm)); + assert(isfinite(waterVolumeVelocity)); } } diff --git a/opm/models/blackoil/blackoilprimaryvariables.hh b/opm/models/blackoil/blackoilprimaryvariables.hh index 998404ac5..01f106af1 100644 --- a/opm/models/blackoil/blackoilprimaryvariables.hh +++ b/opm/models/blackoil/blackoilprimaryvariables.hh @@ -107,7 +107,7 @@ class BlackOilPrimaryVariables : public FvBasePrimaryVariables enum { waterCompIdx = FluidSystem::waterCompIdx }; enum { oilCompIdx = FluidSystem::oilCompIdx }; - using Toolbox = typename Opm::MathToolbox; + using Toolbox = MathToolbox; using ComponentVector = Dune::FieldVector; using SolventModule = BlackOilSolventModule; using ExtboModule = BlackOilExtboModule; @@ -130,7 +130,7 @@ public: BlackOilPrimaryVariables() : ParentType() { - Opm::Valgrind::SetUndefined(*this); + Valgrind::SetUndefined(*this); pvtRegionIdx_ = 0; } @@ -140,7 +140,7 @@ public: BlackOilPrimaryVariables(Scalar value) : ParentType(value) { - Opm::Valgrind::SetUndefined(primaryVarsMeaning_); + Valgrind::SetUndefined(primaryVarsMeaning_); pvtRegionIdx_ = 0; } @@ -190,13 +190,13 @@ public: { using ConstEvaluation = typename std::remove_reference::type; using FsEvaluation = typename std::remove_const::type; - using FsToolbox = typename Opm::MathToolbox; + using FsToolbox = MathToolbox; #ifndef NDEBUG // make sure the temperature is the same in all fluid phases for (unsigned phaseIdx = 1; phaseIdx < numPhases; ++phaseIdx) { - Opm::Valgrind::CheckDefined(fluidState.temperature(0)); - Opm::Valgrind::CheckDefined(fluidState.temperature(phaseIdx)); + Valgrind::CheckDefined(fluidState.temperature(0)); + Valgrind::CheckDefined(fluidState.temperature(phaseIdx)); assert(fluidState.temperature(0) == fluidState.temperature(phaseIdx)); } @@ -216,8 +216,8 @@ public: paramCache.setMaxOilSat(FsToolbox::value(fluidState.saturation(oilPhaseIdx))); // create a mutable fluid state with well defined densities based on the input - using NcpFlash = Opm::NcpFlash; - using FlashFluidState = Opm::CompositionalFluidState; + using NcpFlash = NcpFlash; + using FlashFluidState = CompositionalFluidState; FlashFluidState fsFlash; fsFlash.setTemperature(FsToolbox::value(fluidState.temperature(/*phaseIdx=*/0))); for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { @@ -266,7 +266,7 @@ public: { using ConstEvaluation = typename std::remove_reference::type; using FsEvaluation = typename std::remove_const::type; - using FsToolbox = typename Opm::MathToolbox; + using FsToolbox = MathToolbox; bool gasPresent = FluidSystem::phaseIsActive(gasPhaseIdx)?(fluidState.saturation(gasPhaseIdx) > 0.0):false; bool oilPresent = FluidSystem::phaseIsActive(oilPhaseIdx)?(fluidState.saturation(oilPhaseIdx) > 0.0):false; @@ -320,7 +320,7 @@ public: (*this)[compositionSwitchIdx] = FsToolbox::value(fluidState.saturation(gasPhaseIdx)); } else if (primaryVarsMeaning() == Sw_po_Rs) { - const auto& Rs = Opm::BlackOil::getRs_(fluidState, pvtRegionIdx_); + const auto& Rs = BlackOil::getRs_(fluidState, pvtRegionIdx_); if (waterEnabled) (*this)[waterSaturationIdx] = FsToolbox::value(fluidState.saturation(waterPhaseIdx)); @@ -331,7 +331,7 @@ public: else { assert(primaryVarsMeaning() == Sw_pg_Rv); - const auto& Rv = Opm::BlackOil::getRv_(fluidState, pvtRegionIdx_); + const auto& Rv = BlackOil::getRv_(fluidState, pvtRegionIdx_); if (waterEnabled) (*this)[waterSaturationIdx] = FsToolbox::value(fluidState.saturation(waterPhaseIdx)); @@ -678,11 +678,11 @@ public: #ifndef NDEBUG // check the "real" primary variables for (unsigned i = 0; i < this->size(); ++i) - Opm::Valgrind::CheckDefined((*this)[i]); + Valgrind::CheckDefined((*this)[i]); // check the "pseudo" primary variables - Opm::Valgrind::CheckDefined(primaryVarsMeaning_); - Opm::Valgrind::CheckDefined(pvtRegionIdx_); + Valgrind::CheckDefined(primaryVarsMeaning_); + Valgrind::CheckDefined(pvtRegionIdx_); #endif // NDEBUG } @@ -748,18 +748,18 @@ private: Scalar Sw, const MaterialLawParams& matParams) const { - using SatOnlyFluidState = Opm::SimpleModularFluidState; + using SatOnlyFluidState = SimpleModularFluidState; SatOnlyFluidState fluidState; fluidState.setSaturation(waterPhaseIdx, Sw); fluidState.setSaturation(oilPhaseIdx, So); diff --git a/opm/models/blackoil/blackoilratevector.hh b/opm/models/blackoil/blackoilratevector.hh index 2e525770d..a037052d0 100644 --- a/opm/models/blackoil/blackoilratevector.hh +++ b/opm/models/blackoil/blackoilratevector.hh @@ -71,12 +71,12 @@ class BlackOilRateVector enum { enablePolymerMolarWeight = getPropValue() }; enum { enableFoam = getPropValue() }; enum { enableBrine = getPropValue() }; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; using ParentType = Dune::FieldVector; public: BlackOilRateVector() : ParentType() - { Opm::Valgrind::SetUndefined(*this); } + { Valgrind::SetUndefined(*this); } /*! * \copydoc ImmiscibleRateVector::ImmiscibleRateVector(Scalar) diff --git a/opm/models/blackoil/blackoilsolventmodules.hh b/opm/models/blackoil/blackoilsolventmodules.hh index 9f48ba196..2b28c9b18 100644 --- a/opm/models/blackoil/blackoilsolventmodules.hh +++ b/opm/models/blackoil/blackoilsolventmodules.hh @@ -78,10 +78,10 @@ class BlackOilSolventModule using RateVector = GetPropType; using Indices = GetPropType; - using Toolbox = Opm::MathToolbox; - using SolventPvt = Opm::SolventPvt; + using Toolbox = MathToolbox; + using SolventPvt = ::Opm::SolventPvt; - using TabulatedFunction = typename Opm::Tabulated1DFunction; + using TabulatedFunction = Tabulated1DFunction; static constexpr unsigned solventSaturationIdx = Indices::solventSaturationIdx; static constexpr unsigned contiSolventEqIdx = Indices::contiSolventEqIdx; @@ -96,7 +96,7 @@ public: /*! * \brief Initialize all internal data structures needed by the solvent module */ - static void initFromState(const Opm::EclipseState& eclState, const Schedule& schedule) + static void initFromState(const EclipseState& eclState, const Schedule& schedule) { // some sanity checks: if solvents are enabled, the SOLVENT keyword must be // present, if solvents are disabled the keyword must not be present. @@ -118,7 +118,7 @@ public: unsigned numSatRegions = tableManager.getTabdims().getNumSatTables(); setNumSatRegions(numSatRegions); for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) { - const auto& ssfnTable = ssfnTables.template getTable(satRegionIdx); + const auto& ssfnTable = ssfnTables.template getTable(satRegionIdx); ssfnKrg_[satRegionIdx].setXYContainers(ssfnTable.getSolventFractionColumn(), ssfnTable.getGasRelPermMultiplierColumn(), /*sortInput=*/true); @@ -141,7 +141,7 @@ public: // resize the attributes of the object sof2Krn_.resize(numSatRegions); for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) { - const auto& sof2Table = sof2Tables.template getTable(satRegionIdx); + const auto& sof2Table = sof2Tables.template getTable(satRegionIdx); sof2Krn_[satRegionIdx].setXYContainers(sof2Table.getSoColumn(), sof2Table.getKroColumn(), /*sortInput=*/true); @@ -159,7 +159,7 @@ public: // resize the attributes of the object misc_.resize(numMiscRegions); for (unsigned miscRegionIdx = 0; miscRegionIdx < numMiscRegions; ++miscRegionIdx) { - const auto& miscTable = miscTables.template getTable(miscRegionIdx); + const auto& miscTable = miscTables.template getTable(miscRegionIdx); // solventFraction = Ss / (Ss + Sg); const auto& solventFraction = miscTable.getSolventFractionColumn(); @@ -179,7 +179,7 @@ public: assert(numMiscRegions == pmiscTables.size()); for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) { - const auto& pmiscTable = pmiscTables.template getTable(regionIdx); + const auto& pmiscTable = pmiscTables.template getTable(regionIdx); // Copy data const auto& po = pmiscTable.getOilPhasePressureColumn(); @@ -209,7 +209,7 @@ public: for (unsigned regionIdx = 0; regionIdx < numSatRegions; ++regionIdx) { - const Opm::MsfnTable& msfnTable = msfnTables.template getTable(regionIdx); + const MsfnTable& msfnTable = msfnTables.template getTable(regionIdx); // Copy data // Ssg = Ss + Sg; @@ -239,7 +239,7 @@ public: assert(numMiscRegions == sorwmisTables.size()); for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) { - const auto& sorwmisTable = sorwmisTables.template getTable(regionIdx); + const auto& sorwmisTable = sorwmisTables.template getTable(regionIdx); // Copy data const auto& sw = sorwmisTable.getWaterSaturationColumn(); @@ -266,7 +266,7 @@ public: assert(numMiscRegions ==sgcwmisTables.size()); for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) { - const auto& sgcwmisTable = sgcwmisTables.template getTable(regionIdx); + const auto& sgcwmisTable = sgcwmisTables.template getTable(regionIdx); // Copy data const auto& sw = sgcwmisTable.getWaterSaturationColumn(); @@ -308,7 +308,7 @@ public: assert(numMiscRegions == tlpmixparTables.size()); for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) { - const auto& tlpmixparTable = tlpmixparTables.template getTable(regionIdx); + const auto& tlpmixparTable = tlpmixparTables.template getTable(regionIdx); // Copy data const auto& po = tlpmixparTable.getOilPhasePressureColumn(); @@ -475,7 +475,7 @@ public: // solvents have disabled at compile time return; - Opm::VtkBlackOilSolventModule::registerParameters(); + VtkBlackOilSolventModule::registerParameters(); } /*! @@ -488,7 +488,7 @@ public: // solvents have disabled at compile time return; - model.addOutputModule(new Opm::VtkBlackOilSolventModule(simulator)); + model.addOutputModule(new VtkBlackOilSolventModule(simulator)); } static bool primaryVarApplies(unsigned pvIdx) @@ -582,7 +582,7 @@ public: else flux[contiSolventEqIdx] = extQuants.solventVolumeFlux() - *Opm::decay(up.solventInverseFormationVolumeFactor()); + *decay(up.solventInverseFormationVolumeFactor()); } else { if (upIdx == inIdx) @@ -592,7 +592,7 @@ public: else flux[contiSolventEqIdx] = extQuants.solventVolumeFlux() - *Opm::decay(up.solventDensity()); + *decay(up.solventDensity()); } } @@ -1321,7 +1321,7 @@ class BlackOilSolventExtensiveQuantities using FluidSystem = GetPropType; using GridView = GetPropType; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx; static constexpr int dimWorld = GridView::dimensionworld; @@ -1341,7 +1341,7 @@ public: unsigned timeIdx) { const auto& gradCalc = elemCtx.gradientCalculator(); - Opm::PressureCallback pressureCallback(elemCtx); + PressureCallback pressureCallback(elemCtx); const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(scvfIdx); const auto& faceNormal = scvf.normal(); @@ -1356,7 +1356,7 @@ public: elemCtx, scvfIdx, pressureCallback); - Opm::Valgrind::CheckDefined(solventPGrad); + Valgrind::CheckDefined(solventPGrad); // correct the pressure gradients by the gravitational acceleration if (EWOMS_GET_PARAM(TypeTag, bool, EnableGravity)) { @@ -1402,8 +1402,8 @@ public: for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) { solventPGrad[dimIdx] += f[dimIdx]; - if (!Opm::isfinite(solventPGrad[dimIdx])) - throw Opm::NumericalIssue("Non-finite potential gradient for solvent 'phase'"); + if (!isfinite(solventPGrad[dimIdx])) + throw NumericalIssue("Non-finite potential gradient for solvent 'phase'"); } } @@ -1430,7 +1430,7 @@ public: if (solventUpstreamDofIdx_ == i) solventVolumeFlux_ = solventPGradNormal*up.solventMobility(); else - solventVolumeFlux_ = solventPGradNormal*Opm::scalarValue(up.solventMobility()); + solventVolumeFlux_ = solventPGradNormal*scalarValue(up.solventMobility()); } /*! @@ -1472,7 +1472,7 @@ public: pressureExterior += distZ*g*rhoAvg; Evaluation pressureDiffSolvent = pressureExterior - pressureInterior; - if (std::abs(Opm::scalarValue(pressureDiffSolvent)) > thpres) { + if (std::abs(scalarValue(pressureDiffSolvent)) > thpres) { if (pressureDiffSolvent < 0.0) pressureDiffSolvent += thpres; else @@ -1508,7 +1508,7 @@ public: *pressureDiffSolvent; else solventVolumeFlux_ = - Opm::scalarValue(up.solventMobility()) + scalarValue(up.solventMobility()) *(-trans/faceArea) *pressureDiffSolvent; } diff --git a/opm/models/common/darcyfluxmodule.hh b/opm/models/common/darcyfluxmodule.hh index d794310f6..dd5ff1704 100644 --- a/opm/models/common/darcyfluxmodule.hh +++ b/opm/models/common/darcyfluxmodule.hh @@ -125,7 +125,7 @@ class DarcyExtensiveQuantities enum { dimWorld = GridView::dimensionworld }; enum { numPhases = getPropValue() }; - using Toolbox = typename Opm::MathToolbox; + using Toolbox = MathToolbox; using ParameterCache = typename FluidSystem::template ParameterCache; using EvalDimVector = Dune::FieldVector; using DimVector = Dune::FieldVector; @@ -186,7 +186,7 @@ protected: unsigned timeIdx) { const auto& gradCalc = elemCtx.gradientCalculator(); - Opm::PressureCallback pressureCallback(elemCtx); + PressureCallback pressureCallback(elemCtx); const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(faceIdx); const auto& faceNormal = scvf.normal(); @@ -200,7 +200,7 @@ protected: // calculate the "raw" pressure gradient for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { if (!elemCtx.model().phaseIsConsidered(phaseIdx)) { - Opm::Valgrind::SetUndefined(potentialGrad_[phaseIdx]); + Valgrind::SetUndefined(potentialGrad_[phaseIdx]); continue; } @@ -209,7 +209,7 @@ protected: elemCtx, faceIdx, pressureCallback); - Opm::Valgrind::CheckDefined(potentialGrad_[phaseIdx]); + Valgrind::CheckDefined(potentialGrad_[phaseIdx]); } // correct the pressure gradients by the gravitational acceleration @@ -280,21 +280,21 @@ protected: potentialGrad_[phaseIdx][dimIdx] += f[dimIdx]; for (unsigned dimIdx = 0; dimIdx < potentialGrad_[phaseIdx].size(); ++dimIdx) { - if (!Opm::isfinite(potentialGrad_[phaseIdx][dimIdx])) { - throw Opm::NumericalIssue("Non-finite potential gradient for phase '" - +std::string(FluidSystem::phaseName(phaseIdx))+"'"); + if (!isfinite(potentialGrad_[phaseIdx][dimIdx])) { + throw NumericalIssue("Non-finite potential gradient for phase '" + +std::string(FluidSystem::phaseName(phaseIdx))+"'"); } } } } - Opm::Valgrind::SetUndefined(K_); + Valgrind::SetUndefined(K_); elemCtx.problem().intersectionIntrinsicPermeability(K_, elemCtx, faceIdx, timeIdx); - Opm::Valgrind::CheckDefined(K_); + Valgrind::CheckDefined(K_); for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { if (!elemCtx.model().phaseIsConsidered(phaseIdx)) { - Opm::Valgrind::SetUndefined(potentialGrad_[phaseIdx]); + Valgrind::SetUndefined(potentialGrad_[phaseIdx]); continue; } @@ -335,12 +335,12 @@ protected: const FluidState& fluidState) { const auto& gradCalc = elemCtx.gradientCalculator(); - Opm::BoundaryPressureCallback pressureCallback(elemCtx, fluidState); + BoundaryPressureCallback pressureCallback(elemCtx, fluidState); // calculate the pressure gradient for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { if (!elemCtx.model().phaseIsConsidered(phaseIdx)) { - Opm::Valgrind::SetUndefined(potentialGrad_[phaseIdx]); + Valgrind::SetUndefined(potentialGrad_[phaseIdx]); continue; } @@ -349,7 +349,7 @@ protected: elemCtx, boundaryFaceIdx, pressureCallback); - Opm::Valgrind::CheckDefined(potentialGrad_[phaseIdx]); + Valgrind::CheckDefined(potentialGrad_[phaseIdx]); } const auto& scvf = elemCtx.stencil(timeIdx).boundaryFace(boundaryFaceIdx); @@ -384,7 +384,7 @@ protected: Evaluation rhoIn = intQuantsIn.fluidState().density(phaseIdx); Evaluation pStatIn = - gTimesDist*rhoIn; - Opm::Valgrind::CheckDefined(pStatIn); + Valgrind::CheckDefined(pStatIn); // compute the hydrostatic gradient between the control volume and face integration // point. This gradient exhibitis the same direction as the vector between the // control volume center and face integration point (-distVecIn / absDist) and the @@ -397,11 +397,11 @@ protected: for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) potentialGrad_[phaseIdx][dimIdx] += f[dimIdx]; - Opm::Valgrind::CheckDefined(potentialGrad_[phaseIdx]); + Valgrind::CheckDefined(potentialGrad_[phaseIdx]); for (unsigned dimIdx = 0; dimIdx < potentialGrad_[phaseIdx].size(); ++dimIdx) { - if (!Opm::isfinite(potentialGrad_[phaseIdx][dimIdx])) { - throw Opm::NumericalIssue("Non finite potential gradient for phase '" - +std::string(FluidSystem::phaseName(phaseIdx))+"'"); + if (!isfinite(potentialGrad_[phaseIdx][dimIdx])) { + throw NumericalIssue("Non finite potential gradient for phase '" + +std::string(FluidSystem::phaseName(phaseIdx))+"'"); } } } @@ -414,7 +414,7 @@ protected: Scalar kr[numPhases]; MaterialLaw::relativePermeabilities(kr, matParams, fluidState); - Opm::Valgrind::CheckDefined(kr); + Valgrind::CheckDefined(kr); for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) { if (!elemCtx.model().phaseIsConsidered(phaseIdx)) @@ -447,7 +447,7 @@ protected: mobility_[phaseIdx] = Toolbox::value(intQuantsIn.mobility(phaseIdx)); else mobility_[phaseIdx] = intQuantsIn.mobility(phaseIdx); - Opm::Valgrind::CheckDefined(mobility_[phaseIdx]); + Valgrind::CheckDefined(mobility_[phaseIdx]); } } @@ -461,7 +461,7 @@ protected: { const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(scvfIdx); const DimVector& normal = scvf.normal(); - Opm::Valgrind::CheckDefined(normal); + Valgrind::CheckDefined(normal); for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) { filterVelocity_[phaseIdx] = 0.0; @@ -470,7 +470,7 @@ protected: continue; asImp_().calculateFilterVelocity_(phaseIdx); - Opm::Valgrind::CheckDefined(filterVelocity_[phaseIdx]); + Valgrind::CheckDefined(filterVelocity_[phaseIdx]); volumeFlux_[phaseIdx] = 0.0; for (unsigned i = 0; i < normal.size(); ++i) @@ -490,7 +490,7 @@ protected: { const auto& scvf = elemCtx.stencil(timeIdx).boundaryFace(boundaryFaceIdx); const DimVector& normal = scvf.normal(); - Opm::Valgrind::CheckDefined(normal); + Valgrind::CheckDefined(normal); for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) { if (!elemCtx.model().phaseIsConsidered(phaseIdx)) { @@ -500,7 +500,7 @@ protected: } asImp_().calculateFilterVelocity_(phaseIdx); - Opm::Valgrind::CheckDefined(filterVelocity_[phaseIdx]); + Valgrind::CheckDefined(filterVelocity_[phaseIdx]); volumeFlux_[phaseIdx] = 0.0; for (unsigned i = 0; i < normal.size(); ++i) volumeFlux_[phaseIdx] += filterVelocity_[phaseIdx][i] * normal[i]; @@ -510,7 +510,7 @@ protected: void calculateFilterVelocity_(unsigned phaseIdx) { #ifndef NDEBUG - assert(Opm::isfinite(mobility_[phaseIdx])); + assert(isfinite(mobility_[phaseIdx])); for (unsigned i = 0; i < K_.M(); ++ i) for (unsigned j = 0; j < K_.N(); ++ j) assert(std::isfinite(K_[i][j])); @@ -521,7 +521,7 @@ protected: #ifndef NDEBUG for (unsigned i = 0; i < filterVelocity_[phaseIdx].size(); ++ i) - assert(Opm::isfinite(filterVelocity_[phaseIdx][i])); + assert(isfinite(filterVelocity_[phaseIdx][i])); #endif } diff --git a/opm/models/common/forchheimerfluxmodule.hh b/opm/models/common/forchheimerfluxmodule.hh index 13252ab7c..8bf053243 100644 --- a/opm/models/common/forchheimerfluxmodule.hh +++ b/opm/models/common/forchheimerfluxmodule.hh @@ -225,7 +225,7 @@ class ForchheimerExtensiveQuantities enum { dimWorld = GridView::dimensionworld }; enum { numPhases = getPropValue() }; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; using DimVector = Dune::FieldVector; using DimEvalVector = Dune::FieldVector; @@ -271,16 +271,16 @@ protected: if (focusDofIdx == i) { ergunCoefficient_ = (intQuantsIn.ergunCoefficient() + - Opm::getValue(intQuantsEx.ergunCoefficient()))/2; + getValue(intQuantsEx.ergunCoefficient()))/2; } else if (focusDofIdx == j) ergunCoefficient_ = - (Opm::getValue(intQuantsIn.ergunCoefficient()) + + (getValue(intQuantsIn.ergunCoefficient()) + intQuantsEx.ergunCoefficient())/2; else ergunCoefficient_ = - (Opm::getValue(intQuantsIn.ergunCoefficient()) + - Opm::getValue(intQuantsEx.ergunCoefficient()))/2; + (getValue(intQuantsIn.ergunCoefficient()) + + getValue(intQuantsEx.ergunCoefficient()))/2; // obtain the mobility to passability ratio for each phase. for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) { @@ -298,9 +298,9 @@ protected: } else { density_[phaseIdx] = - Opm::getValue(up.fluidState().density(phaseIdx)); + getValue(up.fluidState().density(phaseIdx)); mobilityPassabilityRatio_[phaseIdx] = - Opm::getValue(up.mobilityPassabilityRatio(phaseIdx)); + getValue(up.mobilityPassabilityRatio(phaseIdx)); } } } @@ -325,7 +325,7 @@ protected: if (focusDofIdx == i) ergunCoefficient_ = intQuantsIn.ergunCoefficient(); else - ergunCoefficient_ = Opm::getValue(intQuantsIn.ergunCoefficient()); + ergunCoefficient_ = getValue(intQuantsIn.ergunCoefficient()); // calculate the square root of the intrinsic permeability assert(isDiagonal_(this->K_)); @@ -343,9 +343,9 @@ protected: } else { density_[phaseIdx] = - Opm::getValue(intQuantsIn.fluidState().density(phaseIdx)); + getValue(intQuantsIn.fluidState().density(phaseIdx)); mobilityPassabilityRatio_[phaseIdx] = - Opm::getValue(intQuantsIn.mobilityPassabilityRatio(phaseIdx)); + getValue(intQuantsIn.mobilityPassabilityRatio(phaseIdx)); } } } @@ -366,22 +366,22 @@ protected: const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(scvfIdx); const auto& normal = scvf.normal(); - Opm::Valgrind::CheckDefined(normal); + Valgrind::CheckDefined(normal); // obtain the Ergun coefficient from the intensive quantity object. Until a // better method comes along, we use arithmetic averaging. if (focusDofIdx == i) ergunCoefficient_ = (intQuantsI.ergunCoefficient() + - Opm::getValue(intQuantsJ.ergunCoefficient())) / 2; + getValue(intQuantsJ.ergunCoefficient())) / 2; else if (focusDofIdx == j) ergunCoefficient_ = - (Opm::getValue(intQuantsI.ergunCoefficient()) + + (getValue(intQuantsI.ergunCoefficient()) + intQuantsJ.ergunCoefficient()) / 2; else ergunCoefficient_ = - (Opm::getValue(intQuantsI.ergunCoefficient()) + - Opm::getValue(intQuantsJ.ergunCoefficient())) / 2; + (getValue(intQuantsI.ergunCoefficient()) + + getValue(intQuantsJ.ergunCoefficient())) / 2; /////////////// // calculate the weights of the upstream and the downstream control volumes @@ -449,8 +449,8 @@ protected: unsigned newtonIter = 0; while (deltaV.one_norm() > 1e-11) { if (newtonIter >= 50) - throw Opm::NumericalIssue("Could not determine Forchheimer velocity within " - +std::to_string(newtonIter)+" iterations"); + throw NumericalIssue("Could not determine Forchheimer velocity within " + +std::to_string(newtonIter)+" iterations"); ++newtonIter; // calculate the residual and its Jacobian matrix @@ -506,7 +506,7 @@ protected: const auto& alpha = density*mobilityPassabilityRatio*ergunCoefficient_*absVel; for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) residual[dimIdx] += sqrtK_[dimIdx]*alpha*velocity[dimIdx]; - Opm::Valgrind::CheckDefined(residual); + Valgrind::CheckDefined(residual); } void gradForchheimerResid_(DimEvalVector& residual, diff --git a/opm/models/common/multiphasebaseextensivequantities.hh b/opm/models/common/multiphasebaseextensivequantities.hh index ee5d0e0a1..6e00169a6 100644 --- a/opm/models/common/multiphasebaseextensivequantities.hh +++ b/opm/models/common/multiphasebaseextensivequantities.hh @@ -89,8 +89,8 @@ public: // normal or in the opposite one for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { if (!elemCtx.model().phaseIsConsidered(phaseIdx)) { - Opm::Valgrind::SetUndefined(upstreamScvIdx_[phaseIdx]); - Opm::Valgrind::SetUndefined(downstreamScvIdx_[phaseIdx]); + Valgrind::SetUndefined(upstreamScvIdx_[phaseIdx]); + Valgrind::SetUndefined(downstreamScvIdx_[phaseIdx]); continue; } diff --git a/opm/models/common/multiphasebasemodel.hh b/opm/models/common/multiphasebasemodel.hh index 8708b4586..4be284b8f 100644 --- a/opm/models/common/multiphasebasemodel.hh +++ b/opm/models/common/multiphasebasemodel.hh @@ -83,11 +83,11 @@ struct NumComponents { static constexpr int //! The type of the base base class for actual problems template -struct BaseProblem { using type = Opm::MultiPhaseBaseProblem; }; +struct BaseProblem { using type = MultiPhaseBaseProblem; }; //! By default, use the Darcy relation to determine the phase velocity template -struct FluxModule { using type = Opm::DarcyFluxModule; }; +struct FluxModule { using type = DarcyFluxModule; }; /*! * \brief Set the material law to the null law by default. @@ -98,10 +98,10 @@ struct MaterialLaw private: using Scalar = GetPropType; using FluidSystem = GetPropType; - using Traits = Opm::NullMaterialTraits; + using Traits = NullMaterialTraits; public: - using type = Opm::NullMaterial; + using type = NullMaterial; }; /*! @@ -116,7 +116,7 @@ struct MaterialLawParams //! by default template struct SolidEnergyLaw -{ using type = Opm::NullSolidEnergyLaw>; }; +{ using type = NullSolidEnergyLaw>; }; //! extract the type of the parameter objects for the solid energy storage law from the //! law itself @@ -127,7 +127,7 @@ struct SolidEnergyLawParams //! set the thermal conduction law to a dummy one by default template struct ThermalConductionLaw -{ using type = Opm::NullThermalConductionLaw>; }; +{ using type = NullThermalConductionLaw>; }; //! extract the type of the parameter objects for the thermal conduction law from the law //! itself @@ -182,8 +182,8 @@ public: ParentType::registerParameters(); // register runtime parameters of the VTK output modules - Opm::VtkMultiPhaseModule::registerParameters(); - Opm::VtkTemperatureModule::registerParameters(); + VtkMultiPhaseModule::registerParameters(); + VtkTemperatureModule::registerParameters(); } /*! @@ -257,8 +257,8 @@ public: ParentType::registerOutputModules_(); // add the VTK output modules which make sense for all multi-phase models - this->addOutputModule(new Opm::VtkMultiPhaseModule(this->simulator_)); - this->addOutputModule(new Opm::VtkTemperatureModule(this->simulator_)); + this->addOutputModule(new VtkMultiPhaseModule(this->simulator_)); + this->addOutputModule(new VtkTemperatureModule(this->simulator_)); } private: diff --git a/opm/models/common/multiphasebaseproblem.hh b/opm/models/common/multiphasebaseproblem.hh index 9de30ef91..99c92064d 100644 --- a/opm/models/common/multiphasebaseproblem.hh +++ b/opm/models/common/multiphasebaseproblem.hh @@ -54,7 +54,7 @@ class MultiPhaseBaseProblem , public GetPropType::FluxBaseProblem { //! \cond SKIP_THIS - using ParentType = Opm::FvBaseProblem; + using ParentType = FvBaseProblem; using Implementation = GetPropType; using Scalar = GetPropType; @@ -115,7 +115,7 @@ public: // you have off-main diagonal entries in your permeabilities! for (unsigned i = 0; i < dimWorld; ++i) for (unsigned j = 0; j < dimWorld; ++j) - result[i][j] = Opm::harmonicMean(K1[i][j], K2[i][j]); + result[i][j] = harmonicMean(K1[i][j], K2[i][j]); } /*! @@ -305,7 +305,7 @@ public: */ unsigned markForGridAdaptation() { - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; unsigned numMarked = 0; ElementContext elemCtx( this->simulator() ); diff --git a/opm/models/common/quantitycallbacks.hh b/opm/models/common/quantitycallbacks.hh index e220569d7..5d545b831 100644 --- a/opm/models/common/quantitycallbacks.hh +++ b/opm/models/common/quantitycallbacks.hh @@ -54,7 +54,7 @@ class TemperatureCallback public: using ResultType = typename std::remove_const::type>::type; - using ResultValueType = typename Opm::MathToolbox::ValueType; + using ResultValueType = typename MathToolbox::ValueType; TemperatureCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) @@ -90,11 +90,11 @@ class PressureCallback public: using ResultType = typename std::remove_const::type>::type; - using ResultValueType = typename Opm::MathToolbox::ValueType; + using ResultValueType = typename MathToolbox::ValueType; PressureCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) - { Opm::Valgrind::SetUndefined(phaseIdx_); } + { Valgrind::SetUndefined(phaseIdx_); } PressureCallback(const ElementContext& elemCtx, unsigned phaseIdx) : elemCtx_(elemCtx) @@ -114,7 +114,7 @@ public: */ ResultType operator()(unsigned dofIdx) const { - Opm::Valgrind::CheckDefined(phaseIdx_); + Valgrind::CheckDefined(phaseIdx_); return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().pressure(phaseIdx_); } @@ -138,7 +138,7 @@ class BoundaryPressureCallback using IQRawFluidState = decltype(std::declval().fluidState()); using IQFluidState = typename std::remove_const::type>::type; using IQScalar = typename IQFluidState::Scalar; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; public: using ResultType = IQScalar; @@ -146,7 +146,7 @@ public: BoundaryPressureCallback(const ElementContext& elemCtx, const FluidState& boundaryFs) : elemCtx_(elemCtx) , boundaryFs_(boundaryFs) - { Opm::Valgrind::SetUndefined(phaseIdx_); } + { Valgrind::SetUndefined(phaseIdx_); } BoundaryPressureCallback(const ElementContext& elemCtx, const FluidState& boundaryFs, @@ -169,13 +169,13 @@ public: */ ResultType operator()(unsigned dofIdx) const { - Opm::Valgrind::CheckDefined(phaseIdx_); + Valgrind::CheckDefined(phaseIdx_); return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().pressure(phaseIdx_); } IQScalar boundaryValue() const { - Opm::Valgrind::CheckDefined(phaseIdx_); + Valgrind::CheckDefined(phaseIdx_); return boundaryFs_.pressure(phaseIdx_); } @@ -201,11 +201,11 @@ class DensityCallback public: using ResultType = typename std::remove_const::type>::type; - using ResultValueType = typename Opm::MathToolbox::ValueType; + using ResultValueType = typename MathToolbox::ValueType; DensityCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) - { Opm::Valgrind::SetUndefined(phaseIdx_); } + { Valgrind::SetUndefined(phaseIdx_); } DensityCallback(const ElementContext& elemCtx, unsigned phaseIdx) : elemCtx_(elemCtx) @@ -225,7 +225,7 @@ public: */ ResultType operator()(unsigned dofIdx) const { - Opm::Valgrind::CheckDefined(phaseIdx_); + Valgrind::CheckDefined(phaseIdx_); return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().density(phaseIdx_); } @@ -249,11 +249,11 @@ class MolarDensityCallback public: using ResultType = decltype(std::declval().molarDensity(0)); - using ResultValueType = typename Opm::MathToolbox::ValueType; + using ResultValueType = typename MathToolbox::ValueType; MolarDensityCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) - { Opm::Valgrind::SetUndefined(phaseIdx_); } + { Valgrind::SetUndefined(phaseIdx_); } MolarDensityCallback(const ElementContext& elemCtx, unsigned phaseIdx) : elemCtx_(elemCtx) @@ -273,7 +273,7 @@ public: */ ResultType operator()(unsigned dofIdx) const { - Opm::Valgrind::CheckDefined(phaseIdx_); + Valgrind::CheckDefined(phaseIdx_); return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().molarDensity(phaseIdx_); } @@ -298,11 +298,11 @@ class ViscosityCallback public: using ResultType = typename std::remove_const::type>::type; - using ResultValueType = typename Opm::MathToolbox::ValueType; + using ResultValueType = typename MathToolbox::ValueType; ViscosityCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) - { Opm::Valgrind::SetUndefined(phaseIdx_); } + { Valgrind::SetUndefined(phaseIdx_); } ViscosityCallback(const ElementContext& elemCtx, unsigned phaseIdx) : elemCtx_(elemCtx) @@ -322,7 +322,7 @@ public: */ ResultType operator()(unsigned dofIdx) const { - Opm::Valgrind::CheckDefined(phaseIdx_); + Valgrind::CheckDefined(phaseIdx_); return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().viscosity(phaseIdx_); } @@ -350,7 +350,7 @@ class VelocityCallback public: using ResultType = typename std::remove_const::type>::type; using ResultFieldType = typename ResultType::field_type; - using ResultFieldValueType = typename Opm::MathToolbox::ValueType; + using ResultFieldValueType = typename MathToolbox::ValueType; VelocityCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) @@ -382,11 +382,11 @@ class VelocityComponentCallback public: using ResultType = typename std::remove_const::type>::type; - using ResultValueType = typename Opm::MathToolbox::ValueType; + using ResultValueType = typename MathToolbox::ValueType; VelocityComponentCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) - { Opm::Valgrind::SetUndefined(dimIdx_); } + { Valgrind::SetUndefined(dimIdx_); } VelocityComponentCallback(const ElementContext& elemCtx, unsigned dimIdx) : elemCtx_(elemCtx) @@ -406,7 +406,7 @@ public: */ ResultType operator()(unsigned dofIdx) const { - Opm::Valgrind::CheckDefined(dimIdx_); + Valgrind::CheckDefined(dimIdx_); return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).velocityCenter()[dimIdx_]; } @@ -431,13 +431,13 @@ class MoleFractionCallback public: using ResultType = typename std::remove_const::type>::type; - using ResultValueType = typename Opm::MathToolbox::ValueType; + using ResultValueType = typename MathToolbox::ValueType; MoleFractionCallback(const ElementContext& elemCtx) : elemCtx_(elemCtx) { - Opm::Valgrind::SetUndefined(phaseIdx_); - Opm::Valgrind::SetUndefined(compIdx_); + Valgrind::SetUndefined(phaseIdx_); + Valgrind::SetUndefined(compIdx_); } MoleFractionCallback(const ElementContext& elemCtx, unsigned phaseIdx, unsigned compIdx) @@ -466,8 +466,8 @@ public: */ ResultType operator()(unsigned dofIdx) const { - Opm::Valgrind::CheckDefined(phaseIdx_); - Opm::Valgrind::CheckDefined(compIdx_); + Valgrind::CheckDefined(phaseIdx_); + Valgrind::CheckDefined(compIdx_); return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().moleFraction(phaseIdx_, compIdx_); } diff --git a/opm/models/discretization/common/fvbaseadlocallinearizer.hh b/opm/models/discretization/common/fvbaseadlocallinearizer.hh index 6bc62341e..624198cb7 100644 --- a/opm/models/discretization/common/fvbaseadlocallinearizer.hh +++ b/opm/models/discretization/common/fvbaseadlocallinearizer.hh @@ -57,7 +57,7 @@ struct AutoDiffLocalLinearizer {}; // set the properties to be spliced in template struct LocalLinearizer -{ using type = Opm::FvBaseAdLocalLinearizer; }; +{ using type = FvBaseAdLocalLinearizer; }; //! Set the function evaluation w.r.t. the primary variables template @@ -69,7 +69,7 @@ private: using Scalar = GetPropType; public: - using type = Opm::DenseAd::Evaluation; + using type = DenseAd::Evaluation; }; } // namespace Opm::Properties @@ -286,7 +286,7 @@ protected: // with regard to the focus variable 'pvIdx' of the degree of freedom // 'focusDofIdx' jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx] = resid[dofIdx][eqIdx].derivative(pvIdx); - Opm::Valgrind::CheckDefined(jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx]); + Valgrind::CheckDefined(jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx]); } } } diff --git a/opm/models/discretization/common/fvbasediscretization.hh b/opm/models/discretization/common/fvbasediscretization.hh index df4cc1f5d..fea9b532f 100644 --- a/opm/models/discretization/common/fvbasediscretization.hh +++ b/opm/models/discretization/common/fvbasediscretization.hh @@ -90,7 +90,7 @@ namespace Opm::Properties { //! Set the default type for the time manager template -struct Simulator { using type = Opm::Simulator; }; +struct Simulator { using type = ::Opm::Simulator; }; //! Mapper for the grid view's vertices. template @@ -109,20 +109,20 @@ struct BorderListCreator using DofMapper = GetPropType; using GridView = GetPropType; public: - using type = Opm::Linear::NullBorderListCreator; + using type = Linear::NullBorderListCreator; }; template -struct DiscLocalResidual { using type = Opm::FvBaseLocalResidual; }; +struct DiscLocalResidual { using type = FvBaseLocalResidual; }; template -struct DiscIntensiveQuantities { using type = Opm::FvBaseIntensiveQuantities; }; +struct DiscIntensiveQuantities { using type = FvBaseIntensiveQuantities; }; template -struct DiscExtensiveQuantities { using type = Opm::FvBaseExtensiveQuantities; }; +struct DiscExtensiveQuantities { using type = FvBaseExtensiveQuantities; }; //! Calculates the gradient of any quantity given the index of a flux approximation point template -struct GradientCalculator { using type = Opm::FvBaseGradientCalculator; }; +struct GradientCalculator { using type = FvBaseGradientCalculator; }; //! The maximum allowed number of timestep divisions for the //! Newton solver @@ -164,7 +164,7 @@ struct BoundaryRateVector * \brief The class which represents constraints. */ template -struct Constraints { using type = Opm::FvBaseConstraints; }; +struct Constraints { using type = FvBaseConstraints; }; /*! * \brief The type for storing a residual for an element. @@ -184,7 +184,7 @@ struct GlobalEqVector * \brief An object representing a local set of primary variables. */ template -struct PrimaryVariables { using type = Opm::FvBasePrimaryVariables; }; +struct PrimaryVariables { using type = FvBasePrimaryVariables; }; /*! * \brief The type of a solution for the whole grid at a fixed time. @@ -199,23 +199,23 @@ struct SolutionVector * This should almost certainly be overloaded by the model... */ template -struct IntensiveQuantities { using type = Opm::FvBaseIntensiveQuantities; }; +struct IntensiveQuantities { using type = FvBaseIntensiveQuantities; }; /*! * \brief The element context */ template -struct ElementContext { using type = Opm::FvBaseElementContext; }; +struct ElementContext { using type = FvBaseElementContext; }; template -struct BoundaryContext { using type = Opm::FvBaseBoundaryContext; }; +struct BoundaryContext { using type = FvBaseBoundaryContext; }; template -struct ConstraintsContext { using type = Opm::FvBaseConstraintsContext; }; +struct ConstraintsContext { using type = FvBaseConstraintsContext; }; /*! * \brief The OpenMP threads manager */ template -struct ThreadManager { using type = Opm::ThreadManager; }; +struct ThreadManager { using type = ::Opm::ThreadManager; }; template struct ThreadsPerProcess { static constexpr int value = 1; }; template @@ -225,7 +225,7 @@ struct UseLinearizationLock { static conste * \brief Linearizer for the global system of equations. */ template -struct Linearizer { using type = Opm::FvBaseLinearizer; }; +struct Linearizer { using type = FvBaseLinearizer; }; //! use an unlimited time step size by default template @@ -370,12 +370,12 @@ class FvBaseDiscretization historySize = getPropValue(), }; - using IntensiveQuantitiesVector = std::vector >; + using IntensiveQuantitiesVector = std::vector >; using Element = typename GridView::template Codim<0>::Entity; using ElementIterator = typename GridView::template Codim<0>::Iterator; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; using VectorBlock = Dune::FieldVector; using EvalEqVector = Dune::FieldVector; @@ -500,7 +500,7 @@ public: NewtonMethod::registerParameters(); // register runtime parameters of the output modules - Opm::VtkPrimaryVarsModule::registerParameters(); + VtkPrimaryVarsModule::registerParameters(); EWOMS_REGISTER_PARAM(TypeTag, bool, EnableGridAdaptation, "Enable adaptive grid refinement/coarsening"); EWOMS_REGISTER_PARAM(TypeTag, bool, EnableVtkOutput, "Global switch for turning on writing VTK files"); @@ -1050,7 +1050,7 @@ public: boundaryCtx, faceIdx, /*timeIdx=*/0); - Opm::Valgrind::CheckDefined(values); + Valgrind::CheckDefined(values); unsigned dofIdx = boundaryCtx.interiorScvIndex(faceIdx, /*timeIdx=*/0); const auto& insideIntQuants = elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0); @@ -1075,7 +1075,7 @@ public: elemCtx, dofIdx, /*timeIdx=*/0); - Opm::Valgrind::CheckDefined(values); + Valgrind::CheckDefined(values); const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0); Scalar dofVolume = @@ -1257,7 +1257,7 @@ public: */ bool update() { - Opm::TimerGuard prePostProcessGuard(prePostProcessTimer_); + TimerGuard prePostProcessGuard(prePostProcessTimer_); #ifndef NDEBUG for (unsigned timeIdx = 0; timeIdx < historySize; ++timeIdx) { @@ -1859,16 +1859,16 @@ public: } #endif - const Opm::Timer& prePostProcessTimer() const + const Timer& prePostProcessTimer() const { return prePostProcessTimer_; } - const Opm::Timer& linearizeTimer() const + const Timer& linearizeTimer() const { return linearizeTimer_; } - const Opm::Timer& solveTimer() const + const Timer& solveTimer() const { return solveTimer_; } - const Opm::Timer& updateTimer() const + const Timer& updateTimer() const { return updateTimer_; } protected: @@ -1909,7 +1909,7 @@ protected: void registerOutputModules_() { // add the output modules available on all model - auto *mod = new Opm::VtkPrimaryVarsModule(simulator_); + auto *mod = new VtkPrimaryVarsModule(simulator_); this->outputModules_.push_back(mod); } @@ -1946,10 +1946,10 @@ protected: NewtonMethod newtonMethod_; - Opm::Timer prePostProcessTimer_; - Opm::Timer linearizeTimer_; - Opm::Timer solveTimer_; - Opm::Timer updateTimer_; + Timer prePostProcessTimer_; + Timer linearizeTimer_; + Timer solveTimer_; + Timer updateTimer_; // calculates the local jacobian matrix for a given element std::vector localLinearizer_; diff --git a/opm/models/discretization/common/fvbaseelementcontext.hh b/opm/models/discretization/common/fvbaseelementcontext.hh index db04be818..63dfb3b00 100644 --- a/opm/models/discretization/common/fvbaseelementcontext.hh +++ b/opm/models/discretization/common/fvbaseelementcontext.hh @@ -103,10 +103,10 @@ public: } static void *operator new(size_t size) - { return Opm::aligned_alloc(alignof(FvBaseElementContext), size); } + { return aligned_alloc(alignof(FvBaseElementContext), size); } static void operator delete(void *ptr) - { Opm::aligned_free(ptr); } + { aligned_free(ptr); } /*! * \brief Construct all volume and extensive quantities of an element @@ -597,8 +597,8 @@ protected: GradientCalculator gradientCalculator_; - std::vector > dofVars_; - std::vector > extensiveQuantities_; + std::vector > dofVars_; + std::vector > extensiveQuantities_; const Simulator *simulatorPtr_; const Element *elemPtr_; diff --git a/opm/models/discretization/common/fvbaseextensivequantities.hh b/opm/models/discretization/common/fvbaseextensivequantities.hh index 2f2069c8e..4b44856b4 100644 --- a/opm/models/discretization/common/fvbaseextensivequantities.hh +++ b/opm/models/discretization/common/fvbaseextensivequantities.hh @@ -73,7 +73,7 @@ public: extrusionFactor_ = (elemCtx.intensiveQuantities(interiorScvIdx_, timeIdx).extrusionFactor() + elemCtx.intensiveQuantities(exteriorScvIdx_, timeIdx).extrusionFactor()) / 2; - Opm::Valgrind::CheckDefined(extrusionFactor_); + Valgrind::CheckDefined(extrusionFactor_); assert(extrusionFactor_ > 0); } @@ -99,7 +99,7 @@ public: exteriorScvIdx_ = static_cast(dofIdx); extrusionFactor_ = context.intensiveQuantities(bfIdx, timeIdx).extrusionFactor(); - Opm::Valgrind::CheckDefined(extrusionFactor_); + Valgrind::CheckDefined(extrusionFactor_); assert(extrusionFactor_ > 0); } diff --git a/opm/models/discretization/common/fvbasefdlocallinearizer.hh b/opm/models/discretization/common/fvbasefdlocallinearizer.hh index 4531bf2e2..27082d7e7 100644 --- a/opm/models/discretization/common/fvbasefdlocallinearizer.hh +++ b/opm/models/discretization/common/fvbasefdlocallinearizer.hh @@ -66,7 +66,7 @@ struct BaseEpsilon { using type = UndefinedProperty; }; // set the properties to be spliced in template struct LocalLinearizer -{ using type = Opm::FvBaseFdLocalLinearizer; }; +{ using type = FvBaseFdLocalLinearizer; }; template struct Evaluation @@ -282,7 +282,7 @@ public: unsigned globalIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0); Scalar pvWeight = elemCtx.model().primaryVarWeight(globalIdx, pvIdx); assert(pvWeight > 0 && std::isfinite(pvWeight)); - Opm::Valgrind::CheckDefined(pvWeight); + Valgrind::CheckDefined(pvWeight); return baseEpsilon()/pvWeight; } @@ -476,7 +476,7 @@ protected: #ifndef NDEBUG for (unsigned i = 0; i < derivResidual_.size(); ++i) - Opm::Valgrind::CheckDefined(derivResidual_[i]); + Valgrind::CheckDefined(derivResidual_[i]); #endif } @@ -497,7 +497,7 @@ protected: // regard to the primary variable 'pvIdx' of the degree of freedom // 'focusDofIdx' jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx] = derivResidual_[dofIdx][eqIdx]; - Opm::Valgrind::CheckDefined(jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx]); + Valgrind::CheckDefined(jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx]); } } } diff --git a/opm/models/discretization/common/fvbasegradientcalculator.hh b/opm/models/discretization/common/fvbasegradientcalculator.hh index cc4508b66..c1d1d6af1 100644 --- a/opm/models/discretization/common/fvbasegradientcalculator.hh +++ b/opm/models/discretization/common/fvbasegradientcalculator.hh @@ -116,12 +116,12 @@ public: if (i == focusDofIdx) value = quantityCallback(i)*interiorDistance; else - value = Opm::getValue(quantityCallback(i))*interiorDistance; + value = getValue(quantityCallback(i))*interiorDistance; if (j == focusDofIdx) value += quantityCallback(j)*exteriorDistance; else - value += Opm::getValue(quantityCallback(j))*exteriorDistance; + value += getValue(quantityCallback(j))*exteriorDistance; value /= interiorDistance + exteriorDistance; @@ -165,9 +165,9 @@ public: value[k] *= interiorDistance; } else { - const auto& dofVal = Opm::getValue(quantityCallback(i)); + const auto& dofVal = getValue(quantityCallback(i)); for (int k = 0; k < dofVal.size(); ++k) - value[k] = Opm::getValue(dofVal[k])*interiorDistance; + value[k] = getValue(dofVal[k])*interiorDistance; } if (j == focusDofIdx) { @@ -178,7 +178,7 @@ public: else { const auto& dofVal = quantityCallback(j); for (int k = 0; k < dofVal.size(); ++k) - value[k] += Opm::getValue(dofVal[k])*exteriorDistance; + value[k] += getValue(dofVal[k])*exteriorDistance; } Scalar totDistance = interiorDistance + exteriorDistance; @@ -218,18 +218,18 @@ public: Evaluation deltay; if (i == focusIdx) { deltay = - Opm::getValue(quantityCallback(j)) + getValue(quantityCallback(j)) - quantityCallback(i); } else if (j == focusIdx) { deltay = quantityCallback(j) - - Opm::getValue(quantityCallback(i)); + - getValue(quantityCallback(i)); } else deltay = - Opm::getValue(quantityCallback(j)) - - Opm::getValue(quantityCallback(i)); + getValue(quantityCallback(j)) + - getValue(quantityCallback(i)); Scalar distSquared = 0.0; for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) { @@ -296,8 +296,8 @@ public: deltay = quantityCallback.boundaryValue() - quantityCallback(face.interiorIndex()); else deltay = - Opm::getValue(quantityCallback.boundaryValue()) - - Opm::getValue(quantityCallback(face.interiorIndex())); + getValue(quantityCallback.boundaryValue()) + - getValue(quantityCallback(face.interiorIndex())); const auto& boundaryFacePos = face.integrationPos(); const auto& interiorPos = stencil.subControlVolume(face.interiorIndex()).center(); diff --git a/opm/models/discretization/common/fvbaselinearizer.hh b/opm/models/discretization/common/fvbaselinearizer.hh index bb0c9ccfb..c148ede9f 100644 --- a/opm/models/discretization/common/fvbaselinearizer.hh +++ b/opm/models/discretization/common/fvbaselinearizer.hh @@ -89,7 +89,7 @@ class FvBaseLinearizer using GridCommHandleFactory = GetPropType; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; using Element = typename GridView::template Codim<0>::Entity; using ElementIterator = typename GridView::template Codim<0>::Iterator; @@ -219,7 +219,7 @@ public: succeeded = gridView_().comm().min(succeeded); if (!succeeded) - throw Opm::NumericalIssue("A process did not succeed in linearizing the system"); + throw NumericalIssue("A process did not succeed in linearizing the system"); } void finalize() @@ -252,7 +252,7 @@ public: succeeded = comm.min(succeeded); if (!succeeded) - throw Opm::NumericalIssue("linearization of an auxilary equation failed"); + throw NumericalIssue("linearization of an auxilary equation failed"); } } diff --git a/opm/models/discretization/common/fvbaselocalresidual.hh b/opm/models/discretization/common/fvbaselocalresidual.hh index 7f8b2638c..778457bcd 100644 --- a/opm/models/discretization/common/fvbaselocalresidual.hh +++ b/opm/models/discretization/common/fvbaselocalresidual.hh @@ -78,7 +78,7 @@ private: enum { numEq = getPropValue() }; enum { extensiveStorageTerm = getPropValue() }; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; using EvalVector = Dune::FieldVector; // copying the local residual class is not a good idea @@ -86,7 +86,7 @@ private: {} public: - using LocalEvalBlockVector = Dune::BlockVector >; + using LocalEvalBlockVector = Dune::BlockVector >; FvBaseLocalResidual() { } @@ -182,7 +182,7 @@ public: Scalar dofVolume = elemCtx.dofTotalVolume(dofIdx, /*timeIdx=*/0); assert(std::isfinite(dofVolume)); - Opm::Valgrind::CheckDefined(dofVolume); + Valgrind::CheckDefined(dofVolume); for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx) residual[dofIdx][eqIdx] /= dofVolume; @@ -283,8 +283,8 @@ public: size_t numPrimaryDof = elemCtx.numPrimaryDof(/*timeIdx=*/0); for (unsigned dofIdx=0; dofIdx < numPrimaryDof; dofIdx++) { for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) { - Opm::Valgrind::CheckDefined(storage[dofIdx][eqIdx]); - assert(Opm::isfinite(storage[dofIdx][eqIdx])); + Valgrind::CheckDefined(storage[dofIdx][eqIdx]); + assert(isfinite(storage[dofIdx][eqIdx])); } } #endif @@ -311,19 +311,19 @@ public: unsigned i = face.interiorIndex(); unsigned j = face.exteriorIndex(); - Opm::Valgrind::SetUndefined(flux); + Valgrind::SetUndefined(flux); asImp_().computeFlux(flux, /*context=*/elemCtx, scvfIdx, timeIdx); - Opm::Valgrind::CheckDefined(flux); + Valgrind::CheckDefined(flux); #ifndef NDEBUG for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) - assert(Opm::isfinite(flux[eqIdx])); + assert(isfinite(flux[eqIdx])); #endif Scalar alpha = elemCtx.extensiveQuantities(scvfIdx, timeIdx).extrusionFactor(); alpha *= face.area(); - Opm::Valgrind::CheckDefined(alpha); + Valgrind::CheckDefined(alpha); assert(alpha > 0.0); - assert(Opm::isfinite(alpha)); + assert(isfinite(alpha)); for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx) flux[eqIdx] *= alpha; @@ -342,7 +342,7 @@ public: // volume i and into sub-control volume j, we need to add the flux to finite // volume i and subtract it from finite volume j for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) { - assert(Opm::isfinite(flux[eqIdx])); + assert(isfinite(flux[eqIdx])); residual[i][eqIdx] += flux[eqIdx]; residual[j][eqIdx] -= flux[eqIdx]; } @@ -353,8 +353,8 @@ public: size_t numDof = elemCtx.numDof(timeIdx); for (unsigned i=0; i < numDof; i++) { for (unsigned j = 0; j < numEq; ++ j) { - assert(Opm::isfinite(residual[i][j])); - Opm::Valgrind::CheckDefined(residual[i][j]); + assert(isfinite(residual[i][j])); + Valgrind::CheckDefined(residual[i][j]); } } #endif @@ -445,8 +445,8 @@ protected: size_t numDof = elemCtx.numDof(/*timeIdx=*/0); for (unsigned i=0; i < numDof; i++) { for (unsigned j = 0; j < numEq; ++ j) { - assert(Opm::isfinite(residual[i][j])); - Opm::Valgrind::CheckDefined(residual[i][j]); + assert(isfinite(residual[i][j])); + Valgrind::CheckDefined(residual[i][j]); } } #endif @@ -464,9 +464,9 @@ protected: { BoundaryRateVector values; - Opm::Valgrind::SetUndefined(values); + Valgrind::SetUndefined(values); boundaryCtx.problem().boundary(values, boundaryCtx, boundaryFaceIdx, timeIdx); - Opm::Valgrind::CheckDefined(values); + Valgrind::CheckDefined(values); const auto& stencil = boundaryCtx.stencil(timeIdx); unsigned dofIdx = stencil.boundaryFace(boundaryFaceIdx).interiorIndex(); @@ -476,8 +476,8 @@ protected: stencil.boundaryFace(boundaryFaceIdx).area() * insideIntQuants.extrusionFactor(); - Opm::Valgrind::CheckDefined(values[eqIdx]); - assert(Opm::isfinite(values[eqIdx])); + Valgrind::CheckDefined(values[eqIdx]); + assert(isfinite(values[eqIdx])); } for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) @@ -504,13 +504,13 @@ protected: for (unsigned dofIdx=0; dofIdx < numPrimaryDof; dofIdx++) { Scalar extrusionFactor = elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0).extrusionFactor(); - Opm::Valgrind::CheckDefined(extrusionFactor); - assert(Opm::isfinite(extrusionFactor)); + Valgrind::CheckDefined(extrusionFactor); + assert(isfinite(extrusionFactor)); assert(extrusionFactor > 0.0); Scalar scvVolume = elemCtx.stencil(/*timeIdx=*/0).subControlVolume(dofIdx).volume() * extrusionFactor; - Opm::Valgrind::CheckDefined(scvVolume); - assert(Opm::isfinite(scvVolume)); + Valgrind::CheckDefined(scvVolume); + assert(isfinite(scvVolume)); assert(scvVolume > 0.0); // if the model uses extensive quantities in its storage term, and we use @@ -528,9 +528,9 @@ protected: asImp_().computeStorage(tmp, elemCtx, dofIdx, /*timeIdx=*/0); #ifndef NDEBUG - Opm::Valgrind::CheckDefined(tmp); + Valgrind::CheckDefined(tmp); for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) - assert(Opm::isfinite(tmp[eqIdx])); + assert(isfinite(tmp[eqIdx])); #endif if (elemCtx.enableStorageCache()) { @@ -559,7 +559,7 @@ protected: tmp2[eqIdx] = Toolbox::value(tmp[eqIdx]); } - Opm::Valgrind::CheckDefined(tmp2); + Valgrind::CheckDefined(tmp2); model.updateCachedStorage(globalDofIdx, /*timeIdx=*/1, tmp2); } @@ -568,7 +568,7 @@ protected: // if the storage term is cached and we're not looking at the first // iteration of the time step, we take the cached data. tmp2 = model.cachedStorage(globalDofIdx, /*timeIdx=*/1); - Opm::Valgrind::CheckDefined(tmp2); + Valgrind::CheckDefined(tmp2); } } else { @@ -576,7 +576,7 @@ protected: // we re-calculate it from scratch. tmp2 = 0.0; asImp_().computeStorage(tmp2, elemCtx, dofIdx, /*timeIdx=*/1); - Opm::Valgrind::CheckDefined(tmp2); + Valgrind::CheckDefined(tmp2); } // Use the implicit Euler time discretization @@ -589,7 +589,7 @@ protected: residual[dofIdx][eqIdx] += tmp[eqIdx]; } - Opm::Valgrind::CheckDefined(residual[dofIdx]); + Valgrind::CheckDefined(residual[dofIdx]); // deal with the source term asImp_().computeSource(sourceRate, elemCtx, dofIdx, /*timeIdx=*/0); @@ -602,7 +602,7 @@ protected: dofIdx != elemCtx.focusDofIndex()) { for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) - residual[dofIdx][eqIdx] -= Opm::scalarValue(sourceRate[eqIdx])*scvVolume; + residual[dofIdx][eqIdx] -= scalarValue(sourceRate[eqIdx])*scvVolume; } else { for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) { @@ -611,7 +611,7 @@ protected: } } - Opm::Valgrind::CheckDefined(residual[dofIdx]); + Valgrind::CheckDefined(residual[dofIdx]); } #if !defined NDEBUG @@ -619,8 +619,8 @@ protected: size_t numDof = elemCtx.numDof(/*timeIdx=*/0); for (unsigned i=0; i < numDof; i++) { for (unsigned j = 0; j < numEq; ++ j) { - assert(Opm::isfinite(residual[i][j])); - Opm::Valgrind::CheckDefined(residual[i][j]); + assert(isfinite(residual[i][j])); + Valgrind::CheckDefined(residual[i][j]); } } #endif diff --git a/opm/models/discretization/common/fvbasenewtonconvergencewriter.hh b/opm/models/discretization/common/fvbasenewtonconvergencewriter.hh index 6a743c105..bdff9b075 100644 --- a/opm/models/discretization/common/fvbasenewtonconvergencewriter.hh +++ b/opm/models/discretization/common/fvbasenewtonconvergencewriter.hh @@ -66,7 +66,7 @@ class FvBaseNewtonConvergenceWriter using NewtonMethod = GetPropType; static const int vtkFormat = getPropValue(); - using VtkMultiWriter = Opm::VtkMultiWriter; + using VtkMultiWriter = ::Opm::VtkMultiWriter; public: FvBaseNewtonConvergenceWriter(NewtonMethod& nm) diff --git a/opm/models/discretization/common/fvbasenewtonmethod.hh b/opm/models/discretization/common/fvbasenewtonmethod.hh index c6def10ec..f02904dfc 100644 --- a/opm/models/discretization/common/fvbasenewtonmethod.hh +++ b/opm/models/discretization/common/fvbasenewtonmethod.hh @@ -57,7 +57,7 @@ struct DiscNewtonMethod { using type = UndefinedProperty; }; // set default values template struct DiscNewtonMethod -{ using type = Opm::FvBaseNewtonMethod; }; +{ using type = FvBaseNewtonMethod; }; template struct NewtonMethod @@ -65,7 +65,7 @@ struct NewtonMethod template struct NewtonConvergenceWriter -{ using type = Opm::FvBaseNewtonConvergenceWriter; }; +{ using type = FvBaseNewtonConvergenceWriter; }; } // namespace Opm::Properties @@ -82,14 +82,13 @@ namespace Opm { template class FvBaseNewtonMethod : public NewtonMethod { - using ParentType = Opm::NewtonMethod; + using ParentType = NewtonMethod; using Implementation = GetPropType; using Scalar = GetPropType; using Simulator = GetPropType; using Model = GetPropType; using Linearizer = GetPropType; - using NewtonMethod = GetPropType; using GlobalEqVector = GetPropType; using SolutionVector = GetPropType; using PrimaryVariables = GetPropType; @@ -102,7 +101,7 @@ public: { } protected: - friend class Opm::NewtonMethod; + friend class NewtonMethod; /*! * \brief Update the current solution with a delta vector. diff --git a/opm/models/discretization/common/fvbaseprimaryvariables.hh b/opm/models/discretization/common/fvbaseprimaryvariables.hh index 5b4c13cbc..1a138c4a1 100644 --- a/opm/models/discretization/common/fvbaseprimaryvariables.hh +++ b/opm/models/discretization/common/fvbaseprimaryvariables.hh @@ -55,13 +55,13 @@ class FvBasePrimaryVariables enum { numEq = getPropValue() }; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; using ParentType = Dune::FieldVector; public: FvBasePrimaryVariables() : ParentType() - { Opm::Valgrind::SetUndefined(*this); } + { Valgrind::SetUndefined(*this); } /*! * \brief Construction from a scalar value @@ -122,7 +122,7 @@ public: */ void checkDefined() const { - Opm::Valgrind::CheckDefined(*static_cast(this)); + Valgrind::CheckDefined(*static_cast(this)); } }; diff --git a/opm/models/discretization/common/fvbaseproblem.hh b/opm/models/discretization/common/fvbaseproblem.hh index ed10a37cb..1998e3663 100644 --- a/opm/models/discretization/common/fvbaseproblem.hh +++ b/opm/models/discretization/common/fvbaseproblem.hh @@ -69,7 +69,7 @@ private: using GridView = GetPropType; static const int vtkOutputFormat = getPropValue(); - using VtkMultiWriter = Opm::VtkMultiWriter; + using VtkMultiWriter = ::Opm::VtkMultiWriter; using Model = GetPropType; using Scalar = GetPropType; diff --git a/opm/models/discretization/vcfv/p1fegradientcalculator.hh b/opm/models/discretization/vcfv/p1fegradientcalculator.hh index 4ae3a5d09..483cff805 100644 --- a/opm/models/discretization/vcfv/p1fegradientcalculator.hh +++ b/opm/models/discretization/vcfv/p1fegradientcalculator.hh @@ -169,7 +169,7 @@ public: #else using QuantityConstType = typename std::remove_reference::type; using QuantityType = typename std::remove_const::type; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; // If the user does not want to use two-point gradients, we // use P1 finite element gradients.. @@ -218,7 +218,7 @@ public: using RawFieldType = decltype(std::declval()[0]); using FieldType = typename std::remove_const::type>::type; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; // If the user does not want to use two-point gradients, we // use P1 finite element gradients.. @@ -287,7 +287,7 @@ public: const auto& dofVal = quantityCallback(vertIdx); const auto& tmp = p1Gradient_[fapIdx][vertIdx]; for (int dimIdx = 0; dimIdx < dim; ++ dimIdx) - quantityGrad[dimIdx] += Opm::scalarValue(dofVal)*tmp[dimIdx]; + quantityGrad[dimIdx] += scalarValue(dofVal)*tmp[dimIdx]; } } #endif diff --git a/opm/models/discretization/vcfv/vcfvdiscretization.hh b/opm/models/discretization/vcfv/vcfvdiscretization.hh index 7af244638..93a4ae343 100644 --- a/opm/models/discretization/vcfv/vcfvdiscretization.hh +++ b/opm/models/discretization/vcfv/vcfvdiscretization.hh @@ -61,7 +61,7 @@ private: using CoordScalar = typename GridView::ctype; public: - using type = Opm::VcfvStencil; + using type = VcfvStencil; }; //! Mapper for the degrees of freedoms. @@ -70,23 +70,23 @@ struct DofMapper { using type = GetPropType -struct Discretization { using type = Opm::VcfvDiscretization; }; +struct Discretization { using type = VcfvDiscretization; }; //! The base class for the output modules (decides whether to write //! element or vertex based fields) template struct DiscBaseOutputModule -{ using type = Opm::VcfvBaseOutputModule; }; +{ using type = VcfvBaseOutputModule; }; //! Calculates the gradient of any quantity given the index of a flux approximation point template struct GradientCalculator -{ using type = Opm::P1FeGradientCalculator; }; +{ using type = P1FeGradientCalculator; }; //! The class to create grid communication handles template struct GridCommHandleFactory -{ using type = Opm::VcfvGridCommHandleFactory; }; +{ using type = VcfvGridCommHandleFactory; }; //! Use two-point gradients by default for the vertex centered finite volume scheme. template @@ -118,7 +118,7 @@ struct BorderListCreator using VertexMapper = GetPropType; using GridView = GetPropType; public: - using type = Opm::Linear::VertexBorderListFromGrid; + using type = Linear::VertexBorderListFromGrid; }; //! For the vertex centered finite volume method, ghost and overlap elements must _not_ diff --git a/opm/models/discretization/vcfv/vcfvstencil.hh b/opm/models/discretization/vcfv/vcfvstencil.hh index ed20f53a3..610a0fdee 100644 --- a/opm/models/discretization/vcfv/vcfvstencil.hh +++ b/opm/models/discretization/vcfv/vcfvstencil.hh @@ -73,7 +73,7 @@ class VcfvScvGeometries enum { numScv = 2 }; public: - using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry; + using ScvLocalGeometry = QuadrialteralQuadratureGeometry; static void init() { @@ -112,7 +112,7 @@ class VcfvScvGeometries enum { numScv = 2 }; public: - using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry; + using ScvLocalGeometry = QuadrialteralQuadratureGeometry; static const ScvLocalGeometry& get(unsigned scvIdx OPM_UNUSED) { @@ -130,7 +130,7 @@ class VcfvScvGeometries enum { numScv = 3 }; public: - using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry; + using ScvLocalGeometry = QuadrialteralQuadratureGeometry; static const ScvLocalGeometry& get(unsigned scvIdx) { return scvGeoms_[scvIdx]; } @@ -182,7 +182,7 @@ class VcfvScvGeometries enum { numScv = 4 }; public: - using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry; + using ScvLocalGeometry = QuadrialteralQuadratureGeometry; static const ScvLocalGeometry& get(unsigned scvIdx) { return scvGeoms_[scvIdx]; } @@ -243,7 +243,7 @@ class VcfvScvGeometries enum { numScv = 4 }; public: - using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry; + using ScvLocalGeometry = QuadrialteralQuadratureGeometry; static const ScvLocalGeometry& get(unsigned scvIdx) { return scvGeoms_[scvIdx]; } @@ -322,7 +322,7 @@ class VcfvScvGeometries enum { numScv = 8 }; public: - using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry; + using ScvLocalGeometry = QuadrialteralQuadratureGeometry; static const ScvLocalGeometry& get(unsigned scvIdx) { return scvGeoms_[scvIdx]; } @@ -484,7 +484,7 @@ private: using LocalPosition = Dune::FieldVector; using IntersectionIterator = typename GridView::IntersectionIterator; - using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry; + using ScvLocalGeometry = QuadrialteralQuadratureGeometry; #if HAVE_DUNE_LOCALFUNCTIONS using LocalFiniteElementCache = Dune::PQkLocalFiniteElementCache; diff --git a/opm/models/io/vtkblackoilenergymodule.hh b/opm/models/io/vtkblackoilenergymodule.hh index 0883fcf3c..48e1bbf89 100644 --- a/opm/models/io/vtkblackoilenergymodule.hh +++ b/opm/models/io/vtkblackoilenergymodule.hh @@ -89,7 +89,7 @@ class VtkBlackOilEnergyModule : public BaseOutputModule using ElementContext = GetPropType; static const int vtkFormat = getPropValue(); - using VtkMultiWriter = Opm::VtkMultiWriter; + using VtkMultiWriter = ::Opm::VtkMultiWriter; enum { enableEnergy = getPropValue() }; enum { numPhases = getPropValue() }; @@ -165,20 +165,20 @@ public: if (rockInternalEnergyOutput_()) rockInternalEnergy_[globalDofIdx] = - Opm::scalarValue(intQuants.rockInternalEnergy()); + scalarValue(intQuants.rockInternalEnergy()); if (totalThermalConductivityOutput_()) totalThermalConductivity_[globalDofIdx] = - Opm::scalarValue(intQuants.totalThermalConductivity()); + scalarValue(intQuants.totalThermalConductivity()); for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { if (fluidInternalEnergiesOutput_()) fluidInternalEnergies_[phaseIdx][globalDofIdx] = - Opm::scalarValue(intQuants.fluidState().internalEnergy(phaseIdx)); + scalarValue(intQuants.fluidState().internalEnergy(phaseIdx)); if (fluidEnthalpiesOutput_()) fluidEnthalpies_[phaseIdx][globalDofIdx] = - Opm::scalarValue(intQuants.fluidState().enthalpy(phaseIdx)); + scalarValue(intQuants.fluidState().enthalpy(phaseIdx)); } } } diff --git a/opm/models/io/vtkblackoilmodule.hh b/opm/models/io/vtkblackoilmodule.hh index ccb0f6b81..3c4bb232a 100644 --- a/opm/models/io/vtkblackoilmodule.hh +++ b/opm/models/io/vtkblackoilmodule.hh @@ -118,7 +118,7 @@ class VtkBlackOilModule : public BaseOutputModule using FluidSystem = GetPropType; static const int vtkFormat = getPropValue(); - using VtkMultiWriter = Opm::VtkMultiWriter; + using VtkMultiWriter = ::Opm::VtkMultiWriter; enum { oilPhaseIdx = FluidSystem::oilPhaseIdx }; enum { gasPhaseIdx = FluidSystem::gasPhaseIdx }; @@ -225,14 +225,14 @@ public: const auto& primaryVars = elemCtx.primaryVars(dofIdx, /*timeIdx=*/0); unsigned pvtRegionIdx = elemCtx.primaryVars(dofIdx, /*timeIdx=*/0).pvtRegionIndex(); - Scalar SoMax = std::max(Opm::getValue(fs.saturation(oilPhaseIdx)), + Scalar SoMax = std::max(getValue(fs.saturation(oilPhaseIdx)), elemCtx.problem().maxOilSaturation(globalDofIdx)); if (FluidSystem::phaseIsActive(gasPhaseIdx) && FluidSystem::phaseIsActive(oilPhaseIdx)) { - Scalar x_oG = Opm::getValue(fs.moleFraction(oilPhaseIdx, gasCompIdx)); - Scalar x_gO = Opm::getValue(fs.moleFraction(gasPhaseIdx, oilCompIdx)); - Scalar X_oG = Opm::getValue(fs.massFraction(oilPhaseIdx, gasCompIdx)); - Scalar X_gO = Opm::getValue(fs.massFraction(gasPhaseIdx, oilCompIdx)); + Scalar x_oG = getValue(fs.moleFraction(oilPhaseIdx, gasCompIdx)); + Scalar x_gO = getValue(fs.moleFraction(gasPhaseIdx, oilCompIdx)); + Scalar X_oG = getValue(fs.massFraction(oilPhaseIdx, gasCompIdx)); + Scalar X_gO = getValue(fs.massFraction(gasPhaseIdx, oilCompIdx)); Scalar Rs = FluidSystem::convertXoGToRs(X_oG, pvtRegionIdx); Scalar Rv = FluidSystem::convertXgOToRv(X_gO, pvtRegionIdx); diff --git a/opm/models/io/vtkblackoilpolymermodule.hh b/opm/models/io/vtkblackoilpolymermodule.hh index 8d6d31fc1..9ed56ee92 100644 --- a/opm/models/io/vtkblackoilpolymermodule.hh +++ b/opm/models/io/vtkblackoilpolymermodule.hh @@ -97,7 +97,7 @@ class VtkBlackOilPolymerModule : public BaseOutputModule using ElementContext = GetPropType; static const int vtkFormat = getPropValue(); - using VtkMultiWriter = Opm::VtkMultiWriter; + using VtkMultiWriter = ::Opm::VtkMultiWriter; enum { enablePolymer = getPropValue() }; @@ -181,27 +181,27 @@ public: if (polymerConcentrationOutput_()) polymerConcentration_[globalDofIdx] = - Opm::scalarValue(intQuants.polymerConcentration()); + scalarValue(intQuants.polymerConcentration()); if (polymerDeadPoreVolumeOutput_()) polymerDeadPoreVolume_[globalDofIdx] = - Opm::scalarValue(intQuants.polymerDeadPoreVolume()); + scalarValue(intQuants.polymerDeadPoreVolume()); if (polymerRockDensityOutput_()) polymerRockDensity_[globalDofIdx] = - Opm::scalarValue(intQuants.polymerRockDensity()); + scalarValue(intQuants.polymerRockDensity()); if (polymerAdsorptionOutput_()) polymerAdsorption_[globalDofIdx] = - Opm::scalarValue(intQuants.polymerAdsorption()); + scalarValue(intQuants.polymerAdsorption()); if (polymerViscosityCorrectionOutput_()) polymerViscosityCorrection_[globalDofIdx] = - Opm::scalarValue(intQuants.polymerViscosityCorrection()); + scalarValue(intQuants.polymerViscosityCorrection()); if (waterViscosityCorrectionOutput_()) waterViscosityCorrection_[globalDofIdx] = - Opm::scalarValue(intQuants.waterViscosityCorrection()); + scalarValue(intQuants.waterViscosityCorrection()); } } diff --git a/opm/models/io/vtkblackoilsolventmodule.hh b/opm/models/io/vtkblackoilsolventmodule.hh index ccefbfc0f..6ef0311b8 100644 --- a/opm/models/io/vtkblackoilsolventmodule.hh +++ b/opm/models/io/vtkblackoilsolventmodule.hh @@ -89,7 +89,7 @@ class VtkBlackOilSolventModule : public BaseOutputModule using ElementContext = GetPropType; static const int vtkFormat = getPropValue(); - using VtkMultiWriter = Opm::VtkMultiWriter; + using VtkMultiWriter = ::Opm::VtkMultiWriter; enum { enableSolvent = getPropValue() }; @@ -157,7 +157,7 @@ public: if (!enableSolvent) return; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; for (unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++dofIdx) { const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0); unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0); diff --git a/opm/models/io/vtkcompositionmodule.hh b/opm/models/io/vtkcompositionmodule.hh index a30e706ad..d307b19f7 100644 --- a/opm/models/io/vtkcompositionmodule.hh +++ b/opm/models/io/vtkcompositionmodule.hh @@ -108,7 +108,7 @@ class VtkCompositionModule : public BaseOutputModule enum { numComponents = getPropValue() }; static const int vtkFormat = getPropValue(); - using VtkMultiWriter = Opm::VtkMultiWriter; + using VtkMultiWriter = ::Opm::VtkMultiWriter; using ComponentBuffer = typename ParentType::ComponentBuffer; using PhaseComponentBuffer = typename ParentType::PhaseComponentBuffer; @@ -168,7 +168,7 @@ public: */ void processElement(const ElementContext& elemCtx) { - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput)) return; diff --git a/opm/models/io/vtkdiffusionmodule.hh b/opm/models/io/vtkdiffusionmodule.hh index 74128f4c9..68ef64dfb 100644 --- a/opm/models/io/vtkdiffusionmodule.hh +++ b/opm/models/io/vtkdiffusionmodule.hh @@ -87,13 +87,13 @@ class VtkDiffusionModule : public BaseOutputModule using GridView = GetPropType; using Evaluation = GetPropType; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; using PhaseComponentBuffer = typename ParentType::PhaseComponentBuffer; using PhaseBuffer = typename ParentType::PhaseBuffer; static const int vtkFormat = getPropValue(); - using VtkMultiWriter = Opm::VtkMultiWriter; + using VtkMultiWriter = ::Opm::VtkMultiWriter; enum { numPhases = getPropValue() }; enum { numComponents = getPropValue() }; diff --git a/opm/models/io/vtkmultiphasemodule.hh b/opm/models/io/vtkmultiphasemodule.hh index ce8b0ae81..33ff5a209 100644 --- a/opm/models/io/vtkmultiphasemodule.hh +++ b/opm/models/io/vtkmultiphasemodule.hh @@ -137,7 +137,7 @@ class VtkMultiPhaseModule : public BaseOutputModule using DiscBaseOutputModule = GetPropType; static const int vtkFormat = getPropValue(); - using VtkMultiWriter = Opm::VtkMultiWriter; + using VtkMultiWriter = ::Opm::VtkMultiWriter; enum { dimWorld = GridView::dimensionworld }; enum { numPhases = getPropValue() }; @@ -247,7 +247,7 @@ public: const auto& fs = intQuants.fluidState(); if (extrusionFactorOutput_()) extrusionFactor_[I] = intQuants.extrusionFactor(); - if (porosityOutput_()) porosity_[I] = Opm::getValue(intQuants.porosity()); + if (porosityOutput_()) porosity_[I] = getValue(intQuants.porosity()); if (intrinsicPermeabilityOutput_()) { const auto& K = problem.intrinsicPermeability(elemCtx, i, /*timeIdx=*/0); @@ -261,19 +261,19 @@ public: continue; } if (pressureOutput_()) - pressure_[phaseIdx][I] = Opm::getValue(fs.pressure(phaseIdx)); + pressure_[phaseIdx][I] = getValue(fs.pressure(phaseIdx)); if (densityOutput_()) - density_[phaseIdx][I] = Opm::getValue(fs.density(phaseIdx)); + density_[phaseIdx][I] = getValue(fs.density(phaseIdx)); if (saturationOutput_()) - saturation_[phaseIdx][I] = Opm::getValue(fs.saturation(phaseIdx)); + saturation_[phaseIdx][I] = getValue(fs.saturation(phaseIdx)); if (mobilityOutput_()) - mobility_[phaseIdx][I] = Opm::getValue(intQuants.mobility(phaseIdx)); + mobility_[phaseIdx][I] = getValue(intQuants.mobility(phaseIdx)); if (relativePermeabilityOutput_()) - relativePermeability_[phaseIdx][I] = Opm::getValue(intQuants.relativePermeability(phaseIdx)); + relativePermeability_[phaseIdx][I] = getValue(intQuants.relativePermeability(phaseIdx)); if (viscosityOutput_()) - viscosity_[phaseIdx][I] = Opm::getValue(fs.viscosity(phaseIdx)); + viscosity_[phaseIdx][I] = getValue(fs.viscosity(phaseIdx)); if (averageMolarMassOutput_()) - averageMolarMass_[phaseIdx][I] = Opm::getValue(fs.averageMolarMass(phaseIdx)); + averageMolarMass_[phaseIdx][I] = getValue(fs.averageMolarMass(phaseIdx)); } } @@ -293,7 +293,7 @@ public: const auto& inputPGrad = extQuants.potentialGrad(phaseIdx); DimVector pGrad; for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) - pGrad[dimIdx] = Opm::getValue(inputPGrad[dimIdx])*weight; + pGrad[dimIdx] = getValue(inputPGrad[dimIdx])*weight; potentialGradient_[phaseIdx][I] += pGrad; } // end for all phases } // end for all faces @@ -312,15 +312,15 @@ public: for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { Scalar weight = std::max(1e-16, - std::abs(Opm::getValue(extQuants.volumeFlux(phaseIdx)))); - Opm::Valgrind::CheckDefined(extQuants.extrusionFactor()); + std::abs(getValue(extQuants.volumeFlux(phaseIdx)))); + Valgrind::CheckDefined(extQuants.extrusionFactor()); assert(extQuants.extrusionFactor() > 0); weight *= extQuants.extrusionFactor(); const auto& inputV = extQuants.filterVelocity(phaseIdx); DimVector v; for (unsigned k = 0; k < dimWorld; ++k) - v[k] = Opm::getValue(inputV[k]); + v[k] = getValue(inputV[k]); if (v.two_norm() > 1e-20) weight /= v.two_norm(); v *= weight; diff --git a/opm/models/io/vtkprimaryvarsmodule.hh b/opm/models/io/vtkprimaryvarsmodule.hh index 28ef83b58..e01e6e69d 100644 --- a/opm/models/io/vtkprimaryvarsmodule.hh +++ b/opm/models/io/vtkprimaryvarsmodule.hh @@ -76,7 +76,7 @@ class VtkPrimaryVarsModule : public BaseOutputModule using GridView = GetPropType; static const int vtkFormat = getPropValue(); - using VtkMultiWriter = Opm::VtkMultiWriter; + using VtkMultiWriter = ::Opm::VtkMultiWriter; using ScalarBuffer = typename ParentType::ScalarBuffer; using EqBuffer = typename ParentType::EqBuffer; diff --git a/opm/models/io/vtktemperaturemodule.hh b/opm/models/io/vtktemperaturemodule.hh index 914f7b134..c9c075f2f 100644 --- a/opm/models/io/vtktemperaturemodule.hh +++ b/opm/models/io/vtktemperaturemodule.hh @@ -76,7 +76,7 @@ class VtkTemperatureModule : public BaseOutputModule using ScalarBuffer = typename ParentType::ScalarBuffer; static const int vtkFormat = getPropValue(); - using VtkMultiWriter = Opm::VtkMultiWriter; + using VtkMultiWriter = ::Opm::VtkMultiWriter; public: VtkTemperatureModule(const Simulator& simulator) @@ -107,7 +107,7 @@ public: */ void processElement(const ElementContext& elemCtx) { - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput)) return; diff --git a/opm/models/nonlinear/newtonmethod.hh b/opm/models/nonlinear/newtonmethod.hh index 9a9de1c8b..50c818058 100644 --- a/opm/models/nonlinear/newtonmethod.hh +++ b/opm/models/nonlinear/newtonmethod.hh @@ -127,9 +127,9 @@ struct NewtonMaxIterations { using type = UndefinedProperty; }; // set default values for the properties template -struct NewtonMethod { using type = Opm::NewtonMethod; }; +struct NewtonMethod { using type = ::Opm::NewtonMethod; }; template -struct NewtonConvergenceWriter { using type = Opm::NullConvergenceWriter; }; +struct NewtonConvergenceWriter { using type = NullConvergenceWriter; }; template struct NewtonWriteConvergence { static constexpr bool value = false; }; template @@ -327,7 +327,7 @@ public: Linearizer& linearizer = model().linearizer(); - Opm::TimerGuard prePostProcessTimerGuard(prePostProcessTimer_); + TimerGuard prePostProcessTimerGuard(prePostProcessTimer_); // tell the implementation that we begin solving prePostProcessTimer_.start(); @@ -335,10 +335,10 @@ public: prePostProcessTimer_.stop(); try { - Opm::TimerGuard innerPrePostProcessTimerGuard(prePostProcessTimer_); - Opm::TimerGuard linearizeTimerGuard(linearizeTimer_); - Opm::TimerGuard updateTimerGuard(updateTimer_); - Opm::TimerGuard solveTimerGuard(solveTimer_); + TimerGuard innerPrePostProcessTimerGuard(prePostProcessTimer_); + TimerGuard linearizeTimerGuard(linearizeTimer_); + TimerGuard updateTimerGuard(updateTimer_); + TimerGuard solveTimerGuard(solveTimer_); // execute the method as long as the implementation thinks // that we should do another iteration @@ -460,7 +460,7 @@ public: return false; } - catch (const Opm::NumericalIssue& e) + catch (const NumericalIssue& e) { if (asImp_().verbose_()) std::cout << "Newton method caught exception: \"" @@ -569,16 +569,16 @@ public: const LinearSolverBackend& linearSolver() const { return linearSolver_; } - const Opm::Timer& prePostProcessTimer() const + const Timer& prePostProcessTimer() const { return prePostProcessTimer_; } - const Opm::Timer& linearizeTimer() const + const Timer& linearizeTimer() const { return linearizeTimer_; } - const Opm::Timer& solveTimer() const + const Timer& solveTimer() const { return solveTimer_; } - const Opm::Timer& updateTimer() const + const Timer& updateTimer() const { return updateTimer_; } protected: @@ -627,7 +627,7 @@ protected: succeeded = comm.min(succeeded); if (!succeeded) - throw Opm::NumericalIssue("pre processing of the problem failed"); + throw NumericalIssue("pre processing of the problem failed"); lastError_ = error_; } @@ -670,7 +670,7 @@ protected: const auto& r = currentResidual[dofIdx]; for (unsigned eqIdx = 0; eqIdx < r.size(); ++eqIdx) - error_ = Opm::max(std::abs(r[eqIdx] * model().eqWeight(dofIdx, eqIdx)), error_); + error_ = max(std::abs(r[eqIdx] * model().eqWeight(dofIdx, eqIdx)), error_); } // take the other processes into account @@ -679,9 +679,9 @@ protected: // make sure that the error never grows beyond the maximum // allowed one if (error_ > newtonMaxError) - throw Opm::NumericalIssue("Newton: Error "+std::to_string(double(error_)) - +" is larger than maximum allowed error of " - +std::to_string(double(newtonMaxError))); + throw NumericalIssue("Newton: Error "+std::to_string(double(error_)) + +" is larger than maximum allowed error of " + +std::to_string(double(newtonMaxError))); } /*! @@ -722,7 +722,7 @@ protected: succeeded = comm.min(succeeded); if (!succeeded) - throw Opm::NumericalIssue("post processing of an auxilary equation failed"); + throw NumericalIssue("post processing of an auxilary equation failed"); } } @@ -753,7 +753,7 @@ protected: // make sure not to swallow non-finite values at this point if (!std::isfinite(solutionUpdate.one_norm())) - throw Opm::NumericalIssue("Non-finite update!"); + throw NumericalIssue("Non-finite update!"); size_t numGridDof = model().numGridDof(); for (unsigned dofIdx = 0; dofIdx < numGridDof; ++dofIdx) { @@ -851,7 +851,7 @@ protected: succeeded = comm.min(succeeded); if (!succeeded) - throw Opm::NumericalIssue("post processing of the problem failed"); + throw NumericalIssue("post processing of the problem failed"); if (asImp_().verbose_()) { std::cout << "Newton iteration " << numIterations_ << "" @@ -921,10 +921,10 @@ protected: Simulator& simulator_; - Opm::Timer prePostProcessTimer_; - Opm::Timer linearizeTimer_; - Opm::Timer solveTimer_; - Opm::Timer updateTimer_; + Timer prePostProcessTimer_; + Timer linearizeTimer_; + Timer solveTimer_; + Timer updateTimer_; std::ostringstream endIterMsgStream_; diff --git a/opm/models/utils/simulator.hh b/opm/models/utils/simulator.hh index fdcc224ea..44129ee6e 100644 --- a/opm/models/utils/simulator.hh +++ b/opm/models/utils/simulator.hh @@ -101,7 +101,7 @@ public: Simulator(bool verbose = true) { - Opm::TimerGuard setupTimerGuard(setupTimer_); + TimerGuard setupTimerGuard(setupTimer_); setupTimer_.start(); @@ -359,51 +359,51 @@ public: * \brief Returns a reference to the timer object which measures the time needed to * set up and initialize the simulation */ - const Opm::Timer& setupTimer() const + const Timer& setupTimer() const { return setupTimer_; } /*! * \brief Returns a reference to the timer object which measures the time needed to * run the simulation */ - const Opm::Timer& executionTimer() const + const Timer& executionTimer() const { return executionTimer_; } - Opm::Timer& executionTimer() + Timer& executionTimer() { return executionTimer_; } /*! * \brief Returns a reference to the timer object which measures the time needed for * pre- and postprocessing of the solutions. */ - const Opm::Timer& prePostProcessTimer() const + const Timer& prePostProcessTimer() const { return prePostProcessTimer_; } /*! * \brief Returns a reference to the timer object which measures the time needed for * linarizing the solutions. */ - const Opm::Timer& linearizeTimer() const + const Timer& linearizeTimer() const { return linearizeTimer_; } /*! * \brief Returns a reference to the timer object which measures the time needed by * the solver. */ - const Opm::Timer& solveTimer() const + const Timer& solveTimer() const { return solveTimer_; } /*! * \brief Returns a reference to the timer object which measures the time needed to * the solutions of the non-linear system of equations. */ - const Opm::Timer& updateTimer() const + const Timer& updateTimer() const { return updateTimer_; } /*! * \brief Returns a reference to the timer object which measures the time needed to * write the visualization output */ - const Opm::Timer& writeTimer() const + const Timer& writeTimer() const { return writeTimer_; } /*! @@ -636,7 +636,7 @@ public: // try to restart a previous simulation time_ = restartTime; - Opm::Restart res; + Restart res; EWOMS_CATCH_PARALLEL_EXCEPTIONS_FATAL(res.deserializeBegin(*this, time_)); if (verbose_) std::cout << "Deserialize from file '" << res.fileName() << "'\n" << std::flush; @@ -887,7 +887,7 @@ public: */ void serialize() { - using Restarter = Opm::Restart; + using Restarter = Restart; Restarter res; res.serializeBegin(*this); if (gridView().comm().rank() == 0) @@ -952,13 +952,13 @@ private: Scalar episodeStartTime_; Scalar episodeLength_; - Opm::Timer setupTimer_; - Opm::Timer executionTimer_; - Opm::Timer prePostProcessTimer_; - Opm::Timer linearizeTimer_; - Opm::Timer solveTimer_; - Opm::Timer updateTimer_; - Opm::Timer writeTimer_; + Timer setupTimer_; + Timer executionTimer_; + Timer prePostProcessTimer_; + Timer linearizeTimer_; + Timer solveTimer_; + Timer updateTimer_; + Timer writeTimer_; std::vector forcedTimeSteps_; Scalar startTime_; @@ -974,7 +974,7 @@ private: namespace Properties { template -struct Simulator { using type = Opm::Simulator; }; +struct Simulator { using type = ::Opm::Simulator; }; } } // namespace Opm