2013-12-10 15:44:40 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-24 00:14:52 -05:00
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
2013-12-10 15:44:40 -06: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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "cvfBase.h"
|
|
|
|
#include "cvfObject.h"
|
|
|
|
#include "cvfVector3.h"
|
2014-08-26 07:46:48 -05:00
|
|
|
#include "cvfStructGrid.h"
|
2013-12-10 15:44:40 -06:00
|
|
|
|
2014-08-26 07:46:48 -05:00
|
|
|
#include "cafFixedArray.h"
|
|
|
|
|
|
|
|
#include <cmath> // Needed for HUGE_VAL on Linux
|
2014-08-26 06:35:49 -05:00
|
|
|
#include <map>
|
2014-08-26 07:46:48 -05:00
|
|
|
#include <vector>
|
2013-12-10 15:44:40 -06:00
|
|
|
|
|
|
|
|
|
|
|
class RigMainGrid;
|
|
|
|
|
|
|
|
class RigConnection
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RigConnection( )
|
|
|
|
: m_c1GlobIdx(cvf::UNDEFINED_SIZE_T),
|
2013-12-11 07:55:14 -06:00
|
|
|
m_c1Face(cvf::StructGridInterface::NO_FACE),
|
2014-08-26 05:07:08 -05:00
|
|
|
m_c2GlobIdx(cvf::UNDEFINED_SIZE_T)
|
2013-12-10 15:44:40 -06:00
|
|
|
{}
|
|
|
|
|
2014-08-22 02:28:25 -05:00
|
|
|
bool hasCommonArea() const
|
|
|
|
{
|
|
|
|
return m_polygon.size() > 0;
|
|
|
|
}
|
|
|
|
|
2013-12-10 15:44:40 -06:00
|
|
|
size_t m_c1GlobIdx;
|
|
|
|
cvf::StructGridInterface::FaceType m_c1Face;
|
|
|
|
size_t m_c2GlobIdx;
|
|
|
|
|
2013-12-11 07:55:14 -06:00
|
|
|
std::vector<cvf::Vec3d> m_polygon;
|
2013-12-10 15:44:40 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class RigNNCData : public cvf::Object
|
|
|
|
{
|
|
|
|
public:
|
2017-08-07 08:28:27 -05:00
|
|
|
enum NNCResultType
|
|
|
|
{
|
|
|
|
NNC_DYNAMIC,
|
|
|
|
NNC_STATIC,
|
|
|
|
NNC_GENERATED
|
|
|
|
};
|
|
|
|
|
2017-06-29 04:19:07 -05:00
|
|
|
static QString propertyNameFluxWat() { return "FLRWAT"; }
|
|
|
|
static QString propertyNameFluxOil() { return "FLROIL"; }
|
|
|
|
static QString propertyNameFluxGas() { return "FLRGAS"; }
|
|
|
|
static QString propertyNameCombTrans() { return "TRAN"; }
|
|
|
|
static QString propertyNameRiCombTrans() { return "riTRAN"; }
|
|
|
|
static QString propertyNameRiCombTransByArea() { return "riTRANbyArea"; }
|
|
|
|
static QString propertyNameRiCombMult() { return "riMULT"; }
|
2017-06-26 03:25:08 -05:00
|
|
|
|
2013-12-10 15:44:40 -06:00
|
|
|
RigNNCData();
|
|
|
|
|
|
|
|
void processConnections(const RigMainGrid& mainGrid);
|
|
|
|
|
|
|
|
std::vector<RigConnection>& connections() { return m_connections; }
|
2017-06-29 04:19:07 -05:00
|
|
|
const std::vector<RigConnection>& connections() const { return m_connections; }
|
2013-12-10 15:44:40 -06:00
|
|
|
|
2017-06-29 04:19:07 -05:00
|
|
|
std::vector<double>& makeStaticConnectionScalarResult(QString nncDataType);
|
2017-06-26 03:25:08 -05:00
|
|
|
const std::vector<double>* staticConnectionScalarResult(size_t scalarResultIndex) const;
|
2017-06-29 04:19:07 -05:00
|
|
|
const std::vector<double>* staticConnectionScalarResultByName(const QString& nncDataType) const;
|
2017-08-08 06:12:43 -05:00
|
|
|
|
2017-06-29 04:19:07 -05:00
|
|
|
std::vector< std::vector<double> >& makeDynamicConnectionScalarResult(QString nncDataType, size_t timeStepCount);
|
2017-06-26 03:25:08 -05:00
|
|
|
const std::vector< std::vector<double> >* dynamicConnectionScalarResult(size_t scalarResultIndex) const;
|
|
|
|
const std::vector<double>* dynamicConnectionScalarResult(size_t scalarResultIndex, size_t timeStep) const;
|
2017-06-29 04:19:07 -05:00
|
|
|
const std::vector< std::vector<double> >* dynamicConnectionScalarResultByName(const QString& nncDataType) const;
|
|
|
|
const std::vector<double>* dynamicConnectionScalarResultByName(const QString& nncDataType, size_t timeStep) const;
|
2014-08-26 05:07:08 -05:00
|
|
|
|
2017-08-08 06:12:43 -05:00
|
|
|
std::vector< std::vector<double> >& makeGeneratedConnectionScalarResult(QString nncDataType, size_t timeStepCount);
|
|
|
|
const std::vector< std::vector<double> >* generatedConnectionScalarResult(size_t scalarResultIndex) const;
|
|
|
|
const std::vector<double>* generatedConnectionScalarResult(size_t scalarResultIndex, size_t timeStep) const;
|
|
|
|
std::vector< std::vector<double> >* generatedConnectionScalarResult(size_t scalarResultIndex);
|
|
|
|
std::vector<double>* generatedConnectionScalarResult(size_t scalarResultIndex, size_t timeStep);
|
|
|
|
const std::vector< std::vector<double> >* generatedConnectionScalarResultByName(const QString& nncDataType) const;
|
|
|
|
const std::vector<double>* generatedConnectionScalarResultByName(const QString& nncDataType, size_t timeStep) const;
|
|
|
|
std::vector< std::vector<double> >* generatedConnectionScalarResultByName(const QString& nncDataType);
|
|
|
|
std::vector<double>* generatedConnectionScalarResultByName(const QString& nncDataType, size_t timeStep);
|
|
|
|
|
2017-08-07 08:28:27 -05:00
|
|
|
std::vector<QString> availableProperties(NNCResultType resultType) const;
|
|
|
|
|
2017-06-29 04:19:07 -05:00
|
|
|
void setScalarResultIndex(const QString& nncDataType, size_t scalarResultIndex);
|
2014-08-26 05:07:08 -05:00
|
|
|
|
2014-09-04 02:28:39 -05:00
|
|
|
bool hasScalarValues(size_t scalarResultIndex);
|
2014-08-26 05:07:08 -05:00
|
|
|
|
2017-08-08 06:12:43 -05:00
|
|
|
private:
|
2017-06-29 04:19:07 -05:00
|
|
|
const QString getNNCDataTypeFromScalarResultIndex(size_t scalarResultIndex) const;
|
2017-08-08 06:12:43 -05:00
|
|
|
bool isNative(QString nncDataType) const;
|
2017-06-26 03:25:08 -05:00
|
|
|
|
2013-12-14 02:30:27 -06:00
|
|
|
private:
|
2017-06-26 03:25:08 -05:00
|
|
|
std::vector<RigConnection> m_connections;
|
2017-06-29 04:19:07 -05:00
|
|
|
std::map<QString, std::vector< std::vector<double> > > m_connectionResults;
|
|
|
|
std::map<size_t, QString> m_resultIndexToNNCDataType;
|
2013-12-10 15:44:40 -06:00
|
|
|
};
|