mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
clang-format: Set column width to 140
* Set column width to 140 * Use c++20 * Remove redundant virtual
This commit is contained in:
@@ -57,9 +57,8 @@ RigFemClosestResultIndexCalculator::RigFemClosestResultIndexCalculator( RigFemPa
|
||||
|
||||
if ( closestLocalNode >= 0 )
|
||||
{
|
||||
int nodeIdx = elementConn[closestLocalNode];
|
||||
m_closestElementNodeResIdx =
|
||||
static_cast<int>( femPart->elementNodeResultIdx( elementIndex, closestLocalNode ) );
|
||||
int nodeIdx = elementConn[closestLocalNode];
|
||||
m_closestElementNodeResIdx = static_cast<int>( femPart->elementNodeResultIdx( elementIndex, closestLocalNode ) );
|
||||
|
||||
if ( resultPosition == RIG_NODAL )
|
||||
{
|
||||
@@ -89,18 +88,17 @@ RigFemClosestResultIndexCalculator::RigFemClosestResultIndexCalculator( RigFemPa
|
||||
int closestLocFaceNode = -1;
|
||||
int closestLocalElmNode = -1;
|
||||
{
|
||||
RigElementType elmType = femPart->elementType( elementIndex );
|
||||
const int* elmNodeIndices = femPart->connectivities( elementIndex );
|
||||
int faceNodeCount = 0;
|
||||
const int* localElmNodeIndicesForFace =
|
||||
RigFemTypes::localElmNodeIndicesForFace( elmType, m_face, &faceNodeCount );
|
||||
RigElementType elmType = femPart->elementType( elementIndex );
|
||||
const int* elmNodeIndices = femPart->connectivities( elementIndex );
|
||||
int faceNodeCount = 0;
|
||||
const int* localElmNodeIndicesForFace = RigFemTypes::localElmNodeIndicesForFace( elmType, m_face, &faceNodeCount );
|
||||
|
||||
float minDist = std::numeric_limits<float>::infinity();
|
||||
for ( int faceNodIdx = 0; faceNodIdx < faceNodeCount; ++faceNodIdx )
|
||||
{
|
||||
int nodeIdx = elmNodeIndices[localElmNodeIndicesForFace[faceNodIdx]];
|
||||
cvf::Vec3f nodePosInDomain = femPart->nodes().coordinates[nodeIdx];
|
||||
float dist = ( nodePosInDomain - cvf::Vec3f( intersectionPointInDomain ) ).lengthSquared();
|
||||
float dist = ( nodePosInDomain - cvf::Vec3f( intersectionPointInDomain ) ).lengthSquared();
|
||||
if ( dist < minDist )
|
||||
{
|
||||
closestLocFaceNode = faceNodIdx;
|
||||
@@ -116,9 +114,8 @@ RigFemClosestResultIndexCalculator::RigFemClosestResultIndexCalculator( RigFemPa
|
||||
|
||||
if ( closestLocFaceNode >= 0 )
|
||||
{
|
||||
elmNodFaceResIdx = elmNodFaceResIdxFaceStart + closestLocFaceNode;
|
||||
m_closestElementNodeResIdx =
|
||||
static_cast<int>( femPart->elementNodeResultIdx( elementIndex, closestLocalElmNode ) );
|
||||
elmNodFaceResIdx = elmNodFaceResIdxFaceStart + closestLocFaceNode;
|
||||
m_closestElementNodeResIdx = static_cast<int>( femPart->elementNodeResultIdx( elementIndex, closestLocalElmNode ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemNativeStatCalc::RigFemNativeStatCalc( RigFemPartResultsCollection* femResultCollection,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemNativeStatCalc::RigFemNativeStatCalc( RigFemPartResultsCollection* femResultCollection, const RigFemResultAddress& resVarAddr )
|
||||
: m_resVarAddr( resVarAddr )
|
||||
{
|
||||
m_resultsData = femResultCollection;
|
||||
@@ -154,7 +153,7 @@ void RigFemNativeStatCalc::uniqueValues( size_t timeStepIndex, std::set<int>& va
|
||||
{
|
||||
auto frames = m_resultsData->findOrLoadScalarResult( pIdx, m_resVarAddr );
|
||||
|
||||
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( timeStepIndex );
|
||||
auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( timeStepIndex );
|
||||
const std::vector<float>& floatValues = frames->frameData( stepIdx, frameIdx );
|
||||
|
||||
for ( size_t i = 0; i < floatValues.size(); i++ )
|
||||
|
||||
@@ -76,8 +76,7 @@ void RigFemNativeVisibleCellsStatCalc::valueSumAndSampleCount( size_t timeStepIn
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFemNativeVisibleCellsStatCalc::addDataToHistogramCalculator( size_t timeStepIndex,
|
||||
RigHistogramCalculator& histogramCalculator )
|
||||
void RigFemNativeVisibleCellsStatCalc::addDataToHistogramCalculator( size_t timeStepIndex, RigHistogramCalculator& histogramCalculator )
|
||||
{
|
||||
traverseElementNodes( histogramCalculator, timeStepIndex );
|
||||
}
|
||||
|
||||
@@ -342,9 +342,8 @@ void RigFemPart::calculateElmNeighbors()
|
||||
bool isNeighborFound = false;
|
||||
for ( int nbcFaceIdx = 0; nbcFaceIdx < nbcFaceCount; ++nbcFaceIdx )
|
||||
{
|
||||
int nbcFaceNodeCount = 0;
|
||||
const int* nbcLocalFaceIndices =
|
||||
RigFemTypes::localElmNodeIndicesForFace( nbcElmType, nbcFaceIdx, &nbcFaceNodeCount );
|
||||
int nbcFaceNodeCount = 0;
|
||||
const int* nbcLocalFaceIndices = RigFemTypes::localElmNodeIndicesForFace( nbcElmType, nbcFaceIdx, &nbcFaceNodeCount );
|
||||
|
||||
// Compare faces
|
||||
if ( fComp.isSameButOposite( nbcElmNodes, nbcLocalFaceIndices, nbcFaceNodeCount ) )
|
||||
@@ -487,8 +486,7 @@ void RigFemPart::findIntersectingCells( const cvf::BoundingBox& inputBB, std::ve
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFemPart::findIntersectingCellsWithExistingSearchTree( const cvf::BoundingBox& inputBB,
|
||||
std::vector<size_t>* elementIndices ) const
|
||||
void RigFemPart::findIntersectingCellsWithExistingSearchTree( const cvf::BoundingBox& inputBB, std::vector<size_t>* elementIndices ) const
|
||||
{
|
||||
CVF_ASSERT( m_elementSearchTree.notNull() );
|
||||
m_elementSearchTree->findIntersections( inputBB, elementIndices );
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
size_t elementNodeResultCount() const;
|
||||
int nodeIdxFromElementNodeResultIdx( size_t elmNodeResultIdx ) const;
|
||||
|
||||
size_t resultValueIdxFromResultPosType( RigFemResultPosEnum resultPosType, int elementIdx, int elmLocalNodeIdx ) const;
|
||||
size_t resultValueIdxFromResultPosType( RigFemResultPosEnum resultPosType, int elementIdx, int elmLocalNodeIdx ) const;
|
||||
RigFemPartNodes& nodes();
|
||||
const RigFemPartNodes& nodes() const;
|
||||
|
||||
@@ -83,9 +83,8 @@ public:
|
||||
cvf::BoundingBox boundingBox() const;
|
||||
float characteristicElementSize() const;
|
||||
const std::vector<int>& possibleGridCornerElements() const;
|
||||
void findIntersectingCells( const cvf::BoundingBox& inputBB, std::vector<size_t>* elementIndices ) const;
|
||||
void findIntersectingCellsWithExistingSearchTree( const cvf::BoundingBox& inputBB,
|
||||
std::vector<size_t>* elementIndices ) const;
|
||||
void findIntersectingCells( const cvf::BoundingBox& inputBB, std::vector<size_t>* elementIndices ) const;
|
||||
void findIntersectingCellsWithExistingSearchTree( const cvf::BoundingBox& inputBB, std::vector<size_t>* elementIndices ) const;
|
||||
|
||||
void ensureIntersectionSearchTreeIsBuilt() const;
|
||||
|
||||
|
||||
@@ -60,8 +60,8 @@ private: // Unused, Not implemented
|
||||
cvf::Vec3d maxCoordinate() const override;
|
||||
bool cellIJKNeighbor( size_t i, size_t j, size_t k, FaceType face, size_t* neighborCellIndex ) const override;
|
||||
|
||||
bool cellIJKFromCoordinate( const cvf::Vec3d& coord, size_t* i, size_t* j, size_t* k ) const override;
|
||||
void cellMinMaxCordinates( size_t cellIndex, cvf::Vec3d* minCoordinate, cvf::Vec3d* maxCoordinate ) const override;
|
||||
bool cellIJKFromCoordinate( const cvf::Vec3d& coord, size_t* i, size_t* j, size_t* k ) const override;
|
||||
void cellMinMaxCordinates( size_t cellIndex, cvf::Vec3d* minCoordinate, cvf::Vec3d* maxCoordinate ) const override;
|
||||
size_t gridPointIndexFromIJK( size_t i, size_t j, size_t k ) const override;
|
||||
cvf::Vec3d gridPointCoordinate( size_t i, size_t j, size_t k ) const override;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPartResultCalculatorBarConverted::RigFemPartResultCalculatorBarConverted( RigFemPartResultsCollection& collection,
|
||||
const std::string& fieldName,
|
||||
const std::string& fieldNameToConvert )
|
||||
const std::string& fieldNameToConvert )
|
||||
: RigFemPartResultCalculator( collection )
|
||||
, m_fieldName( fieldName )
|
||||
, m_fieldNameToConvert( fieldNameToConvert )
|
||||
@@ -67,17 +67,15 @@ bool RigFemPartResultCalculatorBarConverted::isMatching( const RigFemResultAddre
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorBarConverted::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorBarConverted::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 2, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemResultAddress unconvertedResultAddr( resVarAddr.resultPosType, m_fieldNameToConvert, resVarAddr.componentName );
|
||||
RigFemScalarResultFrames* srcDataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, unconvertedResultAddr );
|
||||
RigFemResultAddress unconvertedResultAddr( resVarAddr.resultPosType, m_fieldNameToConvert, resVarAddr.componentName );
|
||||
RigFemScalarResultFrames* srcDataFrames = m_resultCollection->findOrLoadScalarResult( partIndex, unconvertedResultAddr );
|
||||
RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
|
||||
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
@@ -75,8 +75,7 @@ bool RigFemPartResultCalculatorCompaction::isMatching( const RigFemResultAddress
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorCompaction::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorCompaction::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( resVarAddr.fieldName == RigFemPartResultsCollection::FIELD_NAME_COMPACTION );
|
||||
|
||||
@@ -128,11 +127,11 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorCompaction::calculate( int
|
||||
|
||||
cvf::Vec3f currentNodeCoord = part->nodes().coordinates[n];
|
||||
if ( currentNodeCoord.z() >= refElement.intersectionPoint.z() )
|
||||
compactionFrame[n] = -( u3Frames->frameData( stepIdx, fIdx )[n] -
|
||||
u3Frames->frameData( stepIdx, fIdx )[closestRefNodeIdx] );
|
||||
compactionFrame[n] =
|
||||
-( u3Frames->frameData( stepIdx, fIdx )[n] - u3Frames->frameData( stepIdx, fIdx )[closestRefNodeIdx] );
|
||||
else
|
||||
compactionFrame[n] = -( u3Frames->frameData( stepIdx, fIdx )[closestRefNodeIdx] -
|
||||
u3Frames->frameData( stepIdx, fIdx )[n] );
|
||||
compactionFrame[n] =
|
||||
-( u3Frames->frameData( stepIdx, fIdx )[closestRefNodeIdx] - u3Frames->frameData( stepIdx, fIdx )[n] );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -196,10 +195,8 @@ void findReferenceElementForNode( const RigFemPart& part, size_t nodeIdx, size_t
|
||||
{
|
||||
cvf::ubyte faceNodes[4];
|
||||
grid->cellFaceVertexIndices( intersection.m_face, faceNodes );
|
||||
std::vector<size_t> topFaceCoords( { nodeIndices[faceNodes[0]],
|
||||
nodeIndices[faceNodes[1]],
|
||||
nodeIndices[faceNodes[2]],
|
||||
nodeIndices[faceNodes[3]] } );
|
||||
std::vector<size_t> topFaceCoords(
|
||||
{ nodeIndices[faceNodes[0]], nodeIndices[faceNodes[1]], nodeIndices[faceNodes[2]], nodeIndices[faceNodes[3]] } );
|
||||
|
||||
refElement->elementIdx = elemIdx;
|
||||
refElement->intersectionPointToCurrentNodeDistance = nodeToIntersectionDistance;
|
||||
|
||||
@@ -59,8 +59,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorDSM::calculate( int partInde
|
||||
CVF_ASSERT( resVarAddr.fieldName == "SE" && resVarAddr.componentName == "DSM" );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 3, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* se1Frames =
|
||||
|
||||
@@ -59,19 +59,17 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorED::calculate( int partIndex
|
||||
CVF_ASSERT( resVarAddr.fieldName == "NE" && resVarAddr.componentName == "ED" );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 3, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* ea11 = nullptr;
|
||||
RigFemScalarResultFrames* ea33 = nullptr;
|
||||
{
|
||||
ea11 = m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "NE", "E1" ) );
|
||||
ea11 = m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "NE", "E1" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
ea33 = m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "NE", "E3" ) );
|
||||
ea33 = m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "NE", "E3" ) );
|
||||
}
|
||||
|
||||
RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
|
||||
|
||||
@@ -54,17 +54,15 @@ bool RigFemPartResultCalculatorEnIpPorBar::isMatching( const RigFemResultAddress
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Convert POR NODAL result to POR-Bar Element Nodal result
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorEnIpPorBar::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorEnIpPorBar::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 2, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemResultAddress unconvertedResultAddr( RIG_NODAL, "POR", "" );
|
||||
RigFemScalarResultFrames* srcDataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, unconvertedResultAddr );
|
||||
RigFemScalarResultFrames* srcDataFrames = m_resultCollection->findOrLoadScalarResult( partIndex, unconvertedResultAddr );
|
||||
RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
|
||||
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
@@ -59,13 +59,12 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorFOS::calculate( int partInde
|
||||
CVF_ASSERT( resVarAddr.fieldName == "SE" && resVarAddr.componentName == "FOS" );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 2, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* dsmFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "SE", "DSM" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "SE", "DSM" ) );
|
||||
|
||||
RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
|
||||
|
||||
|
||||
@@ -56,12 +56,11 @@ bool RigFemPartResultCalculatorFormationIndices::isMatching( const RigFemResultA
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorFormationIndices::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorFormationIndices::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( 2, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
|
||||
RigFemScalarResultFrames* resFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
|
||||
resFrames->enableAsSingleStepResult();
|
||||
|
||||
@@ -49,9 +49,8 @@ RigFemPartResultCalculatorGamma::~RigFemPartResultCalculatorGamma()
|
||||
bool RigFemPartResultCalculatorGamma::isMatching( const RigFemResultAddress& resVarAddr ) const
|
||||
{
|
||||
return ( resVarAddr.fieldName == "Gamma" &&
|
||||
( resVarAddr.componentName == "Gamma1" || resVarAddr.componentName == "Gamma2" ||
|
||||
resVarAddr.componentName == "Gamma3" || resVarAddr.componentName == "Gamma11" ||
|
||||
resVarAddr.componentName == "Gamma22" || resVarAddr.componentName == "Gamma33" ) );
|
||||
( resVarAddr.componentName == "Gamma1" || resVarAddr.componentName == "Gamma2" || resVarAddr.componentName == "Gamma3" ||
|
||||
resVarAddr.componentName == "Gamma11" || resVarAddr.componentName == "Gamma22" || resVarAddr.componentName == "Gamma33" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -60,8 +59,8 @@ bool RigFemPartResultCalculatorGamma::isMatching( const RigFemResultAddress& res
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorGamma::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 3, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemResultAddress totStressCompAddr( resVarAddr.resultPosType, "ST", "" );
|
||||
@@ -94,12 +93,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorGamma::calculate( int partIn
|
||||
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
calculateGammaFromFrames( partIndex,
|
||||
m_resultCollection->parts(),
|
||||
srcDataFrames,
|
||||
srcPORDataFrames,
|
||||
dstDataFrames,
|
||||
&stepCountProgress );
|
||||
calculateGammaFromFrames( partIndex, m_resultCollection->parts(), srcDataFrames, srcPORDataFrames, dstDataFrames, &stepCountProgress );
|
||||
|
||||
return dstDataFrames;
|
||||
}
|
||||
@@ -107,8 +101,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorGamma::calculate( int partIn
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFemPartResultCalculatorGamma::calculateGammaFromFrames( int partIndex,
|
||||
const RigFemPartCollection* femParts,
|
||||
void RigFemPartResultCalculatorGamma::calculateGammaFromFrames( int partIndex,
|
||||
const RigFemPartCollection* femParts,
|
||||
const RigFemScalarResultFrames* totalStressComponentDataFrames,
|
||||
const RigFemScalarResultFrames* srcPORDataFrames,
|
||||
RigFemScalarResultFrames* dstDataFrames,
|
||||
|
||||
@@ -54,8 +54,7 @@ bool RigFemPartResultCalculatorInitialPorosity::isMatching( const RigFemResultAd
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorInitialPorosity::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorInitialPorosity::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 2, "" );
|
||||
stepCountProgress.setProgressDescription( "Calculating Initial Porosity" );
|
||||
@@ -63,12 +62,10 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorInitialPorosity::calculate(
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* voidRatioFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "VOIDR", "" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "VOIDR", "" ) );
|
||||
|
||||
RigFemScalarResultFrames* porosityFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "PHI0" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "PHI0" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
const RigFemPart* femPart = m_resultCollection->parts()->part( partIndex );
|
||||
|
||||
@@ -56,12 +56,11 @@ bool RigFemPartResultCalculatorKIndices::isMatching( const RigFemResultAddress&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorKIndices::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorKIndices::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( 2, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
|
||||
RigFemScalarResultFrames* resFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
|
||||
resFrames->enableAsSingleStepResult();
|
||||
|
||||
@@ -56,26 +56,23 @@ RigFemPartResultCalculatorMudWeightWindow::~RigFemPartResultCalculatorMudWeightW
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFemPartResultCalculatorMudWeightWindow::isMatching( const RigFemResultAddress& resVarAddr ) const
|
||||
{
|
||||
return ( resVarAddr.fieldName == "MUD-WEIGHT" &&
|
||||
( resVarAddr.componentName == "MWW" || resVarAddr.componentName == "MWM" ||
|
||||
resVarAddr.componentName == "UMWL" || resVarAddr.componentName == "LMWL" ) );
|
||||
return ( resVarAddr.fieldName == "MUD-WEIGHT" && ( resVarAddr.componentName == "MWW" || resVarAddr.componentName == "MWM" ||
|
||||
resVarAddr.componentName == "UMWL" || resVarAddr.componentName == "LMWL" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( isMatching( resVarAddr ) );
|
||||
|
||||
const std::vector<RimMudWeightWindowParameters::ParameterType> parameterTypes =
|
||||
{ RimMudWeightWindowParameters::ParameterType::WELL_DEVIATION,
|
||||
RimMudWeightWindowParameters::ParameterType::WELL_AZIMUTH,
|
||||
RimMudWeightWindowParameters::ParameterType::UCS,
|
||||
RimMudWeightWindowParameters::ParameterType::POISSONS_RATIO,
|
||||
RimMudWeightWindowParameters::ParameterType::K0_FG,
|
||||
RimMudWeightWindowParameters::ParameterType::OBG0 };
|
||||
const std::vector<RimMudWeightWindowParameters::ParameterType> parameterTypes = { RimMudWeightWindowParameters::ParameterType::WELL_DEVIATION,
|
||||
RimMudWeightWindowParameters::ParameterType::WELL_AZIMUTH,
|
||||
RimMudWeightWindowParameters::ParameterType::UCS,
|
||||
RimMudWeightWindowParameters::ParameterType::POISSONS_RATIO,
|
||||
RimMudWeightWindowParameters::ParameterType::K0_FG,
|
||||
RimMudWeightWindowParameters::ParameterType::OBG0 };
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * ( 5 + parameterTypes.size() ), "" );
|
||||
stepCountProgress.setProgressDescription( "Calculating Mud Weight Window" );
|
||||
@@ -85,10 +82,9 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
|
||||
for ( auto parameterType : parameterTypes )
|
||||
{
|
||||
auto task =
|
||||
stepCountProgress.task( "Loading parameter: " +
|
||||
caf::AppEnum<RimMudWeightWindowParameters::ParameterType>::uiText( parameterType ),
|
||||
m_resultCollection->timeStepCount() );
|
||||
auto task = stepCountProgress.task( "Loading parameter: " +
|
||||
caf::AppEnum<RimMudWeightWindowParameters::ParameterType>::uiText( parameterType ),
|
||||
m_resultCollection->timeStepCount() );
|
||||
loadParameterFramesOrValue( parameterType, partIndex, parameterFrames, parameterValues );
|
||||
}
|
||||
|
||||
@@ -97,10 +93,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
|
||||
RimMudWeightWindowParameters::FractureGradientCalculationType fractureGradientCalculationType =
|
||||
m_resultCollection->fractureGradientCalculationTypeMudWeightWindow();
|
||||
RimMudWeightWindowParameters::UpperLimitType upperLimitParameter =
|
||||
m_resultCollection->upperLimitParameterMudWeightWindow();
|
||||
RimMudWeightWindowParameters::LowerLimitType lowerLimitParameter =
|
||||
m_resultCollection->lowerLimitParameterMudWeightWindow();
|
||||
RimMudWeightWindowParameters::UpperLimitType upperLimitParameter = m_resultCollection->upperLimitParameterMudWeightWindow();
|
||||
RimMudWeightWindowParameters::LowerLimitType lowerLimitParameter = m_resultCollection->lowerLimitParameterMudWeightWindow();
|
||||
|
||||
// Pore pressure
|
||||
RigFemScalarResultFrames* porePressureDataFrames = nullptr;
|
||||
@@ -113,33 +107,25 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
// Stress (ST.S3)
|
||||
RigFemScalarResultFrames* stressDataFrames = nullptr;
|
||||
{
|
||||
auto task = stepCountProgress.task( "Loading ST.S3", m_resultCollection->timeStepCount() );
|
||||
stressDataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "ST", "S3" ) );
|
||||
auto task = stepCountProgress.task( "Loading ST.S3", m_resultCollection->timeStepCount() );
|
||||
stressDataFrames = m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "ST", "S3" ) );
|
||||
}
|
||||
|
||||
// Initial overburden gradient (ST.S33)
|
||||
RigFemScalarResultFrames* obg0DataFrames = nullptr;
|
||||
{
|
||||
auto task = stepCountProgress.task( "Loading ST.S33", m_resultCollection->timeStepCount() );
|
||||
obg0DataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "ST", "S33" ) );
|
||||
auto task = stepCountProgress.task( "Loading ST.S33", m_resultCollection->timeStepCount() );
|
||||
obg0DataFrames = m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "ST", "S33" ) );
|
||||
}
|
||||
|
||||
RigFemScalarResultFrames* mudWeightWindowFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "MWW" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "MWW" ) );
|
||||
RigFemScalarResultFrames* mudWeightMiddleFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "MWM" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "MWM" ) );
|
||||
RigFemScalarResultFrames* upperMudWeightLimitFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "UMWL" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "UMWL" ) );
|
||||
RigFemScalarResultFrames* lowerMudWeightLimitFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "LMWL" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "LMWL" ) );
|
||||
|
||||
const RigFemPart* femPart = m_resultCollection->parts()->part( partIndex );
|
||||
const RigFemPartGrid* femPartGrid = femPart->getOrCreateStructGrid();
|
||||
@@ -149,19 +135,15 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
|
||||
RimMudWeightWindowParameters::NonReservoirPorePressureType PP_NonReservoirType =
|
||||
m_resultCollection->nonReservoirPorePressureTypeMudWeightWindow();
|
||||
double hydrostaticMultiplier = m_resultCollection->hydrostaticMultiplierPPNonRes();
|
||||
const QString& nonReservoirAddress = m_resultCollection->nonReservoirPorePressureAddressMudWeightWindow();
|
||||
double hydrostaticMultiplier = m_resultCollection->hydrostaticMultiplierPPNonRes();
|
||||
const QString& nonReservoirAddress = m_resultCollection->nonReservoirPorePressureAddressMudWeightWindow();
|
||||
RigFemScalarResultFrames* nonReservoirResultFrames = nullptr;
|
||||
|
||||
if ( PP_NonReservoirType != RimMudWeightWindowParameters::NonReservoirPorePressureType::HYDROSTATIC &&
|
||||
!nonReservoirAddress.isEmpty() )
|
||||
if ( PP_NonReservoirType != RimMudWeightWindowParameters::NonReservoirPorePressureType::HYDROSTATIC && !nonReservoirAddress.isEmpty() )
|
||||
{
|
||||
auto task = stepCountProgress.task( "Loading non-reservoir pore pressure.", m_resultCollection->timeStepCount() );
|
||||
nonReservoirResultFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_ELEMENT,
|
||||
nonReservoirAddress.toStdString(),
|
||||
"" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT, nonReservoirAddress.toStdString(), "" ) );
|
||||
}
|
||||
|
||||
float inf = std::numeric_limits<float>::infinity();
|
||||
@@ -211,8 +193,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
|
||||
// Load stress
|
||||
RigFemResultAddress stressResAddr( RIG_ELEMENT_NODAL, "ST", "" );
|
||||
std::vector<caf::Ten3f> vertexStressesFloat =
|
||||
m_resultCollection->tensors( stressResAddr, partIndex, stepIdx, fIdx );
|
||||
std::vector<caf::Ten3f> vertexStressesFloat = m_resultCollection->tensors( stressResAddr, partIndex, stepIdx, fIdx );
|
||||
|
||||
std::vector<caf::Ten3d> vertexStresses;
|
||||
vertexStresses.reserve( vertexStressesFloat.size() );
|
||||
@@ -232,46 +213,37 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
cvf::Vec3d cellCentroid = femPartGrid->cellCentroid( elmIdx );
|
||||
double cellCentroidTvdRKB = -cellCentroid.z() + airGap;
|
||||
double waterDensityGCM3 = 1.03;
|
||||
double hydroStaticPressure =
|
||||
RigGeoMechWellLogExtractor::hydroStaticPorePressureAtDepth( cellCentroidTvdRKB, waterDensityGCM3 );
|
||||
double hydroStaticPressure = RigGeoMechWellLogExtractor::hydroStaticPorePressureAtDepth( cellCentroidTvdRKB, waterDensityGCM3 );
|
||||
double hydroStaticPressureForNormalization =
|
||||
RigGeoMechWellLogExtractor::hydroStaticPorePressureAtDepth( cellCentroidTvdRKB, 1.0 );
|
||||
|
||||
if ( isHexahedron && hydroStaticPressureForNormalization != 0.0 )
|
||||
{
|
||||
double wellPathDeviation =
|
||||
getValueForElement( RimMudWeightWindowParameters::ParameterType::WELL_DEVIATION,
|
||||
parameterFrameData,
|
||||
parameterValues,
|
||||
elmIdx );
|
||||
double wellPathDeviation = getValueForElement( RimMudWeightWindowParameters::ParameterType::WELL_DEVIATION,
|
||||
parameterFrameData,
|
||||
parameterValues,
|
||||
elmIdx );
|
||||
|
||||
double wellPathAzimuth = getValueForElement( RimMudWeightWindowParameters::ParameterType::WELL_AZIMUTH,
|
||||
parameterFrameData,
|
||||
parameterValues,
|
||||
elmIdx );
|
||||
|
||||
double ucsBar = getValueForElement( RimMudWeightWindowParameters::ParameterType::UCS,
|
||||
parameterFrameData,
|
||||
parameterValues,
|
||||
elmIdx );
|
||||
double ucsBar =
|
||||
getValueForElement( RimMudWeightWindowParameters::ParameterType::UCS, parameterFrameData, parameterValues, elmIdx );
|
||||
|
||||
double poissonsRatio = getValueForElement( RimMudWeightWindowParameters::ParameterType::POISSONS_RATIO,
|
||||
parameterFrameData,
|
||||
parameterValues,
|
||||
elmIdx );
|
||||
|
||||
double K0_FG = getValueForElement( RimMudWeightWindowParameters::ParameterType::K0_FG,
|
||||
parameterFrameData,
|
||||
parameterValues,
|
||||
elmIdx );
|
||||
double K0_FG =
|
||||
getValueForElement( RimMudWeightWindowParameters::ParameterType::K0_FG, parameterFrameData, parameterValues, elmIdx );
|
||||
|
||||
double OBG0 = 0.0;
|
||||
if ( !OBG0FromGrid )
|
||||
{
|
||||
OBG0 = getValueForElement( RimMudWeightWindowParameters::ParameterType::OBG0,
|
||||
parameterFrameData,
|
||||
parameterValues,
|
||||
elmIdx );
|
||||
OBG0 = getValueForElement( RimMudWeightWindowParameters::ParameterType::OBG0, parameterFrameData, parameterValues, elmIdx );
|
||||
}
|
||||
|
||||
for ( int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx )
|
||||
@@ -296,8 +268,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
if ( porePressureBar == inf )
|
||||
{
|
||||
//
|
||||
if ( PP_NonReservoirType ==
|
||||
RimMudWeightWindowParameters::NonReservoirPorePressureType::HYDROSTATIC )
|
||||
if ( PP_NonReservoirType == RimMudWeightWindowParameters::NonReservoirPorePressureType::HYDROSTATIC )
|
||||
{
|
||||
porePressureBar = hydroStaticPressure * hydrostaticMultiplier;
|
||||
initialPorePressureBar = hydroStaticPressure * hydrostaticMultiplier;
|
||||
@@ -314,8 +285,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
|
||||
cvf::Vec3d wellPathTangent = calculateWellPathTangent( wellPathAzimuth, wellPathDeviation );
|
||||
caf::Ten3d wellPathStressFloat =
|
||||
RigGeoMechWellLogExtractor::transformTensorToWellPathOrientation( wellPathTangent,
|
||||
segmentStress );
|
||||
RigGeoMechWellLogExtractor::transformTensorToWellPathOrientation( wellPathTangent, segmentStress );
|
||||
caf::Ten3d wellPathStressDouble( wellPathStressFloat );
|
||||
|
||||
// Calculate upper limit
|
||||
@@ -346,8 +316,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
}
|
||||
else
|
||||
{
|
||||
upperLimit = stressFrameData[elmNodResIdx] * shMultiplier /
|
||||
hydroStaticPressureForNormalization;
|
||||
upperLimit = stressFrameData[elmNodResIdx] * shMultiplier / hydroStaticPressureForNormalization;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,8 +326,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
{
|
||||
lowerLimit = porePressureBar;
|
||||
}
|
||||
else if ( lowerLimitParameter ==
|
||||
RimMudWeightWindowParameters::LowerLimitType::MAX_OF_PORE_PRESSURE_AND_SFG )
|
||||
else if ( lowerLimitParameter == RimMudWeightWindowParameters::LowerLimitType::MAX_OF_PORE_PRESSURE_AND_SFG )
|
||||
{
|
||||
if ( isSand )
|
||||
{
|
||||
@@ -429,8 +397,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
size_t kElmIdx = femPartGrid->cellIndexFromIJK( i, j, currentK );
|
||||
if ( kElmIdx != cvf::UNDEFINED_SIZE_T && femPart->isHexahedron( kElmIdx ) )
|
||||
{
|
||||
size_t kElmNodResIdx =
|
||||
femPart->elementNodeResultIdx( static_cast<int>( kElmIdx ), elmNodIdx );
|
||||
size_t kElmNodResIdx = femPart->elementNodeResultIdx( static_cast<int>( kElmIdx ), elmNodIdx );
|
||||
|
||||
float currentLowerMudWeightLimit = lowerMudWeightLimitFrameData[kElmNodResIdx];
|
||||
if ( currentLowerMudWeightLimit > maxLowerMudWeightLimit )
|
||||
@@ -491,8 +458,7 @@ void RigFemPartResultCalculatorMudWeightWindow::loadParameterFramesOrValue(
|
||||
if ( !resultAddress.isEmpty() )
|
||||
{
|
||||
resultFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_ELEMENT, resultAddress.toStdString(), "" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT, resultAddress.toStdString(), "" ) );
|
||||
parameterFrames[parameterType] = resultFrames;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,20 +44,18 @@ public:
|
||||
cvf::Vec3d calculateWellPathTangent( double azimuth, double inclination );
|
||||
|
||||
private:
|
||||
void loadParameterFramesOrValue( RimMudWeightWindowParameters::ParameterType parameterType,
|
||||
int partIndex,
|
||||
void loadParameterFramesOrValue( RimMudWeightWindowParameters::ParameterType parameterType,
|
||||
int partIndex,
|
||||
std::map<RimMudWeightWindowParameters::ParameterType, RigFemScalarResultFrames*>& parameterFrames,
|
||||
std::map<RimMudWeightWindowParameters::ParameterType, float>& parameterValues );
|
||||
std::map<RimMudWeightWindowParameters::ParameterType, float>& parameterValues );
|
||||
|
||||
static std::vector<float>
|
||||
loadDataForFrame( RimMudWeightWindowParameters::ParameterType parameterType,
|
||||
std::map<RimMudWeightWindowParameters::ParameterType, RigFemScalarResultFrames*>& parameterFrames,
|
||||
int stepIndex,
|
||||
int frameIndex );
|
||||
static std::vector<float> loadDataForFrame( RimMudWeightWindowParameters::ParameterType parameterType,
|
||||
std::map<RimMudWeightWindowParameters::ParameterType, RigFemScalarResultFrames*>& parameterFrames,
|
||||
int stepIndex,
|
||||
int frameIndex );
|
||||
|
||||
static float
|
||||
getValueForElement( RimMudWeightWindowParameters::ParameterType parameterType,
|
||||
const std::map<RimMudWeightWindowParameters::ParameterType, std::vector<float>>& parameterFrameData,
|
||||
const std::map<RimMudWeightWindowParameters::ParameterType, float> parameterValues,
|
||||
int elmIdx );
|
||||
static float getValueForElement( RimMudWeightWindowParameters::ParameterType parameterType,
|
||||
const std::map<RimMudWeightWindowParameters::ParameterType, std::vector<float>>& parameterFrameData,
|
||||
const std::map<RimMudWeightWindowParameters::ParameterType, float> parameterValues,
|
||||
int elmIdx );
|
||||
};
|
||||
|
||||
@@ -49,9 +49,8 @@ RigFemPartResultCalculatorNE::~RigFemPartResultCalculatorNE()
|
||||
bool RigFemPartResultCalculatorNE::isMatching( const RigFemResultAddress& resVarAddr ) const
|
||||
{
|
||||
return ( ( resVarAddr.fieldName == "NE" ) &&
|
||||
( resVarAddr.componentName == "E11" || resVarAddr.componentName == "E22" ||
|
||||
resVarAddr.componentName == "E33" || resVarAddr.componentName == "E12" ||
|
||||
resVarAddr.componentName == "E13" || resVarAddr.componentName == "E23" ) );
|
||||
( resVarAddr.componentName == "E11" || resVarAddr.componentName == "E22" || resVarAddr.componentName == "E33" ||
|
||||
resVarAddr.componentName == "E12" || resVarAddr.componentName == "E13" || resVarAddr.componentName == "E23" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -60,15 +59,12 @@ bool RigFemPartResultCalculatorNE::isMatching( const RigFemResultAddress& resVar
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorNE::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 2, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* srcDataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
"E",
|
||||
resVarAddr.componentName ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "E", resVarAddr.componentName ) );
|
||||
RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
|
||||
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
@@ -56,15 +56,14 @@ bool RigFemPartResultCalculatorNodalGradients::isMatching( const RigFemResultAdd
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorNodalGradients::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorNodalGradients::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( resVarAddr.fieldName == "POR-Bar" );
|
||||
CVF_ASSERT( resVarAddr.componentName == "X" || resVarAddr.componentName == "Y" || resVarAddr.componentName == "Z" );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 5, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating gradient: " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating gradient: " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* dataFramesX =
|
||||
@@ -133,9 +132,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNodalGradients::calculate( i
|
||||
int elmNodeCount = RigFemTypes::elementNodeCount( elmType );
|
||||
for ( int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx )
|
||||
{
|
||||
size_t elmNodResIdx = femPart->elementNodeResultIdx( elmIdx, elmNodIdx );
|
||||
size_t resultValueIdx =
|
||||
femPart->resultValueIdxFromResultPosType( RIG_NODAL, elmIdx, elmNodIdx );
|
||||
size_t elmNodResIdx = femPart->elementNodeResultIdx( elmIdx, elmNodIdx );
|
||||
size_t resultValueIdx = femPart->resultValueIdxFromResultPosType( RIG_NODAL, elmIdx, elmNodIdx );
|
||||
|
||||
cornerValues[elmNodIdx] = srcFrameData[resultValueIdx];
|
||||
hexCorners[elmNodIdx] = cvf::Vec3d( nodeCoords[resultValueIdx] );
|
||||
@@ -145,9 +143,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNodalGradients::calculate( i
|
||||
|
||||
for ( int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx )
|
||||
{
|
||||
size_t elmNodResIdx = femPart->elementNodeResultIdx( elmIdx, elmNodIdx );
|
||||
size_t resultValueIdx =
|
||||
femPart->resultValueIdxFromResultPosType( RIG_NODAL, elmIdx, elmNodIdx );
|
||||
size_t elmNodResIdx = femPart->elementNodeResultIdx( elmIdx, elmNodIdx );
|
||||
size_t resultValueIdx = femPart->resultValueIdxFromResultPosType( RIG_NODAL, elmIdx, elmNodIdx );
|
||||
// Only use the gradient for particular corner corresponding to the node
|
||||
if ( static_cast<size_t>( nodeIdx ) == resultValueIdx )
|
||||
{
|
||||
|
||||
@@ -48,26 +48,23 @@ RigFemPartResultCalculatorNormalSE::~RigFemPartResultCalculatorNormalSE()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFemPartResultCalculatorNormalSE::isMatching( const RigFemResultAddress& resVarAddr ) const
|
||||
{
|
||||
return ( ( resVarAddr.fieldName == "SE" ) && ( resVarAddr.componentName == "S11" || resVarAddr.componentName == "S22" ||
|
||||
resVarAddr.componentName == "S33" ) );
|
||||
return ( ( resVarAddr.fieldName == "SE" ) &&
|
||||
( resVarAddr.componentName == "S11" || resVarAddr.componentName == "S22" || resVarAddr.componentName == "S33" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorNormalSE::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorNormalSE::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 3, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* srcDataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
"S-Bar",
|
||||
resVarAddr.componentName ) );
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "S-Bar", resVarAddr.componentName ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
|
||||
|
||||
@@ -48,26 +48,23 @@ RigFemPartResultCalculatorNormalST::~RigFemPartResultCalculatorNormalST()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFemPartResultCalculatorNormalST::isMatching( const RigFemResultAddress& resVarAddr ) const
|
||||
{
|
||||
return ( ( resVarAddr.fieldName == "ST" ) && ( resVarAddr.componentName == "S11" || resVarAddr.componentName == "S22" ||
|
||||
resVarAddr.componentName == "S33" ) );
|
||||
return ( ( resVarAddr.fieldName == "ST" ) &&
|
||||
( resVarAddr.componentName == "S11" || resVarAddr.componentName == "S22" || resVarAddr.componentName == "S33" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorNormalST::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorNormalST::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 3, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* srcSDataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
"S-Bar",
|
||||
resVarAddr.componentName ) );
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "S-Bar", resVarAddr.componentName ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
|
||||
@@ -51,15 +51,13 @@ RigFemPartResultCalculatorNormalized::~RigFemPartResultCalculatorNormalized()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFemPartResultCalculatorNormalized::isMatching( const RigFemResultAddress& resVarAddr ) const
|
||||
{
|
||||
return ( resVarAddr.normalizeByHydrostaticPressure() &&
|
||||
RigFemPartResultsCollection::isNormalizableResult( resVarAddr ) );
|
||||
return ( resVarAddr.normalizeByHydrostaticPressure() && RigFemPartResultsCollection::isNormalizableResult( resVarAddr ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorNormalized::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorNormalized::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( resVarAddr.normalizeByHydrostaticPressure() && isNormalizableResult( resVarAddr ) );
|
||||
|
||||
@@ -77,9 +75,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNormalized::calculate( int
|
||||
RigFemScalarResultFrames* dstDataFrames = nullptr;
|
||||
|
||||
{
|
||||
auto task = stepCountProgress.task( "Loading POR Result", m_resultCollection->timeStepCount() );
|
||||
porDataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT_NODAL, "POR-Bar", "" ) );
|
||||
auto task = stepCountProgress.task( "Loading POR Result", m_resultCollection->timeStepCount() );
|
||||
porDataFrames = m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT_NODAL, "POR-Bar", "" ) );
|
||||
if ( !porDataFrames ) return nullptr;
|
||||
}
|
||||
|
||||
@@ -89,7 +86,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNormalized::calculate( int
|
||||
if ( !srcDataFrames ) return nullptr;
|
||||
}
|
||||
{
|
||||
auto task = stepCountProgress.task( "Creating Space for Normalized Result", m_resultCollection->timeStepCount() );
|
||||
auto task = stepCountProgress.task( "Creating Space for Normalized Result", m_resultCollection->timeStepCount() );
|
||||
dstDataFrames = m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr ) );
|
||||
if ( !dstDataFrames ) return nullptr;
|
||||
}
|
||||
@@ -142,22 +139,19 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNormalized::calculate( int
|
||||
// This is in the POR-region. Use hydrostatic pressure from the individual nodes
|
||||
for ( int elmLocalNodeIdx = 0; elmLocalNodeIdx < 8; ++elmLocalNodeIdx )
|
||||
{
|
||||
size_t elmNodeResIdx = femPart->elementNodeResultIdx( elmIdx, elmLocalNodeIdx );
|
||||
const int nodeIdx = femPart->nodeIdxFromElementNodeResultIdx( elmNodeResIdx );
|
||||
double tvdRKB = std::abs( nodeCoords[nodeIdx].z() ) +
|
||||
m_resultCollection->normalizationAirGap();
|
||||
double hydrostaticPressure = RiaWellLogUnitTools<double>::hydrostaticPorePressureBar( tvdRKB );
|
||||
size_t elmNodeResIdx = femPart->elementNodeResultIdx( elmIdx, elmLocalNodeIdx );
|
||||
const int nodeIdx = femPart->nodeIdxFromElementNodeResultIdx( elmNodeResIdx );
|
||||
double tvdRKB = std::abs( nodeCoords[nodeIdx].z() ) + m_resultCollection->normalizationAirGap();
|
||||
double hydrostaticPressure = RiaWellLogUnitTools<double>::hydrostaticPorePressureBar( tvdRKB );
|
||||
dstFrameData[elmNodeResIdx] /= hydrostaticPressure;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Over/under/sideburden. Use hydrostatic pressure from cell centroid.
|
||||
cvf::Vec3d cellCentroid = femPartGrid->cellCentroid( elmIdx );
|
||||
double cellCentroidTvdRKB = std::abs( cellCentroid.z() ) +
|
||||
m_resultCollection->normalizationAirGap();
|
||||
double cellCenterHydroStaticPressure =
|
||||
RiaWellLogUnitTools<double>::hydrostaticPorePressureBar( cellCentroidTvdRKB );
|
||||
cvf::Vec3d cellCentroid = femPartGrid->cellCentroid( elmIdx );
|
||||
double cellCentroidTvdRKB = std::abs( cellCentroid.z() ) + m_resultCollection->normalizationAirGap();
|
||||
double cellCenterHydroStaticPressure = RiaWellLogUnitTools<double>::hydrostaticPorePressureBar( cellCentroidTvdRKB );
|
||||
|
||||
for ( int elmLocalNodeIdx = 0; elmLocalNodeIdx < 8; ++elmLocalNodeIdx )
|
||||
{
|
||||
|
||||
@@ -52,19 +52,16 @@ RigFemPartResultCalculatorPoreCompressibility::~RigFemPartResultCalculatorPoreCo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFemPartResultCalculatorPoreCompressibility::isMatching( const RigFemResultAddress& resVarAddr ) const
|
||||
{
|
||||
return ( resVarAddr.fieldName == "COMPRESSIBILITY" &&
|
||||
( resVarAddr.componentName == "PORE" || resVarAddr.componentName == "VERTICAL" ||
|
||||
resVarAddr.componentName == "VERTICAL-RATIO" ) );
|
||||
return ( resVarAddr.fieldName == "COMPRESSIBILITY" && ( resVarAddr.componentName == "PORE" || resVarAddr.componentName == "VERTICAL" ||
|
||||
resVarAddr.componentName == "VERTICAL-RATIO" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorPoreCompressibility::calculate( int partIndex,
|
||||
const RigFemResultAddress& resAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorPoreCompressibility::calculate( int partIndex, const RigFemResultAddress& resAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( static_cast<size_t>( m_resultCollection->timeStepCount() ) * 7,
|
||||
"Calculating Pore Compressibility" );
|
||||
caf::ProgressInfo stepCountProgress( static_cast<size_t>( m_resultCollection->timeStepCount() ) * 7, "Calculating Pore Compressibility" );
|
||||
|
||||
auto loadFrameLambda = [&]( RigFemResultAddress addr, const QString& errMsg = "" ) -> RigFemScalarResultFrames* {
|
||||
auto task = stepCountProgress.task( QString( "Loading %1: %2" )
|
||||
@@ -86,46 +83,36 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorPoreCompressibility::calcula
|
||||
RigFemScalarResultFrames* srcEVDataFrames = loadFrameLambda( RigFemResultAddress( resAddr.resultPosType, "NE", "EV" ) );
|
||||
|
||||
// Vertical Strain
|
||||
RigFemScalarResultFrames* verticalStrainDataFrames =
|
||||
loadFrameLambda( RigFemResultAddress( resAddr.resultPosType, "NE", "E33" ) );
|
||||
RigFemScalarResultFrames* verticalStrainDataFrames = loadFrameLambda( RigFemResultAddress( resAddr.resultPosType, "NE", "E33" ) );
|
||||
|
||||
// Biot porelastic coefficient (alpha)
|
||||
RigFemScalarResultFrames* biotCoefficient = nullptr;
|
||||
if ( !m_resultCollection->biotResultAddress().isEmpty() )
|
||||
{
|
||||
biotCoefficient = loadFrameLambda(
|
||||
RigFemResultAddress( RIG_ELEMENT, m_resultCollection->biotResultAddress().toStdString(), "" ) );
|
||||
biotCoefficient = loadFrameLambda( RigFemResultAddress( RIG_ELEMENT, m_resultCollection->biotResultAddress().toStdString(), "" ) );
|
||||
}
|
||||
|
||||
QString youngsErrMsg = QString( "Failed to compute %1\n" ).arg( QString::fromStdString( resAddr.componentName ) );
|
||||
youngsErrMsg += "Missing Young's Modulus element data (MODULUS)";
|
||||
|
||||
RigFemScalarResultFrames* youngsModuliFrames =
|
||||
loadFrameLambda( RigFemResultAddress( RIG_ELEMENT, "MODULUS", "" ), youngsErrMsg );
|
||||
RigFemScalarResultFrames* youngsModuliFrames = loadFrameLambda( RigFemResultAddress( RIG_ELEMENT, "MODULUS", "" ), youngsErrMsg );
|
||||
if ( !youngsModuliFrames ) return nullptr;
|
||||
|
||||
QString poissonError = QString( "Failed to compute %1\n" ).arg( QString::fromStdString( resAddr.componentName ) );
|
||||
poissonError += "Missing Poisson Ratio element data (RATIO)";
|
||||
|
||||
RigFemScalarResultFrames* poissonRatioFrames =
|
||||
loadFrameLambda( RigFemResultAddress( RIG_ELEMENT, "RATIO", "" ), poissonError );
|
||||
RigFemScalarResultFrames* poissonRatioFrames = loadFrameLambda( RigFemResultAddress( RIG_ELEMENT, "RATIO", "" ), poissonError );
|
||||
if ( !poissonRatioFrames ) return nullptr;
|
||||
|
||||
RigFemScalarResultFrames* voidRatioFrames =
|
||||
loadFrameLambda( RigFemResultAddress( resAddr.resultPosType, "VOIDR", "" ) );
|
||||
RigFemScalarResultFrames* voidRatioFrames = loadFrameLambda( RigFemResultAddress( resAddr.resultPosType, "VOIDR", "" ) );
|
||||
|
||||
RigFemScalarResultFrames* poreCompressibilityFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resAddr.resultPosType, resAddr.fieldName, "PORE" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resAddr.resultPosType, resAddr.fieldName, "PORE" ) );
|
||||
|
||||
RigFemScalarResultFrames* verticalCompressibilityFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resAddr.resultPosType, resAddr.fieldName, "VERTICAL" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resAddr.resultPosType, resAddr.fieldName, "VERTICAL" ) );
|
||||
RigFemScalarResultFrames* verticalCompressibilityRatioFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resAddr.resultPosType,
|
||||
resAddr.fieldName,
|
||||
"VERTICAL-RATIO" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resAddr.resultPosType, resAddr.fieldName, "VERTICAL-RATIO" ) );
|
||||
|
||||
const RigFemPart* femPart = m_resultCollection->parts()->part( partIndex );
|
||||
float inf = std::numeric_limits<float>::infinity();
|
||||
@@ -141,11 +128,10 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorPoreCompressibility::calcula
|
||||
const int frameCount = srcEVDataFrames->frameCount( stepIdx );
|
||||
for ( int fIdx = 0; fIdx < frameCount; fIdx++ )
|
||||
{
|
||||
const std::vector<float>& evData = srcEVDataFrames->frameData( stepIdx, fIdx );
|
||||
const std::vector<float>& referenceEvData = srcEVDataFrames->frameData( refStepIdx, refFrameIdx );
|
||||
const std::vector<float>& verticalStrainData = verticalStrainDataFrames->frameData( stepIdx, fIdx );
|
||||
const std::vector<float>& referenceVerticalStrainData =
|
||||
verticalStrainDataFrames->frameData( refStepIdx, refFrameIdx );
|
||||
const std::vector<float>& evData = srcEVDataFrames->frameData( stepIdx, fIdx );
|
||||
const std::vector<float>& referenceEvData = srcEVDataFrames->frameData( refStepIdx, refFrameIdx );
|
||||
const std::vector<float>& verticalStrainData = verticalStrainDataFrames->frameData( stepIdx, fIdx );
|
||||
const std::vector<float>& referenceVerticalStrainData = verticalStrainDataFrames->frameData( refStepIdx, refFrameIdx );
|
||||
|
||||
const std::vector<float>& youngsModuliData = youngsModuliFrames->frameData( stepIdx, fIdx );
|
||||
const std::vector<float>& poissonRatioData = poissonRatioFrames->frameData( stepIdx, fIdx );
|
||||
@@ -153,11 +139,9 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorPoreCompressibility::calcula
|
||||
const std::vector<float>& referencePorFrameData = srcPORDataFrames->frameData( refStepIdx, refFrameIdx );
|
||||
const std::vector<float>& porFrameData = srcPORDataFrames->frameData( stepIdx, fIdx );
|
||||
|
||||
std::vector<float>& poreCompressibilityFrameData = poreCompressibilityFrames->frameData( stepIdx, fIdx );
|
||||
std::vector<float>& verticalCompressibilityFrameData =
|
||||
verticalCompressibilityFrames->frameData( stepIdx, fIdx );
|
||||
std::vector<float>& verticalCompressibilityRatioFrameData =
|
||||
verticalCompressibilityRatioFrames->frameData( stepIdx, fIdx );
|
||||
std::vector<float>& poreCompressibilityFrameData = poreCompressibilityFrames->frameData( stepIdx, fIdx );
|
||||
std::vector<float>& verticalCompressibilityFrameData = verticalCompressibilityFrames->frameData( stepIdx, fIdx );
|
||||
std::vector<float>& verticalCompressibilityRatioFrameData = verticalCompressibilityRatioFrames->frameData( stepIdx, fIdx );
|
||||
|
||||
size_t valCount = evData.size();
|
||||
poreCompressibilityFrameData.resize( valCount );
|
||||
@@ -216,8 +200,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorPoreCompressibility::calcula
|
||||
|
||||
// Calculate bulk modulus for solids (grains).
|
||||
// Incoming unit for Young's Modulus is GPa: convert to Pa.
|
||||
double poissonRatio = poissonRatioData[elmIdx];
|
||||
double youngsModuli = RiaEclipseUnitTools::gigaPascalToPascal( youngsModuliData[elmIdx] );
|
||||
double poissonRatio = poissonRatioData[elmIdx];
|
||||
double youngsModuli = RiaEclipseUnitTools::gigaPascalToPascal( youngsModuliData[elmIdx] );
|
||||
double bulkModulusFrame = youngsModuli / ( 3.0 * ( 1.0 - 2.0 * poissonRatio ) );
|
||||
double bulkModulus = bulkModulusFrame / ( 1.0 - biotCoefficient );
|
||||
|
||||
@@ -229,8 +213,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorPoreCompressibility::calcula
|
||||
// and convert unit from Bar to Pascal.
|
||||
double referencePorePressure = referencePorFrameData[nodeIdx];
|
||||
double framePorePressure = porFrameData[nodeIdx];
|
||||
double deltaPorePressure =
|
||||
RiaEclipseUnitTools::barToPascal( framePorePressure - referencePorePressure );
|
||||
double deltaPorePressure = RiaEclipseUnitTools::barToPascal( framePorePressure - referencePorePressure );
|
||||
|
||||
// Calculate pore compressibility
|
||||
double poreCompressibility = inf;
|
||||
@@ -253,16 +236,14 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorPoreCompressibility::calcula
|
||||
|
||||
if ( biotCoefficient != 0.0 && deltaPorePressure != 0.0 )
|
||||
{
|
||||
double deltaStrain = verticalStrainData[elmNodResIdx] -
|
||||
referenceVerticalStrainData[elmNodResIdx];
|
||||
double deltaStrain = verticalStrainData[elmNodResIdx] - referenceVerticalStrainData[elmNodResIdx];
|
||||
|
||||
// Calculate vertical compressibility (unit: 1/Pa)
|
||||
verticalCompressibility = -deltaStrain / ( biotCoefficient * deltaPorePressure );
|
||||
|
||||
// Calculate vertical compressibility ratio
|
||||
verticalCompressibilityRatio =
|
||||
( verticalCompressibility * youngsModuli * ( 1.0 - poissonRatio ) ) /
|
||||
( ( 1.0 + poissonRatio ) * ( 1.0 - 2.0 * poissonRatio ) );
|
||||
verticalCompressibilityRatio = ( verticalCompressibility * youngsModuli * ( 1.0 - poissonRatio ) ) /
|
||||
( ( 1.0 + poissonRatio ) * ( 1.0 - 2.0 * poissonRatio ) );
|
||||
}
|
||||
|
||||
// Convert from 1/Pa to 1/GPa
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPartResultCalculatorPorosityPermeability::RigFemPartResultCalculatorPorosityPermeability(
|
||||
RigFemPartResultsCollection& collection )
|
||||
RigFemPartResultCalculatorPorosityPermeability::RigFemPartResultCalculatorPorosityPermeability( RigFemPartResultsCollection& collection )
|
||||
: RigFemPartResultCalculator( collection )
|
||||
{
|
||||
}
|
||||
@@ -54,15 +53,13 @@ RigFemPartResultCalculatorPorosityPermeability::~RigFemPartResultCalculatorPoros
|
||||
bool RigFemPartResultCalculatorPorosityPermeability::isMatching( const RigFemResultAddress& resVarAddr ) const
|
||||
{
|
||||
return ( resVarAddr.fieldName == "PORO-PERM" &&
|
||||
( resVarAddr.componentName == "PHI" || resVarAddr.componentName == "DPHI" ||
|
||||
resVarAddr.componentName == "PERM" ) );
|
||||
( resVarAddr.componentName == "PHI" || resVarAddr.componentName == "DPHI" || resVarAddr.componentName == "PERM" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames*
|
||||
RigFemPartResultCalculatorPorosityPermeability::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorPorosityPermeability::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 6, "" );
|
||||
stepCountProgress.setProgressDescription( "Calculating Porosity/Permeability" );
|
||||
@@ -83,8 +80,7 @@ RigFemScalarResultFrames*
|
||||
// Pore Compressibility
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* poreCompressibilityFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "COMPRESSIBILITY", "PORE" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "COMPRESSIBILITY", "PORE" ) );
|
||||
if ( poreCompressibilityFrames->frameData( 0, 0 ).empty() )
|
||||
{
|
||||
QString txt = QString( "Failed to compute %1\n" ).arg( QString::fromStdString( resVarAddr.componentName ) );
|
||||
@@ -103,29 +99,24 @@ RigFemScalarResultFrames*
|
||||
if ( !m_resultCollection->initialPermeabilityAddress().isEmpty() )
|
||||
{
|
||||
initialPermeabilityFrames =
|
||||
m_resultCollection
|
||||
->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_ELEMENT,
|
||||
m_resultCollection->initialPermeabilityAddress().toStdString(),
|
||||
"" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_ELEMENT,
|
||||
m_resultCollection->initialPermeabilityAddress().toStdString(),
|
||||
"" ) );
|
||||
}
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* voidRatioFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "VOIDR", "" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "VOIDR", "" ) );
|
||||
|
||||
RigFemScalarResultFrames* porosityFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "PHI" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "PHI" ) );
|
||||
RigFemScalarResultFrames* porosityDeltaFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "DPHI" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "DPHI" ) );
|
||||
RigFemScalarResultFrames* permeabilityFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "PERM" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "PERM" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
const RigFemPart* femPart = m_resultCollection->parts()->part( partIndex );
|
||||
@@ -142,11 +133,11 @@ RigFemScalarResultFrames*
|
||||
const int frameCount = srcEVDataFrames->frameCount( stepIdx );
|
||||
for ( int fIdx = 0; fIdx < frameCount; fIdx++ )
|
||||
{
|
||||
const std::vector<float>& evData = srcEVDataFrames->frameData( stepIdx, fIdx );
|
||||
const std::vector<float>& referenceEvData = srcEVDataFrames->frameData( refStepIdx, refFrameIdx );
|
||||
const std::vector<float>& voidRatioData = voidRatioFrames->frameData( 0, 0 );
|
||||
const std::vector<float>& refPorFrameData = srcPorePressureDataFrames->frameData( refStepIdx, refFrameIdx );
|
||||
const std::vector<float>& porFrameData = srcPorePressureDataFrames->frameData( stepIdx, fIdx );
|
||||
const std::vector<float>& evData = srcEVDataFrames->frameData( stepIdx, fIdx );
|
||||
const std::vector<float>& referenceEvData = srcEVDataFrames->frameData( refStepIdx, refFrameIdx );
|
||||
const std::vector<float>& voidRatioData = voidRatioFrames->frameData( 0, 0 );
|
||||
const std::vector<float>& refPorFrameData = srcPorePressureDataFrames->frameData( refStepIdx, refFrameIdx );
|
||||
const std::vector<float>& porFrameData = srcPorePressureDataFrames->frameData( stepIdx, fIdx );
|
||||
const std::vector<float>& poreCompressibilityFrameData = poreCompressibilityFrames->frameData( stepIdx, fIdx );
|
||||
|
||||
std::vector<float>& porosityFrameData = porosityFrames->frameData( stepIdx, fIdx );
|
||||
@@ -208,8 +199,7 @@ RigFemScalarResultFrames*
|
||||
// and convert unit from Bar to Pascal.
|
||||
double referencePorePressure = refPorFrameData[nodeIdx];
|
||||
double framePorePressure = porFrameData[nodeIdx];
|
||||
double deltaPorePressure =
|
||||
RiaEclipseUnitTools::barToPascal( framePorePressure - referencePorePressure );
|
||||
double deltaPorePressure = RiaEclipseUnitTools::barToPascal( framePorePressure - referencePorePressure );
|
||||
|
||||
// Pore compressibility. Convert from 1/GPa to 1/Pa.
|
||||
double poreCompressibility = poreCompressibilityFrameData[elmNodResIdx] / 1.0e9;
|
||||
@@ -226,8 +216,7 @@ RigFemScalarResultFrames*
|
||||
|
||||
// Permeability. Formula from Petunin, 2011.
|
||||
double permeabilityExponent = m_resultCollection->permeabilityExponent();
|
||||
double permeability = initialPermeability *
|
||||
std::pow( currentPorosity / initialPorosity, permeabilityExponent );
|
||||
double permeability = initialPermeability * std::pow( currentPorosity / initialPorosity, permeabilityExponent );
|
||||
|
||||
porosityFrameData[elmNodResIdx] = currentPorosity;
|
||||
porosityDeltaFrameData[elmNodResIdx] = deltaPorosity;
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPartResultCalculatorPrincipalStrain::RigFemPartResultCalculatorPrincipalStrain( RigFemPartResultsCollection& collection,
|
||||
const std::string fieldName,
|
||||
const std::string componentPrefix )
|
||||
const std::string fieldName,
|
||||
const std::string componentPrefix )
|
||||
: RigFemPartResultCalculator( collection )
|
||||
, m_fieldName( fieldName )
|
||||
, m_componentPrefix( componentPrefix )
|
||||
@@ -67,8 +67,7 @@ bool RigFemPartResultCalculatorPrincipalStrain::isMatching( const RigFemResultAd
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorPrincipalStrain::calculate( int partIndex,
|
||||
const RigFemResultAddress& resAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorPrincipalStrain::calculate( int partIndex, const RigFemResultAddress& resAddr )
|
||||
{
|
||||
CVF_ASSERT( resAddr.componentName == m_componentNames[0] || resAddr.componentName == m_componentNames[1] ||
|
||||
resAddr.componentName == m_componentNames[2] );
|
||||
@@ -78,8 +77,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorPrincipalStrain::calculate(
|
||||
caf::ProgressInfo stepCountProgress( static_cast<size_t>( m_resultCollection->timeStepCount() ) * 7, progressText );
|
||||
|
||||
auto loadFrameLambda = [&]( const std::string& component ) {
|
||||
auto task = stepCountProgress.task( QString::fromStdString( "Loading " + component ),
|
||||
m_resultCollection->timeStepCount() );
|
||||
auto task = stepCountProgress.task( QString::fromStdString( "Loading " + component ), m_resultCollection->timeStepCount() );
|
||||
return m_resultCollection->findOrLoadScalarResult( partIndex, resAddr.copyWithComponent( component ) );
|
||||
};
|
||||
|
||||
@@ -90,12 +88,9 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorPrincipalStrain::calculate(
|
||||
RigFemScalarResultFrames* e13Frames = loadFrameLambda( m_componentPrefix + "13" );
|
||||
RigFemScalarResultFrames* e23Frames = loadFrameLambda( m_componentPrefix + "23" );
|
||||
|
||||
RigFemScalarResultFrames* e1Frames =
|
||||
m_resultCollection->createScalarResult( partIndex, resAddr.copyWithComponent( m_componentNames[0] ) );
|
||||
RigFemScalarResultFrames* e2Frames =
|
||||
m_resultCollection->createScalarResult( partIndex, resAddr.copyWithComponent( m_componentNames[1] ) );
|
||||
RigFemScalarResultFrames* e3Frames =
|
||||
m_resultCollection->createScalarResult( partIndex, resAddr.copyWithComponent( m_componentNames[2] ) );
|
||||
RigFemScalarResultFrames* e1Frames = m_resultCollection->createScalarResult( partIndex, resAddr.copyWithComponent( m_componentNames[0] ) );
|
||||
RigFemScalarResultFrames* e2Frames = m_resultCollection->createScalarResult( partIndex, resAddr.copyWithComponent( m_componentNames[1] ) );
|
||||
RigFemScalarResultFrames* e3Frames = m_resultCollection->createScalarResult( partIndex, resAddr.copyWithComponent( m_componentNames[2] ) );
|
||||
|
||||
const int timeSteps = e11Frames->timeStepCount();
|
||||
for ( int stepIdx = 0; stepIdx < timeSteps; stepIdx++ )
|
||||
|
||||
@@ -52,96 +52,66 @@ bool RigFemPartResultCalculatorPrincipalStress::isMatching( const RigFemResultAd
|
||||
{
|
||||
return ( ( resVarAddr.fieldName == "SE" || resVarAddr.fieldName == "ST" ) &&
|
||||
( resVarAddr.componentName == "S1" || resVarAddr.componentName == "S2" || resVarAddr.componentName == "S3" ||
|
||||
resVarAddr.componentName == "S1inc" || resVarAddr.componentName == "S1azi" ||
|
||||
resVarAddr.componentName == "S2inc" || resVarAddr.componentName == "S2azi" ||
|
||||
resVarAddr.componentName == "S3inc" || resVarAddr.componentName == "S3azi" ) );
|
||||
resVarAddr.componentName == "S1inc" || resVarAddr.componentName == "S1azi" || resVarAddr.componentName == "S2inc" ||
|
||||
resVarAddr.componentName == "S2azi" || resVarAddr.componentName == "S3inc" || resVarAddr.componentName == "S3azi" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorPrincipalStress::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorPrincipalStress::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( resVarAddr.componentName == "S1" || resVarAddr.componentName == "S2" || resVarAddr.componentName == "S3" ||
|
||||
resVarAddr.componentName == "S1inc" || resVarAddr.componentName == "S1azi" ||
|
||||
resVarAddr.componentName == "S2inc" || resVarAddr.componentName == "S2azi" ||
|
||||
resVarAddr.componentName == "S3inc" || resVarAddr.componentName == "S3azi" );
|
||||
resVarAddr.componentName == "S1inc" || resVarAddr.componentName == "S1azi" || resVarAddr.componentName == "S2inc" ||
|
||||
resVarAddr.componentName == "S2azi" || resVarAddr.componentName == "S3inc" || resVarAddr.componentName == "S3azi" );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 7, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* s11Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S11" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S11" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* s22Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S22" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S22" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* s33Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S33" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S33" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* s12Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S12" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S12" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* s13Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S13" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S13" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* s23Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S23" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S23" ) );
|
||||
|
||||
RigFemScalarResultFrames* s1Frames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S1" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S1" ) );
|
||||
RigFemScalarResultFrames* s2Frames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S2" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S2" ) );
|
||||
RigFemScalarResultFrames* s3Frames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S3" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S3" ) );
|
||||
|
||||
RigFemScalarResultFrames* s1IncFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S1inc" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S1inc" ) );
|
||||
RigFemScalarResultFrames* s1AziFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S1azi" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S1azi" ) );
|
||||
RigFemScalarResultFrames* s2IncFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S2inc" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S2inc" ) );
|
||||
RigFemScalarResultFrames* s2AziFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S2azi" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S2azi" ) );
|
||||
RigFemScalarResultFrames* s3IncFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S3inc" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S3inc" ) );
|
||||
RigFemScalarResultFrames* s3AziFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S3azi" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S3azi" ) );
|
||||
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorQ::calculate( int partIndex,
|
||||
CVF_ASSERT( resVarAddr.fieldName == "ST" && resVarAddr.componentName == "Q" );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 5, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* st11 =
|
||||
|
||||
@@ -72,9 +72,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorSFI::calculate( int partInde
|
||||
|
||||
RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resAddr );
|
||||
|
||||
float cohPrFricAngle =
|
||||
(float)( m_resultCollection->parameterCohesion() / tan( m_resultCollection->parameterFrictionAngleRad() ) );
|
||||
float sinFricAng = sin( m_resultCollection->parameterFrictionAngleRad() );
|
||||
float cohPrFricAngle = (float)( m_resultCollection->parameterCohesion() / tan( m_resultCollection->parameterFrictionAngleRad() ) );
|
||||
float sinFricAng = sin( m_resultCollection->parameterFrictionAngleRad() );
|
||||
|
||||
const int timeSteps = se1Frames->timeStepCount();
|
||||
for ( int stepIdx = 0; stepIdx < timeSteps; stepIdx++ )
|
||||
|
||||
@@ -58,15 +58,13 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorSM::calculate( int partIndex
|
||||
{
|
||||
CVF_ASSERT( isMatching( resVarAddr ) );
|
||||
|
||||
QString progressText = "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName );
|
||||
QString progressText = "Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( static_cast<size_t>( m_resultCollection->timeStepCount() ) * 4, progressText );
|
||||
|
||||
auto loadFrameLambda = [&]( const QString& component ) {
|
||||
auto task = stepCountProgress.task( component );
|
||||
return m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
resVarAddr.copyWithComponent( component.toStdString() ) );
|
||||
return m_resultCollection->findOrLoadScalarResult( partIndex, resVarAddr.copyWithComponent( component.toStdString() ) );
|
||||
};
|
||||
|
||||
RigFemScalarResultFrames* st11 = loadFrameLambda( "S11" );
|
||||
|
||||
@@ -48,8 +48,8 @@ RigFemPartResultCalculatorShearSE::~RigFemPartResultCalculatorShearSE()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFemPartResultCalculatorShearSE::isMatching( const RigFemResultAddress& resVarAddr ) const
|
||||
{
|
||||
return ( ( resVarAddr.fieldName == "SE" ) && ( resVarAddr.componentName == "S12" || resVarAddr.componentName == "S13" ||
|
||||
resVarAddr.componentName == "S23" ) );
|
||||
return ( ( resVarAddr.fieldName == "SE" ) &&
|
||||
( resVarAddr.componentName == "S12" || resVarAddr.componentName == "S13" || resVarAddr.componentName == "S23" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -65,11 +65,10 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorShearSE::calculate( int part
|
||||
|
||||
RigFemScalarResultFrames* srcDataFrames = nullptr;
|
||||
{
|
||||
auto task = stepCountProgress.task( "S-Bar", m_resultCollection->timeStepCount() );
|
||||
srcDataFrames = m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resAddr.resultPosType,
|
||||
"S-Bar",
|
||||
resAddr.componentName ) );
|
||||
auto task = stepCountProgress.task( "S-Bar", m_resultCollection->timeStepCount() );
|
||||
srcDataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resAddr.resultPosType, "S-Bar", resAddr.componentName ) );
|
||||
}
|
||||
|
||||
const RigFemPart* femPart = m_resultCollection->parts()->part( partIndex );
|
||||
|
||||
@@ -48,8 +48,8 @@ RigFemPartResultCalculatorShearST::~RigFemPartResultCalculatorShearST()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFemPartResultCalculatorShearST::isMatching( const RigFemResultAddress& resVarAddr ) const
|
||||
{
|
||||
return ( ( resVarAddr.fieldName == "ST" ) && ( resVarAddr.componentName == "S12" || resVarAddr.componentName == "S13" ||
|
||||
resVarAddr.componentName == "S23" ) );
|
||||
return ( ( resVarAddr.fieldName == "ST" ) &&
|
||||
( resVarAddr.componentName == "S12" || resVarAddr.componentName == "S13" || resVarAddr.componentName == "S23" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -58,15 +58,13 @@ bool RigFemPartResultCalculatorShearST::isMatching( const RigFemResultAddress& r
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorShearST::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 2, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* srcSDataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
"S-Bar",
|
||||
resVarAddr.componentName ) );
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "S-Bar", resVarAddr.componentName ) );
|
||||
RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
|
||||
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
@@ -56,8 +56,7 @@ bool RigFemPartResultCalculatorShearSlipIndicator::isMatching( const RigFemResul
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames*
|
||||
RigFemPartResultCalculatorShearSlipIndicator::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorShearSlipIndicator::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( isMatching( resVarAddr ) );
|
||||
|
||||
@@ -67,15 +66,13 @@ RigFemScalarResultFrames*
|
||||
// Pore pressure
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* porePressureDataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "POR-Bar", "" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "POR-Bar", "" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
// Total vertical stress (ST.S33)
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* stressDataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "ST", "S33" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "ST", "S33" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
@@ -54,51 +54,41 @@ bool RigFemPartResultCalculatorStressAnisotropy::isMatching( const RigFemResultA
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorStressAnisotropy::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorStressAnisotropy::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( isMatching( resVarAddr ) );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 4, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
|
||||
RigFemScalarResultFrames* s1Frames = nullptr;
|
||||
{
|
||||
auto task = stepCountProgress.task( "Loading S1.", m_resultCollection->timeStepCount() );
|
||||
s1Frames = m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S1" ) );
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S1" ) );
|
||||
}
|
||||
|
||||
RigFemScalarResultFrames* s2Frames = nullptr;
|
||||
{
|
||||
auto task = stepCountProgress.task( "Loading S2.", m_resultCollection->timeStepCount() );
|
||||
s2Frames = m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S2" ) );
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S2" ) );
|
||||
}
|
||||
|
||||
RigFemScalarResultFrames* s3Frames = nullptr;
|
||||
{
|
||||
auto task = stepCountProgress.task( "Loading S3.", m_resultCollection->timeStepCount() );
|
||||
s3Frames = m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S3" ) );
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S3" ) );
|
||||
}
|
||||
|
||||
RigFemScalarResultFrames* s12Frames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "SA12" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "SA12" ) );
|
||||
RigFemScalarResultFrames* s13Frames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "SA13" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "SA13" ) );
|
||||
RigFemScalarResultFrames* s23Frames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "SA23" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "SA23" ) );
|
||||
|
||||
const int timeSteps = s1Frames->timeStepCount();
|
||||
for ( int stepIdx = 0; stepIdx < timeSteps; stepIdx++ )
|
||||
@@ -138,65 +128,54 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorStressAnisotropy::calculate(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames*
|
||||
RigFemPartResultCalculatorStressAnisotropy::calculateTimeLapse( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorStressAnisotropy::calculateTimeLapse( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( isMatching( resVarAddr ) );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 4, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
|
||||
RigFemScalarResultFrames* s1Frames = nullptr;
|
||||
{
|
||||
auto task = stepCountProgress.task( "Loading S1.", m_resultCollection->timeStepCount() );
|
||||
s1Frames = m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S1" ) );
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S1" ) );
|
||||
}
|
||||
|
||||
RigFemScalarResultFrames* s2Frames = nullptr;
|
||||
{
|
||||
auto task = stepCountProgress.task( "Loading S2.", m_resultCollection->timeStepCount() );
|
||||
s2Frames = m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S2" ) );
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S2" ) );
|
||||
}
|
||||
|
||||
RigFemScalarResultFrames* s3Frames = nullptr;
|
||||
{
|
||||
auto task = stepCountProgress.task( "Loading S3.", m_resultCollection->timeStepCount() );
|
||||
s3Frames = m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"S3" ) );
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "S3" ) );
|
||||
}
|
||||
|
||||
RigFemScalarResultFrames* s12Frames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"SA12",
|
||||
resVarAddr.timeLapseBaseStepIdx ) );
|
||||
RigFemScalarResultFrames* s13Frames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"SA13",
|
||||
resVarAddr.timeLapseBaseStepIdx ) );
|
||||
RigFemScalarResultFrames* s23Frames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"SA23",
|
||||
resVarAddr.timeLapseBaseStepIdx ) );
|
||||
RigFemScalarResultFrames* s12Frames = m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"SA12",
|
||||
resVarAddr.timeLapseBaseStepIdx ) );
|
||||
RigFemScalarResultFrames* s13Frames = m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"SA13",
|
||||
resVarAddr.timeLapseBaseStepIdx ) );
|
||||
RigFemScalarResultFrames* s23Frames = m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"SA23",
|
||||
resVarAddr.timeLapseBaseStepIdx ) );
|
||||
|
||||
constexpr float inf = std::numeric_limits<float>::infinity();
|
||||
int baseTimeStep, baseFrame;
|
||||
std::tie( baseTimeStep, baseFrame ) =
|
||||
m_resultCollection->stepListIndexToTimeStepAndDataFrameIndex( resVarAddr.timeLapseBaseStepIdx );
|
||||
std::tie( baseTimeStep, baseFrame ) = m_resultCollection->stepListIndexToTimeStepAndDataFrameIndex( resVarAddr.timeLapseBaseStepIdx );
|
||||
|
||||
const int timeSteps = s1Frames->timeStepCount();
|
||||
for ( int stepIdx = 0; stepIdx < timeSteps; stepIdx++ )
|
||||
@@ -261,6 +240,5 @@ RigFemScalarResultFrames*
|
||||
bool RigFemPartResultCalculatorStressAnisotropy::isAnisotropyResult( const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
return ( ( ( resVarAddr.fieldName == "ST" || resVarAddr.fieldName == "SE" ) &&
|
||||
( resVarAddr.componentName == "SA12" || resVarAddr.componentName == "SA13" ||
|
||||
resVarAddr.componentName == "SA23" ) ) );
|
||||
( resVarAddr.componentName == "SA12" || resVarAddr.componentName == "SA13" || resVarAddr.componentName == "SA23" ) ) );
|
||||
}
|
||||
|
||||
@@ -51,8 +51,7 @@ bool RigFemPartResultCalculatorStressGradients::isMatching( const RigFemResultAd
|
||||
{
|
||||
if ( resVarAddr.fieldName == "ST" || resVarAddr.fieldName == "SE" )
|
||||
{
|
||||
const std::vector<std::string> allowedComponentNames =
|
||||
RigFemPartResultsCollection::getStressGradientComponentNames();
|
||||
const std::vector<std::string> allowedComponentNames = RigFemPartResultsCollection::getStressGradientComponentNames();
|
||||
|
||||
for ( auto& allowedComponentName : allowedComponentNames )
|
||||
{
|
||||
@@ -69,14 +68,13 @@ bool RigFemPartResultCalculatorStressGradients::isMatching( const RigFemResultAd
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorStressGradients::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorStressGradients::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( resVarAddr.fieldName == "ST" || resVarAddr.fieldName == "SE" );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 2, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating gradient: " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating gradient: " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
QString origFieldName = QString::fromStdString( resVarAddr.fieldName );
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPartResultCalculatorSurfaceAlignedStress::RigFemPartResultCalculatorSurfaceAlignedStress(
|
||||
RigFemPartResultsCollection& collection )
|
||||
RigFemPartResultCalculatorSurfaceAlignedStress::RigFemPartResultCalculatorSurfaceAlignedStress( RigFemPartResultsCollection& collection )
|
||||
: RigFemPartResultCalculator( collection )
|
||||
{
|
||||
}
|
||||
@@ -58,81 +57,61 @@ bool RigFemPartResultCalculatorSurfaceAlignedStress::isMatching( const RigFemRes
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames*
|
||||
RigFemPartResultCalculatorSurfaceAlignedStress::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorSurfaceAlignedStress::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( resVarAddr.componentName == "STH" || resVarAddr.componentName == "STQV" ||
|
||||
resVarAddr.componentName == "SN" || resVarAddr.componentName == "TPH" ||
|
||||
resVarAddr.componentName == "TPQV" || resVarAddr.componentName == "THQV" ||
|
||||
resVarAddr.componentName == "TP" || resVarAddr.componentName == "TPinc" ||
|
||||
resVarAddr.componentName == "FAULTMOB" || resVarAddr.componentName == "PCRIT" );
|
||||
CVF_ASSERT( resVarAddr.componentName == "STH" || resVarAddr.componentName == "STQV" || resVarAddr.componentName == "SN" ||
|
||||
resVarAddr.componentName == "TPH" || resVarAddr.componentName == "TPQV" || resVarAddr.componentName == "THQV" ||
|
||||
resVarAddr.componentName == "TP" || resVarAddr.componentName == "TPinc" || resVarAddr.componentName == "FAULTMOB" ||
|
||||
resVarAddr.componentName == "PCRIT" );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 7, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemScalarResultFrames* s11Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S11" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S11" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* s22Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S22" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S22" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* s33Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S33" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S33" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* s12Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S12" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S12" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* s23Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S23" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S23" ) );
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* s13Frames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S13" ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT_NODAL, resVarAddr.fieldName, "S13" ) );
|
||||
|
||||
RigFemScalarResultFrames* SNFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "SN" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "SN" ) );
|
||||
RigFemScalarResultFrames* STHFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "STH" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "STH" ) );
|
||||
RigFemScalarResultFrames* STQVFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "STQV" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "STQV" ) );
|
||||
RigFemScalarResultFrames* TNHFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "TPH" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "TPH" ) );
|
||||
RigFemScalarResultFrames* TNQVFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "TPQV" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "TPQV" ) );
|
||||
RigFemScalarResultFrames* THQVFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "THQV" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "THQV" ) );
|
||||
RigFemScalarResultFrames* TPFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "TP" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "TP" ) );
|
||||
RigFemScalarResultFrames* TPincFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "TPinc" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "TPinc" ) );
|
||||
RigFemScalarResultFrames* FAULTMOBFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType,
|
||||
resVarAddr.fieldName,
|
||||
"FAULTMOB" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "FAULTMOB" ) );
|
||||
RigFemScalarResultFrames* PCRITFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "PCRIT" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "PCRIT" ) );
|
||||
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
@@ -195,9 +174,8 @@ RigFemScalarResultFrames*
|
||||
|
||||
for ( int lfIdx = 0; lfIdx < faceCount; ++lfIdx )
|
||||
{
|
||||
int faceNodeCount = 0;
|
||||
const int* localElmNodeIndicesForFace =
|
||||
RigFemTypes::localElmNodeIndicesForFace( elmType, lfIdx, &faceNodeCount );
|
||||
int faceNodeCount = 0;
|
||||
const int* localElmNodeIndicesForFace = RigFemTypes::localElmNodeIndicesForFace( elmType, lfIdx, &faceNodeCount );
|
||||
if ( faceNodeCount == 4 )
|
||||
{
|
||||
int elmNodFaceResIdxFaceStart = elmNodFaceResIdxElmStart + lfIdx * 4; // HACK
|
||||
@@ -208,8 +186,8 @@ RigFemScalarResultFrames*
|
||||
quadVxs[2] = ( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[2]]] );
|
||||
quadVxs[3] = ( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[3]]] );
|
||||
|
||||
cvf::Mat3f rotMx = cvf::GeometryTools::computePlaneHorizontalRotationMx( quadVxs[2] - quadVxs[0],
|
||||
quadVxs[3] - quadVxs[1] );
|
||||
cvf::Mat3f rotMx =
|
||||
cvf::GeometryTools::computePlaneHorizontalRotationMx( quadVxs[2] - quadVxs[0], quadVxs[3] - quadVxs[1] );
|
||||
|
||||
size_t qElmNodeResIdx[4];
|
||||
qElmNodeResIdx[0] = femPart->elementNodeResultIdx( elmIdx, localElmNodeIndicesForFace[0] );
|
||||
|
||||
@@ -60,21 +60,18 @@ bool RigFemPartResultCalculatorSurfaceAngles::isMatching( const RigFemResultAddr
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorSurfaceAngles::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorSurfaceAngles::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( resVarAddr.componentName == "Pazi" || resVarAddr.componentName == "Pinc" );
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 1, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
|
||||
RigFemScalarResultFrames* PaziFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "Pazi" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "Pazi" ) );
|
||||
RigFemScalarResultFrames* PincFrames =
|
||||
m_resultCollection->createScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "Pinc" ) );
|
||||
m_resultCollection->createScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "Pinc" ) );
|
||||
|
||||
const RigFemPart* femPart = m_resultCollection->parts()->part( partIndex );
|
||||
const std::vector<cvf::Vec3f>& nodeCoordinates = femPart->nodes().coordinates;
|
||||
@@ -107,9 +104,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorSurfaceAngles::calculate( in
|
||||
|
||||
for ( int lfIdx = 0; lfIdx < faceCount; ++lfIdx )
|
||||
{
|
||||
int faceNodeCount = 0;
|
||||
const int* localElmNodeIndicesForFace =
|
||||
RigFemTypes::localElmNodeIndicesForFace( elmType, lfIdx, &faceNodeCount );
|
||||
int faceNodeCount = 0;
|
||||
const int* localElmNodeIndicesForFace = RigFemTypes::localElmNodeIndicesForFace( elmType, lfIdx, &faceNodeCount );
|
||||
if ( faceNodeCount == 4 )
|
||||
{
|
||||
int elmNodFaceResIdxFaceStart = elmNodFaceResIdxElmStart + lfIdx * 4; // HACK
|
||||
@@ -120,8 +116,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorSurfaceAngles::calculate( in
|
||||
quadVxs[2] = ( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[2]]] );
|
||||
quadVxs[3] = ( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[3]]] );
|
||||
|
||||
cvf::Mat3f rotMx = cvf::GeometryTools::computePlaneHorizontalRotationMx( quadVxs[2] - quadVxs[0],
|
||||
quadVxs[3] - quadVxs[1] );
|
||||
cvf::Mat3f rotMx =
|
||||
cvf::GeometryTools::computePlaneHorizontalRotationMx( quadVxs[2] - quadVxs[0], quadVxs[3] - quadVxs[1] );
|
||||
RiaOffshoreSphericalCoords sphCoord(
|
||||
cvf::Vec3f( rotMx.rowCol( 2, 0 ), rotMx.rowCol( 2, 1 ), rotMx.rowCol( 2, 2 ) ) ); // Use Ez
|
||||
// from the
|
||||
|
||||
@@ -57,8 +57,7 @@ bool RigFemPartResultCalculatorTimeLapse::isMatching( const RigFemResultAddress&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorTimeLapse::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorTimeLapse::calculate( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( resVarAddr.isTimeLapse() );
|
||||
|
||||
@@ -80,12 +79,11 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorTimeLapse::calculate( int
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames*
|
||||
RigFemPartResultCalculatorTimeLapse::calculateTimeLapse( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorTimeLapse::calculateTimeLapse( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 2, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemResultAddress resVarNative( resVarAddr.resultPosType,
|
||||
@@ -111,9 +109,8 @@ RigFemScalarResultFrames*
|
||||
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
const int timeSteps = srcDataFrames->timeStepCount();
|
||||
auto [baseStepIdx, baseFrameIdx] =
|
||||
m_resultCollection->stepListIndexToTimeStepAndDataFrameIndex( resVarAddr.timeLapseBaseStepIdx );
|
||||
const int timeSteps = srcDataFrames->timeStepCount();
|
||||
auto [baseStepIdx, baseFrameIdx] = m_resultCollection->stepListIndexToTimeStepAndDataFrameIndex( resVarAddr.timeLapseBaseStepIdx );
|
||||
|
||||
if ( baseStepIdx >= timeSteps ) return dstDataFrames;
|
||||
|
||||
@@ -147,15 +144,14 @@ RigFemScalarResultFrames*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames*
|
||||
RigFemPartResultCalculatorTimeLapse::calculateGammaTimeLapse( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorTimeLapse::calculateGammaTimeLapse( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
// Gamma time lapse needs to be calculated as ST_dt / POR_dt and not Gamma - Gamma_baseFrame see github
|
||||
// issue #937
|
||||
|
||||
caf::ProgressInfo stepCountProgress( m_resultCollection->timeStepCount() * 3, "" );
|
||||
stepCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setProgressDescription( "Calculating " +
|
||||
QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
|
||||
RigFemResultAddress totStressCompAddr( resVarAddr.resultPosType, "ST", "", resVarAddr.timeLapseBaseStepIdx );
|
||||
@@ -181,9 +177,8 @@ RigFemScalarResultFrames*
|
||||
stepCountProgress.incrementProgress();
|
||||
stepCountProgress.setNextProgressIncrement( m_resultCollection->timeStepCount() );
|
||||
RigFemScalarResultFrames* srcPORDataFrames =
|
||||
m_resultCollection
|
||||
->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_NODAL, "POR-Bar", "", resVarAddr.timeLapseBaseStepIdx ) );
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( RIG_NODAL, "POR-Bar", "", resVarAddr.timeLapseBaseStepIdx ) );
|
||||
RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
|
||||
|
||||
stepCountProgress.incrementProgress();
|
||||
|
||||
@@ -121,8 +121,7 @@ RigFemPartResultsCollection::RigFemPartResultsCollection( RifGeoMechReaderInterf
|
||||
{
|
||||
auto stepNameComplete = stepName;
|
||||
|
||||
if ( !( RiaRegressionTestRunner::instance()->isRunningRegressionTests() &&
|
||||
m_readerInterface->frameTimes( stepIdx ).size() == 1 ) )
|
||||
if ( !( RiaRegressionTestRunner::instance()->isRunningRegressionTests() && m_readerInterface->frameTimes( stepIdx ).size() == 1 ) )
|
||||
{
|
||||
// Do not add postfix for time steps with a single frame to ensure identical generated snapshot
|
||||
// name used by regression tests
|
||||
@@ -158,75 +157,46 @@ RigFemPartResultsCollection::RigFemPartResultsCollection( RifGeoMechReaderInterf
|
||||
|
||||
m_waterDensityShearSlipIndicator = 1.03;
|
||||
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorTimeLapse( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorSurfaceAngles( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorSurfaceAlignedStress( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorTimeLapse( *this ) ) );
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorBarConverted( *this, "S-Bar", "S" ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorSurfaceAngles( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorSurfaceAlignedStress( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>(
|
||||
new RigFemPartResultCalculatorBarConverted( *this, "S-Bar", "S" ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>(
|
||||
new RigFemPartResultCalculatorBarConverted( *this, "POR-Bar", "POR" ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorEnIpPorBar( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorNodalGradients( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorCompaction( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorSFI( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorDSM( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorFOS( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorED( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorEV( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorSM( *this ) ) );
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorBarConverted( *this, "POR-Bar", "POR" ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorEnIpPorBar( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorNodalGradients( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorCompaction( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorSFI( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorDSM( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorFOS( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorED( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorEV( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorSM( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorQ( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorStressGradients( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorNormalized( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorNormalST( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorShearST( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorNormalSE( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorShearSE( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorNE( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorGamma( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorStressGradients( *this ) ) );
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorPrincipalStrain( *this, "NE", "E" ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorNormalized( *this ) ) );
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorPrincipalStrain( *this, "LE", "LE" ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorNormalST( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorShearST( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorNormalSE( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorShearSE( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorNE( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorGamma( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>(
|
||||
new RigFemPartResultCalculatorPrincipalStrain( *this, "NE", "E" ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>(
|
||||
new RigFemPartResultCalculatorPrincipalStrain( *this, "LE", "LE" ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>(
|
||||
new RigFemPartResultCalculatorPrincipalStrain( *this, "PE", "PE" ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorPrincipalStress( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorStressAnisotropy( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorPoreCompressibility( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorPorosityPermeability( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorInitialPorosity( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorMudWeightWindow( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorShearSlipIndicator( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorFormationIndices( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorKIndices( *this ) ) );
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorPrincipalStrain( *this, "PE", "PE" ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorPrincipalStress( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorStressAnisotropy( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorPoreCompressibility( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorPorosityPermeability( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorInitialPorosity( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorMudWeightWindow( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorShearSlipIndicator( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorFormationIndices( *this ) ) );
|
||||
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorKIndices( *this ) ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -295,8 +265,7 @@ void RigFemPartResultsCollection::addElementPropertyFiles( const std::vector<QSt
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigFemResultAddress>
|
||||
RigFemPartResultsCollection::removeElementPropertyFiles( const std::vector<QString>& filenames )
|
||||
std::vector<RigFemResultAddress> RigFemPartResultsCollection::removeElementPropertyFiles( const std::vector<QString>& filenames )
|
||||
{
|
||||
std::vector<RigFemResultAddress> addressesToRemove;
|
||||
|
||||
@@ -323,8 +292,7 @@ std::vector<RigFemResultAddress>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<std::string, QString>
|
||||
RigFemPartResultsCollection::addressesInElementPropertyFiles( const std::vector<QString>& filenames )
|
||||
std::map<std::string, QString> RigFemPartResultsCollection::addressesInElementPropertyFiles( const std::vector<QString>& filenames )
|
||||
{
|
||||
std::map<std::string, QString> fieldsInFile;
|
||||
for ( const QString& filename : filenames )
|
||||
@@ -457,8 +425,7 @@ double RigFemPartResultsCollection::permeabilityExponent() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Will always return a valid object, but it can be empty
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( partIndex < (int)( m_femPartResults.size() ) );
|
||||
CVF_ASSERT( m_readerInterface.notNull() );
|
||||
@@ -529,25 +496,13 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult( i
|
||||
switch ( resVarAddr.resultPosType )
|
||||
{
|
||||
case RIG_NODAL:
|
||||
m_readerInterface->readNodeField( resVarAddr.fieldName,
|
||||
partIndex,
|
||||
stepIndex,
|
||||
frameIndex,
|
||||
&componentDataVectors );
|
||||
m_readerInterface->readNodeField( resVarAddr.fieldName, partIndex, stepIndex, frameIndex, &componentDataVectors );
|
||||
break;
|
||||
case RIG_ELEMENT_NODAL:
|
||||
m_readerInterface->readElementNodeField( resVarAddr.fieldName,
|
||||
partIndex,
|
||||
stepIndex,
|
||||
frameIndex,
|
||||
&componentDataVectors );
|
||||
m_readerInterface->readElementNodeField( resVarAddr.fieldName, partIndex, stepIndex, frameIndex, &componentDataVectors );
|
||||
break;
|
||||
case RIG_INTEGRATION_POINT:
|
||||
m_readerInterface->readIntegrationPointField( resVarAddr.fieldName,
|
||||
partIndex,
|
||||
stepIndex,
|
||||
frameIndex,
|
||||
&componentDataVectors );
|
||||
m_readerInterface->readIntegrationPointField( resVarAddr.fieldName, partIndex, stepIndex, frameIndex, &componentDataVectors );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -573,8 +528,7 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::findOrLoadScalarResult( i
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::createScalarResult( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::createScalarResult( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( partIndex < static_cast<int>( m_femPartResults.size() ) );
|
||||
CVF_ASSERT( resVarAddr.isValid() );
|
||||
@@ -595,8 +549,7 @@ void RigFemPartResultsCollection::deleteAllScalarResults()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<std::string, std::vector<std::string>>
|
||||
RigFemPartResultsCollection::scalarFieldAndComponentNames( RigFemResultPosEnum resPos )
|
||||
std::map<std::string, std::vector<std::string>> RigFemPartResultsCollection::scalarFieldAndComponentNames( RigFemResultPosEnum resPos )
|
||||
{
|
||||
std::map<std::string, std::vector<std::string>> fieldCompNames;
|
||||
|
||||
@@ -887,8 +840,7 @@ std::map<std::string, std::vector<std::string>>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult( int partIndex, const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
for ( const auto& calculator : m_resultCalculators )
|
||||
{
|
||||
@@ -913,8 +865,7 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult( i
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigFemResultAddress>
|
||||
RigFemPartResultsCollection::getResAddrToComponentsToRead( const RigFemResultAddress& resVarAddr )
|
||||
std::vector<RigFemResultAddress> RigFemPartResultsCollection::getResAddrToComponentsToRead( const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
std::map<std::string, std::vector<std::string>> fieldAndComponentNames;
|
||||
switch ( resVarAddr.resultPosType )
|
||||
@@ -944,8 +895,7 @@ std::vector<RigFemResultAddress>
|
||||
{
|
||||
for ( const auto& compName : compNames )
|
||||
{
|
||||
resAddressToComponents.push_back(
|
||||
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, compName ) );
|
||||
resAddressToComponents.push_back( RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, compName ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1116,10 +1066,8 @@ std::vector<RigFemResultAddress> RigFemPartResultsCollection::loadedResults() co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<float>& RigFemPartResultsCollection::resultValues( const RigFemResultAddress& resVarAddr,
|
||||
int partIndex,
|
||||
int stepIndex,
|
||||
int frameIndex )
|
||||
const std::vector<float>&
|
||||
RigFemPartResultsCollection::resultValues( const RigFemResultAddress& resVarAddr, int partIndex, int stepIndex, int frameIndex )
|
||||
{
|
||||
CVF_ASSERT( resVarAddr.isValid() );
|
||||
|
||||
@@ -1183,8 +1131,7 @@ void RigFemPartResultsCollection::globalResultValues( const RigFemResultAddress&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<caf::Ten3f>
|
||||
RigFemPartResultsCollection::tensors( const RigFemResultAddress& resVarAddr, int partIndex, int stepIndex, int frameIndex )
|
||||
std::vector<caf::Ten3f> RigFemPartResultsCollection::tensors( const RigFemResultAddress& resVarAddr, int partIndex, int stepIndex, int frameIndex )
|
||||
{
|
||||
CVF_ASSERT( resVarAddr.resultPosType == RIG_ELEMENT_NODAL || resVarAddr.resultPosType == RIG_INTEGRATION_POINT );
|
||||
|
||||
@@ -1248,9 +1195,7 @@ void RigFemPartResultsCollection::minMaxScalarValues( const RigFemResultAddress&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFemPartResultsCollection::minMaxScalarValues( const RigFemResultAddress& resVarAddr,
|
||||
double* globalMin,
|
||||
double* globalMax )
|
||||
void RigFemPartResultsCollection::minMaxScalarValues( const RigFemResultAddress& resVarAddr, double* globalMin, double* globalMax )
|
||||
{
|
||||
this->statistics( resVarAddr )->minMaxCellScalarValues( *globalMin, *globalMax );
|
||||
}
|
||||
@@ -1290,10 +1235,7 @@ void RigFemPartResultsCollection::meanScalarValue( const RigFemResultAddress& re
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFemPartResultsCollection::meanScalarValue( const RigFemResultAddress& resVarAddr,
|
||||
int stepIndex,
|
||||
int frameIndex,
|
||||
double* meanValue )
|
||||
void RigFemPartResultsCollection::meanScalarValue( const RigFemResultAddress& resVarAddr, int stepIndex, int frameIndex, double* meanValue )
|
||||
{
|
||||
this->statistics( resVarAddr )->meanCellScalarValues( stepIndex, *meanValue );
|
||||
}
|
||||
@@ -1309,11 +1251,7 @@ void RigFemPartResultsCollection::p10p90ScalarValues( const RigFemResultAddress&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFemPartResultsCollection::p10p90ScalarValues( const RigFemResultAddress& resVarAddr,
|
||||
int stepIndex,
|
||||
int frameIndex,
|
||||
double* p10,
|
||||
double* p90 )
|
||||
void RigFemPartResultsCollection::p10p90ScalarValues( const RigFemResultAddress& resVarAddr, int stepIndex, int frameIndex, double* p10, double* p90 )
|
||||
{
|
||||
this->statistics( resVarAddr )->p10p90CellScalarValues( stepIndex, *p10, *p90 );
|
||||
}
|
||||
@@ -1331,10 +1269,7 @@ void RigFemPartResultsCollection::sumScalarValue( const RigFemResultAddress& res
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFemPartResultsCollection::sumScalarValue( const RigFemResultAddress& resVarAddr,
|
||||
int stepIndex,
|
||||
int frameIndex,
|
||||
double* sum )
|
||||
void RigFemPartResultsCollection::sumScalarValue( const RigFemResultAddress& resVarAddr, int stepIndex, int frameIndex, double* sum )
|
||||
{
|
||||
CVF_ASSERT( sum );
|
||||
|
||||
@@ -1352,9 +1287,8 @@ const std::vector<size_t>& RigFemPartResultsCollection::scalarValuesHistogram( c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<size_t>& RigFemPartResultsCollection::scalarValuesHistogram( const RigFemResultAddress& resVarAddr,
|
||||
int stepIndex,
|
||||
int frameIndex )
|
||||
const std::vector<size_t>&
|
||||
RigFemPartResultsCollection::scalarValuesHistogram( const RigFemResultAddress& resVarAddr, int stepIndex, int frameIndex )
|
||||
{
|
||||
return this->statistics( resVarAddr )->cellScalarValuesHistogram( stepIndex );
|
||||
}
|
||||
@@ -1362,8 +1296,7 @@ const std::vector<size_t>& RigFemPartResultsCollection::scalarValuesHistogram( c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigFemResultAddress>
|
||||
RigFemPartResultsCollection::tensorPrincipalComponentAdresses( const RigFemResultAddress& resVarAddr )
|
||||
std::vector<RigFemResultAddress> RigFemPartResultsCollection::tensorPrincipalComponentAdresses( const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
std::vector<RigFemResultAddress> addresses;
|
||||
|
||||
@@ -1395,13 +1328,11 @@ std::vector<RigFemResultAddress>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFemPartResultsCollection::isResultInSet( const RigFemResultAddress& result,
|
||||
const std::set<RigFemResultAddress>& results )
|
||||
bool RigFemPartResultsCollection::isResultInSet( const RigFemResultAddress& result, const std::set<RigFemResultAddress>& results )
|
||||
{
|
||||
for ( auto res : results )
|
||||
{
|
||||
if ( res.resultPosType == result.resultPosType && res.fieldName == result.fieldName &&
|
||||
res.componentName == result.componentName )
|
||||
if ( res.resultPosType == result.resultPosType && res.fieldName == result.fieldName && res.componentName == result.componentName )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1422,16 +1353,13 @@ std::set<RigFemResultAddress> RigFemPartResultsCollection::normalizedResults()
|
||||
{
|
||||
for ( auto component : validComponents )
|
||||
{
|
||||
results.insert(
|
||||
RigFemResultAddress( RIG_ELEMENT_NODAL, field, component, RigFemResultAddress::allTimeLapsesValue(), -1, true ) );
|
||||
results.insert( RigFemResultAddress( RIG_ELEMENT_NODAL, field, component, RigFemResultAddress::allTimeLapsesValue(), -1, true ) );
|
||||
}
|
||||
}
|
||||
results.insert(
|
||||
RigFemResultAddress( RIG_ELEMENT_NODAL, "ST", "Q", RigFemResultAddress::allTimeLapsesValue(), -1, true ) );
|
||||
results.insert( RigFemResultAddress( RIG_ELEMENT_NODAL, "ST", "Q", RigFemResultAddress::allTimeLapsesValue(), -1, true ) );
|
||||
|
||||
results.insert( RigFemResultAddress( RIG_NODAL, "POR-Bar", "", RigFemResultAddress::allTimeLapsesValue(), -1, true ) );
|
||||
results.insert(
|
||||
RigFemResultAddress( RIG_ELEMENT_NODAL, "POR-Bar", "", RigFemResultAddress::allTimeLapsesValue(), -1, true ) );
|
||||
results.insert( RigFemResultAddress( RIG_ELEMENT_NODAL, "POR-Bar", "", RigFemResultAddress::allTimeLapsesValue(), -1, true ) );
|
||||
|
||||
return results;
|
||||
}
|
||||
@@ -1452,14 +1380,9 @@ std::set<RigFemResultAddress> RigFemPartResultsCollection::referenceCaseDependen
|
||||
std::set<RigFemResultAddress> results;
|
||||
for ( auto elementType : { RIG_ELEMENT_NODAL, RIG_INTEGRATION_POINT } )
|
||||
{
|
||||
results.insert(
|
||||
RigFemResultAddress( elementType, "COMPRESSIBILITY", "PORE", RigFemResultAddress::allTimeLapsesValue() ) );
|
||||
results.insert(
|
||||
RigFemResultAddress( elementType, "COMPRESSIBILITY", "VERTICAL", RigFemResultAddress::allTimeLapsesValue() ) );
|
||||
results.insert( RigFemResultAddress( elementType,
|
||||
"COMPRESSIBILITY",
|
||||
"VERTICAL-RATIO",
|
||||
RigFemResultAddress::allTimeLapsesValue() ) );
|
||||
results.insert( RigFemResultAddress( elementType, "COMPRESSIBILITY", "PORE", RigFemResultAddress::allTimeLapsesValue() ) );
|
||||
results.insert( RigFemResultAddress( elementType, "COMPRESSIBILITY", "VERTICAL", RigFemResultAddress::allTimeLapsesValue() ) );
|
||||
results.insert( RigFemResultAddress( elementType, "COMPRESSIBILITY", "VERTICAL-RATIO", RigFemResultAddress::allTimeLapsesValue() ) );
|
||||
results.insert( RigFemResultAddress( elementType, "PORO-PERM", "PHI", RigFemResultAddress::allTimeLapsesValue() ) );
|
||||
results.insert( RigFemResultAddress( elementType, "PORO-PERM", "DPHI", RigFemResultAddress::allTimeLapsesValue() ) );
|
||||
results.insert( RigFemResultAddress( elementType, "PORO-PERM", "PERM", RigFemResultAddress::allTimeLapsesValue() ) );
|
||||
@@ -1597,8 +1520,8 @@ void RigFemPartResultsCollection::minMaxScalarValuesOverAllTensorComponents( con
|
||||
void RigFemPartResultsCollection::posNegClosestToZeroOverAllTensorComponents( const RigFemResultAddress& resVarAddr,
|
||||
int stepIndex,
|
||||
int frameIndex,
|
||||
double* localPosClosestToZero,
|
||||
double* localNegClosestToZero )
|
||||
double* localPosClosestToZero,
|
||||
double* localNegClosestToZero )
|
||||
{
|
||||
double currentPosClosestToZero = HUGE_VAL;
|
||||
double currentNegClosestToZero = -HUGE_VAL;
|
||||
@@ -1626,8 +1549,8 @@ void RigFemPartResultsCollection::posNegClosestToZeroOverAllTensorComponents( co
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFemPartResultsCollection::posNegClosestToZeroOverAllTensorComponents( const RigFemResultAddress& resVarAddr,
|
||||
double* globalPosClosestToZero,
|
||||
double* globalNegClosestToZero )
|
||||
double* globalPosClosestToZero,
|
||||
double* globalNegClosestToZero )
|
||||
{
|
||||
double currentPosClosestToZero = HUGE_VAL;
|
||||
double currentNegClosestToZero = -HUGE_VAL;
|
||||
@@ -1750,9 +1673,8 @@ bool RigFemPartResultsCollection::isValidBiotData( const std::vector<float>& bio
|
||||
{
|
||||
if ( biotData.size() != elementCount )
|
||||
{
|
||||
QString txt = QString( "Unexpected size of biot coefficient element properties: %1 (expected: %2)" )
|
||||
.arg( biotData.size() )
|
||||
.arg( elementCount );
|
||||
QString txt =
|
||||
QString( "Unexpected size of biot coefficient element properties: %1 (expected: %2)" ).arg( biotData.size() ).arg( elementCount );
|
||||
|
||||
Riu3DMainWindowTools::reportAndShowWarning( "Wrong size of biot data", txt );
|
||||
|
||||
@@ -1763,8 +1685,7 @@ bool RigFemPartResultsCollection::isValidBiotData( const std::vector<float>& bio
|
||||
{
|
||||
if ( !std::isinf( b ) && ( b < 0.0 || b > 1.0 ) )
|
||||
{
|
||||
RiaLogging::error(
|
||||
QString( "Found unexpected biot coefficient. The value must be in the [0, 1] interval." ) );
|
||||
RiaLogging::error( QString( "Found unexpected biot coefficient. The value must be in the [0, 1] interval." ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1846,8 +1767,7 @@ double RigFemPartResultsCollection::hydrostaticMultiplierPPNonRes() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMudWeightWindowParameters::NonReservoirPorePressureType
|
||||
RigFemPartResultsCollection::nonReservoirPorePressureTypeMudWeightWindow() const
|
||||
RimMudWeightWindowParameters::NonReservoirPorePressureType RigFemPartResultsCollection::nonReservoirPorePressureTypeMudWeightWindow() const
|
||||
{
|
||||
return m_nonReservoirPorePressureTypeMudWeightWindow;
|
||||
}
|
||||
@@ -1887,16 +1807,15 @@ size_t RigFemPartResultsCollection::referenceLayerMudWeightWindow() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFemPartResultsCollection::setMudWeightWindowParameters(
|
||||
double airGap,
|
||||
RimMudWeightWindowParameters::UpperLimitType upperLimit,
|
||||
RimMudWeightWindowParameters::LowerLimitType lowerLimit,
|
||||
int referenceLayer,
|
||||
RimMudWeightWindowParameters::FractureGradientCalculationType fgCalculationType,
|
||||
double shMultiplier,
|
||||
RimMudWeightWindowParameters::NonReservoirPorePressureType nonReservoirPorePressureType,
|
||||
double hydrostaticMultiplierPPNonRes,
|
||||
const QString& nonReservoirPorePressureAddress )
|
||||
void RigFemPartResultsCollection::setMudWeightWindowParameters( double airGap,
|
||||
RimMudWeightWindowParameters::UpperLimitType upperLimit,
|
||||
RimMudWeightWindowParameters::LowerLimitType lowerLimit,
|
||||
int referenceLayer,
|
||||
RimMudWeightWindowParameters::FractureGradientCalculationType fgCalculationType,
|
||||
double shMultiplier,
|
||||
RimMudWeightWindowParameters::NonReservoirPorePressureType nonReservoirPorePressureType,
|
||||
double hydrostaticMultiplierPPNonRes,
|
||||
const QString& nonReservoirPorePressureAddress )
|
||||
{
|
||||
m_airGapMudWeightWindow = airGap;
|
||||
m_upperLimitParameterMudWeightWindow = upperLimit;
|
||||
@@ -1918,8 +1837,7 @@ void RigFemPartResultsCollection::setMudWeightWindowParameters(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMudWeightWindowParameters::FractureGradientCalculationType
|
||||
RigFemPartResultsCollection::fractureGradientCalculationTypeMudWeightWindow() const
|
||||
RimMudWeightWindowParameters::FractureGradientCalculationType RigFemPartResultsCollection::fractureGradientCalculationTypeMudWeightWindow() const
|
||||
{
|
||||
return m_fractureGradientCalculationTypeMudWeightWindow;
|
||||
}
|
||||
|
||||
@@ -75,16 +75,12 @@ public:
|
||||
double biotFixedFactor() const { return m_biotFixedFactor; }
|
||||
QString biotResultAddress() const { return m_biotResultAddress; }
|
||||
|
||||
void setPermeabilityParameters( double fixedInitalPermeability,
|
||||
const QString& initialPermeabilityAddress,
|
||||
double permeabilityExponent );
|
||||
void setPermeabilityParameters( double fixedInitalPermeability, const QString& initialPermeabilityAddress, double permeabilityExponent );
|
||||
double initialPermeabilityFixed() const;
|
||||
QString initialPermeabilityAddress() const;
|
||||
double permeabilityExponent() const;
|
||||
|
||||
void setCalculationParameters( RimMudWeightWindowParameters::ParameterType parameterType,
|
||||
const QString& address,
|
||||
double value );
|
||||
void setCalculationParameters( RimMudWeightWindowParameters::ParameterType parameterType, const QString& address, double value );
|
||||
double getCalculationParameterValue( RimMudWeightWindowParameters::ParameterType ) const;
|
||||
QString getCalculationParameterAddress( RimMudWeightWindowParameters::ParameterType ) const;
|
||||
|
||||
@@ -94,9 +90,9 @@ public:
|
||||
int referenceLayer,
|
||||
RimMudWeightWindowParameters::FractureGradientCalculationType fgCalculationType,
|
||||
double shMultiplier,
|
||||
RimMudWeightWindowParameters::NonReservoirPorePressureType nonReservoirPorePressureType,
|
||||
double hydroStaticMultiplierPPNonRes,
|
||||
const QString& nonReservoirPorePressureAddress );
|
||||
RimMudWeightWindowParameters::NonReservoirPorePressureType nonReservoirPorePressureType,
|
||||
double hydroStaticMultiplierPPNonRes,
|
||||
const QString& nonReservoirPorePressureAddress );
|
||||
|
||||
double airGapMudWeightWindow() const;
|
||||
double shMultiplierMudWeightWindow() const;
|
||||
@@ -122,13 +118,9 @@ public:
|
||||
|
||||
std::vector<RigFemResultAddress> loadedResults() const;
|
||||
|
||||
const std::vector<float>&
|
||||
resultValues( const RigFemResultAddress& resVarAddr, int partIndex, int stepIndex, int frameIndex );
|
||||
const std::vector<float>& resultValues( const RigFemResultAddress& resVarAddr, int partIndex, int stepIndex, int frameIndex );
|
||||
|
||||
void globalResultValues( const RigFemResultAddress& resVarAddr,
|
||||
int timeStepIndex,
|
||||
int frameIndex,
|
||||
std::vector<float>& resultValues );
|
||||
void globalResultValues( const RigFemResultAddress& resVarAddr, int timeStepIndex, int frameIndex, std::vector<float>& resultValues );
|
||||
|
||||
std::vector<caf::Ten3f> tensors( const RigFemResultAddress& resVarAddr, int partIndex, int stepIndex, int frameIndex );
|
||||
|
||||
@@ -142,20 +134,14 @@ public:
|
||||
std::vector<std::string> stepNames() const;
|
||||
const std::pair<int, int> stepListIndexToTimeStepAndDataFrameIndex( int stepIndex ) const;
|
||||
|
||||
void minMaxScalarValues( const RigFemResultAddress& resVarAddr,
|
||||
int stepIndex,
|
||||
int frameIndex,
|
||||
double* localMin,
|
||||
double* localMax );
|
||||
void minMaxScalarValues( const RigFemResultAddress& resVarAddr, int stepIndex, int frameIndex, double* localMin, double* localMax );
|
||||
void minMaxScalarValues( const RigFemResultAddress& resVarAddr, double* globalMin, double* globalMax );
|
||||
void posNegClosestToZero( const RigFemResultAddress& resVarAddr,
|
||||
int stepIndex,
|
||||
int frameIndex,
|
||||
double* localPosClosestToZero,
|
||||
double* localNegClosestToZero );
|
||||
void posNegClosestToZero( const RigFemResultAddress& resVarAddr,
|
||||
double* globalPosClosestToZero,
|
||||
double* globalNegClosestToZero );
|
||||
void posNegClosestToZero( const RigFemResultAddress& resVarAddr, double* globalPosClosestToZero, double* globalNegClosestToZero );
|
||||
void meanScalarValue( const RigFemResultAddress& resVarAddr, double* meanValue );
|
||||
void meanScalarValue( const RigFemResultAddress& resVarAddr, int stepIndex, int frameIndex, double* meanValue );
|
||||
void p10p90ScalarValues( const RigFemResultAddress& resVarAddr, double* p10, double* p90 );
|
||||
@@ -170,9 +156,7 @@ public:
|
||||
int frameIndex,
|
||||
double* localMin,
|
||||
double* localMax );
|
||||
void minMaxScalarValuesOverAllTensorComponents( const RigFemResultAddress& resVarAddr,
|
||||
double* globalMin,
|
||||
double* globalMax );
|
||||
void minMaxScalarValuesOverAllTensorComponents( const RigFemResultAddress& resVarAddr, double* globalMin, double* globalMax );
|
||||
void posNegClosestToZeroOverAllTensorComponents( const RigFemResultAddress& resVarAddr,
|
||||
int stepIndex,
|
||||
int frameIndex,
|
||||
@@ -254,8 +238,8 @@ private:
|
||||
|
||||
std::vector<std::unique_ptr<RigFemPartResultCalculator>> m_resultCalculators;
|
||||
|
||||
RigStatisticsDataCache* statistics( const RigFemResultAddress& resVarAddr );
|
||||
std::vector<RigFemResultAddress> getResAddrToComponentsToRead( const RigFemResultAddress& resVarAddr );
|
||||
RigStatisticsDataCache* statistics( const RigFemResultAddress& resVarAddr );
|
||||
std::vector<RigFemResultAddress> getResAddrToComponentsToRead( const RigFemResultAddress& resVarAddr );
|
||||
std::map<RigFemResultAddress, cvf::ref<RigStatisticsDataCache>> m_resultStatistics;
|
||||
|
||||
std::vector<std::pair<int, int>> m_stepList;
|
||||
|
||||
@@ -99,10 +99,9 @@ public:
|
||||
|
||||
bool isValid() const
|
||||
{
|
||||
bool isTypeValid = resultPosType == RIG_NODAL || resultPosType == RIG_ELEMENT_NODAL ||
|
||||
resultPosType == RIG_INTEGRATION_POINT || resultPosType == RIG_ELEMENT_NODAL_FACE ||
|
||||
resultPosType == RIG_FORMATION_NAMES || resultPosType == RIG_ELEMENT ||
|
||||
resultPosType == RIG_DIFFERENTIALS;
|
||||
bool isTypeValid = resultPosType == RIG_NODAL || resultPosType == RIG_ELEMENT_NODAL || resultPosType == RIG_INTEGRATION_POINT ||
|
||||
resultPosType == RIG_ELEMENT_NODAL_FACE || resultPosType == RIG_FORMATION_NAMES ||
|
||||
resultPosType == RIG_ELEMENT || resultPosType == RIG_DIFFERENTIALS;
|
||||
bool isFieldValid = fieldName != "";
|
||||
|
||||
return isTypeValid && isFieldValid;
|
||||
@@ -140,9 +139,8 @@ public:
|
||||
|
||||
bool operator==( const RigFemResultAddress& other ) const
|
||||
{
|
||||
if ( resultPosType != other.resultPosType || fieldName != other.fieldName ||
|
||||
componentName != other.componentName || timeLapseBaseStepIdx != other.timeLapseBaseStepIdx ||
|
||||
normalizedByHydrostaticPressure != other.normalizedByHydrostaticPressure )
|
||||
if ( resultPosType != other.resultPosType || fieldName != other.fieldName || componentName != other.componentName ||
|
||||
timeLapseBaseStepIdx != other.timeLapseBaseStepIdx || normalizedByHydrostaticPressure != other.normalizedByHydrostaticPressure )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -58,9 +58,8 @@ int RigFemTypes::elementFaceCount( RigElementType elmType )
|
||||
|
||||
const int* RigFemTypes::localElmNodeIndicesForFace( RigElementType elmType, int faceIdx, int* faceNodeCount )
|
||||
{
|
||||
static const int HEX8_Faces[6][4] =
|
||||
{ { 1, 2, 6, 5 }, { 0, 4, 7, 3 }, { 3, 7, 6, 2 }, { 0, 1, 5, 4 }, { 4, 5, 6, 7 }, { 0, 3, 2, 1 } };
|
||||
static const int CAX4_Faces[4] = { 0, 1, 2, 3 };
|
||||
static const int HEX8_Faces[6][4] = { { 1, 2, 6, 5 }, { 0, 4, 7, 3 }, { 3, 7, 6, 2 }, { 0, 1, 5, 4 }, { 4, 5, 6, 7 }, { 0, 3, 2, 1 } };
|
||||
static const int CAX4_Faces[4] = { 0, 1, 2, 3 };
|
||||
|
||||
switch ( elmType )
|
||||
{
|
||||
|
||||
@@ -121,9 +121,7 @@ bool RigGeoMechCaseData::readTimeSteps( std::string* errorMessage, std::vector<s
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigGeoMechCaseData::readFemParts( std::string* errorMessage,
|
||||
const std::vector<size_t>& timeStepFilter,
|
||||
bool readOnlyLastFrame )
|
||||
bool RigGeoMechCaseData::readFemParts( std::string* errorMessage, const std::vector<size_t>& timeStepFilter, bool readOnlyLastFrame )
|
||||
{
|
||||
CVF_ASSERT( errorMessage );
|
||||
#ifdef USE_ODB_API
|
||||
@@ -141,8 +139,7 @@ bool RigGeoMechCaseData::readFemParts( std::string* errorMessage,
|
||||
|
||||
m_elementPropertyReader = new RifElementPropertyReader( m_femParts->part( 0 )->elementIdxToId() );
|
||||
// Initialize results containers
|
||||
m_femPartResultsColl =
|
||||
new RigFemPartResultsCollection( m_readerInterface.p(), m_elementPropertyReader.p(), m_femParts.p() );
|
||||
m_femPartResultsColl = new RigFemPartResultsCollection( m_readerInterface.p(), m_elementPropertyReader.p(), m_femParts.p() );
|
||||
|
||||
// Calculate derived Fem data
|
||||
for ( int pIdx = 0; pIdx < m_femParts->partCount(); ++pIdx )
|
||||
@@ -161,11 +158,7 @@ bool RigGeoMechCaseData::readFemParts( std::string* errorMessage,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigGeoMechCaseData::readDisplacements( std::string* errorMessage,
|
||||
int partId,
|
||||
int timeStep,
|
||||
int frameIndex,
|
||||
std::vector<cvf::Vec3f>* displacements )
|
||||
bool RigGeoMechCaseData::readDisplacements( std::string* errorMessage, int partId, int timeStep, int frameIndex, std::vector<cvf::Vec3f>* displacements )
|
||||
{
|
||||
CVF_ASSERT( errorMessage );
|
||||
#ifdef USE_ODB_API
|
||||
|
||||
@@ -41,11 +41,7 @@ public:
|
||||
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, bool readOnlyLastFrame );
|
||||
bool readDisplacements( std::string* errorMessage,
|
||||
int partId,
|
||||
int timeStep,
|
||||
int frameIndex,
|
||||
std::vector<cvf::Vec3f>* displacements );
|
||||
bool readDisplacements( std::string* errorMessage, int partId, int timeStep, int frameIndex, std::vector<cvf::Vec3f>* displacements );
|
||||
|
||||
RigFemPartCollection* femParts();
|
||||
const RigFemPartCollection* femParts() const;
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::array<cvf::Vec3d, 8> RigHexGradientTools::gradients( const std::array<cvf::Vec3d, 8>& hexCorners,
|
||||
const std::array<double, 8>& values )
|
||||
std::array<cvf::Vec3d, 8> RigHexGradientTools::gradients( const std::array<cvf::Vec3d, 8>& hexCorners, const std::array<double, 8>& values )
|
||||
{
|
||||
//
|
||||
std::array<cvf::Vec3d, 8> gradientsUVW;
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
class RigHexGradientTools
|
||||
{
|
||||
public:
|
||||
static std::array<cvf::Vec3d, 8> gradients( const std::array<cvf::Vec3d, 8>& hexCorners,
|
||||
const std::array<double, 8>& values );
|
||||
static std::array<cvf::Vec3d, 8> gradients( const std::array<cvf::Vec3d, 8>& hexCorners, const std::array<double, 8>& values );
|
||||
|
||||
private:
|
||||
// Private to avoid instantiation
|
||||
|
||||
@@ -88,11 +88,11 @@ void RivFemElmVisibilityCalculator::computeRangeVisibility( cvf::UByteArray*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivFemElmVisibilityCalculator::computePropertyVisibility( cvf::UByteArray* cellVisibility,
|
||||
const RigFemPart* part,
|
||||
int timeStepIndex,
|
||||
int frameIndex,
|
||||
const cvf::UByteArray* rangeFilterVisibility,
|
||||
void RivFemElmVisibilityCalculator::computePropertyVisibility( cvf::UByteArray* cellVisibility,
|
||||
const RigFemPart* part,
|
||||
int timeStepIndex,
|
||||
int frameIndex,
|
||||
const cvf::UByteArray* rangeFilterVisibility,
|
||||
RimGeoMechPropertyFilterCollection* propFilterColl )
|
||||
{
|
||||
CVF_ASSERT( cellVisibility != nullptr );
|
||||
|
||||
@@ -36,9 +36,7 @@ class RivFemElmVisibilityCalculator
|
||||
{
|
||||
public:
|
||||
static void computeAllVisible( cvf::UByteArray* elmVisibilities, const RigFemPart* femPart );
|
||||
static void computeRangeVisibility( cvf::UByteArray* elmVisibilities,
|
||||
const RigFemPart* femPart,
|
||||
const cvf::CellRangeFilter& rangeFilter );
|
||||
static void computeRangeVisibility( cvf::UByteArray* elmVisibilities, const RigFemPart* femPart, const cvf::CellRangeFilter& rangeFilter );
|
||||
|
||||
static void computePropertyVisibility( cvf::UByteArray* cellVisibility,
|
||||
const RigFemPart* grid,
|
||||
@@ -54,7 +52,6 @@ public:
|
||||
const RimCellFilter::FilterModeType filterType,
|
||||
cvf::UByteArray* cellVisibility );
|
||||
|
||||
static void computeOverriddenCellVisibility( cvf::UByteArray* elmVisibilities,
|
||||
const RigFemPart* femPart,
|
||||
RimViewController* masterViewLink );
|
||||
static void
|
||||
computeOverriddenCellVisibility( cvf::UByteArray* elmVisibilities, const RigFemPart* femPart, RimViewController* masterViewLink );
|
||||
};
|
||||
|
||||
@@ -169,19 +169,14 @@ void RivFemPartGeometryGenerator::computeArrays( const std::vector<cvf::Vec3f>&
|
||||
continue; // Invisible face
|
||||
}
|
||||
|
||||
int faceNodeCount = 0;
|
||||
const int* localElmNodeIndicesForFace =
|
||||
RigFemTypes::localElmNodeIndicesForFace( eType, lfIdx, &faceNodeCount );
|
||||
int faceNodeCount = 0;
|
||||
const int* localElmNodeIndicesForFace = RigFemTypes::localElmNodeIndicesForFace( eType, lfIdx, &faceNodeCount );
|
||||
if ( faceNodeCount == 4 )
|
||||
{
|
||||
cvf::Vec3f quadVxs0( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[0]]] ) -
|
||||
m_displayOffset );
|
||||
cvf::Vec3f quadVxs1( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[1]]] ) -
|
||||
m_displayOffset );
|
||||
cvf::Vec3f quadVxs2( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[2]]] ) -
|
||||
m_displayOffset );
|
||||
cvf::Vec3f quadVxs3( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[3]]] ) -
|
||||
m_displayOffset );
|
||||
cvf::Vec3f quadVxs0( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[0]]] ) - m_displayOffset );
|
||||
cvf::Vec3f quadVxs1( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[1]]] ) - m_displayOffset );
|
||||
cvf::Vec3f quadVxs2( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[2]]] ) - m_displayOffset );
|
||||
cvf::Vec3f quadVxs3( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[3]]] ) - m_displayOffset );
|
||||
|
||||
int qNodeIdx[4];
|
||||
qNodeIdx[0] = elmNodeIndices[localElmNodeIndicesForFace[0]];
|
||||
@@ -253,10 +248,9 @@ void RivFemPartGeometryGenerator::setElementVisibility( const cvf::UByteArray* c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo>
|
||||
RivFemPartGeometryGenerator::createMeshDrawableFromSingleElement( const RigFemPart* part,
|
||||
size_t elmIdx,
|
||||
const cvf::Vec3d& displayModelOffset )
|
||||
cvf::ref<cvf::DrawableGeo> RivFemPartGeometryGenerator::createMeshDrawableFromSingleElement( const RigFemPart* part,
|
||||
size_t elmIdx,
|
||||
const cvf::Vec3d& displayModelOffset )
|
||||
{
|
||||
cvf::ref<cvf::Vec3fArray> quadVertices;
|
||||
|
||||
@@ -276,14 +270,14 @@ cvf::ref<cvf::DrawableGeo>
|
||||
const int* localElmNodeIndicesForFace = RigFemTypes::localElmNodeIndicesForFace( eType, lfIdx, &faceNodeCount );
|
||||
if ( faceNodeCount == 4 )
|
||||
{
|
||||
vertices.push_back( cvf::Vec3f(
|
||||
cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[0]]] ) - displayModelOffset ) );
|
||||
vertices.push_back( cvf::Vec3f(
|
||||
cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[1]]] ) - displayModelOffset ) );
|
||||
vertices.push_back( cvf::Vec3f(
|
||||
cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[2]]] ) - displayModelOffset ) );
|
||||
vertices.push_back( cvf::Vec3f(
|
||||
cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[3]]] ) - displayModelOffset ) );
|
||||
vertices.push_back(
|
||||
cvf::Vec3f( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[0]]] ) - displayModelOffset ) );
|
||||
vertices.push_back(
|
||||
cvf::Vec3f( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[1]]] ) - displayModelOffset ) );
|
||||
vertices.push_back(
|
||||
cvf::Vec3f( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[2]]] ) - displayModelOffset ) );
|
||||
vertices.push_back(
|
||||
cvf::Vec3f( cvf::Vec3d( nodeCoordinates[elmNodeIndices[localElmNodeIndicesForFace[3]]] ) - displayModelOffset ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -86,17 +86,13 @@ public:
|
||||
|
||||
const std::vector<size_t>& quadVerticesToNodeIdxMapping() const { return m_quadVerticesToNodeIdx; }
|
||||
const std::vector<size_t>& quadVerticesToGlobalElmNodeIdx() const { return m_quadVerticesToGlobalElmNodeIdx; }
|
||||
const std::vector<size_t>& quadVerticesToGlobalElmFaceNodeIdx() const
|
||||
{
|
||||
return m_quadVerticesToGlobalElmFaceNodeIdx;
|
||||
}
|
||||
const std::vector<size_t>& quadVerticesToGlobalElmFaceNodeIdx() const { return m_quadVerticesToGlobalElmFaceNodeIdx; }
|
||||
const std::vector<size_t>& quadVerticesToGlobalElmIdx() const { return m_quadVerticesToGlobalElmIdx; }
|
||||
|
||||
RivFemPartTriangleToElmMapper* triangleToElementMapper() { return m_triangleMapper.p(); }
|
||||
|
||||
static cvf::ref<cvf::DrawableGeo> createMeshDrawableFromSingleElement( const RigFemPart* grid,
|
||||
size_t elementIndex,
|
||||
const cvf::Vec3d& displayModelOffset );
|
||||
static cvf::ref<cvf::DrawableGeo>
|
||||
createMeshDrawableFromSingleElement( const RigFemPart* grid, size_t elementIndex, const cvf::Vec3d& displayModelOffset );
|
||||
|
||||
private:
|
||||
void computeArrays( const std::vector<cvf::Vec3f>& nodeCoordinates );
|
||||
|
||||
@@ -109,9 +109,7 @@ void RivFemPartPartMgr::setCellVisibility( cvf::UByteArray* cellVisibilities )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivFemPartPartMgr::setDisplacements( bool useDisplacements,
|
||||
double scalingFactor,
|
||||
const std::vector<cvf::Vec3f>& displacements )
|
||||
void RivFemPartPartMgr::setDisplacements( bool useDisplacements, double scalingFactor, const std::vector<cvf::Vec3f>& displacements )
|
||||
{
|
||||
size_t nodeCount = m_part->nodes().coordinates.size();
|
||||
m_displacedNodeCoordinates.resize( nodeCount );
|
||||
|
||||
@@ -83,10 +83,7 @@ void RivGeoMechVizLogic::appendPartsToModel( int viewerStepIndex, cvf::ModelBasi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivGeoMechVizLogic::updateCellResultColor( int viewerStepIndex,
|
||||
int timeStepIndex,
|
||||
int frameIndex,
|
||||
RimGeoMechCellColors* cellResultColors )
|
||||
void RivGeoMechVizLogic::updateCellResultColor( int viewerStepIndex, int timeStepIndex, int frameIndex, RimGeoMechCellColors* cellResultColors )
|
||||
{
|
||||
std::vector<RivGeoMechPartMgrCache::Key> visiblePartMgrs = keysToVisiblePartMgrs( viewerStepIndex );
|
||||
for ( size_t pmIdx = 0; pmIdx < visiblePartMgrs.size(); ++pmIdx )
|
||||
@@ -218,10 +215,9 @@ RivGeoMechPartMgr* RivGeoMechVizLogic::getUpdatedPartMgr( RivGeoMechPartMgrCache
|
||||
|
||||
if ( m_geomechView->geoMechCase() )
|
||||
{
|
||||
caseData = m_geomechView->geoMechCase()->geoMechData();
|
||||
partCount = caseData->femParts()->partCount();
|
||||
std::tie( timeStepIdx, frameIdx ) =
|
||||
caseData->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( pMgrKey.viewerStepIndex() );
|
||||
caseData = m_geomechView->geoMechCase()->geoMechData();
|
||||
partCount = caseData->femParts()->partCount();
|
||||
std::tie( timeStepIdx, frameIdx ) = caseData->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( pMgrKey.viewerStepIndex() );
|
||||
}
|
||||
|
||||
if ( partMgrToUpdate->initializedFemPartCount() != partCount )
|
||||
@@ -243,9 +239,7 @@ RivGeoMechPartMgr* RivGeoMechVizLogic::getUpdatedPartMgr( RivGeoMechPartMgrCache
|
||||
{
|
||||
cvf::CellRangeFilter cellRangeFilter;
|
||||
m_geomechView->cellFilterCollection()->compoundCellRangeFilter( &cellRangeFilter, femPartIdx );
|
||||
RivFemElmVisibilityCalculator::computeRangeVisibility( elmVisibility.p(),
|
||||
caseData->femParts()->part( femPartIdx ),
|
||||
cellRangeFilter );
|
||||
RivFemElmVisibilityCalculator::computeRangeVisibility( elmVisibility.p(), caseData->femParts()->part( femPartIdx ), cellRangeFilter );
|
||||
}
|
||||
else if ( pMgrKey.geometryType() == PROPERTY_FILTERED )
|
||||
{
|
||||
|
||||
@@ -54,8 +54,7 @@ public:
|
||||
virtual std::map<std::string, std::vector<std::string>> scalarElementNodeFieldAndComponentNames() = 0;
|
||||
virtual std::map<std::string, std::vector<std::string>> scalarIntegrationPointFieldAndComponentNames() = 0;
|
||||
|
||||
virtual void
|
||||
readDisplacements( int partIndex, int stepIndex, int frameIndex, std::vector<cvf::Vec3f>* displacements ) = 0;
|
||||
virtual void readDisplacements( int partIndex, int stepIndex, int frameIndex, std::vector<cvf::Vec3f>* displacements ) = 0;
|
||||
|
||||
virtual void readNodeField( const std::string& fieldName,
|
||||
int partIndex,
|
||||
|
||||
@@ -646,11 +646,7 @@ odb_Instance* RifOdbReader::instance( int instanceIndex )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Get the number of result items (== #nodes or #elements)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RifOdbReader::resultItemCount( const std::string& fieldName,
|
||||
int partIndex,
|
||||
int stepIndex,
|
||||
int frameIndex,
|
||||
ResultPosition resultPosition )
|
||||
size_t RifOdbReader::resultItemCount( const std::string& fieldName, int partIndex, int stepIndex, int frameIndex, ResultPosition resultPosition )
|
||||
{
|
||||
odb_Instance* partInstance = instance( partIndex );
|
||||
CVF_ASSERT( partInstance != NULL );
|
||||
@@ -828,10 +824,10 @@ void RifOdbReader::readNodeField( const std::string& fieldName,
|
||||
}
|
||||
}
|
||||
|
||||
const odb_Frame& frame = stepFrame( stepIndex, frameIndex );
|
||||
const odb_FieldOutput& instanceFieldOutput = frame.fieldOutputs()[fieldName.c_str()].getSubset( *partInstance );
|
||||
const odb_FieldOutput& fieldOutput = instanceFieldOutput.getSubset( odb_Enum::NODAL );
|
||||
const odb_SequenceFieldBulkData& seqFieldBulkData = fieldOutput.bulkDataBlocks();
|
||||
const odb_Frame& frame = stepFrame( stepIndex, frameIndex );
|
||||
const odb_FieldOutput& instanceFieldOutput = frame.fieldOutputs()[fieldName.c_str()].getSubset( *partInstance );
|
||||
const odb_FieldOutput& fieldOutput = instanceFieldOutput.getSubset( odb_Enum::NODAL );
|
||||
const odb_SequenceFieldBulkData& seqFieldBulkData = fieldOutput.bulkDataBlocks();
|
||||
|
||||
int numBlocks = seqFieldBulkData.size();
|
||||
for ( int block = 0; block < numBlocks; block++ )
|
||||
@@ -883,10 +879,10 @@ void RifOdbReader::readElementNodeField( const std::string& field
|
||||
}
|
||||
}
|
||||
|
||||
const odb_Frame& frame = stepFrame( stepIndex, frameIndex );
|
||||
const odb_FieldOutput& instanceFieldOutput = frame.fieldOutputs()[fieldName.c_str()].getSubset( *partInstance );
|
||||
const odb_FieldOutput& fieldOutput = instanceFieldOutput.getSubset( odb_Enum::ELEMENT_NODAL );
|
||||
const odb_SequenceFieldBulkData& seqFieldBulkData = fieldOutput.bulkDataBlocks();
|
||||
const odb_Frame& frame = stepFrame( stepIndex, frameIndex );
|
||||
const odb_FieldOutput& instanceFieldOutput = frame.fieldOutputs()[fieldName.c_str()].getSubset( *partInstance );
|
||||
const odb_FieldOutput& fieldOutput = instanceFieldOutput.getSubset( odb_Enum::ELEMENT_NODAL );
|
||||
const odb_SequenceFieldBulkData& seqFieldBulkData = fieldOutput.bulkDataBlocks();
|
||||
|
||||
std::map<int, int>& elementIdToIdxMap = m_elementIdToIdxMaps[partIndex];
|
||||
CVF_ASSERT( elementIdToIdxMap.size() > 0 );
|
||||
@@ -955,10 +951,10 @@ void RifOdbReader::readIntegrationPointField( const std::string&
|
||||
}
|
||||
}
|
||||
|
||||
const odb_Frame& frame = stepFrame( stepIndex, frameIndex );
|
||||
const odb_FieldOutput& instanceFieldOutput = frame.fieldOutputs()[fieldName.c_str()].getSubset( *partInstance );
|
||||
const odb_FieldOutput& fieldOutput = instanceFieldOutput.getSubset( odb_Enum::INTEGRATION_POINT );
|
||||
const odb_SequenceFieldBulkData& seqFieldBulkData = fieldOutput.bulkDataBlocks();
|
||||
const odb_Frame& frame = stepFrame( stepIndex, frameIndex );
|
||||
const odb_FieldOutput& instanceFieldOutput = frame.fieldOutputs()[fieldName.c_str()].getSubset( *partInstance );
|
||||
const odb_FieldOutput& fieldOutput = instanceFieldOutput.getSubset( odb_Enum::INTEGRATION_POINT );
|
||||
const odb_SequenceFieldBulkData& seqFieldBulkData = fieldOutput.bulkDataBlocks();
|
||||
|
||||
std::map<int, int>& elementIdToIdxMap = m_elementIdToIdxMaps[partIndex];
|
||||
CVF_ASSERT( elementIdToIdxMap.size() > 0 );
|
||||
|
||||
@@ -103,14 +103,10 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
void assertMetaDataLoaded();
|
||||
void close();
|
||||
size_t resultItemCount( const std::string& fieldName,
|
||||
int partIndex,
|
||||
int stepIndex,
|
||||
int frameIndex,
|
||||
ResultPosition resultPosition );
|
||||
size_t componentsCount( const std::string& fieldName, ResultPosition position );
|
||||
void assertMetaDataLoaded();
|
||||
void close();
|
||||
size_t resultItemCount( const std::string& fieldName, int partIndex, int stepIndex, int frameIndex, ResultPosition resultPosition );
|
||||
size_t componentsCount( const std::string& fieldName, ResultPosition position );
|
||||
const odb_Frame& stepFrame( int stepIndex, int frameIndex ) const;
|
||||
odb_Instance* instance( int instanceIndex );
|
||||
|
||||
|
||||
@@ -58,12 +58,10 @@ TEST( OdbReaderTest, BasicTests )
|
||||
std::map<std::string, std::vector<std::string>> scalarNodeFieldsMap = reader->scalarNodeFieldAndComponentNames();
|
||||
EXPECT_EQ( 3, scalarNodeFieldsMap.size() );
|
||||
|
||||
std::map<std::string, std::vector<std::string>> scalarElementNodeFieldsMap =
|
||||
reader->scalarElementNodeFieldAndComponentNames();
|
||||
std::map<std::string, std::vector<std::string>> scalarElementNodeFieldsMap = reader->scalarElementNodeFieldAndComponentNames();
|
||||
EXPECT_EQ( 0, scalarElementNodeFieldsMap.size() );
|
||||
|
||||
std::map<std::string, std::vector<std::string>> scalarIntegrationPointFieldsMap =
|
||||
reader->scalarIntegrationPointFieldAndComponentNames();
|
||||
std::map<std::string, std::vector<std::string>> scalarIntegrationPointFieldsMap = reader->scalarIntegrationPointFieldAndComponentNames();
|
||||
EXPECT_EQ( 6, scalarIntegrationPointFieldsMap.size() );
|
||||
|
||||
std::vector<float> displacementValues;
|
||||
|
||||
Reference in New Issue
Block a user