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
- property Components: dict[str, N2PComponent]#
- property DerivedComponents: dict[str, N2PComponent]#
Returns a list of N2Component with all the derived components available within the result
- property Description: str#
- property Name: str#
- property Position: str#
Returns the position where the results have been obatined within the load case
- property TypesElements: list[str]#
Returns a list with the element types where results are available.
- 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:
N2PComponent
- Return type:
component
- get_derived_component(name: str) N2PComponent [source]#
Returns a N2Component as derived component with name specified,
- Parameters:
name – str
- Returns:
N2PComponent
- Return type:
derived component
- 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:
N2PComponent
- Return type:
component
- 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:
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)")