2013-02-14 07:30:01 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
2013-02-21 08:37:51 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
2013-02-14 07:30:01 -06:00
|
|
|
//
|
|
|
|
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
|
|
|
//
|
|
|
|
// 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 "RIStdInclude.h"
|
|
|
|
|
|
|
|
#include "RimIdenticalGridCaseGroup.h"
|
|
|
|
#include "RimReservoir.h"
|
|
|
|
#include "RimReservoirView.h"
|
|
|
|
#include "RigEclipseCase.h"
|
2013-02-21 05:00:49 -06:00
|
|
|
|
2013-02-15 01:44:45 -06:00
|
|
|
#include "RimStatisticalCalculation.h"
|
2013-02-21 05:00:49 -06:00
|
|
|
#include "RimStatisticalCollection.h"
|
2013-02-14 07:30:01 -06:00
|
|
|
|
|
|
|
|
|
|
|
CAF_PDM_SOURCE_INIT(RimIdenticalGridCaseGroup, "RimIdenticalGridCaseGroup");
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimIdenticalGridCaseGroup::RimIdenticalGridCaseGroup()
|
|
|
|
{
|
2013-02-25 02:43:42 -06:00
|
|
|
CAF_PDM_InitObject("Grid Case Group", "", "", "");
|
2013-02-14 07:30:01 -06:00
|
|
|
|
2013-02-21 03:38:28 -06:00
|
|
|
CAF_PDM_InitField(&name, "UserDescription", QString("Identical Grid Case Group"), "Name", "", "", "");
|
|
|
|
|
2013-02-21 08:37:51 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&caseCollection, "CaseCollection", "Cases", "", "", "");
|
|
|
|
CAF_PDM_InitFieldNoDefault(&statisticalReservoirCollection, "StatisticalReservoirCollection", "Derived Statistics", "", "", "");
|
2013-02-15 01:44:45 -06:00
|
|
|
|
2013-02-21 08:37:51 -06:00
|
|
|
caseCollection = new RimCaseCollection;
|
2013-02-21 05:00:49 -06:00
|
|
|
statisticalReservoirCollection = new RimStatisticalCollection;
|
2013-02-15 01:44:45 -06:00
|
|
|
|
2013-02-14 07:30:01 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimIdenticalGridCaseGroup::~RimIdenticalGridCaseGroup()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimIdenticalGridCaseGroup::addCase(RimReservoir* reservoir)
|
|
|
|
{
|
|
|
|
CVF_ASSERT(reservoir);
|
|
|
|
|
|
|
|
if (!reservoir) return;
|
|
|
|
|
|
|
|
RigMainGrid* incomingMainGrid = reservoir->reservoirData()->mainGrid();
|
|
|
|
|
|
|
|
if (m_mainGrid.isNull())
|
|
|
|
{
|
|
|
|
m_mainGrid = incomingMainGrid;
|
|
|
|
}
|
|
|
|
|
2013-02-21 08:37:51 -06:00
|
|
|
CVF_ASSERT(m_mainGrid.p() == incomingMainGrid);
|
|
|
|
|
|
|
|
caseCollection()->reservoirs().push_back(reservoir);
|
2013-02-14 07:30:01 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RigMainGrid* RimIdenticalGridCaseGroup::mainGrid()
|
|
|
|
{
|
|
|
|
if (m_mainGrid.notNull()) return m_mainGrid.p();
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-02-21 03:38:28 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
caf::PdmFieldHandle* RimIdenticalGridCaseGroup::userDescriptionField()
|
|
|
|
{
|
|
|
|
return &name;
|
|
|
|
}
|
|
|
|
|