mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Creating a fem-results caching system
Needed specifically for statistics Work in progress brakes build
This commit is contained in:
@@ -86,29 +86,9 @@ bool RimGeoMechCase::openGeoMechCase()
|
||||
return false;
|
||||
}
|
||||
|
||||
m_geoMechCaseData = new RigGeoMechCaseData(m_caseFileName().toStdString());
|
||||
|
||||
#ifdef USE_ODB_API
|
||||
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;
|
||||
|
||||
return m_geoMechCaseData->openAndReadFemParts();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifGeoMechReaderInterface* RimGeoMechCase::readerInterface()
|
||||
{
|
||||
return m_readerInterface.p();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,23 +40,22 @@ public:
|
||||
RimGeoMechCase(void);
|
||||
virtual ~RimGeoMechCase(void);
|
||||
|
||||
void setFileName(const QString& fileName) {m_caseFileName = fileName;}
|
||||
bool openGeoMechCase();
|
||||
void setFileName(const QString& fileName) {m_caseFileName = fileName;}
|
||||
bool openGeoMechCase();
|
||||
|
||||
RigGeoMechCaseData* geoMechData() { return m_geoMechCaseData.p(); }
|
||||
const RigGeoMechCaseData* geoMechData() const { return m_geoMechCaseData.p(); }
|
||||
RigGeoMechCaseData* geoMechData() { return m_geoMechCaseData.p(); }
|
||||
const RigGeoMechCaseData* geoMechData() const { return m_geoMechCaseData.p(); }
|
||||
|
||||
RimGeoMechView* createAndAddReservoirView();
|
||||
RimGeoMechView* createAndAddReservoirView();
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
RifGeoMechReaderInterface* readerInterface();
|
||||
// Fields:
|
||||
caf::PdmField<QString> caseUserDescription;
|
||||
caf::PdmPointersField<RimGeoMechView*> geoMechViews;
|
||||
// Fields:
|
||||
caf::PdmField<QString> caseUserDescription;
|
||||
caf::PdmPointersField<RimGeoMechView*> geoMechViews;
|
||||
|
||||
private:
|
||||
cvf::ref<RigGeoMechCaseData> m_geoMechCaseData;
|
||||
caf::PdmField<QString> m_caseFileName;
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
|
||||
cvf::ref<RifGeoMechReaderInterface> m_readerInterface;
|
||||
private:
|
||||
cvf::ref<RigGeoMechCaseData> m_geoMechCaseData;
|
||||
caf::PdmField<QString> m_caseFileName;
|
||||
};
|
||||
|
||||
@@ -24,16 +24,17 @@
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RifGeoMechReaderInterface.h"
|
||||
#include "cafPdmUiListEditor.h"
|
||||
#include "RigGeoMechCaseData.h"
|
||||
|
||||
namespace caf {
|
||||
|
||||
template<>
|
||||
void caf::AppEnum< RimGeoMechResultSlot::ResultPositionEnum >::setUp()
|
||||
void caf::AppEnum< RigFemResultPosEnum >::setUp()
|
||||
{
|
||||
addItem(RimGeoMechResultSlot::NODAL, "NODAL", "Nodal");
|
||||
addItem(RimGeoMechResultSlot::ELEMENT_NODAL, "ELEMENT_NODAL", "Element Nodal");
|
||||
addItem(RimGeoMechResultSlot::INTEGRATION_POINT,"INTEGRATION_POINT","Integration Point");
|
||||
setDefault(RimGeoMechResultSlot::NODAL);
|
||||
addItem(RIG_NODAL, "NODAL", "Nodal");
|
||||
addItem(RIG_ELEMENT_NODAL, "ELEMENT_NODAL", "Element Nodal");
|
||||
addItem(RIG_INTEGRATION_POINT,"INTEGRATION_POINT","Integration Point");
|
||||
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> > fieldCompNames;
|
||||
|
||||
RimGeoMechCase* gmCase = m_reservoirView->geoMechCase();
|
||||
if (gmCase)
|
||||
if (gmCase && gmCase->geoMechData())
|
||||
{
|
||||
cvf::ref<RifGeoMechReaderInterface> reader = gmCase->readerInterface();
|
||||
if (reader.notNull())
|
||||
{
|
||||
if (m_resultPositionTypeUiField == NODAL)
|
||||
{
|
||||
fieldCompNames = reader->scalarNodeFieldAndComponentNames();
|
||||
}
|
||||
else if (m_resultPositionTypeUiField == ELEMENT_NODAL)
|
||||
{
|
||||
fieldCompNames = reader->scalarElementNodeFieldAndComponentNames();
|
||||
}
|
||||
else if (m_resultPositionTypeUiField == INTEGRATION_POINT)
|
||||
{
|
||||
fieldCompNames = reader->scalarIntegrationPointFieldAndComponentNames();
|
||||
}
|
||||
}
|
||||
return gmCase->geoMechData()->scalarFieldAndComponentNames(m_resultPositionTypeUiField());
|
||||
}
|
||||
else
|
||||
{
|
||||
return std::map<std::string, std::vector<std::string> >() ;
|
||||
}
|
||||
return fieldCompNames;
|
||||
}
|
||||
|
||||
void RimGeoMechResultSlot::getUiAndResultVariableStringList(QStringList* uiNames, QStringList* variableNames,
|
||||
@@ -248,17 +235,7 @@ void RimGeoMechResultSlot::loadResult()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifGeoMechReaderInterface* RimGeoMechResultSlot::resultReaderInterface()
|
||||
RigGeoMechCaseData* RimGeoMechResultSlot::ownerCaseData()
|
||||
{
|
||||
if (m_reservoirView)
|
||||
{
|
||||
RimGeoMechCase* gmCase = m_reservoirView->geoMechCase();
|
||||
if (gmCase)
|
||||
{
|
||||
return gmCase->readerInterface();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return m_reservoirView->geoMechCase()->geoMechData();
|
||||
}
|
||||
|
||||
@@ -23,11 +23,12 @@
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPointer.h"
|
||||
#include "cafAppEnum.h"
|
||||
#include "RigFemResultPosEnum.h"
|
||||
|
||||
class RimLegendConfig;
|
||||
class RimGeoMechView;
|
||||
class RifGeoMechReaderInterface;
|
||||
|
||||
class RigGeoMechCaseData;
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
@@ -41,22 +42,15 @@ public:
|
||||
virtual ~RimGeoMechResultSlot(void);
|
||||
|
||||
void setReservoirView(RimGeoMechView* ownerReservoirView);
|
||||
RifGeoMechReaderInterface* resultReaderInterface();
|
||||
|
||||
enum ResultPositionEnum {
|
||||
NODAL,
|
||||
ELEMENT_NODAL,
|
||||
INTEGRATION_POINT
|
||||
};
|
||||
|
||||
ResultPositionEnum resultPositionType() { return m_resultPositionType();}
|
||||
RigGeoMechCaseData* ownerCaseData();
|
||||
|
||||
RigFemResultPosEnum resultPositionType() { return m_resultPositionType();}
|
||||
QString resultFieldName() { return m_resultFieldName();}
|
||||
QString resultComponentName() { return m_resultComponentName();}
|
||||
|
||||
caf::PdmField<RimLegendConfig*> legendConfig;
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool * useOptionsOnly);
|
||||
@@ -70,11 +64,11 @@ private:
|
||||
virtual void initAfterRead();
|
||||
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_resultComponentName;
|
||||
|
||||
caf::PdmField<caf::AppEnum<ResultPositionEnum> > m_resultPositionTypeUiField;
|
||||
caf::PdmField<caf::AppEnum<RigFemResultPosEnum> > m_resultPositionTypeUiField;
|
||||
caf::PdmField<QString> m_resultVariableUiField;
|
||||
|
||||
caf::PdmPointer<RimGeoMechView> m_reservoirView;
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "RivGeoMechPartMgr.h"
|
||||
#include "RigGeoMechCaseData.h"
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
#include "RigFemPartCollection.h"
|
||||
|
||||
namespace caf {
|
||||
|
||||
@@ -254,7 +254,7 @@ void RimGeoMechView::updateLegends()
|
||||
cellResult->legendConfig->setClosestToZeroValues(globalPosClosestToZero, globalNegClosestToZero, localPosClosestToZero, localNegClosestToZero);
|
||||
cellResult->legendConfig->setAutomaticRanges(globalMin, globalMax, localMin, localMax);
|
||||
#endif
|
||||
caf::AppEnum<RimGeoMechResultSlot::ResultPositionEnum> resPosType = cellResult->resultPositionType();
|
||||
caf::AppEnum<RigFemResultPosEnum> resPosType = cellResult->resultPositionType();
|
||||
QString fieldName = cellResult->resultFieldName();
|
||||
QString compName = cellResult->resultComponentName();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user