N2PNastranInputData#

class NaxToPy.Core.Classes.N2PNastranInputData.N2PNastranInputData(dictcardscston2p: dict, inputfiledata)[source]#

Bases: object

Class with the complete data of a MEF input file (text file).

Note

The property N2PModelContent.ModelInputData can be a N2PNastranInputData if the input file is from Nastran (.bdf) or Opstitruct (.fem), or a N2PAbaqusInputData (.inp) if is from Abaqus.

Example

>>> model = n2p.load_model("my_nastran_input_file.bdf")
>>> inputdata = model.ModelInputData  # This is a N2PNastranInputData
create_card(card_type: str, parentBdfFile: object, rawContent: str = None, superElemntId: int = 0) N2PCard[source]#

Method that creates a new card of the type specified.

find_cards(superElements: int, category: Literal['GRID', 'ELEMENT', 'CONNECTOR', 'PROPERTY', 'MATERIAL', 'COORDINATESYSTEM', 'LOAD', 'CONSTRAINT'], cardTypes: list[str] = None, filters: dict[str, object] = None) list[N2PCard][source]#

Searches for cards based on specified criteria:

  • superElements (mandatory): integer number of 8 bits (1 byte)

  • category (mandatory): Element, property, material, etc

  • cardTypes (optional): Specific type of card: CQUAD4, PBEAM, COORD2R

  • filters (optional): Each category has common fields. It is possible to filter acordinf to those fields.
    • GRID: “ID”, “CP”, “CD”, “PS”, “SEID”, “X1”, “X2”, “X3”

    • ELEMENT: “EID, “PID”, “NodeArray”

    • CONNECTOR:

    • PROPERTY: “PID”

    • MATERIAL: “MID”

    • COORDINATESYSTEM: “CoordinateSystemIds”, “ReferenceSystemId”

    • LOAD:

    • CONSTRAINT:

Example

>>> grids = model.ModelInputData.find_cards(0, "GRID")
>>> cuads = model.ModelInputData.find_cards(0, "ELEMENT", ["CQUAD4"])
>>> pshell_3 = model.ModelInputData.find_cards(0, "PROPERTY", ["PSHELL"], {"PID": 3})
>>> grids_cp10 = model.ModelInputData.find_cards(0, "GRID", None, {"CP": 10})
get_cards_by_field(fields: list[str], row: int = 0, col: int = 0) list[N2PCard][source]#

ATTENTION: Deprecated method in version 3.2.0. Use find_cards() instead.

get_failed_cards() list[N2PCard][source]#

Method that returns a list with the N2PCard objects of the input FEM file that have not been mapped correctly.

print_include_hierarchy() None[source]#

Function that prints in the console the hierarchy of includes of a Nastran input file.

print_model_directory_structure() None[source]#

Function that prints in the console the directory structure of a Nastran input file.

rebuild_file(folder: str) None[source]#

Method that writes the solver input file with the same file structure that was read in the folder is specified

Parameters:

folder – str -> Path of the folder where the file or files will be written.

property CaseControlInstructions: list[N2PInputDataNas]#

Executive Control Statements and Control Case Commands

Type:

List with the instructions of the model. They are the commands above the BEGIN BULK

property ExecutiveControlInstructions: list[N2PInputDataNas]#

Executive Control Statements and Control Case Commands

Type:

List with the instructions of the model. They are the commands above the BEGIN BULK

property GetAbsolutePathsOfBdfFiles: list[str]#

List with theabsolute file paths of all BDF files that compose this model

property ListBulkDataCards: list[N2PCard]#

List with the N2PCard objects of the input FEM file. It has all bulk data cards of the model

property ListInstructions: list[N2PInputDataNas]#

Executive Control Statements and Control Case Commands

Type:

List with the instructions of the model. They are the commands above the BEGIN BULK

N2PInputData#