2018-03-15 15:25:54 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2019-01-09 08:21:38 -06:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2018-03-15 15:25:54 -05:00
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RivWellConnectionSourceInfo.h"
|
|
|
|
|
|
|
|
#include "RimWellPath.h"
|
|
|
|
#include "RivWellConnectionFactorGeometryGenerator.h"
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 03:48:40 -06:00
|
|
|
RivWellConnectionSourceInfo::RivWellConnectionSourceInfo( RimWellPath* wellPath, RivWellConnectionFactorGeometryGenerator* geometryGenerator )
|
2019-09-06 03:40:57 -05:00
|
|
|
: m_wellPath( wellPath )
|
|
|
|
, m_geometryGenerator( geometryGenerator )
|
2018-03-15 15:25:54 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellPath* RivWellConnectionSourceInfo::wellPath() const
|
|
|
|
{
|
|
|
|
return m_wellPath;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
size_t RivWellConnectionSourceInfo::globalCellIndexFromTriangleIndex( cvf::uint triangleIndex ) const
|
2018-03-15 15:25:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_geometryGenerator.isNull() ) return 0;
|
2018-03-15 15:25:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return m_geometryGenerator->globalCellIndexFromTriangleIndex( triangleIndex );
|
2018-03-15 15:25:54 -05:00
|
|
|
}
|
2018-03-19 08:41:46 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-03-19 08:41:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
double RivWellConnectionSourceInfo::connectionFactorFromTriangleIndex( cvf::uint triangleIndex ) const
|
2018-03-19 08:41:46 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_geometryGenerator.isNull() ) return 0.0;
|
2018-03-19 08:41:46 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return m_geometryGenerator->connectionFactor( triangleIndex );
|
2018-03-19 08:41:46 -05:00
|
|
|
}
|