#3043 Implement Time step filtering on import for Geomech

This commit is contained in:
Gaute Lindkvist
2018-06-11 13:47:21 +02:00
parent 62792b59c4
commit 280656ca26
23 changed files with 616 additions and 209 deletions

View File

@@ -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;
}