more timings

This commit is contained in:
hnil 2023-02-15 11:06:25 +01:00
parent f5a427a55b
commit 9a63513afb
2 changed files with 17 additions and 1 deletions

View File

@ -124,6 +124,7 @@ public:
static void computeStorage(Dune::FieldVector<LhsEval, numEq>& storage,
const IntensiveQuantities& intQuants)
{
OPM_TIMEBLOCK_LOCAL(computeStorage);
// retrieve the intensive quantities for the SCV at the specified point in time
const auto& fs = intQuants.fluidState();
storage = 0.0;
@ -213,6 +214,7 @@ public:
const Scalar faceArea,
const FaceDir::DirEnum facedir)
{
OPM_TIMEBLOCK_LOCAL(computeFlux);
flux = 0.0;
darcy = 0.0;
Scalar Vin = problem.model().dofTotalVolume(globalIndexIn);
@ -260,6 +262,7 @@ public:
unsigned scvfIdx,
unsigned timeIdx)
{
OPM_TIMEBLOCK_LOCAL(computeFlux);
assert(timeIdx == 0);
flux = 0.0;
@ -336,6 +339,7 @@ public:
const Scalar& faceArea,
const FaceDir::DirEnum facedir)
{
OPM_TIMEBLOCK_LOCAL(calculateFluxes);
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
if (!FluidSystem::phaseIsActive(phaseIdx))
continue;
@ -460,6 +464,7 @@ public:
const IntensiveQuantities& insideIntQuants,
unsigned globalSpaceIdx)
{
OPM_TIMEBLOCK_LOCAL(computeBoundaryFluxFree);
std::array<short, numPhases> upIdx;
std::array<short, numPhases> dnIdx;
RateVector volumeFlux;
@ -543,6 +548,7 @@ public:
unsigned globalSpaceIdex,
unsigned timeIdx)
{
OPM_TIMEBLOCK_LOCAL(computeSource);
// retrieve the source term intrinsic to the problem
problem.source(source, globalSpaceIdex, timeIdx);
@ -564,6 +570,7 @@ public:
unsigned dofIdx,
unsigned timeIdx) const
{
OPM_TIMEBLOCK_LOCAL(computeSource);
// retrieve the source term intrinsic to the problem
elemCtx.problem().source(source, elemCtx, dofIdx, timeIdx);

View File

@ -529,6 +529,7 @@ private:
#pragma omp parallel for
#endif
for (unsigned globI = 0; globI < numCells; globI++) {
OPM_TIMEBLOCK_LOCAL(linearizationForEachCell);
const auto& nbInfos = neighborInfo_[globI]; // this is a set but should maybe be changed
VectorBlock res(0.0);
MatrixBlock bMat(0.0);
@ -541,8 +542,11 @@ private:
const IntensiveQuantities& intQuantsIn = *intQuantsInP;
// Flux term.
{
OPM_TIMEBLOCK_LOCAL(fluxCalculationForEachCell);
short loc = 0;
for (const auto& nbInfo : nbInfos) {
OPM_TIMEBLOCK_LOCAL(fluxCalculationForEachFace);
unsigned globJ = nbInfo.neighbor;
assert(globJ != globI);
res = 0.0;
@ -577,13 +581,17 @@ private:
*nbInfo.matBlockAddress += bMat;
++loc;
}
}
// Accumulation term.
double dt = simulator_().timeStepSize();
double volume = model_().dofTotalVolume(globI);
Scalar storefac = volume / dt;
adres = 0.0;
LocalResidual::computeStorage(adres, intQuantsIn);
{
OPM_TIMEBLOCK_LOCAL(calculateStorage);
LocalResidual::computeStorage(adres, intQuantsIn);
}
setResAndJacobi(res, bMat, adres);
// TODO: check recycleFirst etc.
// first we use it as storage cache
@ -599,6 +607,7 @@ private:
*diagMatAddress_[globI] += bMat;
// wells sources for now (should be moved out)
if (well_local) {
OPM_TIMEBLOCK_LOCAL(localWellAssembly);
res = 0.0;
bMat = 0.0;
adres = 0.0;