Commit 0c53d5fe authored by Timo Koch's avatar Timo Koch
Browse files

[md] Use new curSol interface (removes deprecation warnings)

parent 09c5c1d1
Pipeline #8513 passed with stages
......@@ -233,7 +233,7 @@ public:
const SubControlVolume<i>& scv) const
{
VolumeVariables<i> volVars;
const auto elemSol = elementSolution(element, this->curSol()[domainI], this->problem(domainI).gridGeometry());
const auto elemSol = elementSolution(element, this->curSol(domainI), this->problem(domainI).gridGeometry());
volVars.update(elemSol, this->problem(domainI), element, scv);
return volVars;
}
......
......@@ -202,7 +202,7 @@ public:
darcyFvGeometry.bindElement(darcyElement);
const auto& scv = (*scvs(darcyFvGeometry).begin());
const auto darcyElemSol = elementSolution(darcyElement, this->curSol()[darcyIdx], this->problem(darcyIdx).gridGeometry());
const auto darcyElemSol = elementSolution(darcyElement, this->curSol(darcyIdx), this->problem(darcyIdx).gridGeometry());
VolumeVariables<darcyIdx> darcyVolVars;
darcyVolVars.update(darcyElemSol, this->problem(darcyIdx), darcyElement, scv);
......@@ -246,11 +246,11 @@ public:
for(const auto& scvf : scvfs(stokesFvGeometry))
{
if(scvf.index() == indices.scvfIdx)
faceVelocity[scvf.directionIndex()] = this->curSol()[stokesFaceIdx][scvf.dofIndex()];
faceVelocity[scvf.directionIndex()] = this->curSol(stokesFaceIdx)[scvf.dofIndex()];
}
using PriVarsType = typename VolumeVariables<stokesCellCenterIdx>::PrimaryVariables;
const auto& cellCenterPriVars = this->curSol()[stokesCellCenterIdx][indices.eIdx];
const auto& cellCenterPriVars = this->curSol(stokesCellCenterIdx)[indices.eIdx];
const auto elemSol = makeElementSolutionFromCellCenterPrivars<PriVarsType>(cellCenterPriVars);
VolumeVariables<stokesIdx> stokesVolVars;
......@@ -273,7 +273,7 @@ public:
const PrimaryVariables<darcyIdx>& priVarsJ,
int pvIdxJ)
{
this->curSol()[domainJ][dofIdxGlobalJ][pvIdxJ] = priVarsJ[pvIdxJ];
this->curSol(domainJ)[dofIdxGlobalJ][pvIdxJ] = priVarsJ[pvIdxJ];
}
/*!
......@@ -287,7 +287,7 @@ public:
const PrimaryVariables<stokesCellCenterIdx>& priVars,
int pvIdxJ)
{
this->curSol()[domainJ][dofIdxGlobalJ] = priVars;
this->curSol(domainJ)[dofIdxGlobalJ] = priVars;
for (auto& data : darcyCouplingContext_)
{
......@@ -315,7 +315,7 @@ public:
const PrimaryVariables<stokesFaceIdx>& priVars,
int pvIdxJ)
{
this->curSol()[domainJ][dofIdxGlobalJ] = priVars;
this->curSol(domainJ)[dofIdxGlobalJ] = priVars;
for (auto& data : darcyCouplingContext_)
{
......@@ -338,7 +338,7 @@ public:
const PrimaryVariables<darcyIdx>& priVars,
int pvIdxJ)
{
this->curSol()[domainJ][dofIdxGlobalJ] = priVars;
this->curSol(domainJ)[dofIdxGlobalJ] = priVars;
for (auto& data : stokesCouplingContext_)
{
......@@ -347,7 +347,7 @@ public:
if(darcyElemIdx != dofIdxGlobalJ)
continue;
const auto darcyElemSol = elementSolution(data.element, this->curSol()[darcyIdx], this->problem(darcyIdx).gridGeometry());
const auto darcyElemSol = elementSolution(data.element, this->curSol(darcyIdx), this->problem(darcyIdx).gridGeometry());
for(const auto& scv : scvs(data.fvGeometry))
data.volVars.update(darcyElemSol, this->problem(darcyIdx), data.element, scv);
......
......@@ -382,11 +382,11 @@ public:
//! Return data for a bulk point source with the identifier id
PrimaryVariables<bulkIdx> bulkPriVars(std::size_t id) const
{ return pointSourceData_[id].interpolateBulk(this->curSol()[bulkIdx]); }
{ return pointSourceData_[id].interpolateBulk(this->curSol(bulkIdx)); }
//! Return data for a low dim point source with the identifier id
PrimaryVariables<lowDimIdx> lowDimPriVars(std::size_t id) const
{ return pointSourceData_[id].interpolateLowDim(this->curSol()[lowDimIdx]); }
{ return pointSourceData_[id].interpolateLowDim(this->curSol(lowDimIdx)); }
//! return the average distance to the coupled bulk cell center
Scalar averageDistance(std::size_t id) const
......
......@@ -479,7 +479,7 @@ public:
auto fvGeom = localView(ldGridGeometry);
for (const auto lowDimElemIdx : elementStencil)
{
const auto& ldSol = Assembler::isImplicit() ? this->curSol()[lowDimId] : assembler.prevSol()[lowDimId];
const auto& ldSol = Assembler::isImplicit() ? this->curSol(lowDimId) : assembler.prevSol()[lowDimId];
const auto elemJ = ldGridGeometry.element(lowDimElemIdx);
fvGeom.bindElement(elemJ);
......@@ -538,7 +538,7 @@ public:
for (unsigned int i = 0; i < numEmbedments; ++i)
{
const auto& bulkSol = Assembler::isImplicit() ? this->curSol()[bulkId] : assembler.prevSol()[bulkId];
const auto& bulkSol = Assembler::isImplicit() ? this->curSol(bulkId) : assembler.prevSol()[bulkId];
const auto curBulkElem = bulkGridGeom.element(embedments[i].first);
bulkFvGeom.bind(curBulkElem);
......@@ -622,7 +622,7 @@ public:
const auto& fvGeom = bulkContext_.lowDimFvGeometries[idxInContext];
const auto& coupledScvfIndices = couplingEntry.elementToScvfMap.at(eIdxGlobal);
makeCoupledLowDimElemVolVars_(bulkLocalAssembler.element(), bulkLocalAssembler.fvGeometry(),
element, fvGeom, this->curSol()[lowDimId], coupledScvfIndices, elemVolVars);
element, fvGeom, this->curSol(lowDimId), coupledScvfIndices, elemVolVars);
}
}
}
......@@ -691,7 +691,7 @@ public:
{
// element contains the deflected dof
const auto& fvGeom = *lowDimContext_.bulkFvGeometries[embedmentIdx];
(*lowDimContext_.bulkElemVolVars[embedmentIdx]).bindElement(elementJ, fvGeom, this->curSol()[bulkId]);
(*lowDimContext_.bulkElemVolVars[embedmentIdx]).bindElement(elementJ, fvGeom, this->curSol(bulkId));
}
}
......@@ -748,7 +748,7 @@ public:
const auto& scvfIndices = bulkCouplingEntry.elementToScvfMap.at(lowDimContext_.elementIdx);
makeCoupledLowDimElemVolVars_(bulkElement, bulkFvGeometry, element, fvGeom,
this->curSol()[lowDimId], scvfIndices, elemVolVars);
this->curSol(lowDimId), scvfIndices, elemVolVars);
}
}
......
......@@ -273,7 +273,7 @@ public:
auto updateContext = [&] (auto elemIdx, auto dofIdx, auto priVars, auto pvIdx)
{
// deflect the solution
auto& ldSol = this->curSol()[lowDimId];
auto& ldSol = this->curSol(lowDimId);
ldSol[dofIdx][pvIdx] = priVars[pvIdx];
// update the corresponding vol vars in the bulk context
......@@ -377,7 +377,7 @@ private:
for (auto dofIndex : elemDofsJ)
{
auto partialDerivs = origResidual;
const auto origPriVars = this->curSol()[lowDimId][dofIndex];
const auto origPriVars = this->curSol(lowDimId)[dofIndex];
// calculate derivatives w.r.t to the privars at the dof at hand
static constexpr auto numEq = std::decay_t<decltype(origPriVars)>::dimension;
......
......@@ -436,7 +436,7 @@ public:
auto fvGeom = localView(ldGridGeometry);
for (const auto lowDimElemIdx : elementStencil)
{
const auto& ldSol = Assembler::isImplicit() ? this->curSol()[lowDimId] : assembler.prevSol()[lowDimId];
const auto& ldSol = Assembler::isImplicit() ? this->curSol(lowDimId) : assembler.prevSol()[lowDimId];
const auto& ldProblem = this->problem(lowDimId);
const auto elemJ = ldGridGeometry.element(lowDimElemIdx);
......@@ -496,7 +496,7 @@ public:
bindCouplingContext(bulkId, bulkElem, assembler);
// evaluate variables on old/new time level depending on time disc scheme
const auto& bulkSol = Assembler::isImplicit() ? this->curSol()[bulkId] : assembler.prevSol()[bulkId];
const auto& bulkSol = Assembler::isImplicit() ? this->curSol(bulkId) : assembler.prevSol()[bulkId];
// then simply bind the local views of that first neighbor
auto bulkFvGeom = localView(bulkGridGeom).bind(bulkElem);
......@@ -538,7 +538,7 @@ public:
{
const auto& map = couplingMapperPtr_->couplingMap(bulkGridId, lowDimGridId);
const auto& couplingElemStencil = map.find(bulkContext_.elementIdx)->second.couplingElementStencil;
const auto& ldSol = this->curSol()[lowDimId];
const auto& ldSol = this->curSol(lowDimId);
const auto& ldProblem = this->problem(lowDimId);
const auto& ldGridGeometry = this->problem(lowDimId).gridGeometry();
......@@ -641,7 +641,7 @@ public:
// update corresponding vol vars in context
const auto& scv = lowDimContext_.bulkFvGeometry->scv(dofIdxGlobalJ);
const auto elemSol = elementSolution(elementJ, this->curSol()[bulkId], bulkGridGeom);
const auto elemSol = elementSolution(elementJ, this->curSol(bulkId), bulkGridGeom);
(*lowDimContext_.bulkElemVolVars)[dofIdxGlobalJ].update(elemSol, this->problem(bulkId), elementJ, scv);
// update the element flux variables cache (tij might be solution-dependent)
......@@ -680,7 +680,7 @@ public:
// skip the rest if context is empty
if (lowDimContext_.isSet)
{
const auto& ldSol = this->curSol()[lowDimId];
const auto& ldSol = this->curSol(lowDimId);
const auto& ldProblem = this->problem(lowDimId);
const auto& ldGridGeometry = this->problem(lowDimId).gridGeometry();
......@@ -749,7 +749,7 @@ public:
// update transmissibilities after low dim context has changed (implicit only)
if (BulkLocalAssembler::isImplicit())
{
const auto elemVolVars = localView(gridVolVars).bind(bulkLocalAssembler.element(), bulkLocalAssembler.fvGeometry(), this->curSol()[bulkId]);
const auto elemVolVars = localView(gridVolVars).bind(bulkLocalAssembler.element(), bulkLocalAssembler.fvGeometry(), this->curSol(bulkId));
fluxVarsCache.update(bulkLocalAssembler.element(), bulkLocalAssembler.fvGeometry(), elemVolVars);
}
}
......
......@@ -72,7 +72,7 @@ public:
const PriVarsJ& priVarsJ,
int pvIdxJ)
{
auto& curSol = this->curSol()[domainJ];
auto& curSol = this->curSol(domainJ);
// only proceed if the solution vector has actually been set in the base class
// (which is not the case if the staggered model is not coupled to another domain)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment