mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-27 08:47:00 -06:00
100 lines
3.4 KiB
C++
100 lines
3.4 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) Statoil ASA
|
|
// Copyright (C) Ceetron Solutions 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.
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
#include "cvfBase.h"
|
|
#include "cvfObject.h"
|
|
#include "cvfVector3.h"
|
|
#include "cvfStructGrid.h"
|
|
|
|
#include "cafFixedArray.h"
|
|
|
|
#include <cmath> // Needed for HUGE_VAL on Linux
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
|
|
class RigMainGrid;
|
|
|
|
class RigConnection
|
|
{
|
|
public:
|
|
RigConnection( )
|
|
: m_c1GlobIdx(cvf::UNDEFINED_SIZE_T),
|
|
m_c1Face(cvf::StructGridInterface::NO_FACE),
|
|
m_c2GlobIdx(cvf::UNDEFINED_SIZE_T)
|
|
{}
|
|
|
|
bool hasCommonArea() const
|
|
{
|
|
return m_polygon.size() > 0;
|
|
}
|
|
|
|
size_t m_c1GlobIdx;
|
|
cvf::StructGridInterface::FaceType m_c1Face;
|
|
size_t m_c2GlobIdx;
|
|
|
|
std::vector<cvf::Vec3d> m_polygon;
|
|
};
|
|
|
|
|
|
class RigNNCData : public cvf::Object
|
|
{
|
|
public:
|
|
enum NNCDataType {
|
|
FLUX_WAT,
|
|
FLUX_OIL,
|
|
FLUX_GAS,
|
|
COMB_TRANS,
|
|
RI_COMB_TRANS,
|
|
RI_COMB_MULT,
|
|
RI_COMB_TRANS_BY_AREA,
|
|
};
|
|
|
|
RigNNCData();
|
|
|
|
void processConnections(const RigMainGrid& mainGrid);
|
|
|
|
std::vector<RigConnection>& connections() { return m_connections; }
|
|
const std::vector<RigConnection>& connections() const { return m_connections; };
|
|
|
|
std::vector<double>& makeStaticConnectionScalarResult(NNCDataType nncDataType);
|
|
const std::vector<double>* staticConnectionScalarResult(size_t scalarResultIndex) const;
|
|
std::vector< std::vector<double> >& makeDynamicConnectionScalarResult(NNCDataType nncDataType, size_t timeStepCount);
|
|
const std::vector< std::vector<double> >* dynamicConnectionScalarResult(size_t scalarResultIndex) const;
|
|
const std::vector<double>* dynamicConnectionScalarResult(size_t scalarResultIndex, size_t timeStep) const;
|
|
|
|
void setScalarResultIndex(NNCDataType nncDataType, size_t scalarResultIndex);
|
|
|
|
bool hasScalarValues(size_t scalarResultIndex);
|
|
|
|
private: // This section is possibly not needed
|
|
//const std::vector<size_t>& findConnectionIndices(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face) const;
|
|
//typedef std::map<size_t, caf::FixedArray<std::vector<size_t>, 7 > > ConnectionSearchMap;
|
|
//ConnectionSearchMap m_cellIdxToFaceToConnectionIdxMap;
|
|
|
|
const NNCDataType* getNNCDataTypeFromScalarResultIndex(size_t scalarResultIndex) const;
|
|
|
|
private:
|
|
std::vector<RigConnection> m_connections;
|
|
std::map<NNCDataType, std::vector< std::vector<double> > > m_connectionResults;
|
|
std::map<size_t, NNCDataType> m_resultIndexToNNCDataType;
|
|
};
|