mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3043 Implement Time step filtering on import for Geomech
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user