Skip to content

Commit

Permalink
Update valueAtPosition interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriben committed Dec 8, 2023
1 parent 8b69c04 commit 7eb528a
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ std::vector<double> RimFaultReactivationDataAccess::extractModelData( const RigF
{
for ( auto& node : grid->globalNodes() )
{
double value = accessor->valueAtPosition( node );
double value = accessor->valueAtPosition( node, model, gridPart );
values.push_back( value );
}
}
Expand All @@ -153,7 +153,7 @@ std::vector<double> RimFaultReactivationDataAccess::extractModelData( const RigF
double bottomDepth = computeAverageDepth( corners, { 4, 5, 6, 7 } );

cvf::Vec3d position = RigCaseToCaseCellMapperTools::calculateCellCenter( corners.data() );
double value = accessor->valueAtPosition( position, topDepth, bottomDepth );
double value = accessor->valueAtPosition( position, model, gridPart, topDepth, bottomDepth );
values.push_back( value );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <map>

class RigMainGrid;
class RigFaultReactivationModel;

//==================================================================================================
///
Expand All @@ -41,9 +42,11 @@ class RimFaultReactivationDataAccessor

virtual bool isMatching( RimFaultReactivation::Property property ) const = 0;

virtual double valueAtPosition( const cvf::Vec3d& position,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const = 0;
virtual double valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const = 0;

protected:
virtual void updateResultAccessor() = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ bool RimFaultReactivationDataAccessorGeoMech::isMatching( RimFaultReactivation::
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationDataAccessorGeoMech::valueAtPosition( const cvf::Vec3d& position, double topDepth, double bottomDepth ) const
double RimFaultReactivationDataAccessorGeoMech::valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth,
double bottomDepth ) const

{
if ( !m_resultFrames ) return std::numeric_limits<double>::infinity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ class RimFaultReactivationDataAccessorGeoMech : public RimFaultReactivationDataA

bool isMatching( RimFaultReactivation::Property property ) const override;

double valueAtPosition( const cvf::Vec3d& position,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;
double valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;

private:
void updateResultAccessor() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ bool RimFaultReactivationDataAccessorPorePressure::isMatching( RimFaultReactivat
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationDataAccessorPorePressure::valueAtPosition( const cvf::Vec3d& position, double topDepth, double bottomDepth ) const
double RimFaultReactivationDataAccessorPorePressure::valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth,
double bottomDepth ) const
{
if ( ( m_mainGrid != nullptr ) && m_resultAccessor.notNull() )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ class RimFaultReactivationDataAccessorPorePressure : public RimFaultReactivation

bool isMatching( RimFaultReactivation::Property property ) const override;

double valueAtPosition( const cvf::Vec3d& position,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;
double valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;

private:
void updateResultAccessor() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ bool RimFaultReactivationDataAccessorStress::isMatching( RimFaultReactivation::P
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationDataAccessorStress::valueAtPosition( const cvf::Vec3d& position, double topDepth, double bottomDepth ) const
double RimFaultReactivationDataAccessorStress::valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth,
double bottomDepth ) const
{
if ( !m_porFrames || !m_s11Frames || !m_s22Frames || !m_s33Frames || !m_femPart ) return std::numeric_limits<double>::infinity();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ class RimFaultReactivationDataAccessorStress : public RimFaultReactivationDataAc

bool isMatching( RimFaultReactivation::Property property ) const override;

double valueAtPosition( const cvf::Vec3d& position,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;
double valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;

private:
void updateResultAccessor() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ bool RimFaultReactivationDataAccessorTemperature::isMatching( RimFaultReactivati
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationDataAccessorTemperature::valueAtPosition( const cvf::Vec3d& position, double topDepth, double bottomDepth ) const
double RimFaultReactivationDataAccessorTemperature::valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth,
double bottomDepth ) const
{
if ( ( m_mainGrid != nullptr ) && m_resultAccessor.notNull() )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ class RimFaultReactivationDataAccessorTemperature : public RimFaultReactivationD

bool isMatching( RimFaultReactivation::Property property ) const override;

double valueAtPosition( const cvf::Vec3d& position,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;
double valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;

private:
void updateResultAccessor() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ bool RimFaultReactivationDataAccessorVoidRatio::isMatching( RimFaultReactivation
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationDataAccessorVoidRatio::valueAtPosition( const cvf::Vec3d& position, double topDepth, double bottomDepth ) const
double RimFaultReactivationDataAccessorVoidRatio::valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth,
double bottomDepth ) const
{
if ( ( m_mainGrid != nullptr ) && m_resultAccessor.notNull() )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ class RimFaultReactivationDataAccessorVoidRatio : public RimFaultReactivationDat

bool isMatching( RimFaultReactivation::Property property ) const override;

double valueAtPosition( const cvf::Vec3d& position,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;
double valueAtPosition( const cvf::Vec3d& position,
const RigFaultReactivationModel& model,
RimFaultReactivation::GridPart gridPart,
double topDepth = std::numeric_limits<double>::infinity(),
double bottomDepth = std::numeric_limits<double>::infinity() ) const override;

private:
void updateResultAccessor() override;
Expand Down

0 comments on commit 7eb528a

Please sign in to comment.