#3043 Implement Time step filtering on import for Geomech

This commit is contained in:
Gaute Lindkvist committed 2018-06-13 14:10:47 +02:00
1 parent 62792b59c4
commit 280656ca26
23 files changed
+616 -209

No files matched your search

@@ -90,11 +90,11 @@ RigFemPartResultsCollection::RigFemPartResultsCollection(RifGeoMechReaderInterfa
m_femParts = femPartCollection;
m_femPartResults.resize(m_femParts->partCount());
std::vector<std::string> stepNames = m_readerInterface->stepNames();
std::vector<std::string> filteredStepNames = m_readerInterface->filteredStepNames();
for (auto & femPartResult : m_femPartResults)
{
femPartResult = new RigFemPartResults;
femPartResult->initResultSteps(stepNames);
femPartResult->initResultSteps(filteredStepNames);
}
m_cohesion = 10.0;
@@ -2150,10 +2150,10 @@ std::vector< RigFemResultAddress> RigFemPartResultsCollection::getResAddrToCompo
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RigFemPartResultsCollection::stepNames() const
std::vector<std::string> RigFemPartResultsCollection::filteredStepNames() const
{
CVF_ASSERT(m_readerInterface.notNull());
return m_readerInterface->stepNames();
return m_readerInterface->filteredStepNames();
}
//--------------------------------------------------------------------------------------------------
@@ -2161,7 +2161,7 @@ std::vector<std::string> RigFemPartResultsCollection::stepNames() const
//--------------------------------------------------------------------------------------------------
int RigFemPartResultsCollection::frameCount()
{
return static_cast<int>(stepNames().size());
return static_cast<int>(filteredStepNames().size());
}
//--------------------------------------------------------------------------------------------------
@@ -64,7 +64,7 @@ public:
double parameterFrictionAngleRad() const { return m_frictionAngleRad; }
std::map<std::string, std::vector<std::string> > scalarFieldAndComponentNames(RigFemResultPosEnum resPos);
std::vector<std::string> stepNames() const;
std::vector<std::string> filteredStepNames() const;
bool assertResultsLoaded(const RigFemResultAddress& resVarAddr);
void deleteResult(const RigFemResultAddress& resVarAddr);
@@ -88,17 +88,48 @@ RigFemPartResultsCollection* RigGeoMechCaseData::femPartResults()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RigGeoMechCaseData::openAndReadFemParts(std::string* errorMessage)
bool RigGeoMechCaseData::open(std::string* errorMessage)
{
#ifdef USE_ODB_API
m_readerInterface = new RifOdbReader;
#endif
if (m_readerInterface.notNull() && m_readerInterface->openFile(m_geoMechCaseFileName, errorMessage))
{
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigGeoMechCaseData::readTimeSteps(std::string* errorMessage, std::vector<std::string>* stepNames)
{
CVF_ASSERT(stepNames);
#ifdef USE_ODB_API
if (m_readerInterface.notNull() && m_readerInterface->isOpen())
{
*stepNames = m_readerInterface->allStepNames();
return true;
}
#endif
*errorMessage = std::string("Could not read time steps");
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigGeoMechCaseData::readFemParts(std::string* errorMessage, const std::vector<size_t>& timeStepFilter)
{
CVF_ASSERT(errorMessage);
#ifdef USE_ODB_API
if (m_readerInterface.notNull() && m_readerInterface->isOpen())
{
m_readerInterface->setTimeStepFilter(timeStepFilter);
m_femParts = new RigFemPartCollection();
caf::ProgressInfo progress(10, ""); // Here because the next call uses progress
@@ -117,9 +148,11 @@ bool RigGeoMechCaseData::openAndReadFemParts(std::string* errorMessage)
{
m_femParts->part(pIdx)->assertNodeToElmIndicesIsCalculated();
m_femParts->part(pIdx)->assertElmNeighborsIsCalculated();
}
}
return true;
}
}
#endif
*errorMessage = std::string("Could not read FEM parts");
return false;
}
@@ -39,8 +39,9 @@ public:
explicit RigGeoMechCaseData(const std::string& fileName);
~RigGeoMechCaseData();
bool openAndReadFemParts(std::string* errorMessage);
bool open(std::string* errorMessage);
bool readTimeSteps(std::string* errorMessage, std::vector<std::string>* stepNames);
bool readFemParts(std::string* errorMessage, const std::vector<size_t>& timeStepFilter = std::vector<size_t>());
RigFemPartCollection* femParts();
const RigFemPartCollection* femParts() const;