Python: Add api and example to get fracture template scale factors.

This commit is contained in:
Kristian Bendiksen 2022-10-28 14:14:14 +02:00 committed by Magne Sjaastad
parent 4c3e1c3fe8
commit 26dd61a604
2 changed files with 23 additions and 10 deletions

View File

@ -202,16 +202,16 @@ RimFractureTemplate::RimFractureTemplate()
m_dFactorSummaryText.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::LabelPosType::TOP );
m_dFactorSummaryText.xmlCapability()->disableIO();
CAF_PDM_InitField( &m_heightScaleFactor, "HeightScaleFactor", 1.0, "Height" );
CAF_PDM_InitField( &m_halfLengthScaleFactor, "WidthScaleFactor", 1.0, "Half Length" );
CAF_PDM_InitField( &m_dFactorScaleFactor, "DFactorScaleFactor", 1.0, "D-factor" );
CAF_PDM_InitField( &m_conductivityScaleFactor,
"ConductivityFactor",
1.0,
"Conductivity",
"",
"The conductivity values read from file will be scaled with this parameters",
"" );
CAF_PDM_InitScriptableField( &m_heightScaleFactor, "HeightScaleFactor", 1.0, "Height" );
CAF_PDM_InitScriptableField( &m_halfLengthScaleFactor, "WidthScaleFactor", 1.0, "Half Length" );
CAF_PDM_InitScriptableField( &m_dFactorScaleFactor, "DFactorScaleFactor", 1.0, "D-factor" );
CAF_PDM_InitScriptableField( &m_conductivityScaleFactor,
"ConductivityFactor",
1.0,
"Conductivity",
"",
"The conductivity values read from file will be scaled with this parameters",
"" );
CAF_PDM_InitField( &m_scaleApplyButton, "ScaleApplyButton", false, "Apply" );
m_scaleApplyButton.xmlCapability()->disableIO();

View File

@ -52,3 +52,16 @@ fracture_template.update()
fracture_template.set_scale_factors(
half_length=2.0, height=2.0, d_factor=1.1, conductivity=1.2
)
# Output scale factors for all fracture templates
fmt_collection = project.descendants(rips.FractureTemplate)
for fracture_template in fmt_collection:
print(
"Fracture: '{}' Scale factors: Height={} Half Length={} D Factor={} Conductivity={}".format(
fracture_template.user_description,
fracture_template.height_scale_factor,
fracture_template.width_scale_factor,
fracture_template.d_factor_scale_factor,
fracture_template.conductivity_factor,
)
)