From 5f28175603ea210881ec21950d306e1d9cf3b590 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 24 Mar 2023 14:56:23 +0100 Subject: [PATCH 1/3] fix whitespace at eol and some brace placements --- ebos/eclgenericoutputblackoilmodule.cc | 2 +- ebos/eclgenericoutputblackoilmodule.hh | 2 +- ebos/ecloutputblackoilmodule.hh | 20 +++++++++++--------- ebos/eclproblem.hh | 16 ++++++++-------- ebos/eclwriter.hh | 12 ++++++------ ebos/equil/initstateequil.cc | 8 ++++---- ebos/equil/initstateequil_impl.hh | 4 ++-- 7 files changed, 33 insertions(+), 31 deletions(-) diff --git a/ebos/eclgenericoutputblackoilmodule.cc b/ebos/eclgenericoutputblackoilmodule.cc index 8521a6c3e..5c18e1031 100644 --- a/ebos/eclgenericoutputblackoilmodule.cc +++ b/ebos/eclgenericoutputblackoilmodule.cc @@ -169,7 +169,7 @@ EclGenericOutputBlackoilModule(const EclipseState& eclState, , enableSaltPrecipitation_(enableSaltPrecipitation) , enableExtbo_(enableExtbo) , enableMICP_(enableMICP) - , local_data_valid_(false) + , local_data_valid_(false) { const auto& fp = eclState_.fieldProps(); diff --git a/ebos/eclgenericoutputblackoilmodule.hh b/ebos/eclgenericoutputblackoilmodule.hh index e8ff155f9..43ffe9d2c 100644 --- a/ebos/eclgenericoutputblackoilmodule.hh +++ b/ebos/eclgenericoutputblackoilmodule.hh @@ -260,7 +260,7 @@ public: void validateLocalData(){ local_data_valid_ = true; } - + // Virtual destructor for safer inheritance. virtual ~EclGenericOutputBlackoilModule(); diff --git a/ebos/ecloutputblackoilmodule.hh b/ebos/ecloutputblackoilmodule.hh index 845ae35f1..401556e75 100644 --- a/ebos/ecloutputblackoilmodule.hh +++ b/ebos/ecloutputblackoilmodule.hh @@ -545,7 +545,7 @@ public: this->viscosity_[gasPhaseIdx][globalDofIdx] = FluidSystem::viscosity(fsInitial, gasPhaseIdx, intQuants.pvtRegionIndex()); } - + // Adding Well RFT data const auto cartesianIdx = elemCtx.simulator().vanguard().cartesianIndex(globalDofIdx); @@ -592,7 +592,7 @@ public: for (unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++dofIdx) { unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0); - if (!problem.model().linearizer().getFlowsInfo().empty()) { + if (!problem.model().linearizer().getFlowsInfo().empty()) { const auto& flowsInf = problem.model().linearizer().getFlowsInfo(); auto flowsInfos = flowsInf[globalDofIdx]; for (auto& flowsInfo : flowsInfos) { @@ -856,8 +856,7 @@ public: } } } - - + /*! * \brief Capture connection fluxes, particularly to account for inter-region flows. * @@ -1003,12 +1002,14 @@ public: } } - void updateFluidInPlace(const ElementContext& elemCtx){ + void updateFluidInPlace(const ElementContext& elemCtx) + { for (unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++dofIdx) { updateFluidInPlace_(elemCtx, dofIdx); } } - void updateFluidInPlace(unsigned globalDofIdx,const IntensiveQuantities& intQuants, double totVolume){ + void updateFluidInPlace(unsigned globalDofIdx,const IntensiveQuantities& intQuants, double totVolume) + { this->updateFluidInPlace_(globalDofIdx, intQuants, totVolume); } private: @@ -1022,13 +1023,14 @@ private: return candidate == parallelWells.end() || *candidate != value; } - void updateFluidInPlace_(const ElementContext& elemCtx, unsigned dofIdx){ + void updateFluidInPlace_(const ElementContext& elemCtx, unsigned dofIdx) + { const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0); unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0); const auto totVolume = elemCtx.simulator().model().dofTotalVolume(globalDofIdx); this->updateFluidInPlace_(globalDofIdx, intQuants, totVolume); } - + void updateFluidInPlace_(unsigned globalDofIdx,const IntensiveQuantities& intQuants, double totVolume) { OPM_TIMEBLOCK_LOCAL(updateFluidInPlace); @@ -1295,7 +1297,7 @@ private: } const Simulator& simulator_; - }; +}; } // namespace Opm diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index c6780ed8d..8ef55dff7 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -855,7 +855,7 @@ public: this->readRockParameters_(simulator.vanguard().cellCenterDepths()); readMaterialParameters_(); readThermalParameters_(); - + // Re-ordering in case of ALUGrid std::function gridToEquilGrid; #if USE_ALUGRID @@ -1454,7 +1454,7 @@ public: */ std::shared_ptr materialLawManager() const { return materialLawManager_; } - + template void updateRelperms( std::array &mobility, @@ -1797,8 +1797,8 @@ public: const auto& model = this->model(); // we use a lower tolerance for the compensation too - // assure the added drift from the last step does not - // cause convergence issues on the current step + // assure the added drift from the last step does not + // cause convergence issues on the current step Scalar maxCompensation = model.newtonMethod().tolerance()/10; Scalar poro = this->porosity(globalDofIdx, timeIdx); Scalar dt = simulator.timeStepSize(); @@ -2068,11 +2068,11 @@ public: serializer(tracerModel_); serializer(*materialLawManager_); serializer(*eclWriter_); - } + } private: Implementation& asImp_() { return *static_cast(this); } - + void updateExplicitQuantitites_() { OPM_TIMEBLOCK(updateExplicitQuantities); @@ -2216,7 +2216,7 @@ private: return false; } - bool updateMaxOilSaturation_(unsigned compressedDofIdx, const IntensiveQuantities& iq) + bool updateMaxOilSaturation_(unsigned compressedDofIdx, const IntensiveQuantities& iq) { OPM_TIMEBLOCK_LOCAL(updateMaxOilSaturation); const auto& fs = iq.fluidState(); @@ -2704,7 +2704,7 @@ private: - gasSaturationData[dofIdx]); ////// - // set phase pressures + // set phase pressures ////// Scalar pressure = pressureData[dofIdx]; // oil pressure (or gas pressure for water-gas system or water pressure for single phase) diff --git a/ebos/eclwriter.hh b/ebos/eclwriter.hh index 120124cf9..8d3b46510 100644 --- a/ebos/eclwriter.hh +++ b/ebos/eclwriter.hh @@ -250,7 +250,7 @@ public: std::map> regionData; Inplace inplace; { - OPM_TIMEBLOCK(outputFipLogAndFipresvLog); + OPM_TIMEBLOCK(outputFipLogAndFipresvLog); inplace = eclOutputModule_->outputFipLog(miscSummaryData, regionData, isSubStep, simulator_.gridView().comm()); eclOutputModule_->outputFipresvLog(miscSummaryData, regionData, isSubStep, simulator_.gridView().comm()); } @@ -284,7 +284,7 @@ public: miscSummaryData["MSUMNEWT"] = this->simulation_report_.success.total_newton_iterations; } { - OPM_TIMEBLOCK(evalSummary); + OPM_TIMEBLOCK(evalSummary); this->evalSummary(reportStepNum, curTime, this->collectToIORank_.isParallel() ? this->collectToIORank_.globalWBPData() : @@ -304,7 +304,7 @@ public: summaryState(), udqState()); } { - OPM_TIMEBLOCK(outputXXX); + OPM_TIMEBLOCK(outputXXX); eclOutputModule_->outputProdLog(reportStepNum, isSubStep, forceDisableProdOutput); eclOutputModule_->outputInjLog(reportStepNum, isSubStep, forceDisableInjOutput); eclOutputModule_->outputCumLog(reportStepNum, isSubStep, forceDisableCumOutput); @@ -533,7 +533,7 @@ private: ElementContext elemCtx(simulator_); OPM_BEGIN_PARALLEL_TRY_CATCH(); { - OPM_TIMEBLOCK(prepareCellBasedData); + OPM_TIMEBLOCK(prepareCellBasedData); for (const auto& elem : elements(gridView)) { elemCtx.updatePrimaryStencil(elem); elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0); @@ -542,7 +542,7 @@ private: } } if(!simulator_.model().linearizer().getFlowsInfo().empty()){ - OPM_TIMEBLOCK(prepareFlowsData); + OPM_TIMEBLOCK(prepareFlowsData); for (const auto& elem : elements(gridView)) { elemCtx.updatePrimaryStencil(elem); elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0); @@ -550,7 +550,7 @@ private: } } { - OPM_TIMEBLOCK(prepareBlockData); + OPM_TIMEBLOCK(prepareBlockData); for (const auto& elem : elements(gridView)) { elemCtx.updatePrimaryStencil(elem); elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0); diff --git a/ebos/equil/initstateequil.cc b/ebos/equil/initstateequil.cc index 0eb5d1091..9c63981dd 100644 --- a/ebos/equil/initstateequil.cc +++ b/ebos/equil/initstateequil.cc @@ -27,7 +27,7 @@ namespace Opm { namespace EQUIL { -namespace DeckDependent { +namespace DeckDependent { #if HAVE_DUNE_FEM using GridView = Dune::Fem::GridPart2GridViewImpl< Dune::Fem::AdaptiveLeafGridPart< @@ -57,7 +57,7 @@ template InitialStateComputer, const GridView&, const Dune::CartesianIndexMapper&, const double, - const bool); + const bool); #if HAVE_DUNE_ALUGRID #if HAVE_MPI using ALUGridComm = Dune::ALUGridMPIComm; @@ -105,6 +105,6 @@ namespace Details { template std::pair cellZMinMax(const Dune::cpgrid::Entity<0>& element); } -} + } // namespace EQUIL - // namespace Opm +} // namespace Opm diff --git a/ebos/equil/initstateequil_impl.hh b/ebos/equil/initstateequil_impl.hh index 9462069e9..a286292bc 100644 --- a/ebos/equil/initstateequil_impl.hh +++ b/ebos/equil/initstateequil_impl.hh @@ -1821,7 +1821,7 @@ cellLoop(const CellRange& cells, this->rs_[cell] = Rs; this->rv_[cell] = Rv; } - + if (watActive && gasActive) { this->rvw_[cell] = Rvw; } @@ -1938,7 +1938,7 @@ equilibrateHorizontal(const CellRange& cells, Rv = eqreg.evaporationCalculator() (cz, pressures.gas, temp, saturations.oil); - + Rvw = eqreg.waterEvaporationCalculator() (cz, pressures.gas, temp, saturations.water); }); From 163be007e5f296516cb28b273a936f66d7011531 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 24 Mar 2023 14:56:39 +0100 Subject: [PATCH 2/3] add missing includes --- ebos/ecloutputblackoilmodule.hh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ebos/ecloutputblackoilmodule.hh b/ebos/ecloutputblackoilmodule.hh index 401556e75..9d43dfd5a 100644 --- a/ebos/ecloutputblackoilmodule.hh +++ b/ebos/ecloutputblackoilmodule.hh @@ -28,15 +28,19 @@ #define EWOMS_ECL_OUTPUT_BLACK_OIL_MODULE_HH #include +#include #include -#include +#include +#include +#include +#include +#include +#include #include #include -#include - #include #include #include From 1f8fb5d6647104bc22fa5eb0854d6881a568e9f2 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 24 Mar 2023 14:56:49 +0100 Subject: [PATCH 3/3] simplify: use std::is_same_v<> --- ebos/ecloutputblackoilmodule.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebos/ecloutputblackoilmodule.hh b/ebos/ecloutputblackoilmodule.hh index 9d43dfd5a..ff4c47598 100644 --- a/ebos/ecloutputblackoilmodule.hh +++ b/ebos/ecloutputblackoilmodule.hh @@ -589,7 +589,7 @@ public: void processElementFlows(const ElementContext& elemCtx) { OPM_TIMEBLOCK_LOCAL(processElementBlockData); - if (!std::is_same>::value) + if (!std::is_same_v>) return; const auto& problem = elemCtx.simulator().problem();