Skip to content

Commit

Permalink
Check environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
hakonhagland committed Jan 29, 2024
1 parent e9340f5 commit ab317d5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions opm/models/discretization/common/fvbaseelementcontext.hh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <dune/common/fvector.hh>

#include <vector>
#include <cstdlib>

namespace Opm {

Expand Down Expand Up @@ -98,7 +99,6 @@ public:
enableStorageCache_ = EWOMS_GET_PARAM(TypeTag, bool, EnableStorageCache);
stashedDofIdx_ = -1;
focusDofIdx_ = -1;
dofVars_.resize(1);
}

static void *operator new(size_t size)
Expand Down Expand Up @@ -153,16 +153,20 @@ public:
// remember the current element
elemPtr_ = &elem;

// update the finite element geometry
#pragma omp critical
{
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);
auto numDof = stencil_.numPrimaryDof();
}
stencil_.updatePrimaryTopology(elem);
auto numDof = stencil_.numPrimaryDof();
if (debug) {
std::cout << dofVars_.size()
<< "-" << numDof
<< std::endl;
dofVars_.resize(numDof);
}
dofVars_.resize(numDof);
if (debug) {
std::cout << "x" << std::endl;
}
}
Expand Down

0 comments on commit ab317d5

Please sign in to comment.