Extract results over a chosen interface Python

Hello, 

I'm trying to write a python script that will extract stress and displacement results from all nodes on a single chosen interface, but am having some trouble with getting results for the interface element, i've tried variations on the code below, but get the error as shown:

Code:

stress_results = g_o.getresults(phase,g_o.ResultTypes.Interface.InterfaceTotalNormalStress,'node')

(also not working: g_o.getresults(interface,phase,g_o.ResultTypes.Interface.InterfaceTotalNormalStress,'node')  ((the structure of which works fine for extracting beam / embedded beam results)

Error (in PLAXIS): 

!!!!> getresults 8 ResultTypes.Interface.InterfaceTotalNormalStress "node"
Invalid parameters. Make sure that the specified parameters match the ones that are expected.

I know the above (when working) will get me node results for every interface in the model. Would there be a way to instruct it to only extract results from an interface with a certain reference? 

As always, any help would be very much appreciated!

Kind regards

Maddie

Parents
  • Dear Maggie,

    Have you checked our documentation? You can find it under Help>Command reference>Output commands>getresults.

    You can find a couple of alternatives (examples) of the syntax of the command that includes any object, e.g., embedded beam or in your case, interface.

    The same for scripting as you are writing a Python script. You can find it under Help>Scripting reference>Output>getresults.

    The one thing I notice in your case is that even though the structure of the command is correct, apparently the variable "interface" is pointing to a number (=8). So the error message is actually correct, something in your specified parameters is not as expected.
    Therefore, I think that somewhere in your script that variable is defined and it should have been, for example, g_o.PositiveInterface_8_1 and not it is just 8.

    If you correct that part in your script then the command should work, which you can verify by running it first in the PLAXIS command line (use the PLAXIS syntax) or via the Interpreter (with Python):

    getresults PositiveInterface_8_1 ResultTypes.Interface.InterfaceTotalNormalStress "node"    # for example

    interface = g_o.PositiveInterface_8_1  # for example
    phase = g_o.Phases[-1]  # for example
    g_o.getresults(interface, phase, g_o.ResultTypes.Interface.InterfaceTotalNormalStress, 'node')

    Answer Verified By: maddie groves 

  • Thanks Stefanos! It was the way i was trying to set the phase, in my ebedded beam one i had an extra stage (the g_o.Phases stage), but had forgotten to use that in this one, so i was just trying to use my phase as "8". All sorted now!

Reply Children
No Data