N2PComponent#

class NaxToPy.Core.Classes.N2PComponent.N2PComponent(name, sections, result_father)[source]#

Bases: object

Class which contains the information associated to a component of a N2PResult instance.

Name#

str.

Sections#

list[N2PSection].

IsTransformable#

bool.

property IsTransformable: bool#

Property that keeps if the component of a result is transformable in other coordinate system.

property Name: str#
property Sections: list[N2PSection, ...]#

Returns a list of N2PSection objects with all the sections contained in the component

get_result_array(sections=None, aveSections=-1, cornerData=False, aveNodes=-1, variation=100, realPolar=0, coordsys: int = -1000, v1: tuple = (1, 0, 0), v2: tuple = (0, 1, 0)) tuple[list, str][source]#

Deprecated method. Please, use get_result_list instead for asking the results as a list. If a numpy array is preferred, use get_result_ndarray

get_result_list(sections=None, aveSections=-1, cornerData=False, aveNodes=-1, variation=100, realPolar=0, coordsys: int = -1000, v1: tuple | ndarray = (1, 0, 0), v2: tuple | ndarray = (0, 1, 0)) tuple[list, str][source]#

Returns a tuple with the list of floats with the result array asked and a str with the position of the results

Parameters:
  • sections – list[str] | list[N2PSection] -> Optional. Sections which operations are done. None (Default) = All Sections

  • aveSections

    int -> Optional. Operation Among Sections.

    -1 : Maximum (Default), -2 : Minimum, -3 : Average, -4 : Extreme, -6 : Difference.

  • cornerData

    bool -> Optional. Flag to get results in element nodal.

    True : Results in Element-Nodal, False : Results in centroid (Default).

  • aveNodes

    int -> Optional. Operation among nodes when cornerData is selected.

    0 : None,

    -1 : Maximum (Default), -2 : Minimum, -3 : Average, -6 : Difference.

  • variation

    int -> Optional. Integer between 0 & 100 to select.

    0 : No average between nodes, 100 : Total average between nodes (Default).

  • realPolar

    int -> Optional. Data type when complex result.

    1 : Real / Imaginary, 2 : Magnitude / Phase.

  • coordsys

    int -> Optional. Coordinate System where the result_array will be represented. By default, the output is in element system:

    0 : Global, -1 : Material Coordinate System, -10 : User defined, -20 : Element/Node User Defined, >0 : Solver ID of the Predefined Coordinate System.

  • v1 – tuple -> Optional.

  • v2

    tuple -> Optional. Directions vectors that generate the coordinate system axis:

    x=v1, z=v1^v2, y=z^x.

Returns:

tuple(list[float], str)

Return type:

results

get_result_ndarray(sections=None, aveSections=-1, cornerData=False, aveNodes=-1, variation=100, realPolar=0, coordsys: int = -1000, v1: tuple | ndarray = (1, 0, 0), v2: tuple | ndarray = (0, 1, 0), filter_list: list = None) tuple[array, str][source]#

Returns a tuple with the numpy array of floats with the result array asked and a str with the position of the results

Parameters:
  • sections – list[str] | list[N2PSection] -> Optional. Sections which operations are done. None (Default) = All Sections

  • aveSections

    int -> Optional. Operation Among Sections.

    -1 : Maximum (Default), -2 : Minimum, -3 : Average, -4 : Extreme, -6 : Difference.

  • cornerData

    bool -> Optional. Flag to get results in element nodal.

    True : Results in Element-Nodal, False : Results in centroid (Default).

  • aveNodes

    int -> Optional. Operation among nodes when cornerData is selected.

    0 : None,

    -1 : Maximum (Default), -2 : Minimum, -3 : Average, -6 : Difference.

  • variation

    int -> Optional. Integer between 0 & 100 to select.

    0 : No average between nodes, 100 : Total average between nodes (Default).

  • realPolar

    int -> Optional. Data type when complex result.

    1 : Real / Imaginary, 2 : Magnitude / Phase.

  • coordsys

    int -> Optional. Coordinate System where the result_array will be represented. By default, the output is in element system:

    0 : Global, -1 : Material Coordinate System, -10 : User defined, -20 : Element/Node User Defined, >0 : Solver ID of the Predefined Coordinate System.

  • v1 – tuple -> Optional.

  • v2

    tuple -> Optional. Directions vectors that generate the coordinate system axis:

    x=v1, z=v1^v2, y=z^x.

  • filter_n2p – list[N2PElement|N2PNode] (optional) List with the N2PElement or N2PNode where the results are asked. Filtering the results slows the result extraction. If the results are needed in two separate list of itmes (nodes or elements) ask first for both and filter them later.

Returns:

tuple(np.array, str)

Return type:

results

Examples
>>> # N2PComponent is a N2PLoadCase.get_results("DISPLACEMENTS").get_component("X")
>>> displ_X_array, where = N2PComponent.get_result_ndarray(aveSections=-3, coordsys=-1)
>>> # N2PComponent is a N2PLoadCase.get_results("STRESSES").get_component("XX")
>>> stress_array, where = N2PComponent.get_result_ndarray(v1=(-1, 0, 0), v2=(0, -1, 0))