2015-06-04 12:35:22 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
|
// Copyright (C) 2015- 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 "RigFemResultAddress.h"
|
|
|
|
|
|
2018-02-08 16:43:12 +01:00
|
|
|
#include "cafTensor3.h"
|
|
|
|
|
|
2015-06-04 12:35:22 +02:00
|
|
|
#include "cvfCollection.h"
|
|
|
|
|
#include "cvfObject.h"
|
2018-01-10 10:43:33 +01:00
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
2015-06-04 12:35:22 +02:00
|
|
|
#include <map>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
class RifGeoMechReaderInterface;
|
2018-01-10 10:43:33 +01:00
|
|
|
class RifElementPropertyReader;
|
2015-06-04 12:35:22 +02:00
|
|
|
class RigFemScalarResultFrames;
|
|
|
|
|
class RigFemPartResultsCollection;
|
|
|
|
|
class RigFemPartResults;
|
2015-06-04 16:10:02 +02:00
|
|
|
class RigStatisticsDataCache;
|
2015-06-15 12:15:00 +02:00
|
|
|
class RigFemPartCollection;
|
2016-09-06 10:27:30 +02:00
|
|
|
class RigFormationNames;
|
2018-01-10 10:43:33 +01:00
|
|
|
|
2016-10-31 08:44:40 +01:00
|
|
|
namespace caf
|
|
|
|
|
{
|
|
|
|
|
class ProgressInfo;
|
|
|
|
|
}
|
2015-06-04 12:35:22 +02:00
|
|
|
|
|
|
|
|
class RigFemPartResultsCollection: public cvf::Object
|
|
|
|
|
{
|
|
|
|
|
public:
|
2018-02-15 10:58:13 +01:00
|
|
|
static const std::string FIELD_NAME_COMPACTION;
|
|
|
|
|
|
2019-01-22 08:54:00 +01:00
|
|
|
RigFemPartResultsCollection(RifGeoMechReaderInterface* readerInterface,
|
|
|
|
|
RifElementPropertyReader* elementPropertyReader,
|
|
|
|
|
const RigFemPartCollection * femPartCollection);
|
2019-01-10 22:12:11 +01:00
|
|
|
~RigFemPartResultsCollection() override;
|
2015-06-04 12:35:22 +02:00
|
|
|
|
2016-09-06 10:27:30 +02:00
|
|
|
void setActiveFormationNames(RigFormationNames* activeFormationNames);
|
|
|
|
|
RigFormationNames* activeFormationNames();
|
2018-01-10 10:43:33 +01:00
|
|
|
|
2018-01-12 16:18:54 +01:00
|
|
|
void addElementPropertyFiles(const std::vector<QString>& filenames);
|
2018-01-15 16:09:52 +01:00
|
|
|
std::vector<RigFemResultAddress> removeElementPropertyFiles(const std::vector<QString>& filenames);
|
2018-01-10 10:43:33 +01:00
|
|
|
|
2016-10-27 15:01:21 +02:00
|
|
|
void setCalculationParameters(double cohesion, double frictionAngleRad);
|
2016-11-01 09:29:52 +01:00
|
|
|
double parameterCohesion() const { return m_cohesion;}
|
|
|
|
|
double parameterFrictionAngleRad() const { return m_frictionAngleRad; }
|
2016-09-06 10:27:30 +02:00
|
|
|
|
2015-06-04 12:35:22 +02:00
|
|
|
std::map<std::string, std::vector<std::string> > scalarFieldAndComponentNames(RigFemResultPosEnum resPos);
|
2018-06-11 13:47:21 +02:00
|
|
|
std::vector<std::string> filteredStepNames() const;
|
2015-06-09 16:18:11 +02:00
|
|
|
bool assertResultsLoaded(const RigFemResultAddress& resVarAddr);
|
2016-10-21 14:30:45 +02:00
|
|
|
void deleteResult(const RigFemResultAddress& resVarAddr);
|
2019-01-18 16:12:02 +01:00
|
|
|
void deleteResultFrame(const RigFemResultAddress& resVarAddr, int partIndex, int frameIndex);
|
2018-06-18 14:17:13 +02:00
|
|
|
std::vector<RigFemResultAddress> loadedResults() const;
|
|
|
|
|
|
2018-02-08 16:43:12 +01:00
|
|
|
const std::vector<float>& resultValues(const RigFemResultAddress& resVarAddr, int partIndex, int frameIndex);
|
|
|
|
|
std::vector<caf::Ten3f> tensors(const RigFemResultAddress& resVarAddr, int partIndex, int frameIndex);
|
2015-11-06 10:18:55 +01:00
|
|
|
int partCount() const;
|
2015-06-04 16:10:02 +02:00
|
|
|
int frameCount();
|
2015-06-04 12:35:22 +02:00
|
|
|
|
2018-03-06 10:29:04 +01:00
|
|
|
static float dsm(float p1, float p3, float tanFricAng, float cohPrTanFricAngle);
|
2015-06-04 12:35:22 +02:00
|
|
|
|
2015-06-04 16:10:02 +02:00
|
|
|
void minMaxScalarValues (const RigFemResultAddress& resVarAddr, int frameIndex, double* localMin, double* localMax);
|
|
|
|
|
void minMaxScalarValues (const RigFemResultAddress& resVarAddr, double* globalMin, double* globalMax);
|
2015-11-04 15:44:09 +01:00
|
|
|
void posNegClosestToZero(const RigFemResultAddress& resVarAddr, int frameIndex, double* localPosClosestToZero, double* localNegClosestToZero);
|
2015-06-04 16:10:02 +02:00
|
|
|
void posNegClosestToZero(const RigFemResultAddress& resVarAddr, double* globalPosClosestToZero, double* globalNegClosestToZero);
|
|
|
|
|
void meanScalarValue(const RigFemResultAddress& resVarAddr, double* meanValue);
|
2015-11-04 15:44:09 +01:00
|
|
|
void meanScalarValue(const RigFemResultAddress& resVarAddr, int frameIndex, double* meanValue);
|
2015-06-04 16:10:02 +02:00
|
|
|
void p10p90ScalarValues(const RigFemResultAddress& resVarAddr, double* p10, double* p90);
|
2015-11-04 15:44:09 +01:00
|
|
|
void p10p90ScalarValues(const RigFemResultAddress& resVarAddr, int frameIndex, double* p10, double* p90);
|
2016-08-04 14:15:59 +02:00
|
|
|
void sumScalarValue(const RigFemResultAddress& resVarAddr, double* sum);
|
|
|
|
|
void sumScalarValue(const RigFemResultAddress& resVarAddr, int frameIndex, double* sum);
|
2015-06-04 16:10:02 +02:00
|
|
|
const std::vector<size_t>& scalarValuesHistogram(const RigFemResultAddress& resVarAddr);
|
2015-11-04 15:44:09 +01:00
|
|
|
const std::vector<size_t>& scalarValuesHistogram(const RigFemResultAddress& resVarAddr, int frameIndex);
|
2015-06-09 16:18:11 +02:00
|
|
|
|
2018-02-08 16:43:12 +01:00
|
|
|
void minMaxScalarValuesOverAllTensorComponents(const RigFemResultAddress& resVarAddr, int frameIndex, double* localMin, double* localMax);
|
2018-02-20 13:38:45 +01:00
|
|
|
void minMaxScalarValuesOverAllTensorComponents(const RigFemResultAddress& resVarAddr, double* globalMin, double* globalMax);
|
|
|
|
|
void posNegClosestToZeroOverAllTensorComponents(const RigFemResultAddress& resVarAddr, int frameIndex, double* localPosClosestToZero, double* localNegClosestToZero);
|
|
|
|
|
void posNegClosestToZeroOverAllTensorComponents(const RigFemResultAddress& resVarAddr, double* globalPosClosestToZero, double* globalNegClosestToZero);
|
2018-06-18 14:17:13 +02:00
|
|
|
|
|
|
|
|
static std::vector<RigFemResultAddress> tensorComponentAddresses(const RigFemResultAddress& resVarAddr);
|
|
|
|
|
static std::vector<RigFemResultAddress> tensorPrincipalComponentAdresses(const RigFemResultAddress& resVarAddr);
|
|
|
|
|
|
2015-06-04 12:35:22 +02:00
|
|
|
private:
|
2015-06-04 16:10:02 +02:00
|
|
|
RigFemScalarResultFrames* findOrLoadScalarResult(int partIndex,
|
|
|
|
|
const RigFemResultAddress& resVarAddr);
|
|
|
|
|
|
2015-06-12 18:41:47 +02:00
|
|
|
RigFemScalarResultFrames* calculateDerivedResult(int partIndex, const RigFemResultAddress& resVarAddr);
|
|
|
|
|
|
2016-10-31 10:24:17 +01:00
|
|
|
|
2016-10-27 11:13:05 +02:00
|
|
|
void calculateGammaFromFrames(int partIndex,
|
|
|
|
|
const RigFemScalarResultFrames * totalStressComponentDataFrames,
|
|
|
|
|
const RigFemScalarResultFrames * srcPORDataFrames,
|
2016-10-31 08:44:40 +01:00
|
|
|
RigFemScalarResultFrames * dstDataFrames,
|
|
|
|
|
caf::ProgressInfo* frameCountProgress);
|
2016-10-27 11:13:05 +02:00
|
|
|
|
2017-03-03 16:23:20 +01:00
|
|
|
RigFemScalarResultFrames* calculateBarConvertedResult(int partIndex, const RigFemResultAddress &convertedResultAddr, const std::string& fieldNameToConvert);
|
2015-09-28 07:39:57 +02:00
|
|
|
RigFemScalarResultFrames* calculateEnIpPorBarResult(int partIndex, const RigFemResultAddress &convertedResultAddr);
|
2016-10-10 16:09:54 +02:00
|
|
|
RigFemScalarResultFrames* calculateTimeLapseResult(int partIndex, const RigFemResultAddress& resVarAddr);
|
2016-10-13 12:43:31 +02:00
|
|
|
RigFemScalarResultFrames* calculateMeanStressSEM(int partIndex, const RigFemResultAddress& resVarAddr);
|
2016-10-27 15:01:21 +02:00
|
|
|
RigFemScalarResultFrames* calculateSFI(int partIndex, const RigFemResultAddress& resVarAddr);
|
2016-10-31 11:15:07 +01:00
|
|
|
RigFemScalarResultFrames* calculateDSM(int partIndex, const RigFemResultAddress& resVarAddr);
|
|
|
|
|
RigFemScalarResultFrames* calculateFOS(int partIndex, const RigFemResultAddress& resVarAddr);
|
2016-10-13 13:28:52 +02:00
|
|
|
RigFemScalarResultFrames* calculateMeanStressSTM(int partIndex, const RigFemResultAddress& resVarAddr);
|
2016-10-11 14:54:42 +02:00
|
|
|
RigFemScalarResultFrames* calculateDeviatoricStress(int partIndex, const RigFemResultAddress& resVarAddr);
|
2016-10-11 15:38:51 +02:00
|
|
|
RigFemScalarResultFrames* calculateVolumetricStrain(int partIndex, const RigFemResultAddress& resVarAddr);
|
2016-10-31 10:34:51 +01:00
|
|
|
RigFemScalarResultFrames* calculateDeviatoricStrain(int partIndex, const RigFemResultAddress& resVarAddr);
|
2016-10-19 12:22:13 +02:00
|
|
|
RigFemScalarResultFrames* calculateSurfaceAlignedStress(int partIndex, const RigFemResultAddress& resVarAddr);
|
2016-11-01 12:04:56 +01:00
|
|
|
RigFemScalarResultFrames* calculateSurfaceAngles(int partIndex, const RigFemResultAddress& resVarAddr);
|
2016-10-31 10:24:17 +01:00
|
|
|
RigFemScalarResultFrames* calculatePrincipalStressValues(int partIndex, const RigFemResultAddress &resVarAddr);
|
|
|
|
|
RigFemScalarResultFrames* calculatePrincipalStrainValues(int partIndex, const RigFemResultAddress &resVarAddr);
|
2018-02-15 10:58:13 +01:00
|
|
|
RigFemScalarResultFrames* calculateCompactionValues(int partIndex, const RigFemResultAddress &resVarAddr);
|
2018-05-07 11:17:33 +02:00
|
|
|
RigFemScalarResultFrames* calculateNE(int partIndex, const RigFemResultAddress &resVarAddr);
|
|
|
|
|
RigFemScalarResultFrames* calculateSE(int partIndex, const RigFemResultAddress &resVarAddr);
|
|
|
|
|
RigFemScalarResultFrames* calculateST_11_22_33(int partIndex, const RigFemResultAddress &resVarAddr);
|
|
|
|
|
RigFemScalarResultFrames* calculateST_12_13_23(int partIndex, const RigFemResultAddress &resVarAddr);
|
|
|
|
|
RigFemScalarResultFrames* calculateGamma(int partIndex, const RigFemResultAddress &resVarAddr);
|
|
|
|
|
RigFemScalarResultFrames* calculateFormationIndices(int partIndex, const RigFemResultAddress &resVarAddr);
|
2018-06-18 14:17:13 +02:00
|
|
|
|
2018-02-20 13:38:45 +01:00
|
|
|
private:
|
2015-06-04 16:10:02 +02:00
|
|
|
cvf::Collection<RigFemPartResults> m_femPartResults;
|
|
|
|
|
cvf::ref<RifGeoMechReaderInterface> m_readerInterface;
|
2018-01-10 10:43:33 +01:00
|
|
|
cvf::ref<RifElementPropertyReader> m_elementPropertyReader;
|
2015-06-15 12:15:00 +02:00
|
|
|
cvf::cref<RigFemPartCollection> m_femParts;
|
2016-09-06 10:27:30 +02:00
|
|
|
cvf::ref<RigFormationNames> m_activeFormationNamesData;
|
2015-06-04 12:35:22 +02:00
|
|
|
|
2016-10-27 15:01:21 +02:00
|
|
|
double m_cohesion;
|
|
|
|
|
double m_frictionAngleRad;
|
|
|
|
|
|
2015-06-04 16:10:02 +02:00
|
|
|
RigStatisticsDataCache* statistics(const RigFemResultAddress& resVarAddr);
|
2015-06-12 18:41:47 +02:00
|
|
|
std::vector< RigFemResultAddress> getResAddrToComponentsToRead(const RigFemResultAddress& resVarAddr);
|
2015-06-04 16:10:02 +02:00
|
|
|
std::map<RigFemResultAddress, cvf::ref<RigStatisticsDataCache> > m_resultStatistics;
|
2015-06-04 12:35:22 +02:00
|
|
|
};
|
|
|
|
|
|
2016-10-25 13:42:40 +02:00
|
|
|
|
|
|
|
|
class RigFemPart;
|
|
|
|
|
|
|
|
|
|
class RigFemClosestResultIndexCalculator
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
RigFemClosestResultIndexCalculator(RigFemPart* femPart,
|
|
|
|
|
RigFemResultPosEnum resultPosition,
|
|
|
|
|
int elementIndex,
|
|
|
|
|
int m_face,
|
2018-09-27 14:47:15 +02:00
|
|
|
const cvf::Vec3d& intersectionPointInDomain);
|
2016-10-25 13:42:40 +02:00
|
|
|
|
|
|
|
|
int resultIndexToClosestResult() { return m_resultIndexToClosestResult; }
|
|
|
|
|
int closestNodeId() { return m_closestNodeId; }
|
2016-10-26 17:05:39 +02:00
|
|
|
int closestElementNodeResIdx () { return m_closestElementNodeResIdx; }
|
2016-10-25 13:42:40 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int m_resultIndexToClosestResult;
|
|
|
|
|
int m_closestNodeId;
|
2016-10-26 17:05:39 +02:00
|
|
|
int m_closestElementNodeResIdx;
|
2016-10-25 13:42:40 +02:00
|
|
|
};
|