adjust to PAvgDynamicSourceData templating

This commit is contained in:
Arne Morten Kvarving
2024-04-11 10:21:02 +02:00
parent 1d92aa952d
commit 59e6d4db08
5 changed files with 24 additions and 22 deletions

View File

@@ -89,13 +89,15 @@ namespace Opm {
this->alternative_well_rate_init_ =
Parameters::get<TypeTag, Properties::AlternativeWellRateInit>();
using SourceDataSpan =
typename PAvgDynamicSourceData<Scalar>::template SourceDataSpan<Scalar>;
this->wbpCalculationService_
.localCellIndex([this](const std::size_t globalIndex)
{ return this->compressedIndexForInterior(globalIndex); })
.evalCellSource([this](const int localCell,
PAvgDynamicSourceData::SourceDataSpan<Scalar> sourceTerms)
.evalCellSource([this](const int localCell,
SourceDataSpan sourceTerms)
{
using Item = typename PAvgDynamicSourceData::SourceDataSpan<Scalar>::Item;
using Item = typename SourceDataSpan::Item;
const auto* intQuants = this->simulator_.model()
.cachedIntensiveQuantities(localCell, /*timeIndex = */0);
@@ -2077,7 +2079,7 @@ namespace Opm {
BlackoilWellModel<TypeTag>::
makeWellSourceEvaluatorFactory(const std::vector<Well>::size_type wellIdx) const
{
using Span = PAvgDynamicSourceData::SourceDataSpan<Scalar>;
using Span = typename PAvgDynamicSourceData<Scalar>::template SourceDataSpan<Scalar>;
using Item = typename Span::Item;
return [wellIdx, this]() -> ParallelWBPCalculation::Evaluator

View File

@@ -105,7 +105,7 @@ finaliseConstruction(const std::vector<std::size_t>& sourceLocations,
this->defineCommunication();
}
Opm::PAvgDynamicSourceData::SourceDataSpan<double>
Opm::PAvgDynamicSourceData<double>::SourceDataSpan<double>
Opm::ParallelPAvgDynamicSourceData::localSourceTerm(const std::size_t localIx)
{
return this->sourceTerm(localIx, this->localSrc_);

View File

@@ -32,7 +32,7 @@ namespace Opm {
/// Dynamic source data for block-average pressure calculations.
/// Specialisation for parallel runs.
class ParallelPAvgDynamicSourceData : public PAvgDynamicSourceData
class ParallelPAvgDynamicSourceData : public PAvgDynamicSourceData<double>
{
public:
/// Translate globally unique, linearised Cartesian cell indices to