2015-05-08 10:34:57 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2015-05-08 10:34:57 +02: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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2015-05-08 10:34:57 +02:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-05-08 10:34:57 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "RigFemResultPosEnum.h"
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
//==================================================================================================
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2015-05-08 10:34:57 +02:00
|
|
|
//==================================================================================================
|
|
|
|
|
|
|
|
|
|
class RigFemResultAddress
|
|
|
|
|
{
|
|
|
|
|
public:
|
2018-01-15 14:48:00 +01:00
|
|
|
RigFemResultAddress()
|
2019-09-06 10:40:57 +02:00
|
|
|
: resultPosType( RIG_NODAL )
|
|
|
|
|
, fieldName( "" )
|
|
|
|
|
, componentName( "" )
|
|
|
|
|
, timeLapseBaseFrameIdx( NO_TIME_LAPSE )
|
|
|
|
|
, refKLayerIndex( NO_COMPACTION )
|
2020-02-11 10:11:15 +01:00
|
|
|
, normalizedByHydrostaticPressure( false )
|
2018-01-15 14:48:00 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
RigFemResultAddress( RigFemResultPosEnum resPosType,
|
|
|
|
|
const std::string& aFieldName,
|
|
|
|
|
const std::string& aComponentName,
|
2020-02-11 10:11:15 +01:00
|
|
|
int timeLapseBaseFrameIdx = NO_TIME_LAPSE,
|
|
|
|
|
int refKLayerIndex = NO_COMPACTION,
|
|
|
|
|
bool normalizedByHydrostaticPressure = false )
|
2019-09-06 10:40:57 +02:00
|
|
|
: resultPosType( resPosType )
|
|
|
|
|
, fieldName( aFieldName )
|
|
|
|
|
, componentName( aComponentName )
|
|
|
|
|
, timeLapseBaseFrameIdx( timeLapseBaseFrameIdx )
|
|
|
|
|
, refKLayerIndex( refKLayerIndex )
|
2020-02-11 10:11:15 +01:00
|
|
|
, normalizedByHydrostaticPressure( normalizedByHydrostaticPressure )
|
2016-10-27 15:01:21 +02:00
|
|
|
{
|
|
|
|
|
}
|
2015-05-08 10:34:57 +02:00
|
|
|
|
|
|
|
|
RigFemResultPosEnum resultPosType;
|
2016-12-16 09:41:22 +01:00
|
|
|
std::string fieldName;
|
|
|
|
|
std::string componentName;
|
|
|
|
|
int timeLapseBaseFrameIdx;
|
2018-02-15 10:58:13 +01:00
|
|
|
int refKLayerIndex;
|
2020-02-11 10:11:15 +01:00
|
|
|
bool normalizedByHydrostaticPressure;
|
2016-10-10 16:09:54 +02:00
|
|
|
|
2020-02-12 11:13:38 +01:00
|
|
|
static constexpr int allTimeLapsesValue() { return ALL_TIME_LAPSES; }
|
|
|
|
|
static constexpr int noTimeLapseValue() { return NO_TIME_LAPSE; }
|
|
|
|
|
static constexpr int noCompactionValue() { return NO_COMPACTION; }
|
2016-10-27 15:01:21 +02:00
|
|
|
|
2020-02-12 11:13:38 +01:00
|
|
|
bool isTimeLapse() const { return timeLapseBaseFrameIdx > NO_TIME_LAPSE; }
|
|
|
|
|
bool representsAllTimeLapses() const { return timeLapseBaseFrameIdx == ALL_TIME_LAPSES; }
|
|
|
|
|
bool normalizeByHydrostaticPressure() const { return normalizedByHydrostaticPressure; }
|
2015-05-08 10:34:57 +02:00
|
|
|
|
2015-06-09 16:18:11 +02:00
|
|
|
bool isValid() const
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
bool isTypeValid = resultPosType == RIG_NODAL || resultPosType == RIG_ELEMENT_NODAL ||
|
|
|
|
|
resultPosType == RIG_INTEGRATION_POINT || resultPosType == RIG_ELEMENT_NODAL_FACE ||
|
2020-02-11 08:41:26 +01:00
|
|
|
resultPosType == RIG_FORMATION_NAMES || resultPosType == RIG_ELEMENT ||
|
|
|
|
|
resultPosType == RIG_DIFFERENTIALS;
|
2015-06-09 16:18:11 +02:00
|
|
|
bool isFieldValid = fieldName != "";
|
2016-10-10 16:09:54 +02:00
|
|
|
|
2015-06-09 16:18:11 +02:00
|
|
|
return isTypeValid && isFieldValid;
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
bool operator<( const RigFemResultAddress& other ) const
|
2015-05-08 10:34:57 +02:00
|
|
|
{
|
2020-02-11 10:11:15 +01:00
|
|
|
if ( normalizedByHydrostaticPressure != other.normalizedByHydrostaticPressure )
|
|
|
|
|
{
|
|
|
|
|
return ( normalizedByHydrostaticPressure < other.normalizedByHydrostaticPressure );
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( timeLapseBaseFrameIdx != other.timeLapseBaseFrameIdx )
|
2016-10-10 16:09:54 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
return ( timeLapseBaseFrameIdx < other.timeLapseBaseFrameIdx );
|
2016-10-10 16:09:54 +02:00
|
|
|
}
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( resultPosType != other.resultPosType )
|
2015-05-08 10:34:57 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
return ( resultPosType < other.resultPosType );
|
2015-05-08 10:34:57 +02:00
|
|
|
}
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( fieldName != other.fieldName )
|
2015-05-08 10:34:57 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
return ( fieldName < other.fieldName );
|
2015-05-08 10:34:57 +02:00
|
|
|
}
|
2019-09-06 10:40:57 +02:00
|
|
|
|
|
|
|
|
if ( refKLayerIndex != other.refKLayerIndex )
|
2018-02-15 10:58:13 +01:00
|
|
|
{
|
|
|
|
|
return refKLayerIndex < other.refKLayerIndex;
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
return ( componentName < other.componentName );
|
|
|
|
|
}
|
2018-01-15 16:09:52 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
bool operator==( const RigFemResultAddress& other ) const
|
2018-01-15 16:09:52 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( resultPosType != other.resultPosType || fieldName != other.fieldName ||
|
2020-02-11 10:11:15 +01:00
|
|
|
componentName != other.componentName || timeLapseBaseFrameIdx != other.timeLapseBaseFrameIdx ||
|
|
|
|
|
normalizedByHydrostaticPressure != other.normalizedByHydrostaticPressure )
|
2018-01-15 16:09:52 +01:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
2015-05-08 10:34:57 +02:00
|
|
|
}
|
2019-04-03 11:46:26 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
static const int ALL_TIME_LAPSES = -2;
|
|
|
|
|
static const int NO_TIME_LAPSE = -1;
|
|
|
|
|
static const int NO_COMPACTION = -1;
|
2015-05-08 10:34:57 +02:00
|
|
|
};
|