N2PResult#

class NaxToPy.Core.Classes.N2PResult.N2PResult(components, position, derivedComps, description, elemTypes, name, loadCase_father)[source]#

Bases: object

Class which contains the information associated to a result of a N2PLoadCase

get_component(name: str) N2PComponent[source]#

Returns a N2Component as component with name specified. It can be a Raw Component or a derived component

Parameters:

name – str

Returns:

component

Return type:

N2PComponent

get_derived_component(name: str) N2PComponent[source]#

Returns a N2Component as derived component with name specified,

Parameters:

namestr

Returns:

derived component

Return type:

N2PComponent

get_raw_component(name: str) N2PComponent[source]#

Returns a N2Component as component with name specified. It checks only in the original list of components

Parameters:

name – str

Returns:

component

Return type:

N2PComponent

new_derived_component(name: str, formula: str) N2PComponent[source]#

Generate a new N2PComponent combination of n components from N2PResult.

These combinations can be obtained later with the method get_derived_component().

To define the combination, pass a string with the result and component names, along with the arithmetic commands as strings. The name of the new derived component must be set. To add a component to the formula, it must start with CMPT_ followed by the Result name (the result must be the same) if it is an original component, and with CMPTD (only that), then : and finally the Component name.

The Result|Component must have this structure: <CMPT_Result:Component> or <CMPTD:Component>.

Parameters:
  • name (str) – The name of the component.

  • formula (str) – String containing the Result:Component intended to be used and the arithmetic operations.

Returns:

Derived load case.

Return type:

N2PComponent

Examples

>>> N2PResult.new_derived_component("dev_comp1", formula="<0.5*CMPT_DISPLACEMENTS:MAGNITUDE_D>+2*<CMPT_DISPLACEMENTS:MAGNITUDE_R>")
>>> N2PResult.new_derived_component("dev_comp2", formula="(<CMPTD:Example>-2*<CMPT_DISPLACEMENTS:MAGNITUDE_R>)^2"
>>> N2PResult.new_derived_component("dev_comp3", formula="sqrt(<CMPT_STRESSES:XX>^2+<CMPT_STRESSES:YY>^2-<CMPT_STRESSES:XX>*<CMPT_STRESSES:YY>+3*<CMPT_STRESSES:XY>^2)")
property Components: dict[str, N2PComponent]#

Dictionary with the name of the components as keys and N2PComponent as values

property DerivedComponents: dict[str, N2PComponent]#

Returns a list of N2Component with all the derived components available within the result

property Description: str#

Descriprion of the result

property Name: str#
property Position: str#

Returns the position where the results have been obtained within the load case

property TypesElements: list[str]#

Returns a list with the element types where results are available.