mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3058 Implement a memory cleanup dialog for GeoMech data.
This commit is contained in:
@@ -26,8 +26,10 @@ add_library( ${PROJECT_NAME}
|
||||
RigFemPartGrid.cpp
|
||||
RigFemResultAddress.h
|
||||
RigFemResultPosEnum.h
|
||||
RimGeoMechGeometrySelectionItem.h
|
||||
RimGeoMechGeometrySelectionItem.cpp
|
||||
RimFemResultObserver.h
|
||||
RimFemResultObserver.cpp
|
||||
RimGeoMechGeometrySelectionItem.h
|
||||
RimGeoMechGeometrySelectionItem.cpp
|
||||
)
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
|
@@ -92,3 +92,16 @@ void RigFemPartResults::deleteScalarResult(const RigFemResultAddress& resVarAddr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigFemResultAddress> RigFemPartResults::loadedResults() const
|
||||
{
|
||||
std::vector<RigFemResultAddress> currentResults;
|
||||
for (const auto& result : resultSets)
|
||||
{
|
||||
currentResults.push_back(result.first);
|
||||
}
|
||||
return currentResults;
|
||||
}
|
||||
|
@@ -39,9 +39,10 @@ public:
|
||||
|
||||
void initResultSteps(const std::vector<std::string>& stepNames);
|
||||
|
||||
RigFemScalarResultFrames* createScalarResult(const RigFemResultAddress& resVarAddr);
|
||||
RigFemScalarResultFrames* findScalarResult(const RigFemResultAddress& resVarAddr);
|
||||
void deleteScalarResult(const RigFemResultAddress& resVarAddr);
|
||||
RigFemScalarResultFrames* createScalarResult(const RigFemResultAddress& resVarAddr);
|
||||
RigFemScalarResultFrames* findScalarResult(const RigFemResultAddress& resVarAddr);
|
||||
void deleteScalarResult(const RigFemResultAddress& resVarAddr);
|
||||
std::vector<RigFemResultAddress> loadedResults() const;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -2243,6 +2243,20 @@ void RigFemPartResultsCollection::deleteResult(const RigFemResultAddress& resVar
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigFemResultAddress> RigFemPartResultsCollection::loadedResults() const
|
||||
{
|
||||
std::vector<RigFemResultAddress> currentResults;
|
||||
for (auto & femPartResult : m_femPartResults)
|
||||
{
|
||||
std::vector<RigFemResultAddress> partResults = femPartResult->loadedResults();
|
||||
currentResults.insert(currentResults.end(), partResults.begin(), partResults.end());
|
||||
}
|
||||
return currentResults;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -2263,40 +2277,19 @@ std::vector<caf::Ten3f> RigFemPartResultsCollection::tensors(const RigFemResultA
|
||||
|
||||
std::vector<caf::Ten3f> outputTensors;
|
||||
|
||||
RigFemResultAddress address11(resVarAddr.resultPosType, resVarAddr.fieldName, "");
|
||||
RigFemResultAddress address22(resVarAddr.resultPosType, resVarAddr.fieldName, "");
|
||||
RigFemResultAddress address33(resVarAddr.resultPosType, resVarAddr.fieldName, "");
|
||||
RigFemResultAddress address12(resVarAddr.resultPosType, resVarAddr.fieldName, "");
|
||||
RigFemResultAddress address13(resVarAddr.resultPosType, resVarAddr.fieldName, "");
|
||||
RigFemResultAddress address23(resVarAddr.resultPosType, resVarAddr.fieldName, "");
|
||||
std::vector<RigFemResultAddress> addresses = tensorComponentAddresses(resVarAddr);
|
||||
|
||||
if (resVarAddr.fieldName == "SE" || resVarAddr.fieldName == "ST")
|
||||
if (addresses.empty())
|
||||
{
|
||||
address11.componentName = "S11";
|
||||
address22.componentName = "S22";
|
||||
address33.componentName = "S33";
|
||||
address12.componentName = "S12";
|
||||
address13.componentName = "S13";
|
||||
address23.componentName = "S23";
|
||||
}
|
||||
else if (resVarAddr.fieldName == "NE")
|
||||
{
|
||||
address11.componentName = "E11";
|
||||
address22.componentName = "E22";
|
||||
address33.componentName = "E33";
|
||||
address12.componentName = "E12";
|
||||
address13.componentName = "E13";
|
||||
address23.componentName = "E23";
|
||||
}
|
||||
else
|
||||
return outputTensors;
|
||||
}
|
||||
|
||||
const std::vector<float>& v11 = resultValues(address11, partIndex, frameIndex);
|
||||
const std::vector<float>& v22 = resultValues(address22, partIndex, frameIndex);
|
||||
const std::vector<float>& v33 = resultValues(address33, partIndex, frameIndex);
|
||||
const std::vector<float>& v12 = resultValues(address12, partIndex, frameIndex);
|
||||
const std::vector<float>& v13 = resultValues(address13, partIndex, frameIndex);
|
||||
const std::vector<float>& v23 = resultValues(address23, partIndex, frameIndex);
|
||||
const std::vector<float>& v11 = resultValues(addresses[caf::Ten3f::SXX], partIndex, frameIndex);
|
||||
const std::vector<float>& v22 = resultValues(addresses[caf::Ten3f::SYY], partIndex, frameIndex);
|
||||
const std::vector<float>& v33 = resultValues(addresses[caf::Ten3f::SZZ], partIndex, frameIndex);
|
||||
const std::vector<float>& v12 = resultValues(addresses[caf::Ten3f::SXY], partIndex, frameIndex);
|
||||
const std::vector<float>& v13 = resultValues(addresses[caf::Ten3f::SZX], partIndex, frameIndex);
|
||||
const std::vector<float>& v23 = resultValues(addresses[caf::Ten3f::SYZ], partIndex, frameIndex);
|
||||
|
||||
size_t valCount = v11.size();
|
||||
outputTensors.resize(valCount);
|
||||
@@ -2568,6 +2561,38 @@ void RigFemPartResultsCollection::posNegClosestToZeroOverAllTensorComponents(con
|
||||
*globalNegClosestToZero = currentNegClosestToZero;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigFemResultAddress> RigFemPartResultsCollection::tensorComponentAddresses(const RigFemResultAddress& resVarAddr)
|
||||
{
|
||||
std::vector<RigFemResultAddress> addresses(6, RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, ""));
|
||||
|
||||
if (resVarAddr.fieldName == "SE" || resVarAddr.fieldName == "ST")
|
||||
{
|
||||
addresses[caf::Ten3f::SXX].componentName = "S11";
|
||||
addresses[caf::Ten3f::SYY].componentName = "S22";
|
||||
addresses[caf::Ten3f::SZZ].componentName = "S33";
|
||||
addresses[caf::Ten3f::SXY].componentName = "S12";
|
||||
addresses[caf::Ten3f::SZX].componentName = "S13";
|
||||
addresses[caf::Ten3f::SYZ].componentName = "S23";
|
||||
}
|
||||
else if (resVarAddr.fieldName == "NE")
|
||||
{
|
||||
addresses[caf::Ten3f::SXX].componentName = "E11";
|
||||
addresses[caf::Ten3f::SYY].componentName = "E22";
|
||||
addresses[caf::Ten3f::SZZ].componentName = "E33";
|
||||
addresses[caf::Ten3f::SXY].componentName = "E12";
|
||||
addresses[caf::Ten3f::SZX].componentName = "E13";
|
||||
addresses[caf::Ten3f::SYZ].componentName = "E23";
|
||||
}
|
||||
else
|
||||
{
|
||||
return std::vector<RigFemResultAddress>();
|
||||
}
|
||||
return addresses;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -68,6 +68,8 @@ public:
|
||||
bool assertResultsLoaded(const RigFemResultAddress& resVarAddr);
|
||||
void deleteResult(const RigFemResultAddress& resVarAddr);
|
||||
|
||||
std::vector<RigFemResultAddress> loadedResults() const;
|
||||
|
||||
const std::vector<float>& resultValues(const RigFemResultAddress& resVarAddr, int partIndex, int frameIndex);
|
||||
std::vector<caf::Ten3f> tensors(const RigFemResultAddress& resVarAddr, int partIndex, int frameIndex);
|
||||
int partCount() const;
|
||||
@@ -92,6 +94,10 @@ public:
|
||||
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);
|
||||
|
||||
static std::vector<RigFemResultAddress> tensorComponentAddresses(const RigFemResultAddress& resVarAddr);
|
||||
static std::vector<RigFemResultAddress> tensorPrincipalComponentAdresses(const RigFemResultAddress& resVarAddr);
|
||||
|
||||
private:
|
||||
RigFemScalarResultFrames* findOrLoadScalarResult(int partIndex,
|
||||
const RigFemResultAddress& resVarAddr);
|
||||
@@ -127,9 +133,7 @@ private:
|
||||
RigFemScalarResultFrames* calculateST_12_13_23(int partIndex, const RigFemResultAddress &resVarAddr);
|
||||
RigFemScalarResultFrames* calculateGamma(int partIndex, const RigFemResultAddress &resVarAddr);
|
||||
RigFemScalarResultFrames* calculateFormationIndices(int partIndex, const RigFemResultAddress &resVarAddr);
|
||||
|
||||
static std::vector<RigFemResultAddress> tensorPrincipalComponentAdresses(const RigFemResultAddress& resVarAddr);
|
||||
|
||||
|
||||
private:
|
||||
cvf::Collection<RigFemPartResults> m_femPartResults;
|
||||
cvf::ref<RifGeoMechReaderInterface> m_readerInterface;
|
||||
|
@@ -0,0 +1,4 @@
|
||||
#include "RimFemResultObserver.h"
|
||||
|
||||
CAF_PDM_ABSTRACT_SOURCE_INIT(RimFemResultObserver, "RimFemResultObserver");
|
||||
|
@@ -0,0 +1,32 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- Statoil 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 "RigFemResultAddress.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimFemResultObserver : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
virtual std::vector<RigFemResultAddress> observedResults() const = 0;
|
||||
};
|
Reference in New Issue
Block a user