get_results#
- dlubal.api.rfem.Application.get_results(self, results_id: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7eabcbea5c40>, filters: ~collections.abc.Iterable[~dlubal.api.rfem.results.results_query_pb2.ResultsFilter] | None = None, **keyword_filters)#
GetResults returns Table, which is just a convenience wrapper around a Pandas Dataframe. The Dataframe can be directly accessed as .data
- Parameters:
results_id (list[obj]) – A list of objects to be deleted. Refer to the dlubal.api.rfem for available objects. example: ResultsId.RESULTS_ID_TEST
filters (ResultsFilter, optional) – Filter to get only relevant results. Valid filter expressions are: “min”, “max”, “>value”, “<value”, and just “value” for equality. example: filters=[ResultsFilter(column_id=”support_force_p_x”, filter_expression=”max”)]
- Returns:
Requested results in form of table.
- Return type:
Table(data_frame)
from dlubal.api import rfem # Connect to the RFEM application with rfem.Application() as rfem_app: rfem_app.create_model(name='results_dummy_data') print("All results (from test data):") results = rfem_app.get_results(rfem.results.ResultsId.RESULTS_ID_TEST) print(results.data) print() # GetResults returns Table, which is just a convenience wrapper around a Pandas Dataframe, # the Dataframe can be directly accessed as .data print("Filtered results:") results = rfem_app.get_results( rfem.results.ResultsId.RESULTS_ID_TEST, filters=[rfem.results.ResultsFilter( column_id="support_force_p_x", filter_expression="max")], ) print(results.data) print() # Valid filter expressions are: "min", "max", ">value", "<value", and just "value" for equality print("Filtered results (simplified syntax):") results = rfem_app.get_results( rfem.results.ResultsId.RESULTS_ID_TEST, support_force_p_x="max") print(results.data) print() print( "If you need more than one filter on the same column, have to use the full syntax:" ) results = rfem_app.get_results( rfem.results.ResultsId.RESULTS_ID_TEST, filters=[ rfem.results.ResultsFilter( column_id="no", filter_expression=">1"), rfem.results.ResultsFilter( column_id="no", filter_expression="<5"), ], ) print(results.data) for row in results: print(row["support_force_p_x"]) print() print("Get value(s) of one column:") value = rfem_app.get_results( rfem.results.ResultsId.RESULTS_ID_TEST, support_force_p_z="min", no="min" )["node_no"] print(value) print()
Output:
All results (from test data):
no node_no support_forces_label support_force_p_x support_force_p_y support_force_p_z support_moment_m_x support_moment_m_y support_moment_m_z
0 1 4 0.37 0.48 55.87 0.0 0.0 0.0
1 2 8 0.02 0.98 243.99 0.0 0.0 0.0
2 3 12 1.11 0.03 327.11 0.0 0.0 0.0
3 4 12 Px 1.11 0.03 327.11 0.0 0.0 0.0
4 5 8 Px 0.02 0.98 243.99 0.0 0.0 0.0
5 6 8 Py 0.02 0.98 243.99 0.0 0.0 0.0
6 7 12 Py 1.11 0.03 327.11 0.0 0.0 0.0
7 8 12 Pz 1.11 0.03 327.11 0.0 0.0 0.0
8 9 4 Pz 0.37 0.48 55.87 0.0 0.0 0.0
9 10 4 Mx 0.37 0.48 55.87 0.0 0.0 0.0
10 11 4 Mx 0.37 0.48 55.87 0.0 0.0 0.0
11 12 4 My 0.37 0.48 55.87 0.0 0.0 0.0
12 13 4 My 0.37 0.48 55.87 0.0 0.0 0.0
13 14 4 Mz 0.37 0.48 55.87 0.0 0.0 0.0
14 15 8 Mz 0.02 0.98 243.99 0.0 0.0 0.0
Filtered results:
no node_no support_forces_label support_force_p_x support_force_p_y support_force_p_z support_moment_m_x support_moment_m_y support_moment_m_z
0 3 12 1.11 0.03 327.11 0.0 0.0 0.0
1 4 12 Px 1.11 0.03 327.11 0.0 0.0 0.0
2 7 12 Py 1.11 0.03 327.11 0.0 0.0 0.0
3 8 12 Pz 1.11 0.03 327.11 0.0 0.0 0.0
Filtered results (simplified syntax):
no node_no support_forces_label support_force_p_x support_force_p_y support_force_p_z support_moment_m_x support_moment_m_y support_moment_m_z
0 1 4 0.37 0.48 55.87 0.0 0.0 0.0
1 2 8 0.02 0.98 243.99 0.0 0.0 0.0
2 3 12 1.11 0.03 327.11 0.0 0.0 0.0
3 4 12 Px 1.11 0.03 327.11 0.0 0.0 0.0
4 5 8 Px 0.02 0.98 243.99 0.0 0.0 0.0
5 6 8 Py 0.02 0.98 243.99 0.0 0.0 0.0
6 7 12 Py 1.11 0.03 327.11 0.0 0.0 0.0
7 8 12 Pz 1.11 0.03 327.11 0.0 0.0 0.0
8 9 4 Pz 0.37 0.48 55.87 0.0 0.0 0.0
9 10 4 Mx 0.37 0.48 55.87 0.0 0.0 0.0
10 11 4 Mx 0.37 0.48 55.87 0.0 0.0 0.0
11 12 4 My 0.37 0.48 55.87 0.0 0.0 0.0
12 13 4 My 0.37 0.48 55.87 0.0 0.0 0.0
13 14 4 Mz 0.37 0.48 55.87 0.0 0.0 0.0
14 15 8 Mz 0.02 0.98 243.99 0.0 0.0 0.0
If you need more than one filter on the same column, have to use the full syntax:
no node_no support_forces_label support_force_p_x support_force_p_y support_force_p_z support_moment_m_x support_moment_m_y support_moment_m_z
0 2 8 0.02 0.98 243.99 0.0 0.0 0.0
1 3 12 1.11 0.03 327.11 0.0 0.0 0.0
2 4 12 Px 1.11 0.03 327.11 0.0 0.0 0.0
0.02
1.11
1.11
Get value(s) of one column:
[ 4 8 12 12 8 8 12 12 4 4 4 4 4 4 8]