mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-26 21:27:15 -05:00
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:
@@ -156,11 +156,19 @@ void RimRefinementRegion::setDefaultsFromCase( RimEclipseCase* eclipseCase )
|
||||
auto grid = eclipseCase->mainGrid();
|
||||
if ( !grid ) return;
|
||||
|
||||
m_startI = 1;
|
||||
m_startJ = 1;
|
||||
const int gridI = static_cast<int>( grid->cellCountI() );
|
||||
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_cellCountI = static_cast<int>( grid->cellCountI() );
|
||||
m_cellCountJ = static_cast<int>( grid->cellCountJ() );
|
||||
m_cellCountI = countI;
|
||||
m_cellCountJ = countJ;
|
||||
m_cellCountK = static_cast<int>( grid->cellCountK() );
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,8 @@ public:
|
||||
caf::VecIjk0 ijkMin() 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 );
|
||||
|
||||
// Build the refinement for this region alone, sized to its own bounds.
|
||||
|
||||
Reference in New Issue
Block a user