#5914 Import faults : Avoid computation of faults if turned off in preferences

This commit is contained in:
Magne Sjaastad
2020-05-13 12:38:33 +02:00
parent 2bc9cb37c0
commit 0c32538e01
3 changed files with 19 additions and 10 deletions

View File

@@ -609,12 +609,16 @@ void RimEclipseCase::computeCachedData()
{ {
auto task = pInf.task( "Calculating faults", 17 ); auto task = pInf.task( "Calculating faults", 17 );
bool computeFaults = RiaApplication::instance()->preferences()->readerSettings()->importFaults();
if ( computeFaults )
{
bool computeNncs = RiaApplication::instance()->preferences()->readerSettings()->importNNCs(); bool computeNncs = RiaApplication::instance()->preferences()->readerSettings()->importNNCs();
rigEclipseCase->mainGrid()->calculateFaults( rigEclipseCase->activeCellInfo( rigEclipseCase->mainGrid()->calculateFaults( rigEclipseCase->activeCellInfo(
RiaDefines::PorosityModelType::MATRIX_MODEL ), RiaDefines::PorosityModelType::MATRIX_MODEL ),
computeNncs ); computeNncs );
} }
}
{ {
auto task = pInf.task( "Calculating Formation Names Result", 2 ); auto task = pInf.task( "Calculating Formation Names Result", 2 );

View File

@@ -132,11 +132,14 @@ RigMainGrid* RimEclipseCaseCollection::registerCaseInGridCollection( RigEclipseC
// This is the first insertion of this grid, compute cached data // This is the first insertion of this grid, compute cached data
rigEclipseCase->mainGrid()->computeCachedData(); rigEclipseCase->mainGrid()->computeCachedData();
bool computeFaults = RiaApplication::instance()->preferences()->readerSettings()->importFaults();
if ( computeFaults )
{
bool computeNncs = RiaApplication::instance()->preferences()->readerSettings()->importNNCs(); bool computeNncs = RiaApplication::instance()->preferences()->readerSettings()->importNNCs();
rigEclipseCase->mainGrid()->calculateFaults( rigEclipseCase->activeCellInfo( rigEclipseCase->mainGrid()->calculateFaults( rigEclipseCase->activeCellInfo(
RiaDefines::PorosityModelType::MATRIX_MODEL ), RiaDefines::PorosityModelType::MATRIX_MODEL ),
computeNncs ); computeNncs );
}
equalGrid = rigEclipseCase->mainGrid(); equalGrid = rigEclipseCase->mainGrid();
} }

View File

@@ -569,6 +569,8 @@ void RigMainGrid::calculateFaults( const RigActiveCellInfo* activeCellInfo, bool
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RigMainGrid::distributeNNCsToFaults() void RigMainGrid::distributeNNCsToFaults()
{ {
if ( m_faultsPrCellAcc.isNull() ) return;
const RigConnectionContainer& nncs = this->nncData()->connections(); const RigConnectionContainer& nncs = this->nncData()->connections();
for ( size_t nncIdx = 0; nncIdx < nncs.size(); ++nncIdx ) for ( size_t nncIdx = 0; nncIdx < nncs.size(); ++nncIdx )
{ {
@@ -655,7 +657,7 @@ bool RigMainGrid::isFaceNormalsOutwards() const
const RigFault* RigMainGrid::findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, const RigFault* RigMainGrid::findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex,
cvf::StructGridInterface::FaceType face ) const cvf::StructGridInterface::FaceType face ) const
{ {
CVF_TIGHT_ASSERT( m_faultsPrCellAcc.notNull() ); if ( m_faultsPrCellAcc.isNull() ) return nullptr;
if ( face == cvf::StructGridInterface::NO_FACE ) return nullptr; if ( face == cvf::StructGridInterface::NO_FACE ) return nullptr;