mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#540) Added interface for fem to ecl range filter mapping as well.
This commit is contained in:
parent
a5ef83a2ee
commit
4fc0553451
@ -32,10 +32,30 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
void RigCaseToCaseRangeFilterMapper::convertRangeFilterEclToFem(RimCellRangeFilter* srcFilter, const RigMainGrid* srcEclGrid, RimCellRangeFilter* dstFilter, const RigFemPart* dstFemPart)
|
||||
void RigCaseToCaseRangeFilterMapper::convertRangeFilterEclToFem(RimCellRangeFilter* srcFilter, const RigMainGrid* srcEclGrid,
|
||||
RimCellRangeFilter* dstFilter, const RigFemPart* dstFemPart)
|
||||
{
|
||||
CVF_ASSERT(srcFilter && srcEclGrid && dstFilter && dstFemPart);
|
||||
convertRangeFilter(srcFilter, dstFilter, srcEclGrid, dstFemPart, true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCaseToCaseRangeFilterMapper::convertRangeFilterFemToEcl(RimCellRangeFilter* srcFilter, const RigFemPart* srcFemPart,
|
||||
RimCellRangeFilter* dstFilter, const RigMainGrid* dstEclGrid)
|
||||
{
|
||||
convertRangeFilter(srcFilter, dstFilter, dstEclGrid, srcFemPart, false);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
void RigCaseToCaseRangeFilterMapper::convertRangeFilter(RimCellRangeFilter* srcFilter, RimCellRangeFilter* dstFilter,
|
||||
const RigMainGrid* eclGrid, const RigFemPart* femPart,
|
||||
bool femIsDestination)
|
||||
{
|
||||
CVF_ASSERT(srcFilter && eclGrid && dstFilter && femPart);
|
||||
CVF_ASSERT(srcFilter->gridIndex() == 0); // LGR not supported yet
|
||||
|
||||
struct RangeFilterCorner { RangeFilterCorner() : isExactMatch(false){} cvf::Vec3st ijk; bool isExactMatch; };
|
||||
@ -75,23 +95,46 @@ void RigCaseToCaseRangeFilterMapper::convertRangeFilterEclToFem(RimCellRangeFilt
|
||||
{
|
||||
diagIdx = (cornerIdx < 2) ? cornerIdx + 6 : cornerIdx + 2;
|
||||
|
||||
rangeFilterMatches[cornerIdx].isExactMatch = findBestFemCellFromEclCell(srcEclGrid,
|
||||
if (femIsDestination)
|
||||
{
|
||||
rangeFilterMatches[cornerIdx].isExactMatch = findBestFemCellFromEclCell(eclGrid,
|
||||
srcRangeCube[cornerIdx][0],
|
||||
srcRangeCube[cornerIdx][1],
|
||||
srcRangeCube[cornerIdx][2],
|
||||
dstFemPart,
|
||||
femPart,
|
||||
&(rangeFilterMatches[cornerIdx].ijk[0]),
|
||||
&(rangeFilterMatches[cornerIdx].ijk[1]),
|
||||
&(rangeFilterMatches[cornerIdx].ijk[2]));
|
||||
|
||||
rangeFilterMatches[diagIdx].isExactMatch = findBestFemCellFromEclCell(srcEclGrid,
|
||||
rangeFilterMatches[diagIdx].isExactMatch = findBestFemCellFromEclCell(eclGrid,
|
||||
srcRangeCube[diagIdx][0],
|
||||
srcRangeCube[diagIdx][1],
|
||||
srcRangeCube[diagIdx][2],
|
||||
dstFemPart,
|
||||
femPart,
|
||||
&(rangeFilterMatches[diagIdx].ijk[0]),
|
||||
&(rangeFilterMatches[diagIdx].ijk[1]),
|
||||
&(rangeFilterMatches[diagIdx].ijk[2]));
|
||||
}
|
||||
else
|
||||
{
|
||||
rangeFilterMatches[cornerIdx].isExactMatch = findBestEclCellFromFemCell(femPart,
|
||||
srcRangeCube[cornerIdx][0],
|
||||
srcRangeCube[cornerIdx][1],
|
||||
srcRangeCube[cornerIdx][2],
|
||||
eclGrid,
|
||||
&(rangeFilterMatches[cornerIdx].ijk[0]),
|
||||
&(rangeFilterMatches[cornerIdx].ijk[1]),
|
||||
&(rangeFilterMatches[cornerIdx].ijk[2]));
|
||||
|
||||
rangeFilterMatches[diagIdx].isExactMatch = findBestEclCellFromFemCell(femPart,
|
||||
srcRangeCube[diagIdx][0],
|
||||
srcRangeCube[diagIdx][1],
|
||||
srcRangeCube[diagIdx][2],
|
||||
eclGrid,
|
||||
&(rangeFilterMatches[diagIdx].ijk[0]),
|
||||
&(rangeFilterMatches[diagIdx].ijk[1]),
|
||||
&(rangeFilterMatches[diagIdx].ijk[2]));
|
||||
}
|
||||
|
||||
if (rangeFilterMatches[cornerIdx].isExactMatch && rangeFilterMatches[diagIdx].isExactMatch)
|
||||
{
|
||||
@ -293,3 +336,4 @@ bool RigCaseToCaseRangeFilterMapper::findBestEclCellFromFemCell(const RigFemPart
|
||||
|
||||
return foundExactMatch;
|
||||
}
|
||||
|
||||
|
@ -27,8 +27,16 @@ class RigCaseToCaseRangeFilterMapper
|
||||
public:
|
||||
static void convertRangeFilterEclToFem(RimCellRangeFilter* srcFilter, const RigMainGrid* srcEclGrid,
|
||||
RimCellRangeFilter* dstFilter, const RigFemPart* dstFemPart);
|
||||
static void convertRangeFilterFemToEcl(RimCellRangeFilter* srcFilter, const RigFemPart* srcFemPart,
|
||||
RimCellRangeFilter* dstFilter, const RigMainGrid* dstEclGrid);
|
||||
|
||||
private:
|
||||
|
||||
static void convertRangeFilter(RimCellRangeFilter* srcFilter, RimCellRangeFilter* dstFilter,
|
||||
const RigMainGrid* eclGrid, const RigFemPart* femPart,
|
||||
bool femIsDestination);
|
||||
|
||||
|
||||
static bool findBestFemCellFromEclCell(const RigMainGrid* masterEclGrid, size_t ei, size_t ej, size_t ek,
|
||||
const RigFemPart* dependentFemPart, size_t* fi, size_t * fj, size_t* fk);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user