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:
parent
746e9d402d
commit
27dcd80bfd
@ -16,7 +16,12 @@ add_library( ${PROJECT_NAME}
|
||||
RigGeoMechCaseData.h
|
||||
RigFemPartCollection.cpp
|
||||
RigFemPartCollection.h
|
||||
|
||||
RigFemPartResults.h
|
||||
RigFemPartResults.cpp
|
||||
RigFemScalarResultFrames.h
|
||||
RigFemScalarResultFrames.cpp
|
||||
RigFemNativeStatCalc.h
|
||||
RigFemNativeStatCalc.cpp
|
||||
)
|
||||
|
||||
target_link_libraries( ${PROJECT_NAME} LibCore )
|
@ -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"
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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()
|
||||
{
|
||||
|
||||
}
|
63
ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResults.h
Normal file
63
ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResults.h
Normal 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;
|
||||
|
||||
};
|
||||
|
@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
enum RigFemResultPosEnum {
|
||||
RIG_NODAL,
|
||||
RIG_ELEMENT_NODAL,
|
||||
RIG_INTEGRATION_POINT
|
||||
};
|
@ -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"
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -18,13 +18,19 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,22 +18,41 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#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
|
||||
{
|
||||
public:
|
||||
RigGeoMechCaseData();
|
||||
RigGeoMechCaseData(const std::string& fileName);
|
||||
~RigGeoMechCaseData();
|
||||
|
||||
RigFemPartCollection* femParts();
|
||||
const RigFemPartCollection* femParts() const;
|
||||
bool openAndReadFemParts();
|
||||
|
||||
RigFemPartCollection* femParts();
|
||||
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:
|
||||
cvf::ref<RigFemPartCollection> m_femParts;
|
||||
|
||||
std::string m_geoMechCaseFileName;
|
||||
cvf::ref<RigFemPartCollection> m_femParts;
|
||||
cvf::Collection<RigFemPartResults> m_femPartResults;
|
||||
cvf::ref<RifGeoMechReaderInterface> m_readerInterface;
|
||||
};
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
enum RigFemResultPosEnum {
|
||||
NODAL,
|
||||
ELEMENT_NODAL,
|
||||
INTEGRATION_POINT
|
||||
};
|
@ -43,6 +43,7 @@ public:
|
||||
cvf::ref<cvf::DrawableGeo> createOutlineMeshDrawable(double creaseAngle);
|
||||
|
||||
const std::vector<size_t>& quadVerticesToNodeIdxMapping() const { return m_quadVerticesToNodeIdx;}
|
||||
const std::vector<size_t>& quadVerticesToGlobalElmNodeIdx() const { return m_quadVerticesToGlobalElmNodeIdx;}
|
||||
|
||||
private:
|
||||
static cvf::ref<cvf::UIntArray>
|
||||
|
@ -47,6 +47,8 @@
|
||||
#include "cvfStructGrid.h"
|
||||
#include "cvfUniform.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();
|
||||
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();
|
||||
m_surfaceFacesTextureCoords->resize(vxToResultMapping.size());
|
||||
RigGeoMechCaseData* caseData = cellResultSlot->ownerCaseData();
|
||||
|
||||
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();
|
||||
|
||||
#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
|
||||
{
|
||||
rawPtr[vxIdx][1] = 1.0f;
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user