Add interface for updating stored parameters in linearizers.

Implement for the TpfaLinearizer to update transmissibilities.
This commit is contained in:
Atgeirr Flø Rasmussen 2022-10-27 09:56:01 +02:00
parent 11c9c34dcc
commit 477acf0c6c
2 changed files with 26 additions and 0 deletions

View File

@ -282,6 +282,11 @@ public:
return linearizationType_;
};
void updateDiscretizationParameters()
{
// This linearizer stores no such parameters.
}
/*!
* \brief Returns the map of constraint degrees of freedom.
*

View File

@ -265,6 +265,11 @@ public:
return linearizationType_;
};
void updateDiscretizationParameters()
{
updateStoredTransmissibilities();
}
/*!
* \brief Returns the map of constraint degrees of freedom.
*
@ -498,6 +503,22 @@ private:
}
}
void updateStoredTransmissibilities()
{
unsigned numCells = model_().numTotalDof();
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (unsigned globI = 0; globI < numCells; globI++) {
auto nbInfos = neighborInfo_[globI]; // nbInfos will be a SparseTable<...>::mutable_iterator_range.
for (auto& nbInfo : nbInfos) {
unsigned globJ = nbInfo.neighbor;
nbInfo.trans = problem_().transmissibility(globI, globJ);
}
}
}
Simulator *simulatorPtr_;
// the jacobian matrix