mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-29 10:21:54 -06:00
#1506 Fix stimPlan getGlobalIndexFromIJ() errors
Misunderstandings of row/column count and CellCounts and point counts. Quite an obfuscation to use j as fast index, and CellCountI = ColumnCount - 2. The names are not quite enlightening.
This commit is contained in:
parent
6cdf13a2bc
commit
38315f7bc2
@ -260,16 +260,16 @@ void RifFractureExportTools::exportWellPathFracturesToEclipseDataInputFile(const
|
||||
//////
|
||||
// Calculate Transmissibility in the fracture: From one StimPlan Cell to the other
|
||||
|
||||
for (size_t i = 0; i < fracTemplateStimPlan->stimPlanGridNumberOfColums(); i++)
|
||||
for (size_t i = 0; i < fracTemplateStimPlan->stimPlanGridNumberOfColums()-2; i++)
|
||||
{
|
||||
for (size_t j = 0; j < fracTemplateStimPlan->stimPlanGridNumberOfRows(); j++)
|
||||
for (size_t j = 0; j < fracTemplateStimPlan->stimPlanGridNumberOfRows()-2; j++)
|
||||
{
|
||||
size_t stimPlanCellIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(i, j);
|
||||
const RigStimPlanFracTemplateCell stimPlanCell = fracTemplateStimPlan->stimPlanCellFromIndex(stimPlanCellIndex);
|
||||
|
||||
if (stimPlanCell.getConductivtyValue() < 1e-7) continue;
|
||||
|
||||
if (i < fracTemplateStimPlan->stimPlanGridNumberOfColums() - 1)
|
||||
if (i < fracTemplateStimPlan->stimPlanGridNumberOfColums() - 2-1)
|
||||
{
|
||||
size_t stimPlanCellNeighbourXIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(i + 1, j);
|
||||
const RigStimPlanFracTemplateCell stimPlanCellNeighbourX = fracTemplateStimPlan->stimPlanCellFromIndex(stimPlanCellNeighbourXIndex);
|
||||
@ -289,7 +289,7 @@ void RifFractureExportTools::exportWellPathFracturesToEclipseDataInputFile(const
|
||||
|
||||
}
|
||||
|
||||
if (j < fracTemplateStimPlan->stimPlanGridNumberOfRows() - 1)
|
||||
if (j < fracTemplateStimPlan->stimPlanGridNumberOfRows() - 2-1)
|
||||
{
|
||||
size_t stimPlanCellNeighbourZIndex = fracTemplateStimPlan->getGlobalIndexFromIJ(i, j + 1);
|
||||
const RigStimPlanFracTemplateCell stimPlanCellNeighbourZ = fracTemplateStimPlan->stimPlanCellFromIndex(stimPlanCellNeighbourZIndex);
|
||||
|
@ -959,9 +959,11 @@ std::pair<size_t, size_t> RimStimPlanFractureTemplate::getStimPlanCellAtWellCent
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RimStimPlanFractureTemplate::getGlobalIndexFromIJ(size_t i, size_t j) const
|
||||
{
|
||||
size_t length_I = stimPlanGridNumberOfRows() - 1;
|
||||
size_t globIndex = j * length_I + i;
|
||||
size_t cellCountJ = stimPlanGridNumberOfRows() - 2;
|
||||
size_t globIndex = i * cellCountJ + j;
|
||||
|
||||
CVF_ASSERT(m_stimPlanCells[globIndex].getI() == i && m_stimPlanCells[globIndex].getJ() == j);
|
||||
|
||||
return globIndex;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user