Skip to content

Scripting: geomechanical cell result - #14952

Closed
hnil wants to merge 2 commits into
OPM:devfrom
hnil:scripting-geomech-cell-result
Closed

hnil wants to merge 2 commits into
OPM:devfrom
hnil:scripting-geomech-cell-result

Conversation

@hnil

@hnil hnil commented Oct 16, 2026

Copy link
Copy Markdown
Member

The cell result of a geomechanical view could not be read or set from Python. Position, field and component of RimGeoMechResultDefinition and the view's cell result are now scriptable, and the gRPC update syncs the UI fields and loads the result as for grid results:

cr = view.cell_result(); cr.result_position_type = "ELEMENT_NODAL"
cr.result_field_name = "SE"; cr.result_component_name = "S1"; cr.update()

rips View.case() now also works for geomechanical views, so export_snapshot() does.

🤖 Generated with Claude Code

hnil and others added 2 commits October 15, 2026 09:44
The cell result of a geomechanical view could not be read or set from
Python. Make RimGeoMechResultDefinition (position, field and component)
and the view's cell result scriptable, as for grid views:

    cr = geomech_view.cell_result()
    cr.result_position_type = "ELEMENT_NODAL"
    cr.result_field_name = "SE"
    cr.result_component_name = "S1"
    cr.update()

On update the UI fields are synced and the result loaded, as for the
grid result definition. rips View.case() now also works for
geomechanical views, so View.export_snapshot() does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@kriben kriben left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good, Halvor! See the review for two small nitpicks before merging.

Comment on lines +205 to 209
# Geomechanical views are children of their case
if not hasattr(self, "eclipse_case"):
return self.ancestor(rips.case.Case)

project = self.ancestor(rips.project.Project)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer match on the type of self instead of checking for attributes it does have?

Comment on lines +547 to +549

m_timeLapseBaseTimestep.uiCapability()->setUiReadOnly( resultPositionType() == RIG_WELLPATH_DERIVED );
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this line not part of the updateUiFieldsFromActiveResult method?

@magnesj

magnesj commented Oct 20, 2026

Copy link
Copy Markdown
Member

I did some minor changes to your PR. Created a new PR in the main repo here #14985

@magnesj magnesj closed this Oct 20, 2026
magnesj added a commit that referenced this pull request Oct 21, 2026
Make RimGeoMechResultDefinition (position, field and component) and the view's cell result scriptable, as for grid views.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants