#6930 StimPlanModel: Warn when exporting models with more than 100 layers.

This commit is contained in:
Kristian Bendiksen
2020-11-20 11:23:07 +01:00
committed by Magne Sjaastad
parent 9ecbce4491
commit 9175806e6b
2 changed files with 16 additions and 1 deletions

View File

@@ -18,6 +18,8 @@
#include "RifStimPlanModelGeologicalFrkExporter.h"
#include "RiaLogging.h"
#include "RimStimPlanModel.h"
#include "RimStimPlanModelCalculator.h"
@@ -91,7 +93,9 @@ bool RifStimPlanModelGeologicalFrkExporter::writeToFile( RimStimPlanModel* stimP
}
std::map<QString, std::vector<double>> values;
values["dpthlyr"] = stimPlanModel->calculator()->calculateTrueVerticalDepth();
std::vector<double> tvd = stimPlanModel->calculator()->calculateTrueVerticalDepth();
values["dpthlyr"] = tvd;
values["strs"] = stimPlanModel->calculator()->calculateStress();
values["strsg"] = stimPlanModel->calculator()->calculateStressGradient();
values["elyr"] = stimPlanModel->calculator()->calculateYoungsModulus();
@@ -110,6 +114,15 @@ bool RifStimPlanModelGeologicalFrkExporter::writeToFile( RimStimPlanModel* stimP
values["zonePoroElas"] = stimPlanModel->calculator()->calculatePoroElasticConstant();
values["zoneThermalExp"] = stimPlanModel->calculator()->calculateThermalExpansionCoefficient();
// Warn if the generated model has too many layers for StimPlan
if ( tvd.size() > MAX_STIMPLAN_LAYERS )
{
RiaLogging::warning(
QString( "Exporting model with too many layers: %1. Maximum supported number of layers is %2." )
.arg( tvd.size() )
.arg( MAX_STIMPLAN_LAYERS ) );
}
QFile data( filepath );
if ( !data.open( QFile::WriteOnly | QFile::Truncate ) )
{

View File

@@ -30,6 +30,8 @@ class QTextStream;
class RifStimPlanModelGeologicalFrkExporter
{
public:
static const int MAX_STIMPLAN_LAYERS = 100;
static bool writeToFile( RimStimPlanModel* plot, bool useDetailedFluidLoss, const QString& filepath );
private: