#9099 Thermal Fracture Import: include perimter nodes.

This commit is contained in:
Kristian Bendiksen
2022-07-06 10:42:35 +02:00
parent 6f623e9320
commit 44c469c12c
8 changed files with 218 additions and 59 deletions

View File

@@ -62,6 +62,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RigStimPlanFractureDefinition.h
${CMAKE_CURRENT_LIST_DIR}/RigThermalFractureDefinition.h
${CMAKE_CURRENT_LIST_DIR}/RigThermalFractureResultUtil.h
${CMAKE_CURRENT_LIST_DIR}/RigThermalFractureResult.h
${CMAKE_CURRENT_LIST_DIR}/RigFractureGrid.h
${CMAKE_CURRENT_LIST_DIR}/RigFractureCell.h
${CMAKE_CURRENT_LIST_DIR}/RigConvexHull.h
@@ -154,6 +155,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RigStimPlanFractureDefinition.cpp
${CMAKE_CURRENT_LIST_DIR}/RigThermalFractureDefinition.cpp
${CMAKE_CURRENT_LIST_DIR}/RigThermalFractureResultUtil.cpp
${CMAKE_CURRENT_LIST_DIR}/RigThermalFractureResult.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFractureGrid.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFractureCell.cpp
${CMAKE_CURRENT_LIST_DIR}/RigConvexHull.cpp

View File

@@ -110,12 +110,12 @@ std::vector<std::pair<QString, QString>> RigThermalFractureDefinition::getProper
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigThermalFractureDefinition::appendPropertyValue( int propertyIndex, int nodeIndex, int timeStepIndex, double value )
void RigThermalFractureDefinition::appendPropertyValue( int propertyIndex, int nodeIndex, double value )
{
CAF_ASSERT( propertyIndex >= 0 );
CAF_ASSERT( propertyIndex < static_cast<int>( m_results.size() ) );
m_results[propertyIndex].appendValue( nodeIndex, timeStepIndex, value );
m_results[propertyIndex].appendValue( nodeIndex, value );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -20,47 +20,14 @@
#include "RiaDefines.h"
#include "RigThermalFractureResult.h"
#include "cvfVector3.h"
#include <QString>
#include <vector>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RigThermalFractureResult
{
public:
RigThermalFractureResult( const QString& name, const QString& unit )
: m_name( name )
, m_unit( unit )
{
}
QString name() const { return m_name; }
QString unit() const { return m_unit; }
void appendValue( int nodeIndex, int timeStepIndex, double value )
{
if ( nodeIndex >= static_cast<int>( parameterValues.size() ) )
parameterValues.push_back( { value } );
else
parameterValues[nodeIndex].push_back( value );
}
double getValue( int nodeIndex, int timeStepIndex ) const { return parameterValues[nodeIndex][timeStepIndex]; }
size_t numNodes() const { return parameterValues.size(); }
private:
QString m_name;
QString m_unit;
// Vector for each time step for each node
std::vector<std::vector<double>> parameterValues;
};
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -83,7 +50,7 @@ public:
std::vector<std::pair<QString, QString>> getPropertyNamesUnits() const;
void appendPropertyValue( int propertyIndex, int nodeIndex, int timeStepIndex, double value );
void appendPropertyValue( int propertyIndex, int nodeIndex, double value );
double getPropertyValue( int propertyIndex, int nodeIndex, int timeStepIndex ) const;

View File

@@ -0,0 +1,71 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2022 - Equinor ASA
//
// 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 "RigThermalFractureResult.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigThermalFractureResult::RigThermalFractureResult( const QString& name, const QString& unit )
: m_name( name )
, m_unit( unit )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RigThermalFractureResult::name() const
{
return m_name;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RigThermalFractureResult::unit() const
{
return m_unit;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigThermalFractureResult::appendValue( int nodeIndex, double value )
{
if ( nodeIndex >= static_cast<int>( m_parameterValues.size() ) )
m_parameterValues.push_back( { value } );
else
m_parameterValues[nodeIndex].push_back( value );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigThermalFractureResult::getValue( int nodeIndex, int timeStepIndex ) const
{
return m_parameterValues[nodeIndex][timeStepIndex];
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RigThermalFractureResult::numNodes() const
{
return m_parameterValues.size();
}

View File

@@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2022 - Equinor ASA
//
// 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 "RiaDefines.h"
#include "cvfVector3.h"
#include <QString>
#include <vector>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RigThermalFractureResult
{
public:
RigThermalFractureResult( const QString& name, const QString& unit );
QString name() const;
QString unit() const;
void appendValue( int nodeIndex, double value );
double getValue( int nodeIndex, int timeStepIndex ) const;
size_t numNodes() const;
private:
QString m_name;
QString m_unit;
// Vector for each time step for each node
std::vector<std::vector<double>> m_parameterValues;
};