Creating a fem-results caching system

Needed specifically for statistics
Work in progress brakes build
This commit is contained in:
Jacob Støren
2015-05-06 16:07:30 +02:00
parent 746e9d402d
commit 27dcd80bfd
18 changed files with 443 additions and 107 deletions

View File

@@ -16,7 +16,12 @@ add_library( ${PROJECT_NAME}
RigGeoMechCaseData.h RigGeoMechCaseData.h
RigFemPartCollection.cpp RigFemPartCollection.cpp
RigFemPartCollection.h RigFemPartCollection.h
RigFemPartResults.h
RigFemPartResults.cpp
RigFemScalarResultFrames.h
RigFemScalarResultFrames.cpp
RigFemNativeStatCalc.h
RigFemNativeStatCalc.cpp
) )
target_link_libraries( ${PROJECT_NAME} LibCore ) target_link_libraries( ${PROJECT_NAME} LibCore )

View File

@@ -0,0 +1,23 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RigFemNativeStatCalc.h"

View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RigStatisticsCalculator.h"
class RigFemScalarResultFrames;
class RigFemNativeStatCalc : public RigStatisticsCalculator
{
public:
RigFemNativeStatCalc(RigFemScalarResultFrames* cellResultsData);
virtual void minMaxCellScalarValues(size_t timeStepIndex, double& min, double& max);
virtual void posNegClosestToZero(size_t timeStepIndex, double& pos, double& neg);
virtual void valueSumAndSampleCount(double& valueSum, size_t& sampleCount);
virtual void addDataToHistogramCalculator(RigHistogramCalculator& histogramCalculator);
virtual size_t timeStepCount();
private:
RigFemScalarResultFrames* m_resultsData;
};

View File

@@ -0,0 +1,36 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RigFemPartResults.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFemPartResults::RigFemPartResults()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFemPartResults::~RigFemPartResults()
{
}

View File

@@ -0,0 +1,63 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "cvfObject.h"
#include "RigFemResultPosEnum.h"
#include <string>
#include <vector>
#include <map>
#include "RigFemScalarResultFrames.h"
//==================================================================================================
///
//==================================================================================================
class RigFemPartResults : public cvf::Object
{
public:
RigFemPartResults();
~RigFemPartResults();
void initResultStages( const std::vector<std::string>& stageNames);
RigFemScalarResultFrames* createScalarResult( size_t stageIndex,
RigFemResultPosEnum resultPosType,
const std::string& fieldName,
const std::string& componentName,
const std::vector<double>& frameTimes);
RigFemScalarResultFrames* findScalarResult( size_t stageIndex,
RigFemResultPosEnum resultPosType,
const std::string& fieldName,
const std::string& componentName);
private:
struct RigAnalysisStage
{
std::string stageName;
std::map<RigFemResultPosEnum, std::map<std::string, std::map< std::string, cvf::ref<RigFemScalarResultFrames> > > > resultSets;
};
std::vector<RigAnalysisStage> m_femAnalysisStages;
};

View File

@@ -0,0 +1,7 @@
#pragma once
enum RigFemResultPosEnum {
RIG_NODAL,
RIG_ELEMENT_NODAL,
RIG_INTEGRATION_POINT
};

View File

@@ -0,0 +1,22 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RigFemScalarResultFrames.h"

View File

@@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "cvfObject.h"
#include <vector>
//==================================================================================================
///
//==================================================================================================
class RigStatisticsDataCache;
class RigFemScalarResultFrames: public cvf::Object
{
public:
RigFemScalarResultFrames(const std::vector<double>& frameTimes);
virtual ~RigFemScalarResultFrames();
std::vector<float>& frameData(size_t frameIndex);
size_t frameCount();
RigStatisticsDataCache* statistics();
private:
std::vector< std::vector<float> > m_dataForEachFrame;
std::vector<double> m_frameTimes;
cvf::ref<RigStatisticsDataCache> m_statistics;
};

View File

@@ -18,13 +18,19 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
#include "RigGeoMechCaseData.h" #include "RigGeoMechCaseData.h"
#include "RigFemPartCollection.h"
#include "RifGeoMechReaderInterface.h"
#ifdef USE_ODB_API
#include "RifOdbReader.h"
#endif
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RigGeoMechCaseData::RigGeoMechCaseData() RigGeoMechCaseData::RigGeoMechCaseData(const std::string& fileName)
{ {
m_femParts = new RigFemPartCollection(); m_geoMechCaseFileName = fileName;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -50,3 +56,92 @@ const RigFemPartCollection* RigGeoMechCaseData::femParts() const
{ {
return m_femParts.p(); return m_femParts.p();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigGeoMechCaseData::openAndReadFemParts()
{
#ifdef USE_ODB_API
m_readerInterface = new RifOdbReader;
#endif
if (m_readerInterface.notNull() && m_readerInterface->openFile(m_geoMechCaseFileName))
{
m_femParts = new RigFemPartCollection();
if (m_readerInterface->readFemParts(m_femParts.p()))
{
// Initialize results containers
m_femPartResults.resize(m_femParts->partCount());
std::vector<std::string> stepNames = m_readerInterface->stepNames();
for (int pIdx = 0; pIdx < m_femPartResults.size(); ++pIdx)
{
m_femPartResults[pIdx]->initResultStages(stepNames);
}
return true;
}
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<std::string, std::vector<std::string> > RigGeoMechCaseData::scalarFieldAndComponentNames(RigFemResultPosEnum resPos)
{
std::map<std::string, std::vector<std::string> > fieldCompNames;
if (m_readerInterface.notNull())
{
if (resPos == RIG_NODAL)
{
fieldCompNames = m_readerInterface->scalarNodeFieldAndComponentNames();
}
else if (resPos == RIG_ELEMENT_NODAL)
{
fieldCompNames = m_readerInterface->scalarElementNodeFieldAndComponentNames();
}
else if (resPos == RIG_INTEGRATION_POINT)
{
fieldCompNames = m_readerInterface->scalarIntegrationPointFieldAndComponentNames();
}
}
return fieldCompNames;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFemScalarResultFrames* RigGeoMechCaseData::findOrLoadScalarResult(size_t partIndex, size_t stepIndex,
RigFemResultPosEnum resultPosType,
const std::string& fieldName,
const std::string& componentName)
{
CVF_ASSERT(partIndex < m_femParts->partCount());
RigFemScalarResultFrames* frames = m_femPartResults[partIndex]->findScalarResult(stepIndex, resultPosType, fieldName, componentName);
if (frames) return frames;
std::vector<double > frameTimes = m_readerInterface->frameTimes(stepIndex);
frames = m_femPartResults[partIndex]->createScalarResult( stepIndex, resultPosType, fieldName, componentName, frameTimes);
for (size_t fIdx = 0; fIdx < frameTimes.size(); ++fIdx)
{
std::vector<float>* frameData = &(frames->frameData(fIdx));
switch (resultPosType)
{
case RIG_NODAL:
m_readerInterface->readScalarNodeField(fieldName, componentName, partIndex, stepIndex, fIdx, frameData);
break;
case RIG_ELEMENT_NODAL:
//m_readerInterface->readScalarElementNodeField(fieldName, componentName, partIndex, stepIndex, fIdx, frameData);
break;
case RIG_INTEGRATION_POINT:
//m_readerInterface->readScalarIntegrationPointField(fieldName, componentName, partIndex, stepIndex, fIdx, frameData);
break;
}
}
}

View File

@@ -18,22 +18,41 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#include "cvfObject.h"
#include <string>
#include <map>
#include <vector>
#include "RigFemResultPosEnum.h"
#include "cvfCollection.h"
#include "RigFemPartResults.h"
#include "RigFemPartCollection.h" class RifGeoMechReaderInterface;
class RigFemPartCollection;
class RigFemScalarResultFrames;
class RigGeoMechCaseData: public cvf::Object class RigGeoMechCaseData: public cvf::Object
{ {
public: public:
RigGeoMechCaseData(); RigGeoMechCaseData(const std::string& fileName);
~RigGeoMechCaseData(); ~RigGeoMechCaseData();
bool openAndReadFemParts();
RigFemPartCollection* femParts(); RigFemPartCollection* femParts();
const RigFemPartCollection* femParts() const; const RigFemPartCollection* femParts() const;
std::map<std::string, std::vector<std::string> > scalarFieldAndComponentNames(RigFemResultPosEnum resPos);
std::vector<std::string> stepNames();
RigFemScalarResultFrames* findOrLoadScalarResult(size_t partIndex,
size_t stepIndex,
RigFemResultPosEnum resultPosType,
const std::string& fieldName,
const std::string& componentName);
private: private:
std::string m_geoMechCaseFileName;
cvf::ref<RigFemPartCollection> m_femParts; cvf::ref<RigFemPartCollection> m_femParts;
cvf::Collection<RigFemPartResults> m_femPartResults;
cvf::ref<RifGeoMechReaderInterface> m_readerInterface;
}; };

View File

@@ -0,0 +1,7 @@
#pragma once
enum RigFemResultPosEnum {
NODAL,
ELEMENT_NODAL,
INTEGRATION_POINT
};

View File

@@ -43,6 +43,7 @@ public:
cvf::ref<cvf::DrawableGeo> createOutlineMeshDrawable(double creaseAngle); cvf::ref<cvf::DrawableGeo> createOutlineMeshDrawable(double creaseAngle);
const std::vector<size_t>& quadVerticesToNodeIdxMapping() const { return m_quadVerticesToNodeIdx;} const std::vector<size_t>& quadVerticesToNodeIdxMapping() const { return m_quadVerticesToNodeIdx;}
const std::vector<size_t>& quadVerticesToGlobalElmNodeIdx() const { return m_quadVerticesToGlobalElmNodeIdx;}
private: private:
static cvf::ref<cvf::UIntArray> static cvf::ref<cvf::UIntArray>

View File

@@ -47,6 +47,8 @@
#include "cvfStructGrid.h" #include "cvfStructGrid.h"
#include "cvfUniform.h" #include "cvfUniform.h"
#include "RifGeoMechReaderInterface.h" #include "RifGeoMechReaderInterface.h"
#include "RigGeomechCaseData.h"
#include "RigFemScalarResultFrames.h"
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -219,20 +221,33 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechRe
{ {
const cvf::ScalarMapper* mapper = cellResultSlot->legendConfig()->scalarMapper(); const cvf::ScalarMapper* mapper = cellResultSlot->legendConfig()->scalarMapper();
RifGeoMechReaderInterface* reader = cellResultSlot->resultReaderInterface();
std::vector<float> resultValues;
reader->readScalarNodeField(cellResultSlot->resultFieldName().toStdString(),
cellResultSlot->resultComponentName().toStdString(),
m_gridIdx, 0, timeStepIndex, &resultValues);
const std::vector<size_t>& vxToResultMapping = m_surfaceGenerator.quadVerticesToNodeIdxMapping(); RigGeoMechCaseData* caseData = cellResultSlot->ownerCaseData();
m_surfaceFacesTextureCoords->resize(vxToResultMapping.size());
if (!caseData) return;
RigFemScalarResultFrames* scalarResults = caseData->findOrLoadScalarResult(m_gridIdx, 0, cellResultSlot->resultPositionType(), cellResultSlot->resultFieldName().toStdString(), cellResultSlot->resultComponentName().toStdString());
std::vector<float>& resultValues = scalarResults->frameData(timeStepIndex);
const std::vector<size_t>* vxToResultMapping = NULL;
if (cellResultSlot->resultPositionType() == RIG_NODAL)
{
vxToResultMapping = &(m_surfaceGenerator.quadVerticesToNodeIdxMapping());
}
else if ( cellResultSlot->resultPositionType() == RIG_ELEMENT_NODAL
|| cellResultSlot->resultPositionType() == RIG_INTEGRATION_POINT)
{
vxToResultMapping = &(m_surfaceGenerator.quadVerticesToNodeIdxMapping());
}
m_surfaceFacesTextureCoords->resize(vxToResultMapping->size());
cvf::Vec2f* rawPtr = m_surfaceFacesTextureCoords->ptr(); cvf::Vec2f* rawPtr = m_surfaceFacesTextureCoords->ptr();
#pragma omp parallel for schedule(dynamic) #pragma omp parallel for schedule(dynamic)
for (int vxIdx = 0; vxIdx < vxToResultMapping.size(); ++vxIdx) for (int vxIdx = 0; vxIdx < vxToResultMapping->size(); ++vxIdx)
{ {
float resultValue = resultValues[vxToResultMapping[vxIdx]]; float resultValue = resultValues[(*vxToResultMapping)[vxIdx]];
if (resultValue == HUGE_VAL || resultValue != resultValue) // a != a is true for NAN's if (resultValue == HUGE_VAL || resultValue != resultValue) // a != a is true for NAN's
{ {
rawPtr[vxIdx][1] = 1.0f; rawPtr[vxIdx][1] = 1.0f;

View File

@@ -86,29 +86,9 @@ bool RimGeoMechCase::openGeoMechCase()
return false; return false;
} }
m_geoMechCaseData = new RigGeoMechCaseData(m_caseFileName().toStdString());
#ifdef USE_ODB_API return m_geoMechCaseData->openAndReadFemParts();
m_readerInterface = new RifOdbReader;
m_geoMechCaseData = new RigGeoMechCaseData;
if (m_readerInterface->readFemParts(m_caseFileName().toStdString(), m_geoMechCaseData->femParts()))
{
// Todo: Default Results stuff, if needed
return true;
}
#endif
return false;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifGeoMechReaderInterface* RimGeoMechCase::readerInterface()
{
return m_readerInterface.p();
}

View File

@@ -48,15 +48,14 @@ public:
RimGeoMechView* createAndAddReservoirView(); RimGeoMechView* createAndAddReservoirView();
virtual caf::PdmFieldHandle* userDescriptionField();
RifGeoMechReaderInterface* readerInterface();
// Fields: // Fields:
caf::PdmField<QString> caseUserDescription; caf::PdmField<QString> caseUserDescription;
caf::PdmPointersField<RimGeoMechView*> geoMechViews; caf::PdmPointersField<RimGeoMechView*> geoMechViews;
private:
virtual caf::PdmFieldHandle* userDescriptionField();
private: private:
cvf::ref<RigGeoMechCaseData> m_geoMechCaseData; cvf::ref<RigGeoMechCaseData> m_geoMechCaseData;
caf::PdmField<QString> m_caseFileName; caf::PdmField<QString> m_caseFileName;
cvf::ref<RifGeoMechReaderInterface> m_readerInterface;
}; };

View File

@@ -24,16 +24,17 @@
#include "RimGeoMechCase.h" #include "RimGeoMechCase.h"
#include "RifGeoMechReaderInterface.h" #include "RifGeoMechReaderInterface.h"
#include "cafPdmUiListEditor.h" #include "cafPdmUiListEditor.h"
#include "RigGeoMechCaseData.h"
namespace caf { namespace caf {
template<> template<>
void caf::AppEnum< RimGeoMechResultSlot::ResultPositionEnum >::setUp() void caf::AppEnum< RigFemResultPosEnum >::setUp()
{ {
addItem(RimGeoMechResultSlot::NODAL, "NODAL", "Nodal"); addItem(RIG_NODAL, "NODAL", "Nodal");
addItem(RimGeoMechResultSlot::ELEMENT_NODAL, "ELEMENT_NODAL", "Element Nodal"); addItem(RIG_ELEMENT_NODAL, "ELEMENT_NODAL", "Element Nodal");
addItem(RimGeoMechResultSlot::INTEGRATION_POINT,"INTEGRATION_POINT","Integration Point"); addItem(RIG_INTEGRATION_POINT,"INTEGRATION_POINT","Integration Point");
setDefault(RimGeoMechResultSlot::NODAL); setDefault(RIG_NODAL);
} }
} }
@@ -178,29 +179,15 @@ void RimGeoMechResultSlot::fieldChangedByUi(const caf::PdmFieldHandle* changedFi
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::map<std::string, std::vector<std::string> > RimGeoMechResultSlot::getResultMetaDataForUIFieldSetting() std::map<std::string, std::vector<std::string> > RimGeoMechResultSlot::getResultMetaDataForUIFieldSetting()
{ {
std::map<std::string, std::vector<std::string> > fieldCompNames;
RimGeoMechCase* gmCase = m_reservoirView->geoMechCase(); RimGeoMechCase* gmCase = m_reservoirView->geoMechCase();
if (gmCase) if (gmCase && gmCase->geoMechData())
{ {
cvf::ref<RifGeoMechReaderInterface> reader = gmCase->readerInterface(); return gmCase->geoMechData()->scalarFieldAndComponentNames(m_resultPositionTypeUiField());
if (reader.notNull()) }
else
{ {
if (m_resultPositionTypeUiField == NODAL) return std::map<std::string, std::vector<std::string> >() ;
{
fieldCompNames = reader->scalarNodeFieldAndComponentNames();
} }
else if (m_resultPositionTypeUiField == ELEMENT_NODAL)
{
fieldCompNames = reader->scalarElementNodeFieldAndComponentNames();
}
else if (m_resultPositionTypeUiField == INTEGRATION_POINT)
{
fieldCompNames = reader->scalarIntegrationPointFieldAndComponentNames();
}
}
}
return fieldCompNames;
} }
void RimGeoMechResultSlot::getUiAndResultVariableStringList(QStringList* uiNames, QStringList* variableNames, void RimGeoMechResultSlot::getUiAndResultVariableStringList(QStringList* uiNames, QStringList* variableNames,
@@ -248,17 +235,7 @@ void RimGeoMechResultSlot::loadResult()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RifGeoMechReaderInterface* RimGeoMechResultSlot::resultReaderInterface() RigGeoMechCaseData* RimGeoMechResultSlot::ownerCaseData()
{ {
if (m_reservoirView) return m_reservoirView->geoMechCase()->geoMechData();
{
RimGeoMechCase* gmCase = m_reservoirView->geoMechCase();
if (gmCase)
{
return gmCase->readerInterface();
}
}
return NULL;
} }

View File

@@ -23,11 +23,12 @@
#include "cafPdmObject.h" #include "cafPdmObject.h"
#include "cafPdmPointer.h" #include "cafPdmPointer.h"
#include "cafAppEnum.h" #include "cafAppEnum.h"
#include "RigFemResultPosEnum.h"
class RimLegendConfig; class RimLegendConfig;
class RimGeoMechView; class RimGeoMechView;
class RifGeoMechReaderInterface; class RifGeoMechReaderInterface;
class RigGeoMechCaseData;
//================================================================================================== //==================================================================================================
/// ///
/// ///
@@ -41,22 +42,15 @@ public:
virtual ~RimGeoMechResultSlot(void); virtual ~RimGeoMechResultSlot(void);
void setReservoirView(RimGeoMechView* ownerReservoirView); void setReservoirView(RimGeoMechView* ownerReservoirView);
RifGeoMechReaderInterface* resultReaderInterface(); RigGeoMechCaseData* ownerCaseData();
enum ResultPositionEnum { RigFemResultPosEnum resultPositionType() { return m_resultPositionType();}
NODAL,
ELEMENT_NODAL,
INTEGRATION_POINT
};
ResultPositionEnum resultPositionType() { return m_resultPositionType();}
QString resultFieldName() { return m_resultFieldName();} QString resultFieldName() { return m_resultFieldName();}
QString resultComponentName() { return m_resultComponentName();} QString resultComponentName() { return m_resultComponentName();}
caf::PdmField<RimLegendConfig*> legendConfig; caf::PdmField<RimLegendConfig*> legendConfig;
private: private:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
bool * useOptionsOnly); bool * useOptionsOnly);
@@ -70,11 +64,11 @@ private:
virtual void initAfterRead(); virtual void initAfterRead();
void loadResult(); void loadResult();
caf::PdmField<caf::AppEnum<ResultPositionEnum> > m_resultPositionType; caf::PdmField<caf::AppEnum<RigFemResultPosEnum> > m_resultPositionType;
caf::PdmField<QString> m_resultFieldName; caf::PdmField<QString> m_resultFieldName;
caf::PdmField<QString> m_resultComponentName; caf::PdmField<QString> m_resultComponentName;
caf::PdmField<caf::AppEnum<ResultPositionEnum> > m_resultPositionTypeUiField; caf::PdmField<caf::AppEnum<RigFemResultPosEnum> > m_resultPositionTypeUiField;
caf::PdmField<QString> m_resultVariableUiField; caf::PdmField<QString> m_resultVariableUiField;
caf::PdmPointer<RimGeoMechView> m_reservoirView; caf::PdmPointer<RimGeoMechView> m_reservoirView;

View File

@@ -40,7 +40,7 @@
#include "RivGeoMechPartMgr.h" #include "RivGeoMechPartMgr.h"
#include "RigGeoMechCaseData.h" #include "RigGeoMechCaseData.h"
#include "cvfqtUtils.h" #include "cvfqtUtils.h"
#include "RigFemPartCollection.h"
namespace caf { namespace caf {
@@ -254,7 +254,7 @@ void RimGeoMechView::updateLegends()
cellResult->legendConfig->setClosestToZeroValues(globalPosClosestToZero, globalNegClosestToZero, localPosClosestToZero, localNegClosestToZero); cellResult->legendConfig->setClosestToZeroValues(globalPosClosestToZero, globalNegClosestToZero, localPosClosestToZero, localNegClosestToZero);
cellResult->legendConfig->setAutomaticRanges(globalMin, globalMax, localMin, localMax); cellResult->legendConfig->setAutomaticRanges(globalMin, globalMax, localMin, localMax);
#endif #endif
caf::AppEnum<RimGeoMechResultSlot::ResultPositionEnum> resPosType = cellResult->resultPositionType(); caf::AppEnum<RigFemResultPosEnum> resPosType = cellResult->resultPositionType();
QString fieldName = cellResult->resultFieldName(); QString fieldName = cellResult->resultFieldName();
QString compName = cellResult->resultComponentName(); QString compName = cellResult->resultComponentName();