mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2483 Refactoring : Simplify generation of well branch geometry (1)
This commit is contained in:
@@ -490,25 +490,12 @@ void RimIntersection::updateSimulationWellCenterline() const
|
||||
{
|
||||
if (isActive() && type == CS_SIMULATION_WELL && simulationWell())
|
||||
{
|
||||
if (m_simulationWellBranchCenterlines.size() == 0)
|
||||
if (m_simulationWellBranchCenterlines.empty())
|
||||
{
|
||||
RimEclipseCase* rimEclCase = nullptr;
|
||||
simulationWell->firstAncestorOrThisOfType(rimEclCase);
|
||||
if (rimEclCase)
|
||||
auto branches = simulationWell->wellPipeBranches();
|
||||
for (const auto& branch : branches)
|
||||
{
|
||||
RimSimWellInViewCollection* simWellCollection = nullptr;
|
||||
simulationWell->firstAncestorOrThisOfTypeAsserted(simWellCollection);
|
||||
|
||||
bool includeCellCenters = simulationWell->isUsingCellCenterForPipe();
|
||||
bool detectBrances = simWellCollection->isAutoDetectingBranches;
|
||||
|
||||
RigEclipseCaseData* caseData = rimEclCase->eclipseCaseData();
|
||||
auto branches = caseData->simulationWellBranches(simulationWell->name, includeCellCenters, detectBrances);
|
||||
|
||||
for (auto b : branches)
|
||||
{
|
||||
m_simulationWellBranchCenterlines.push_back(b->m_wellPathPoints);
|
||||
}
|
||||
m_simulationWellBranchCenterlines.push_back(branch->m_wellPathPoints);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +153,25 @@ caf::PdmFieldHandle* RimSimWellInView::objectToggleField()
|
||||
return &showWell;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<const RigWellPath*> RimSimWellInView::wellPipeBranches() const
|
||||
{
|
||||
RimSimWellInViewCollection* simWellCollection = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(simWellCollection);
|
||||
|
||||
RimEclipseCase* eclipseCase = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(eclipseCase);
|
||||
RigEclipseCaseData* caseData = eclipseCase->eclipseCaseData();
|
||||
CVF_ASSERT(caseData);
|
||||
|
||||
bool includeCellCenters = this->isUsingCellCenterForPipe();
|
||||
bool detectBrances = simWellCollection->isAutoDetectingBranches;
|
||||
|
||||
return caseData->simulationWellBranches(this->name(), includeCellCenters, detectBrances);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -164,19 +183,6 @@ void RimSimWellInView::calculateWellPipeStaticCenterLine(std::vector<std::vector
|
||||
pipeBranchesCellIds);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSimWellInView::calculateWellPipeDynamicCenterLine(size_t timeStepIdx,
|
||||
std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
std::vector<std::vector<RigWellResultPoint>>& pipeBranchesCellIds) const
|
||||
{
|
||||
RigSimulationWellCenterLineCalculator::calculateWellPipeDynamicCenterline(this,
|
||||
static_cast<int>(timeStepIdx),
|
||||
pipeBranchesCLCoords,
|
||||
pipeBranchesCellIds);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// frameIndex = -1 will use the static well frame
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -37,6 +37,7 @@ class RigWellResultFrame;
|
||||
struct RigWellResultPoint;
|
||||
|
||||
class RimSimWellFractureCollection;
|
||||
class RigWellPath;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -64,13 +65,11 @@ public:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
||||
std::vector<const RigWellPath*> wellPipeBranches() const;
|
||||
|
||||
void calculateWellPipeStaticCenterLine( std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds);
|
||||
|
||||
void calculateWellPipeDynamicCenterLine(size_t timeStepIdx,
|
||||
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds) const;
|
||||
|
||||
void wellHeadTopBottomPosition(int frameIndex, cvf::Vec3d* top, cvf::Vec3d* bottom);
|
||||
double pipeRadius();
|
||||
caf::PdmField<bool> showWell;
|
||||
|
||||
Reference in New Issue
Block a user