Skip to content

Commit

Permalink
Use correct result name for Void ratio
Browse files Browse the repository at this point in the history
Enable porosity calculator for imported inp data
Add model validation check for export/show model
Fix last res. layer not being splitted into subelements
  • Loading branch information
jonjenssen committed Dec 18, 2023
1 parent 9e1a09b commit 32d5ace
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void RicExportInpFileFeature::onActionTriggered( bool isChecked )
if ( !isOk )
{
const QString frmTitle( "Fault Reactivation Modeling" );
QString outErrorText =
QString outErrorText =
QString( "Failed to export INP model to file %1.\n\n%2" ).arg( exportFile ).arg( QString::fromStdString( errorMessage ) );
QMessageBox::critical( nullptr, frmTitle, outErrorText );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ std::map<std::string, std::vector<std::string>> RigFemPartResultsCollection::sca
{
fieldCompNames = m_readerInterface->scalarNodeFieldAndComponentNames();
fieldCompNames[RigFemAddressDefines::porBar()];
if ( fieldCompNames.contains( "VOIDR" ) ) fieldCompNames["PORO-PERM"].push_back( "PHI0" );

if ( m_readerInterface->populateDerivedResultNames() )
{
Expand All @@ -584,7 +585,10 @@ std::map<std::string, std::vector<std::string>> RigFemPartResultsCollection::sca
{
fieldCompNames = m_readerInterface->scalarElementNodeFieldAndComponentNames();

if ( !m_readerInterface->populateDerivedResultNames() ) return fieldCompNames;
if ( !m_readerInterface->populateDerivedResultNames() )
{
return fieldCompNames;
}

fieldCompNames["SE"].push_back( "SM" );
fieldCompNames["SE"].push_back( "SFI" );
Expand Down
2 changes: 1 addition & 1 deletion ApplicationLibCode/GeoMech/OdbReader/RifInpReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ RigElementType RifInpReader::read( std::istream&
else if ( prevline.starts_with( "*INITIAL" ) )
{
auto label = parseLabel( prevline, "type" );
if ( label == "RATIO" ) propertyName = "RATIO";
if ( label == "RATIO" ) propertyName = "VOIDR";
resultType = RigFemResultPosEnum::RIG_NODAL;
}
if ( propertyName.empty() )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,9 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm
sizeModelGrp->add( &m_modelMinZ );
sizeModelGrp->add( &m_modelBelowSize );

if ( m_geomechCase() != nullptr )
const bool hasGeoMechCase = ( m_geomechCase() != nullptr );

if ( hasGeoMechCase )
{
m_modelMinZ.setValue( std::abs( m_geomechCase->allCellsBoundingBox().max().z() ) );
m_modelMinZ.uiCapability()->setUiReadOnly( true );
Expand Down Expand Up @@ -462,14 +464,14 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm
propertiesGrp->add( &m_useGridPorePressure );
propertiesGrp->add( &m_useGridVoidRatio );
propertiesGrp->add( &m_useGridTemperature );
propertiesGrp->add( &m_useGridDensity );
propertiesGrp->add( &m_useGridElasticProperties );
propertiesGrp->add( &m_useGridStress );
propertiesGrp->add( &m_waterDensity );

auto trgGroup = uiOrdering.addNewGroup( "Debug" );
trgGroup->setCollapsedByDefault();
trgGroup->add( &m_targets );

if ( hasGeoMechCase )
{
propertiesGrp->add( &m_useGridDensity );
propertiesGrp->add( &m_useGridElasticProperties );
propertiesGrp->add( &m_useGridStress );
propertiesGrp->add( &m_waterDensity );
}

uiOrdering.skipRemainingFields();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

#include "cafHexGridIntersectionTools/cafHexGridIntersectionTools.h"

#include <ranges>

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -572,39 +574,31 @@ void RigFaultReactivationModelGenerator::splitLargeLayers( std::map<double, cvf:
{
std::vector<cvf::Vec3d> additionalPoints;

std::pair<double, cvf::Vec3d> prevLayer;
std::vector<int> newKLayers;
std::vector<int> newKLayers;

bool first = true;
int k = 0;
const int nLayers = (int)layers.size();
const int nKLayers = (int)kLayers.size();

const int nLayers = (int)layers.size();
int n = 0;
auto kv = std::views::keys( layers );
std::vector<double> keys{ kv.begin(), kv.end() };
auto vv = std::views::values( layers );
std::vector<cvf::Vec3d> vals{ vv.begin(), vv.end() };

for ( auto& layer : layers )
for ( int k = 0; k < nLayers; k++ )
{
if ( n++ == ( nLayers - 1 ) ) break;

if ( first )
{
prevLayer = layer;
first = false;
newKLayers.push_back( kLayers[k++] );
continue;
}

if ( std::abs( prevLayer.first - layer.first ) > maxHeight )
if ( k > 0 )
{
const auto& points = interpolateExtraPoints( prevLayer.second, layer.second, maxHeight );
for ( auto& p : points )
if ( std::abs( keys[k] - keys[k - 1] ) > maxHeight )
{
additionalPoints.push_back( p );
newKLayers.push_back( kLayers[k - 1] );
const auto& points = interpolateExtraPoints( vals[k - 1], vals[k], maxHeight );
for ( auto& p : points )
{
additionalPoints.push_back( p );
newKLayers.push_back( kLayers[k - 1] );
}
}
}

prevLayer = layer;
newKLayers.push_back( kLayers[k++] );
if ( k < nKLayers ) newKLayers.push_back( kLayers[k] );
}

for ( auto& p : additionalPoints )
Expand Down

0 comments on commit 32d5ace

Please sign in to comment.