Sector export: Default refinement region to small centered box

Initialize new refinement regions with a small box (~1/4 of grid I/J
extent) centered in I/J and spanning the full K range, so the wireframe
is clearly visible against the parent grid edges instead of coinciding
with the grid bounds.
This commit is contained in:
Kristian Bendiksen
2026-04-29 13:14:49 +02:00
parent 87e9ab7b5b
commit 2b52193e90
2 changed files with 14 additions and 5 deletions
@@ -156,11 +156,19 @@ void RimRefinementRegion::setDefaultsFromCase( RimEclipseCase* eclipseCase )
auto grid = eclipseCase->mainGrid(); auto grid = eclipseCase->mainGrid();
if ( !grid ) return; if ( !grid ) return;
m_startI = 1; const int gridI = static_cast<int>( grid->cellCountI() );
m_startJ = 1; const int gridJ = static_cast<int>( grid->cellCountJ() );
// Default to a small box (~1/4 of grid I/J extent) centered in I/J, spanning the full K range,
// so the wireframe is clearly visible against the parent grid edges.
const int countI = std::max( 1, gridI / 4 );
const int countJ = std::max( 1, gridJ / 4 );
m_startI = std::max( 1, ( gridI - countI ) / 2 + 1 );
m_startJ = std::max( 1, ( gridJ - countJ ) / 2 + 1 );
m_startK = 1; m_startK = 1;
m_cellCountI = static_cast<int>( grid->cellCountI() ); m_cellCountI = countI;
m_cellCountJ = static_cast<int>( grid->cellCountJ() ); m_cellCountJ = countJ;
m_cellCountK = static_cast<int>( grid->cellCountK() ); m_cellCountK = static_cast<int>( grid->cellCountK() );
} }
@@ -62,7 +62,8 @@ public:
caf::VecIjk0 ijkMin() const; caf::VecIjk0 ijkMin() const;
caf::VecIjk0 ijkMax() const; caf::VecIjk0 ijkMax() const;
// Populate the region with defaults derived from the case's main grid (full grid, refinement 1,1,1). // Populate the region with defaults derived from the case's main grid: a small box centered in I/J
// (roughly 1/4 of the grid I/J extent) spanning the full K range, so the wireframe is visible on creation.
void setDefaultsFromCase( RimEclipseCase* eclipseCase ); void setDefaultsFromCase( RimEclipseCase* eclipseCase );
// Build the refinement for this region alone, sized to its own bounds. // Build the refinement for this region alone, sized to its own bounds.