28#ifndef TPFA_LINEARIZER_HH
29#define TPFA_LINEARIZER_HH
31#include <dune/common/version.hh>
32#include <dune/common/fvector.hh>
33#include <dune/common/fmatrix.hh>
35#include <opm/common/Exceptions.hpp>
36#include <opm/common/TimingMacros.hpp>
38#include <opm/grid/utility/SparseTable.hpp>
40#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
41#include <opm/input/eclipse/Schedule/BCProp.hpp>
63template<
class TypeTag>
75template<
class TypeTag>
95 using Element =
typename GridView::template Codim<0>::Entity;
96 using ElementIterator =
typename GridView::template Codim<0>::Iterator;
98 using Vector = GlobalEqVector;
100 enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
101 enum { historySize = getPropValue<TypeTag, Properties::TimeDiscHistorySize>() };
102 enum { dimWorld = GridView::dimensionworld };
104 using MatrixBlock =
typename SparseMatrixAdapter::MatrixBlock;
105 using VectorBlock = Dune::FieldVector<Scalar, numEq>;
108 static const bool linearizeNonLocalElements = getPropValue<TypeTag, Properties::LinearizeNonLocalElements>();
109 static const bool enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>();
110 static const bool enableDiffusion = getPropValue<TypeTag, Properties::EnableDiffusion>();
121 separateSparseSourceTerms_ = Parameters::Get<Parameters::SeparateSparseSourceTerms>();
133 Parameters::Register<Parameters::SeparateSparseSourceTerms>
134 (
"Treat well source terms all in one go, instead of on a cell by cell basis.");
148 simulatorPtr_ = &simulator;
196 catch (
const std::exception& e)
198 std::cout <<
"rank " << simulator_().
gridView().comm().rank()
199 <<
" caught an exception while linearizing:" << e.what()
200 <<
"\n" << std::flush;
205 std::cout <<
"rank " << simulator_().
gridView().comm().rank()
206 <<
" caught an exception while linearizing"
207 <<
"\n" << std::flush;
210 succeeded = simulator_().
gridView().comm().min(succeeded);
213 throw NumericalProblem(
"A process did not succeed in linearizing the system");
226 template <
class SubDomainType>
234 initFirstIteration_();
237 if (domain.cells.size() == model_().numTotalDof()) {
248 { jacobian_->finalize(); }
256 OPM_TIMEBLOCK(linearizeAuxilaryEquations);
260 auto& model = model_();
261 const auto& comm = simulator_().
gridView().comm();
262 for (
unsigned auxModIdx = 0; auxModIdx < model.numAuxiliaryModules(); ++auxModIdx) {
263 bool succeeded =
true;
265 model.auxiliaryModule(auxModIdx)->linearize(*jacobian_, residual_);
267 catch (
const std::exception& e) {
270 std::cout <<
"rank " << simulator_().
gridView().comm().rank()
271 <<
" caught an exception while linearizing:" << e.what()
272 <<
"\n" << std::flush;
275 succeeded = comm.min(succeeded);
278 throw NumericalProblem(
"linearization of an auxiliary equation failed");
286 {
return *jacobian_; }
289 {
return *jacobian_; }
295 {
return residual_; }
298 {
return residual_; }
301 linearizationType_ = linearizationType;
305 return linearizationType_;
335 return velocityInfo_;
340 updateStoredTransmissibilities();
344 for (
auto& bdyInfo : boundaryInfo_) {
345 const auto [type, massrateAD] = problem_().boundaryCondition(bdyInfo.cell, bdyInfo.dir);
348 VectorBlock massrate(0.0);
349 for (
size_t ii = 0; ii < massrate.size(); ++ii) {
350 massrate[ii] = massrateAD[ii].value();
352 if (type != BCType::NONE) {
353 const auto& exFluidState = problem_().boundaryFluidState(bdyInfo.cell, bdyInfo.dir);
354 bdyInfo.bcdata.type = type;
355 bdyInfo.bcdata.massRate = massrate;
356 bdyInfo.bcdata.exFluidState = exFluidState;
369 template <
class SubDomainType>
373 initFirstIteration_();
375 for (
int globI : domain.cells) {
376 residual_[globI] = 0.0;
377 jacobian_->clearRow(globI, 0.0);
383 {
return *simulatorPtr_; }
384 const Simulator& simulator_()
const
385 {
return *simulatorPtr_; }
388 {
return simulator_().
problem(); }
389 const Problem& problem_()
const
390 {
return simulator_().
problem(); }
393 {
return simulator_().
model(); }
394 const Model& model_()
const
395 {
return simulator_().
model(); }
397 const GridView& gridView_()
const
398 {
return problem_().gridView(); }
400 void initFirstIteration_()
406 residual_.resize(model_().numTotalDof());
416 OPM_TIMEBLOCK(createMatrix);
417 if (!neighborInfo_.empty()) {
422 const auto& model = model_();
423 Stencil stencil(gridView_(), model_().dofMapper());
427 using NeighborSet = std::set< unsigned >;
428 std::vector<NeighborSet> sparsityPattern(model.numTotalDof());
429 const Scalar gravity = problem_().gravity()[dimWorld - 1];
430 unsigned numCells = model.numTotalDof();
431 neighborInfo_.reserve(numCells, 6 * numCells);
432 std::vector<NeighborInfo> loc_nbinfo;
433 for (
const auto& elem : elements(gridView_())) {
434 stencil.update(elem);
436 for (
unsigned primaryDofIdx = 0; primaryDofIdx < stencil.numPrimaryDof(); ++primaryDofIdx) {
437 unsigned myIdx = stencil.globalSpaceIndex(primaryDofIdx);
438 loc_nbinfo.resize(stencil.numDof() - 1);
440 for (
unsigned dofIdx = 0; dofIdx < stencil.numDof(); ++dofIdx) {
441 unsigned neighborIdx = stencil.globalSpaceIndex(dofIdx);
442 sparsityPattern[myIdx].insert(neighborIdx);
444 const Scalar trans = problem_().transmissibility(myIdx, neighborIdx);
445 const auto scvfIdx = dofIdx - 1;
446 const auto& scvf = stencil.interiorFace(scvfIdx);
447 const Scalar area = scvf.area();
448 const Scalar Vin = problem_().model().dofTotalVolume(myIdx);
449 const Scalar Vex = problem_().model().dofTotalVolume(neighborIdx);
450 const Scalar zIn = problem_().dofCenterDepth(myIdx);
451 const Scalar zEx = problem_().dofCenterDepth(neighborIdx);
452 const Scalar dZg = (zIn - zEx)*gravity;
453 const Scalar thpres = problem_().thresholdPressure(myIdx, neighborIdx);
455 Scalar outAlpha {0.};
456 Scalar diffusivity {0.};
457 Scalar dispersivity {0.};
458 if constexpr(enableEnergy){
459 inAlpha = problem_().thermalHalfTransmissibility(myIdx, neighborIdx);
460 outAlpha = problem_().thermalHalfTransmissibility(neighborIdx, myIdx);
462 if constexpr(enableDiffusion){
463 diffusivity = problem_().diffusivity(myIdx, neighborIdx);
465 if (simulator_().vanguard().eclState().getSimulationConfig().rock_config().dispersion()) {
466 dispersivity = problem_().dispersivity(myIdx, neighborIdx);
468 const auto dirId = scvf.dirId();
469 auto faceDir = dirId < 0 ? FaceDir::DirEnum::Unknown
470 : FaceDir::FromIntersectionIndex(dirId);
471 loc_nbinfo[dofIdx - 1] = NeighborInfo{neighborIdx, {trans, area, thpres, dZg, faceDir, Vin, Vex, inAlpha, outAlpha, diffusivity, dispersivity},
nullptr};
475 neighborInfo_.appendRow(loc_nbinfo.begin(), loc_nbinfo.end());
476 if (problem_().nonTrivialBoundaryConditions()) {
477 for (
unsigned bfIndex = 0; bfIndex < stencil.numBoundaryFaces(); ++bfIndex) {
478 const auto& bf = stencil.boundaryFace(bfIndex);
479 const int dir_id = bf.dirId();
483 const auto [type, massrateAD] = problem_().boundaryCondition(myIdx, dir_id);
485 VectorBlock massrate(0.0);
486 for (
size_t ii = 0; ii < massrate.size(); ++ii) {
487 massrate[ii] = massrateAD[ii].value();
489 const auto& exFluidState = problem_().boundaryFluidState(myIdx, dir_id);
490 BoundaryConditionData bcdata{type,
492 exFluidState.pvtRegionIndex(),
495 bf.integrationPos()[dimWorld - 1],
497 boundaryInfo_.push_back({myIdx, dir_id, bfIndex, bcdata});
505 size_t numAuxMod = model.numAuxiliaryModules();
506 for (
unsigned auxModIdx = 0; auxModIdx < numAuxMod; ++auxModIdx)
507 model.auxiliaryModule(auxModIdx)->addNeighbors(sparsityPattern);
510 jacobian_.reset(
new SparseMatrixAdapter(simulator_()));
511 diagMatAddress_.resize(numCells);
513 jacobian_->reserve(sparsityPattern);
514 for (
unsigned globI = 0; globI < numCells; globI++) {
515 const auto& nbInfos = neighborInfo_[globI];
516 diagMatAddress_[globI] = jacobian_->blockAddress(globI, globI);
517 for (
auto& nbInfo : nbInfos) {
518 nbInfo.matBlockAddress = jacobian_->blockAddress(nbInfo.neighbor, globI);
523 fullDomain_.cells.resize(numCells);
524 std::iota(fullDomain_.cells.begin(), fullDomain_.cells.end(), 0);
538 OPM_TIMEBLOCK(createFlows);
542 const bool anyFlows = simulator_().
problem().eclWriter()->outputModule().anyFlows();
543 const bool anyFlores = simulator_().
problem().eclWriter()->outputModule().anyFlores();
544 const bool enableDispersion = simulator_().
vanguard().eclState().getSimulationConfig().rock_config().dispersion();
545 if (((!anyFlows || !flowsInfo_.empty()) && (!anyFlores || !floresInfo_.empty())) && !enableDispersion) {
548 const auto& model = model_();
549 const auto& nncOutput = simulator_().
problem().eclWriter()->getOutputNnc();
550 Stencil stencil(gridView_(), model_().dofMapper());
551 unsigned numCells = model.numTotalDof();
552 std::unordered_multimap<int, std::pair<int, int>> nncIndices;
553 std::vector<FlowInfo> loc_flinfo;
554 std::vector<VelocityInfo> loc_vlinfo;
555 unsigned int nncId = 0;
556 VectorBlock flow(0.0);
559 for (
unsigned int nncIdx = 0; nncIdx < nncOutput.size(); ++nncIdx) {
560 const int ci1 = nncOutput[nncIdx].cell1;
561 const int ci2 = nncOutput[nncIdx].cell2;
562 nncIndices.emplace(ci1, std::make_pair(ci2, nncIdx));
566 flowsInfo_.reserve(numCells, 6 * numCells);
569 floresInfo_.reserve(numCells, 6 * numCells);
571 if (enableDispersion) {
572 velocityInfo_.reserve(numCells, 6 * numCells);
575 for (
const auto& elem : elements(gridView_())) {
576 stencil.update(elem);
577 for (
unsigned primaryDofIdx = 0; primaryDofIdx < stencil.numPrimaryDof(); ++primaryDofIdx) {
578 unsigned myIdx = stencil.globalSpaceIndex(primaryDofIdx);
579 int numFaces = stencil.numBoundaryFaces() + stencil.numInteriorFaces();
580 loc_flinfo.resize(numFaces);
581 loc_vlinfo.resize(stencil.numDof() - 1);
583 for (
unsigned dofIdx = 0; dofIdx < stencil.numDof(); ++dofIdx) {
584 unsigned neighborIdx = stencil.globalSpaceIndex(dofIdx);
586 const auto scvfIdx = dofIdx - 1;
587 const auto& scvf = stencil.interiorFace(scvfIdx);
588 int faceId = scvf.dirId();
589 const int cartMyIdx = simulator_().
vanguard().cartesianIndex(myIdx);
590 const int cartNeighborIdx = simulator_().
vanguard().cartesianIndex(neighborIdx);
591 const auto& range = nncIndices.equal_range(cartMyIdx);
592 for (
auto it = range.first; it != range.second; ++it) {
593 if (it->second.first == cartNeighborIdx){
597 nncId = it->second.second;
600 loc_flinfo[dofIdx - 1] = FlowInfo{faceId, flow, nncId};
601 loc_vlinfo[dofIdx - 1] = VelocityInfo{flow};
605 for (
unsigned bdfIdx = 0; bdfIdx < stencil.numBoundaryFaces(); ++bdfIdx) {
606 const auto& scvf = stencil.boundaryFace(bdfIdx);
607 int faceId = scvf.dirId();
608 loc_flinfo[stencil.numInteriorFaces() + bdfIdx] = FlowInfo{faceId, flow, nncId};
613 flowsInfo_.appendRow(loc_flinfo.begin(), loc_flinfo.end());
616 floresInfo_.appendRow(loc_flinfo.begin(), loc_flinfo.end());
618 if (enableDispersion) {
619 velocityInfo_.appendRow(loc_vlinfo.begin(), loc_vlinfo.end());
628 for (
unsigned eqIdx = 0; eqIdx < numEq; eqIdx++)
629 res[eqIdx] = resid[eqIdx].value();
631 for (
unsigned eqIdx = 0; eqIdx < numEq; eqIdx++) {
632 for (
unsigned pvIdx = 0; pvIdx < numEq; pvIdx++) {
637 bMat[eqIdx][pvIdx] = resid[eqIdx].derivative(pvIdx);
643 OPM_TIMEBLOCK(updateFlows);
644 const bool& enableFlows = simulator_().
problem().eclWriter()->outputModule().hasFlows() ||
645 simulator_().
problem().eclWriter()->outputModule().hasBlockFlows();
646 const bool& enableFlores = simulator_().
problem().eclWriter()->outputModule().hasFlores();
647 if (!enableFlows && !enableFlores) {
650 const unsigned int numCells = model_().numTotalDof();
652#pragma omp parallel for
654 for (
unsigned globI = 0; globI < numCells; ++globI) {
655 OPM_TIMEBLOCK_LOCAL(linearizationForEachCell);
656 const auto& nbInfos = neighborInfo_[globI];
657 ADVectorBlock adres(0.0);
658 ADVectorBlock darcyFlux(0.0);
659 const IntensiveQuantities& intQuantsIn = model_().intensiveQuantities(globI, 0);
662 OPM_TIMEBLOCK_LOCAL(fluxCalculationForEachCell);
664 for (
const auto& nbInfo : nbInfos) {
665 OPM_TIMEBLOCK_LOCAL(fluxCalculationForEachFace);
666 unsigned globJ = nbInfo.neighbor;
667 assert(globJ != globI);
670 const IntensiveQuantities& intQuantsEx = model_().intensiveQuantities(globJ, 0);
671 LocalResidual::computeFlux(adres,darcyFlux, globI, globJ, intQuantsIn, intQuantsEx, nbInfo.res_nbinfo, problem_().moduleParams());
672 adres *= nbInfo.res_nbinfo.faceArea;
674 for (
unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx) {
675 flowsInfo_[globI][loc].flow[eqIdx] = adres[eqIdx].value();
679 for (
unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx) {
680 floresInfo_[globI][loc].flow[eqIdx] = darcyFlux[eqIdx].value();
689 for (
const auto& bdyInfo : boundaryInfo_) {
690 if (bdyInfo.bcdata.type == BCType::NONE)
693 ADVectorBlock adres(0.0);
694 const unsigned globI = bdyInfo.cell;
695 const auto& nbInfos = neighborInfo_[globI];
696 const IntensiveQuantities& insideIntQuants = model_().intensiveQuantities(globI, 0);
697 LocalResidual::computeBoundaryFlux(adres, problem_(), bdyInfo.bcdata, insideIntQuants, globI);
698 adres *= bdyInfo.bcdata.faceArea;
699 const unsigned bfIndex = bdyInfo.bfIndex;
701 for (
unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx) {
702 flowsInfo_[globI][nbInfos.size() + bfIndex].flow[eqIdx] = adres[eqIdx].value();
710 template <
class SubDomainType>
711 void linearize_(
const SubDomainType& domain)
716 if (!problem_().recycleFirstIterationStorage()) {
717 if (!model_().storeIntensiveQuantities() && !model_().enableStorageCache()) {
718 OPM_THROW(std::runtime_error,
"Must have cached either IQs or storage when we cannot recycle.");
727 const bool& enableDispersion = simulator_().
vanguard().eclState().getSimulationConfig().rock_config().dispersion();
728 const unsigned int numCells = domain.cells.size();
729 const bool on_full_domain = (numCells == model_().numTotalDof());
732#pragma omp parallel for
734 for (
unsigned ii = 0; ii < numCells; ++ii) {
735 OPM_TIMEBLOCK_LOCAL(linearizationForEachCell);
736 const unsigned globI = domain.cells[ii];
737 const auto& nbInfos = neighborInfo_[globI];
738 VectorBlock res(0.0);
739 MatrixBlock bMat(0.0);
740 ADVectorBlock adres(0.0);
741 ADVectorBlock darcyFlux(0.0);
742 const IntensiveQuantities& intQuantsIn = model_().intensiveQuantities(globI, 0);
746 OPM_TIMEBLOCK_LOCAL(fluxCalculationForEachCell);
748 for (
const auto& nbInfo : nbInfos) {
749 OPM_TIMEBLOCK_LOCAL(fluxCalculationForEachFace);
750 unsigned globJ = nbInfo.neighbor;
751 assert(globJ != globI);
756 const IntensiveQuantities& intQuantsEx = model_().intensiveQuantities(globJ, 0);
757 LocalResidual::computeFlux(adres,darcyFlux, globI, globJ, intQuantsIn, intQuantsEx, nbInfo.res_nbinfo, problem_().moduleParams());
758 adres *= nbInfo.res_nbinfo.faceArea;
759 if (enableDispersion) {
760 for (
unsigned phaseIdx = 0; phaseIdx < numEq; ++ phaseIdx) {
761 velocityInfo_[globI][loc].velocity[phaseIdx] = darcyFlux[phaseIdx].value() / nbInfo.res_nbinfo.faceArea;
765 residual_[globI] += res;
767 *diagMatAddress_[globI] += bMat;
770 *nbInfo.matBlockAddress += bMat;
777 double volume = model_().dofTotalVolume(globI);
778 Scalar storefac = volume / dt;
781 OPM_TIMEBLOCK_LOCAL(computeStorage);
782 LocalResidual::computeStorage(adres, intQuantsIn);
786 if (model_().enableStorageCache()) {
790 model_().updateCachedStorage(globI, 0, res);
791 if (model_().newtonMethod().numIterations() == 0) {
793 if (problem_().recycleFirstIterationStorage()) {
796 if (on_full_domain) {
803 model_().updateCachedStorage(globI, 1, res);
806 Dune::FieldVector<Scalar, numEq> tmp;
807 IntensiveQuantities intQuantOld = model_().intensiveQuantities(globI, 1);
808 LocalResidual::computeStorage(tmp, intQuantOld);
809 model_().updateCachedStorage(globI, 1, tmp);
812 res -= model_().cachedStorage(globI, 1);
814 OPM_TIMEBLOCK_LOCAL(computeStorage0);
815 Dune::FieldVector<Scalar, numEq> tmp;
816 IntensiveQuantities intQuantOld = model_().intensiveQuantities(globI, 1);
817 LocalResidual::computeStorage(tmp, intQuantOld);
823 residual_[globI] += res;
825 *diagMatAddress_[globI] += bMat;
832 if (separateSparseSourceTerms_) {
833 LocalResidual::computeSourceDense(adres, problem_(), globI, 0);
835 LocalResidual::computeSource(adres, problem_(), globI, 0);
839 residual_[globI] += res;
841 *diagMatAddress_[globI] += bMat;
845 if (separateSparseSourceTerms_) {
846 problem_().wellModel().addReservoirSourceTerms(residual_, diagMatAddress_);
850 for (
const auto& bdyInfo : boundaryInfo_) {
851 if (bdyInfo.bcdata.type == BCType::NONE)
854 VectorBlock res(0.0);
855 MatrixBlock bMat(0.0);
856 ADVectorBlock adres(0.0);
857 const unsigned globI = bdyInfo.cell;
858 const IntensiveQuantities& insideIntQuants = model_().intensiveQuantities(globI, 0);
859 LocalResidual::computeBoundaryFlux(adres, problem_(), bdyInfo.bcdata, insideIntQuants, globI);
860 adres *= bdyInfo.bcdata.faceArea;
862 residual_[globI] += res;
864 *diagMatAddress_[globI] += bMat;
868 void updateStoredTransmissibilities()
870 if (neighborInfo_.empty()) {
874 initFirstIteration_();
876 unsigned numCells = model_().numTotalDof();
878#pragma omp parallel for
880 for (
unsigned globI = 0; globI < numCells; globI++) {
881 auto nbInfos = neighborInfo_[globI];
882 for (
auto& nbInfo : nbInfos) {
883 unsigned globJ = nbInfo.neighbor;
884 nbInfo.res_nbinfo.trans = problem_().transmissibility(globI, globJ);
890 Simulator *simulatorPtr_;
893 std::unique_ptr<SparseMatrixAdapter> jacobian_;
896 GlobalEqVector residual_;
898 LinearizationType linearizationType_;
900 using ResidualNBInfo =
typename LocalResidual::ResidualNBInfo;
903 unsigned int neighbor;
904 ResidualNBInfo res_nbinfo;
905 MatrixBlock* matBlockAddress;
907 SparseTable<NeighborInfo> neighborInfo_;
908 std::vector<MatrixBlock*> diagMatAddress_;
916 SparseTable<FlowInfo> flowsInfo_;
917 SparseTable<FlowInfo> floresInfo_;
921 VectorBlock velocity;
923 SparseTable<VelocityInfo> velocityInfo_;
925 using ScalarFluidState =
typename IntensiveQuantities::ScalarFluidState;
926 struct BoundaryConditionData
929 VectorBlock massRate;
930 unsigned pvtRegionIdx;
931 unsigned boundaryFaceIndex;
934 ScalarFluidState exFluidState;
940 unsigned int bfIndex;
941 BoundaryConditionData bcdata;
943 std::vector<BoundaryInfo> boundaryInfo_;
944 bool separateSparseSourceTerms_ =
false;
947 std::vector<int> cells;
948 std::vector<bool> interior;
950 FullDomain fullDomain_;
The base class for the element-centered finite-volume discretization scheme.
Definition: ecfvdiscretization.hh:147
Definition: matrixblock.hh:227
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:102
Scalar timeStepSize() const
Returns the time step length so that we don't miss the beginning of the next episode or cross the en...
Definition: simulator.hh:455
Vanguard & vanguard()
Return a reference to the grid manager of simulation.
Definition: simulator.hh:275
Problem & problem()
Return the object which specifies the pysical setup of the simulation.
Definition: simulator.hh:306
const GridView & gridView() const
Return the grid view for which the simulation is done.
Definition: simulator.hh:287
Model & model()
Return the physical model used in the simulation.
Definition: simulator.hh:293
The common code for the linearizers of non-linear systems of equations.
Definition: tpfalinearizer.hh:77
const auto & getFloresInfo() const
Return constant reference to the floresInfo.
Definition: tpfalinearizer.hh:323
const LinearizationType & getLinearizationType() const
Definition: tpfalinearizer.hh:304
void updateBoundaryConditionData()
Definition: tpfalinearizer.hh:343
void linearize()
Linearize the full system of non-linear equations.
Definition: tpfalinearizer.hh:173
SparseMatrixAdapter & jacobian()
Definition: tpfalinearizer.hh:288
const auto & getFlowsInfo() const
Return constant reference to the flowsInfo.
Definition: tpfalinearizer.hh:313
TpfaLinearizer()
Definition: tpfalinearizer.hh:117
void linearizeDomain(const SubDomainType &domain)
Linearize the part of the non-linear system of equations that is associated with a part of the spatia...
Definition: tpfalinearizer.hh:227
void finalize()
Definition: tpfalinearizer.hh:247
void init(Simulator &simulator)
Initialize the linearizer.
Definition: tpfalinearizer.hh:146
void updateFlowsInfo()
Definition: tpfalinearizer.hh:642
void setResAndJacobi(VectorBlock &res, MatrixBlock &bMat, const ADVectorBlock &resid) const
Definition: tpfalinearizer.hh:626
~TpfaLinearizer()
Definition: tpfalinearizer.hh:124
static void registerParameters()
Register all run-time parameters for the Jacobian linearizer.
Definition: tpfalinearizer.hh:131
void linearizeDomain()
Linearize the part of the non-linear system of equations that is associated with the spatial domain.
Definition: tpfalinearizer.hh:189
const SparseMatrixAdapter & jacobian() const
Return constant reference to global Jacobian matrix backend.
Definition: tpfalinearizer.hh:285
void setLinearizationType(LinearizationType linearizationType)
Definition: tpfalinearizer.hh:300
GlobalEqVector & residual()
Definition: tpfalinearizer.hh:297
void eraseMatrix()
Causes the Jacobian matrix to be recreated from scratch before the next iteration.
Definition: tpfalinearizer.hh:159
const auto & getVelocityInfo() const
Return constant reference to the velocityInfo.
Definition: tpfalinearizer.hh:333
void updateDiscretizationParameters()
Definition: tpfalinearizer.hh:338
void resetSystem_(const SubDomainType &domain)
Definition: tpfalinearizer.hh:370
const std::map< unsigned, Constraints > constraintsMap() const
Returns the map of constraint degrees of freedom.
Definition: tpfalinearizer.hh:366
void linearizeAuxiliaryEquations()
Linearize the part of the non-linear system of equations that is associated with the spatial domain.
Definition: tpfalinearizer.hh:254
const GlobalEqVector & residual() const
Return constant reference to global residual vector.
Definition: tpfalinearizer.hh:294
Declare the properties used by the infrastructure code of the finite volume discretizations.
Definition: blackoilnewtonmethodparameters.hh:31
Definition: blackoilboundaryratevector.hh:37
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:235
Definition: linearizationtype.hh:35
Definition: tpfalinearizer.hh:56
static constexpr bool value
Definition: tpfalinearizer.hh:56