2013-06-07 02:32:06 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2013-06-07 02:32:06 -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 "RimOilField.h"
|
|
|
|
|
2018-11-23 06:33:59 -06:00
|
|
|
#include "RimAnnotationCollection.h"
|
2018-12-13 12:49:37 -06:00
|
|
|
#include "RimCompletionTemplateCollection.h"
|
2015-06-25 06:36:15 -05:00
|
|
|
#include "RimEclipseCaseCollection.h"
|
2016-08-24 01:30:12 -05:00
|
|
|
#include "RimFormationNamesCollection.h"
|
2017-02-07 04:08:56 -06:00
|
|
|
#include "RimFractureTemplateCollection.h"
|
2018-12-13 12:49:37 -06:00
|
|
|
#include "RimValveTemplateCollection.h"
|
2016-12-16 07:05:11 -06:00
|
|
|
#include "RimGeoMechModels.h"
|
2017-09-19 03:14:58 -05:00
|
|
|
#include "RimObservedData.h"
|
2017-09-14 08:44:01 -05:00
|
|
|
#include "RimObservedDataCollection.h"
|
2017-09-19 03:14:58 -05:00
|
|
|
#include "RimSummaryCase.h"
|
2017-09-06 09:32:46 -05:00
|
|
|
#include "RimSummaryCaseMainCollection.h"
|
2016-12-16 07:05:11 -06:00
|
|
|
#include "RimWellPathCollection.h"
|
2018-12-19 07:41:17 -06:00
|
|
|
#include "RimMeasurement.h"
|
2013-06-07 02:32:06 -05:00
|
|
|
|
|
|
|
CAF_PDM_SOURCE_INIT(RimOilField, "ResInsightOilField");
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimOilField::RimOilField(void)
|
|
|
|
{
|
2013-06-07 07:54:02 -05:00
|
|
|
CAF_PDM_InitObject("Oil Field", "", "", "");
|
|
|
|
|
2013-06-07 02:32:06 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&analysisModels, "AnalysisModels", "Grid Models", ":/GridModels.png", "", "");
|
2015-04-20 02:02:33 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&geoMechModels, "GeoMechModels", "Geo Mech Models", ":/GridModels.png", "", "");
|
2013-06-07 07:54:02 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "");
|
2017-08-21 08:24:20 -05:00
|
|
|
|
2018-12-13 12:49:37 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&completionTemplateCollection, "CompletionTemplateCollection", "", "", "", "");
|
2017-08-21 08:24:20 -05:00
|
|
|
|
2017-09-06 09:32:46 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&summaryCaseMainCollection,"SummaryCaseCollection","Summary Cases",":/GridModels.png","","");
|
2016-08-24 01:30:12 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&formationNamesCollection,"FormationNamesCollection","Formations","","","");
|
2017-11-30 06:44:18 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&observedDataCollection, "ObservedDataCollection", "Observed Data", ":/Cases16x16.png", "", "");
|
2016-08-24 01:30:12 -05:00
|
|
|
|
2018-11-23 06:33:59 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&annotationCollection, "AnnotationCollection", "Annotations", "", "", "");
|
|
|
|
|
2018-12-13 12:49:37 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(
|
|
|
|
&m_fractureTemplateCollection_OBSOLETE, "FractureDefinitionCollection", "Defenition of Fractures", "", "", "");
|
|
|
|
|
|
|
|
completionTemplateCollection = new RimCompletionTemplateCollection;
|
2018-12-19 07:41:17 -06:00
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault(&measurement, "Measurement", "Measurement", "", "", "");
|
|
|
|
measurement = new RimMeasurement();
|
2019-01-03 00:06:37 -06:00
|
|
|
measurement.xmlCapability()->disableIO();
|
2018-12-19 07:41:17 -06:00
|
|
|
|
2015-06-25 05:11:06 -05:00
|
|
|
analysisModels = new RimEclipseCaseCollection();
|
2015-11-30 08:07:54 -06:00
|
|
|
wellPathCollection = new RimWellPathCollection();
|
2017-09-06 09:32:46 -05:00
|
|
|
summaryCaseMainCollection = new RimSummaryCaseMainCollection();
|
2017-09-14 08:44:01 -05:00
|
|
|
observedDataCollection = new RimObservedDataCollection();
|
2018-01-04 08:04:58 -06:00
|
|
|
formationNamesCollection = new RimFormationNamesCollection();
|
2018-11-23 06:33:59 -06:00
|
|
|
annotationCollection = new RimAnnotationCollection();
|
2018-12-13 12:49:37 -06:00
|
|
|
|
|
|
|
m_fractureTemplateCollection_OBSOLETE = new RimFractureTemplateCollection;
|
|
|
|
m_fractureTemplateCollection_OBSOLETE.xmlCapability()->setIOWritable(false);
|
2013-06-07 02:32:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimOilField::~RimOilField(void)
|
|
|
|
{
|
2018-12-13 12:49:37 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimFractureTemplateCollection* RimOilField::fractureDefinitionCollection()
|
|
|
|
{
|
|
|
|
return completionTemplateCollection()->fractureTemplateCollection();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
const RimFractureTemplateCollection* RimOilField::fractureDefinitionCollection() const
|
|
|
|
{
|
|
|
|
return completionTemplateCollection()->fractureTemplateCollection();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimValveTemplateCollection* RimOilField::valveTemplateCollection()
|
|
|
|
{
|
|
|
|
return completionTemplateCollection()->valveTemplateCollection();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
const RimValveTemplateCollection* RimOilField::valveTemplateCollection() const
|
|
|
|
{
|
|
|
|
return completionTemplateCollection()->valveTemplateCollection();
|
2013-06-07 02:32:06 -05:00
|
|
|
}
|
2013-06-12 02:36:50 -05:00
|
|
|
|
2017-09-19 03:14:58 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimOilField::uniqueShortNameForCase(RimSummaryCase* summaryCase)
|
|
|
|
{
|
|
|
|
std::set<QString> allAutoShortNames;
|
|
|
|
|
|
|
|
std::vector<RimSummaryCase*> allCases = summaryCaseMainCollection->allSummaryCases();
|
2019-04-05 03:11:30 -05:00
|
|
|
std::vector<RimObservedData*> observedDataCases = observedDataCollection->allObservedData();
|
2017-09-19 03:14:58 -05:00
|
|
|
|
2017-09-22 07:26:54 -05:00
|
|
|
for (auto observedData : observedDataCases)
|
2017-09-19 03:14:58 -05:00
|
|
|
{
|
2019-04-05 03:11:30 -05:00
|
|
|
allCases.push_back(observedData);
|
2017-09-19 03:14:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
for (RimSummaryCase* sumCase : allCases)
|
|
|
|
{
|
|
|
|
if (sumCase && sumCase != summaryCase)
|
|
|
|
{
|
|
|
|
allAutoShortNames.insert(sumCase->shortName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool foundUnique = false;
|
|
|
|
|
|
|
|
QString caseName = summaryCase->caseName();
|
|
|
|
QString shortName;
|
|
|
|
|
|
|
|
if (caseName.size() > 2)
|
|
|
|
{
|
|
|
|
QString candidate;
|
|
|
|
candidate += caseName[0];
|
|
|
|
|
|
|
|
for (int i = 1; i < caseName.size(); ++i)
|
|
|
|
{
|
|
|
|
if (allAutoShortNames.count(candidate + caseName[i]) == 0)
|
|
|
|
{
|
|
|
|
shortName = candidate + caseName[i];
|
|
|
|
foundUnique = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
shortName = caseName.left(2);
|
|
|
|
if (allAutoShortNames.count(shortName) == 0)
|
|
|
|
{
|
|
|
|
foundUnique = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QString candidate = shortName;
|
|
|
|
int autoNumber = 0;
|
|
|
|
|
|
|
|
while (!foundUnique)
|
|
|
|
{
|
|
|
|
candidate = shortName + QString::number(autoNumber++);
|
|
|
|
if (allAutoShortNames.count(candidate) == 0)
|
|
|
|
{
|
|
|
|
shortName = candidate;
|
|
|
|
foundUnique = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return shortName;
|
|
|
|
}
|
|
|
|
|
2018-12-13 12:49:37 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimOilField::initAfterRead()
|
|
|
|
{
|
|
|
|
RimFractureTemplateCollection* fractureTemplateCollection = m_fractureTemplateCollection_OBSOLETE.value();
|
|
|
|
if (!fractureTemplateCollection->fractureTemplates().empty())
|
|
|
|
{
|
|
|
|
m_fractureTemplateCollection_OBSOLETE.removeChildObject(fractureTemplateCollection);
|
|
|
|
completionTemplateCollection->setFractureTemplateCollection(fractureTemplateCollection);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|