mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Geomech frames support (#9678)
Support for showing frames in geomech data.
This commit is contained in:
@@ -81,11 +81,12 @@ double RimWellIADataAccess::resultValue( QString fieldName,
|
||||
QString componentName,
|
||||
RigFemResultPosEnum resultType,
|
||||
size_t resultIndex,
|
||||
int timeStep )
|
||||
int timeStep,
|
||||
int frameId )
|
||||
{
|
||||
RigFemResultAddress address( resultType, fieldName.toStdString(), componentName.toStdString() );
|
||||
|
||||
const std::vector<float>& scalarResults = m_caseData->femPartResults()->resultValues( address, 0, timeStep );
|
||||
const std::vector<float>& scalarResults = m_caseData->femPartResults()->resultValues( address, 0, timeStep, frameId );
|
||||
|
||||
if ( resultIndex < scalarResults.size() ) return scalarResults[resultIndex];
|
||||
|
||||
@@ -99,7 +100,8 @@ double RimWellIADataAccess::interpolatedResultValue( QString fieldNa
|
||||
QString componentName,
|
||||
RigFemResultPosEnum resultType,
|
||||
cvf::Vec3d position,
|
||||
int timeStep )
|
||||
int timeStep,
|
||||
int frameId )
|
||||
{
|
||||
RigFemResultAddress address( resultType, fieldName.toStdString(), componentName.toStdString() );
|
||||
|
||||
@@ -110,7 +112,7 @@ double RimWellIADataAccess::interpolatedResultValue( QString fieldNa
|
||||
const int* elementConn = femPart->connectivities( elmIdx );
|
||||
int elmNodeCount = RigFemTypes::elementNodeCount( elmType );
|
||||
|
||||
const std::vector<float>& scalarResults = m_caseData->femPartResults()->resultValues( address, 0, timeStep );
|
||||
const std::vector<float>& scalarResults = m_caseData->femPartResults()->resultValues( address, 0, timeStep, frameId );
|
||||
|
||||
std::array<double, 8> nodeResults;
|
||||
std::array<cvf::Vec3d, 8> nodeCorners;
|
||||
|
||||
@@ -45,12 +45,14 @@ public:
|
||||
QString componentName,
|
||||
RigFemResultPosEnum resultType,
|
||||
size_t resultIndex,
|
||||
int timeStep );
|
||||
int timeStep,
|
||||
int frameId );
|
||||
double interpolatedResultValue( QString fieldname,
|
||||
QString componentName,
|
||||
RigFemResultPosEnum resultType,
|
||||
cvf::Vec3d position,
|
||||
int timeStep );
|
||||
int timeStep,
|
||||
int frameId );
|
||||
|
||||
private:
|
||||
RimGeoMechCase* m_case;
|
||||
|
||||
@@ -473,7 +473,7 @@ bool RimWellIASettings::updateResInsightParameters()
|
||||
for ( size_t i = 0; i < nativeKeys.size(); i++ )
|
||||
{
|
||||
double stressValue =
|
||||
dataAccess.interpolatedResultValue( "ST", nativeKeys[i], RigFemResultPosEnum::RIG_ELEMENT_NODAL, position, 0 );
|
||||
dataAccess.interpolatedResultValue( "ST", nativeKeys[i], RigFemResultPosEnum::RIG_ELEMENT_NODAL, position, 0, 0 );
|
||||
if ( std::isfinite( stressValue ) )
|
||||
{
|
||||
initialStress->addParameter( paramKeys[i], stressValue * 100000.0 );
|
||||
@@ -484,7 +484,7 @@ bool RimWellIASettings::updateResInsightParameters()
|
||||
}
|
||||
}
|
||||
|
||||
double ppValue = dataAccess.interpolatedResultValue( "POR-Bar", "", RigFemResultPosEnum::RIG_NODAL, position, 0 );
|
||||
double ppValue = dataAccess.interpolatedResultValue( "POR-Bar", "", RigFemResultPosEnum::RIG_NODAL, position, 0, 0 );
|
||||
if ( std::isfinite( ppValue ) )
|
||||
{
|
||||
initialStress->addParameter( "PP", ppValue * 100000.0 );
|
||||
@@ -673,9 +673,13 @@ std::vector<cvf::Vec3d> RimWellIASettings::extractDisplacements( std::vector<cvf
|
||||
|
||||
for ( auto& pos : corners )
|
||||
{
|
||||
double u1 = dataAccess.interpolatedResultValue( "U", "U1", RigFemResultPosEnum::RIG_NODAL, pos, timeStep );
|
||||
double u2 = dataAccess.interpolatedResultValue( "U", "U2", RigFemResultPosEnum::RIG_NODAL, pos, timeStep );
|
||||
double u3 = dataAccess.interpolatedResultValue( "U", "U3", RigFemResultPosEnum::RIG_NODAL, pos, timeStep );
|
||||
int lastFrame = -1;
|
||||
double u1 =
|
||||
dataAccess.interpolatedResultValue( "U", "U1", RigFemResultPosEnum::RIG_NODAL, pos, timeStep, lastFrame );
|
||||
double u2 =
|
||||
dataAccess.interpolatedResultValue( "U", "U2", RigFemResultPosEnum::RIG_NODAL, pos, timeStep, lastFrame );
|
||||
double u3 =
|
||||
dataAccess.interpolatedResultValue( "U", "U3", RigFemResultPosEnum::RIG_NODAL, pos, timeStep, lastFrame );
|
||||
|
||||
displacements.push_back( cvf::Vec3d( u1, u2, u3 ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user