mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
more timings
This commit is contained in:
parent
f5a427a55b
commit
9a63513afb
@ -124,6 +124,7 @@ public:
|
|||||||
static void computeStorage(Dune::FieldVector<LhsEval, numEq>& storage,
|
static void computeStorage(Dune::FieldVector<LhsEval, numEq>& storage,
|
||||||
const IntensiveQuantities& intQuants)
|
const IntensiveQuantities& intQuants)
|
||||||
{
|
{
|
||||||
|
OPM_TIMEBLOCK_LOCAL(computeStorage);
|
||||||
// retrieve the intensive quantities for the SCV at the specified point in time
|
// retrieve the intensive quantities for the SCV at the specified point in time
|
||||||
const auto& fs = intQuants.fluidState();
|
const auto& fs = intQuants.fluidState();
|
||||||
storage = 0.0;
|
storage = 0.0;
|
||||||
@ -213,6 +214,7 @@ public:
|
|||||||
const Scalar faceArea,
|
const Scalar faceArea,
|
||||||
const FaceDir::DirEnum facedir)
|
const FaceDir::DirEnum facedir)
|
||||||
{
|
{
|
||||||
|
OPM_TIMEBLOCK_LOCAL(computeFlux);
|
||||||
flux = 0.0;
|
flux = 0.0;
|
||||||
darcy = 0.0;
|
darcy = 0.0;
|
||||||
Scalar Vin = problem.model().dofTotalVolume(globalIndexIn);
|
Scalar Vin = problem.model().dofTotalVolume(globalIndexIn);
|
||||||
@ -260,6 +262,7 @@ public:
|
|||||||
unsigned scvfIdx,
|
unsigned scvfIdx,
|
||||||
unsigned timeIdx)
|
unsigned timeIdx)
|
||||||
{
|
{
|
||||||
|
OPM_TIMEBLOCK_LOCAL(computeFlux);
|
||||||
assert(timeIdx == 0);
|
assert(timeIdx == 0);
|
||||||
|
|
||||||
flux = 0.0;
|
flux = 0.0;
|
||||||
@ -336,6 +339,7 @@ public:
|
|||||||
const Scalar& faceArea,
|
const Scalar& faceArea,
|
||||||
const FaceDir::DirEnum facedir)
|
const FaceDir::DirEnum facedir)
|
||||||
{
|
{
|
||||||
|
OPM_TIMEBLOCK_LOCAL(calculateFluxes);
|
||||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
||||||
if (!FluidSystem::phaseIsActive(phaseIdx))
|
if (!FluidSystem::phaseIsActive(phaseIdx))
|
||||||
continue;
|
continue;
|
||||||
@ -460,6 +464,7 @@ public:
|
|||||||
const IntensiveQuantities& insideIntQuants,
|
const IntensiveQuantities& insideIntQuants,
|
||||||
unsigned globalSpaceIdx)
|
unsigned globalSpaceIdx)
|
||||||
{
|
{
|
||||||
|
OPM_TIMEBLOCK_LOCAL(computeBoundaryFluxFree);
|
||||||
std::array<short, numPhases> upIdx;
|
std::array<short, numPhases> upIdx;
|
||||||
std::array<short, numPhases> dnIdx;
|
std::array<short, numPhases> dnIdx;
|
||||||
RateVector volumeFlux;
|
RateVector volumeFlux;
|
||||||
@ -543,6 +548,7 @@ public:
|
|||||||
unsigned globalSpaceIdex,
|
unsigned globalSpaceIdex,
|
||||||
unsigned timeIdx)
|
unsigned timeIdx)
|
||||||
{
|
{
|
||||||
|
OPM_TIMEBLOCK_LOCAL(computeSource);
|
||||||
// retrieve the source term intrinsic to the problem
|
// retrieve the source term intrinsic to the problem
|
||||||
problem.source(source, globalSpaceIdex, timeIdx);
|
problem.source(source, globalSpaceIdex, timeIdx);
|
||||||
|
|
||||||
@ -564,6 +570,7 @@ public:
|
|||||||
unsigned dofIdx,
|
unsigned dofIdx,
|
||||||
unsigned timeIdx) const
|
unsigned timeIdx) const
|
||||||
{
|
{
|
||||||
|
OPM_TIMEBLOCK_LOCAL(computeSource);
|
||||||
// retrieve the source term intrinsic to the problem
|
// retrieve the source term intrinsic to the problem
|
||||||
elemCtx.problem().source(source, elemCtx, dofIdx, timeIdx);
|
elemCtx.problem().source(source, elemCtx, dofIdx, timeIdx);
|
||||||
|
|
||||||
|
@ -529,6 +529,7 @@ private:
|
|||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
#endif
|
#endif
|
||||||
for (unsigned globI = 0; globI < numCells; globI++) {
|
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
|
const auto& nbInfos = neighborInfo_[globI]; // this is a set but should maybe be changed
|
||||||
VectorBlock res(0.0);
|
VectorBlock res(0.0);
|
||||||
MatrixBlock bMat(0.0);
|
MatrixBlock bMat(0.0);
|
||||||
@ -541,8 +542,11 @@ private:
|
|||||||
const IntensiveQuantities& intQuantsIn = *intQuantsInP;
|
const IntensiveQuantities& intQuantsIn = *intQuantsInP;
|
||||||
|
|
||||||
// Flux term.
|
// Flux term.
|
||||||
|
{
|
||||||
|
OPM_TIMEBLOCK_LOCAL(fluxCalculationForEachCell);
|
||||||
short loc = 0;
|
short loc = 0;
|
||||||
for (const auto& nbInfo : nbInfos) {
|
for (const auto& nbInfo : nbInfos) {
|
||||||
|
OPM_TIMEBLOCK_LOCAL(fluxCalculationForEachFace);
|
||||||
unsigned globJ = nbInfo.neighbor;
|
unsigned globJ = nbInfo.neighbor;
|
||||||
assert(globJ != globI);
|
assert(globJ != globI);
|
||||||
res = 0.0;
|
res = 0.0;
|
||||||
@ -577,13 +581,17 @@ private:
|
|||||||
*nbInfo.matBlockAddress += bMat;
|
*nbInfo.matBlockAddress += bMat;
|
||||||
++loc;
|
++loc;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Accumulation term.
|
// Accumulation term.
|
||||||
double dt = simulator_().timeStepSize();
|
double dt = simulator_().timeStepSize();
|
||||||
double volume = model_().dofTotalVolume(globI);
|
double volume = model_().dofTotalVolume(globI);
|
||||||
Scalar storefac = volume / dt;
|
Scalar storefac = volume / dt;
|
||||||
adres = 0.0;
|
adres = 0.0;
|
||||||
LocalResidual::computeStorage(adres, intQuantsIn);
|
{
|
||||||
|
OPM_TIMEBLOCK_LOCAL(calculateStorage);
|
||||||
|
LocalResidual::computeStorage(adres, intQuantsIn);
|
||||||
|
}
|
||||||
setResAndJacobi(res, bMat, adres);
|
setResAndJacobi(res, bMat, adres);
|
||||||
// TODO: check recycleFirst etc.
|
// TODO: check recycleFirst etc.
|
||||||
// first we use it as storage cache
|
// first we use it as storage cache
|
||||||
@ -599,6 +607,7 @@ private:
|
|||||||
*diagMatAddress_[globI] += bMat;
|
*diagMatAddress_[globI] += bMat;
|
||||||
// wells sources for now (should be moved out)
|
// wells sources for now (should be moved out)
|
||||||
if (well_local) {
|
if (well_local) {
|
||||||
|
OPM_TIMEBLOCK_LOCAL(localWellAssembly);
|
||||||
res = 0.0;
|
res = 0.0;
|
||||||
bMat = 0.0;
|
bMat = 0.0;
|
||||||
adres = 0.0;
|
adres = 0.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user