diff --git a/opm/models/discretization/common/fvbaseelementcontext.hh b/opm/models/discretization/common/fvbaseelementcontext.hh index 55e1cdc51..cf556587d 100644 --- a/opm/models/discretization/common/fvbaseelementcontext.hh +++ b/opm/models/discretization/common/fvbaseelementcontext.hh @@ -36,6 +36,7 @@ #include #include +#include namespace Opm { @@ -98,6 +99,12 @@ public: enableStorageCache_ = EWOMS_GET_PARAM(TypeTag, bool, EnableStorageCache); stashedDofIdx_ = -1; focusDofIdx_ = -1; + const char* opm_debug = std::getenv("OPM_DEBUG"); + const bool debug = opm_debug != NULL && std::string(opm_debug) == "1"; + if (debug) { + std::cout << "rd" << std::endl; + dofVars_.resize(1); + } } static void *operator new(size_t size) @@ -152,10 +159,22 @@ public: // remember the current element elemPtr_ = &elem; - // update the finite element geometry + const char* opm_debug = std::getenv("OPM_DEBUG"); + const bool debug = opm_debug != NULL && std::string(opm_debug) == "1"; + if (debug) { + std::cout << "u" << std::endl; + } stencil_.updatePrimaryTopology(elem); - - dofVars_.resize(stencil_.numPrimaryDof()); + auto numDof = stencil_.numPrimaryDof(); + if (debug) { + std::cout << dofVars_.size() + << "-" << numDof + << std::endl; + } + dofVars_.resize(numDof); + if (debug) { + std::cout << "x" << std::endl; + } } /*! @@ -208,7 +227,14 @@ public: * \param timeIdx The index of the solution vector used by the time discretization. */ void updatePrimaryIntensiveQuantities(unsigned timeIdx) - { updateIntensiveQuantities_(timeIdx, numPrimaryDof(timeIdx)); } + { + const char* opm_debug = std::getenv("OPM_DEBUG"); + const bool debug = opm_debug != NULL && std::string(opm_debug) == "1"; + if (debug) { + std::cout << "a" << std::endl; + } + updateIntensiveQuantities_(timeIdx, numPrimaryDof(timeIdx)); + } /*! * \brief Compute the intensive quantities of a single sub-control volume of the @@ -436,6 +462,16 @@ public: IntensiveQuantities& intensiveQuantities(unsigned dofIdx, unsigned timeIdx) { assert(dofIdx < numDof(timeIdx)); + const char* opm_debug = std::getenv("OPM_DEBUG"); + const bool debug = opm_debug != NULL && std::string(opm_debug) == "1"; + if (debug) { + std::cout << "iq" << std::endl; + } + //auto iq = dofVars_[dofIdx].intensiveQuantities[timeIdx]; + //if (debug) { + // std::cout << "iq2" << std::endl; + //} + //return iq; return dofVars_[dofIdx].intensiveQuantities[timeIdx]; } @@ -545,6 +581,11 @@ protected: */ void updateIntensiveQuantities_(unsigned timeIdx, size_t numDof) { + const char* opm_debug = std::getenv("OPM_DEBUG"); + const bool debug = opm_debug != NULL && std::string(opm_debug) == "1"; + if (debug) { + std::cout << "b" << std::endl; + } // update the intensive quantities for the whole history const SolutionVector& globalSol = model().solution(timeIdx); diff --git a/opm/models/discretization/ecfv/ecfvstencil.hh b/opm/models/discretization/ecfv/ecfvstencil.hh index a83cfd9e3..a4958ee98 100644 --- a/opm/models/discretization/ecfv/ecfvstencil.hh +++ b/opm/models/discretization/ecfv/ecfvstencil.hh @@ -41,6 +41,7 @@ #include #include +#include namespace Opm { /*! @@ -293,10 +294,24 @@ public: void updatePrimaryTopology(const Element& element) { + const char* opm_debug = std::getenv("OPM_DEBUG"); + const bool debug = opm_debug != NULL && std::string(opm_debug) == "1"; + if (debug) { + std::cout << "upt1" << std::endl; + } // add the "center" element of the stencil subControlVolumes_.clear(); + if (debug) { + std::cout << "upt2" << std::endl; + } subControlVolumes_.emplace_back(/*SubControlVolume(*/element/*)*/); + if (debug) { + std::cout << "upt3" << std::endl; + } elements_.clear(); + if (debug) { + std::cout << "upt4" << std::endl; + } elements_.emplace_back(element); }