NaxToPy API Reference#

Direct Functions#

class NaxToPy.N2PLog[source]#

Bases: ABC

Class prepared for the control of the program.

It uses the module logging to register the main instructions and data of the NaxToPy Package. It can’t be instanced.

LevelList#
class Critical[source]#

Bases: object

Class with all the critical errors.

The critical are methods that do not return anything, they write in the log file and console the error. Optionally a raise Exception could be added. Always a sys.exit() should be executed at the end.

static C001(message)[source]#
static C100(path, error) str[source]#

Critical error raised when the model couldn’t be initialized.

static C101(error) str[source]#

Critical error raised when the mesh couldn’t be generated.

static C102(py_version) str[source]#

Critical Error raised when the current python version is not supported.

static C103() str[source]#

Critical Error raised when VizzerClasses.dll is not properly load.

static C104() str[source]#

Critical Error raised when the console argument in n2ptoexe is not a bool type.

static C105(directions) None[source]#

Critical Error raised when the argument abaqus version in n2ptoexe is wrong or not supported.

static C106() str[source]#

Critical Error raised when the pyinstaller is not installed and it couldn´t be downloaded.

static C107() str[source]#

Error raised when the NaxTo libraries couldn’t be found.

static C108(path) str[source]#

Error raised when the file couldn’t be found.

static C109(ver, comp_ver) None[source]#

Error raised when NaxTo is not compatible with NaxToPy.

static C110(ver, naxver) str[source]#

Error raised when there aren’t installed a compatible version of with minor changes.

static C111(ver) None[source]#

Error raised when there version of NaxTo is not found.

static C112() str[source]#

Error raised when there is an Elements safearray error in VizzerClasses (Vizzer Error: -1003). This error could happen when the memory of the processor tthat call the low level libraries has a leak (is not correctly erased). A solution may be change the initialize method to parallel.

static C113(lib, ver, listver) str[source]#

Error raised when the NaxToPy versions the dll is compatible with is not this one

static C114(path) str[source]#

Register gave a path to a file that doen’t exist

static C200() None[source]#

Critical error raised when numpy couldn’t be installed.

static C201() None[source]#

Critical error raised when the type of the argument of N2PAbaqusInputData.get_keywords_by_type is not a string.

static C500() None[source]#

Critical error raised when numpy couldn’t be installed.

static C520() None[source]#

Critical error raised when all load cases are broken.

static user(message: str) None[source]#

Method prepared to be called by the user for adding CRITICAL errors to the loggin.

Method prepared to be called by the user for adding CRITICAL errors to the loggin.

Anyone who is using NaxToPy can write in the register their own CRITICAL error message. Use the following structure as a standard message (C + four digits + Body).

Parameters:

message – str

Example

“CXXXX: BODY OF THE MESSAGE”

class Debug[source]#

Bases: object

Class with all the debug data.

The DXXX are methods that keep in the register the information in the debuggibg procces about the processes that the package is keeping. Use only in the debug stages.

static D100(instruction, timee) None[source]#

Method for timing the instructions during debug

static D101(path) None[source]#

Method that shows the location of the NaxToModel library found

static D102() None[source]#

Method that shows if the property Program_Call of N2ModelContent was changed

static D103(parallel) None[source]#

Method that shows the parallel option set at low level

static D200(assembly) None[source]#

Message that shows the assembly version of the core library

static D201(result_file) None[source]#

Message that shows that the results from a file were loaded correctly

static D500(current_time, tinit) None[source]#

Information given for the extraction time.

static D501(current_time, tinit) None[source]#

Information given for computation time of elastic modulus.

static D502(current_time, tinit) None[source]#

Information given for computation time of set intersection

static D503(current_time, tinit) None[source]#

Information given for computation time of fastener update

static D504(current_time, tinit) None[source]#

Information given for loading time of the model

static D600(current_time, tinit) None[source]#

Information given for result obtention time.

static D601(current_time, tinit) None[source]#

Information given for fasteners obtention time.

static D602(current_time, tinit) None[source]#

Information given for fasteners analysis time.

static D603(current_time, tinit) None[source]#

Information given for fasteners attachments obtention time.

static D604(current_time, tinit) None[source]#

Information given for fasteners whole calculation time.

static D605(current_time, tinit) None[source]#

Information given for fasteners distance obtention time.

static D606(current_time, tinit) None[source]#

Information given for fasteners force obtention time.

static D607(current_time, tinit) None[source]#

Information given for fasteners bypass loads obtention time.

static D608(current_time, tinit) None[source]#

Information given for results export time.

static user(message: str) None[source]#

Method prepared to be called by the user for adding debugs data to the loggin

Anyone who is using NaxToPy can write in the register their own debug message. Use the following structure as a standard message (D + four digits + Body).

Parameters:

message – str

Example

“DXXXX: Body of the message”

class Error[source]#

Bases: object

Class with all the errors that can be expected.

They should be handeled by a try-exception clasule. The errors are method that do not return anything, they write in the log file and console the error.

static E101() None[source]#

Error raised when the NaxTo libraries couldn’t be found.

static E102() None[source]#

Error raised when the value to set the directory where the .log file is not a string.

static E103() None[source]#

Error raised when the value to set the file name of the .log is not a string.

static E104() None[source]#

Error raised when directory of the .log couldn’t be changed.

static E105() None[source]#

Error raised when the file name of the .log couldn’t be changed.

static E106() None[source]#

Error raised when there is an error while closing the windows register after modifing.

static E107(levellist) None[source]#

Error raised when the register level is intended to change and the level is not one of the possible choices.

static E108() None[source]#

Error raised when the change of register level of the .log file fails.

static E109() None[source]#

Error raised when the change of register level of the console fails.

static E110(path) None[source]#

Error raised when the n2ptoexe tries to createa exe from a module that dont use NaxToPy.

static E111() str[source]#

Error raised when a file with an extension of a binary result file is intended to be loaded as nastran input text file

static E112(er) str[source]#

Error raised when the Windows Register couldn’t be modified

static E113(file) str[source]#

Error raised when the Windows Register couldn’t be modified

static E201(*args) None[source]#

Error raised when the id of the node is not in the node dictionary.

static E202(*args) None[source]#

Error raised when the id of the element is not in the element dictionary.

static E203(*args) None[source]#

Error raised when the id of the coordinate system is not in the coord dictionary.

static E204(*args) None[source]#

Error raised when the id of the connector is not in the coord dictionary.

static E205(*args) None[source]#

Error raised when the arguments are no recognize by the function.

static E206(arg) None[source]#

Error raised when the component don’t have any results.

static E207(arg) None[source]#

Error raised when there is not any Increment with the ID specified.

static E208() None[source]#

Error raised when there is not any result. Some arguments may be the problem.

static E209(name) None[source]#

Error raised when there is not ID for the property (Abaqus don’t use ids for properties).

static E210(name) None[source]#

Error raised when there is not PartID for the property (Abaqus don’t use ids for properties).

static E211() None[source]#

Error raised when the increment asked is not an id(int) or a name(str).

static E212(id) None[source]#

Error raised when the increment asked is found.

static E213(name) None[source]#

Error raised when the result asked is found.

static E214() None[source]#

Error raised when the result asked is not name(str).

static E215(name) None[source]#

Error raised when the component asked is not found.

static E216() None[source]#

Error raised when the component asked is not name(str).

static E217(name) None[source]#

Error raised when the derived component asked is not found.

static E218() str[source]#

Error raised when the sections asked in the get_array function.

static E219() str[source]#

Error raised when the component selected is not transformable.

static E220() str[source]#

Error raised when there is an error during the processing of the output coord system.

static E221(arg) None[source]#

Error raised when the id of the load case is not found.

static E222(arg) None[source]#

Error raised when the NAME of the load case is not found.

static E223() None[source]#

Error raised when the get element need the part and not only the id.

static E224() None[source]#

Error raised when the get nodes need the part and not only the id.

static E225() None[source]#

Error raised when the get connectors need the part and not only the id.

static E226() None[source]#

Error raised when ABD matrix is not invertible.

static E227(rep_id) None[source]#

Error raised when there is a repeated ID in the properties

static E228(formula, vz_msg) None[source]#

Error raised when the formula introduced for a new derived loadcase is wrong

static E229(formula, vz_msg) None[source]#

Error raised when the formula introduced for a new envelope loadcase is wrong

static E230(formula, vz_msg) None[source]#

Error raised when the formula introduced for a new derived component is wrong

static E231() str[source]#

Error raised when the argument “where” of load_user_coord_sys_from_csv is not “NODES” or “ELEMENTS”

static E232(result_file) None[source]#

Error raised when the file to import results don’t exist

static E233() str[source]#

The filter list contains elements and the result is in nodes

static E234() str[source]#

The filter list contains nodes and the result is in elements

static E235() str[source]#

The filter list are not nodes or elements

static E236(aveNodes, supported) str[source]#

Error when the aveNodes option is not supported

static E237(aveSections, supported) str[source]#

Error when the aveSections option is not supported

static E238(section, actualsections) str[source]#

Error when the sections selected don’t exist

static E239(realPolar, supported) str[source]#

Error when the realPolar option is not supported

static E300(args) None[source]#

Error raised when the program fail to save the model (as a N2PModelContent object).

static E301(args) None[source]#

Error raised when the extension of the file path that is intended to save is wrong.

static E302(args) None[source]#

Error raised when the program faile to load the model (as a N2PModelContent object) from a .N2P file.

static E303(args) None[source]#

Error raised when the extension of the file path that is intended to load is wrong.

static E304() None[source]#

Error raised when NaxToPy.ico is not found.

static E305() None[source]#

Error raised when the length of the columns of the cloud of points don’t macht in N2PEnvelope.

static E306() None[source]#

Error raised when the arguments of envelope are not valid.

static E307() None[source]#

Error raised when the dataframe of envelope has NaN values.

static E308() None[source]#

Error raised when qhull library fails (wrong inputs, coplanar points, etc).

static E309() None[source]#

Error raised when qhull library fails (wrong inputs, coplanar points, etc).

static E310() None[source]#

Error raised when the inputs list(tuple(LC, Incr)) for getting results for LC and Incr are wrong.

static E311(propID) None[source]#

Error raised when young modulus is not found.

static E312(lc, result) None[source]#

Error raised when the components asked for the N2PReport are not found in the result of the loadcase

static E313() None[source]#

Error raised when there is an error in the arguments, probably in the formulas.

static E314() None[source]#

Error raised when there is an error generating the report in VizzerClasses.

static E315() str[source]#

Error raised when the matrix couldn’t be inverted.

static E316() str[source]#

Error raised when the string used in N2PAbaqusInputData.get_keywords_by_type is not a valid one

static E317(card: str, i: int, e: str) str[source]#

Theres being an error modifing a card

static E318() None[source]#

Error raised when the inputs components in get_result_by_LCs_Incr is not a string or a list of strings.

static E319() None[source]#

Error raised when not all the inputs components are in N2PResult.Components

static E400() None[source]#

Error raised when the atttribute of a N2PCard is intended to change and the new value lenght don’t match with the previous.

static E500() None[source]#

Error raised when an element not found correctly when trying to create plates.

static E501() None[source]#

Error raised when a prop not found correctly or it is not supported.

static E502() None[source]#

Error raised when a mat not found correctly or it is not supported.

static E503(bolt) None[source]#

Error raised when fastener is said to have the Head in a middle element1D.

static E504() None[source]#

Error raised when load cases/s are not found.

static E505(bolt) None[source]#

Error raised when a fastener is not connected to 2 plates.

static E506(bolt) None[source]#

Error raised when a fastener diameter is not defined.

static E507(plate) None[source]#

Error raised when iterations > max_iter.

static E508(plate) None[source]#

Error raised when there is a problem with the geometry of the plate.

static E509(bolt) None[source]#

Error raised when no forces were correctly retrieved.

static E510() None[source]#

Error raised when there is an error in the isoparametric transformation.

static E511() None[source]#

Error raised when elements are not supported in interpolation.

static E512() None[source]#

Error raised when the number of components of the vector and the reference systems are not multiple of 3 in the rotation.

static E513() None[source]#

Error raised when the type is not supported.

static E514() None[source]#

Error raised when trying to serialize something that is not a list.

static E515() None[source]#

Error raised when trying to deserialize something that is not a list.

static E516() None[source]#

Error raised when trying to deserialize something that is not a list.

static E517(listids) None[source]#

Error raised when having fasteners with wrong diameter.

static E518() None[source]#

Error raised when solver_id_list is not present but part_id is in get_joints(…)

static E519() None[source]#

Error raised when part_id is not present but solver_id_list is in get_joints()

static E520() None[source]#

Error raised when no joints have been imported

static E521() None[source]#

Error raised when no model has been imported

static E522() None[source]#

Error raised when, in N2PGetFasteners, the get_distance or get_attachments method is used before the get_joints() one

static E523() None[source]#

Error raised when, in N2PGetLoadFasteners, no N2PJoints have been imported

static E524() None[source]#

Error raised when, in N2PGetLoadFasteners, the get_forces_joints() or get_bypass_joints() methods are used before the get_results_joints() one

static E525(loadcase) None[source]#

Error raised when the loadcases attribute is not filled with integers

static E526(export) None[source]#

Error raised when the wrong export style is used.

static E527() None[source]#

Error raised when the used solver is not Nastran

static E529() None[source]#

Error raised when, in N2PGetLoadFasteners, the export_results() method is used before the get_forces_joints() one

static E530() None[source]#

Error raised when, in N2PGetLoadFasteners, the export_results() method is used before the get_bypass_joints() one

static E531(path) None[source]#

Error raised when a loaded file does not exist or is not a file

static E532(element) None[source]#

Error raised when one wants to determine if a point is in an element that is not supported.

static E533(element) None[source]#

Error raised when one wants to project a point into an element with not enough nodes

static E534() None[source]#

Error raised when, in N2PGetLoadFasteners, no result files have been imported

static E535(input, instance) None[source]#

Error raised when an input is of a wrong instance.

static E536(attribute, instance) None[source]#

Error raised when an input (as a list) has no valid elements inside.

static E537() None[source]#

Error raised when the first column of the dataset (ID Entity column) is not composed of integers.

static E650() None[source]#

Error raised when trying to assign a non isotropic material to a isotropic one

static E651() None[source]#

Error raised when trying to assign a non orthotropic material to a orthotropic one

static E652() None[source]#

Error raised when trying to assign a wrong hardening to a plastic class

static E654() None[source]#

Error raised when trying to assign wrong arguments to a plastic class

static E655() None[source]#

Error raised when trying to assign wrong plastic class

static E656() None[source]#

Error raised when trying to assign a wrong N2PMaterial instance to a material subclass

static E657() None[source]#

Error raised when trying to get a Plastic instance which is not assigned

static E658() None[source]#

Error raised when trying to set a non Plastic instance

static E659() None[source]#

Error raised when trying to get an Allowable instance which is not assigned

static E660() None[source]#

Error raised when trying to set a non Plastic instance

static E661(materialid) None[source]#

Error raised when trying to use the N2PNeuber module without assign a YieldStress to a material

static E662(materialid) None[source]#

Error raised when trying to use the N2PNeuber module without assign a RO_exponent to a material

static E663() None[source]#

Error raised when trying to assign a non N2PElement list

static E664() None[source]#

Error raised when trying to assign a non N2PLoadCase list

static E665(ele) None[source]#

Error raised when is not possible to find a Neuber solution

static E670() None[source]#

Error raised when trying to get an Allowable instance which is not assigned

static E671() None[source]#

Error raised when no valid results are available

static E672(*args) None[source]#

Error raised when the id of the material is not in the material dictionary.

static E673(*args) None[source]#

Error raised when the id of the property is not in the property dictionary.

static E700() None[source]#

Error raised when trying to write in a dataset that has different data types than the one in the data entry

static E701() None[source]#

Error raised when an entity ID is not of integer type

static E702(entityID) None[source]#

Error raised when, in a dataset, one tries to write a row whose entity ID is already in the dataset

static E703() None[source]#

Error raised when dataset introduced in HDF5 is not an nparray or a string

static E800() None[source]#

Error raised when a module (Failure Aanlysis) is initialized with a wrong model assignment.

static E801() None[source]#

Error raised when a module (Failure Analysis) is initialized with a wrong Element list assignment.

static E802() None[source]#

Error raised when a module (Failure Analysis) is initialized with a wrong LoadCase list assignment.

static E803(criteria, criteria_dict: dict) None[source]#

Error raised when a Failure Criterion assigned by user is not supported by module computations.

static E804() None[source]#

Error raised when a Failure Criterion analysis is trying to be launched and Material Instances have not their Allowable values assigned yet.

static E805() None[source]#

Error raised when trying to initialize a Property class with a wrong N2PProperty / N2PMaterial instance / user input

static E806() None[source]#

Error raised when trying to initialize a CompositeShell subclass with non-composite N2PProperty instance

static E850() None[source]#

Error raised when the IntegrationDistance is not a dictionary

static E851(key) None[source]#

Error raised when key of IntegrationDistance is not a N2PElement instance

static E852(value, key) None[source]#

Error raised when key of IntegrationDistance is not a float

static E853() None[source]#

Error raised when the FailureCriteria is not a valid criteria

static E854(material) None[source]#

Error raised when Material is not a Orthotropic instance

static E855() None[source]#

Error raised when Ez, PoissonXZ or PoissonYZ are not defined

static E856() None[source]#

Error raised when convergence is not reached in optimization process

static E857(material) None[source]#

Error raised when allowables are not defined

static E858() None[source]#

Error raised when load case list is not defined

static E859() None[source]#

Error raised when element list is not defined

static E860(solver) None[source]#

Error raised when element list is not defined

static E861() None[source]#

Error raised when solver is not one of the availables for the module

static user(message: str) None[source]#

Method prepared to be called by the user for adding errors to the loggin

This anyone who is using NaxToPy can write in the register their own error message. Use the following structure as a standard message (E + four digits + Body).

Parameters:

message – str

Example

“EXXXX: BODY OF THE MESSAGE”

class Info[source]#

Bases: object

Class with all the information data. The IXXX are methods that keep in the register the information about the processes that the package is keeping.

static I100() None[source]#

Information that show that the NaxToPy Runing Code.

static I101(vizzer_libs) None[source]#

Information that show that the NaxTo libraries were correctly found at vizzer_libs.

static I102(value) None[source]#
static I103(value) None[source]#
static I104() None[source]#
static I105() None[source]#

Information given when the register is modified correctly.

static I106(register, key_version) None[source]#

Information given when the register is modified correctly.

static I107() None[source]#

Information given when the program is called from a .exe file.

static I108() None[source]#

Information given when the program use the develover version of NaxToModel.

static I109() None[source]#

Information given when the NaxToModel library is load correctly.

static I110(path) None[source]#

Information given when the file .N2P is saved correctly.

static I111(path) None[source]#

Information given when the result file is initialize correctly.

static I112() None[source]#

Information given when the result the mesh is build correctly.

static I113() None[source]#

Information given when the program use the compiled version of NaxToModel.

static I200() None[source]#

Information given when the NaxToPy.ico is found correctly.

static I201(file) None[source]#

Information given when the .exe file built with n2ptoexe() is correctly created.

static I202(id) None[source]#

Information given when the .exe file built with n2ptoexe() is correctly created.

static I203() None[source]#

Information given when the module N2PEnvelope is executing.

static I500() None[source]#

Information given when the ID list is empty.

static I501() None[source]#

Information given when the ID list is empty.

static user(message) None[source]#

Method prepared to be used by the user so anyone who is using NaxToPy can write in the register their own information message. Use the following structure as a standard message (I + four digits + Body).

“IXXXX: Body of the message”

class property LevelList: list[str]#

Property that retuns the list with the message levels in the log

class Warning[source]#

Bases: object

Class with all the warnings. The WXXX are methods that keep in the register the warnings that might be revised. They don’t affect directly to the correct working of the package.

static W100() None[source]#

Warning raised when numpy is not installed and it will be installed using pip

static W101() None[source]#

Warning raised when the register level of the .log file is intended to change, as it could make more difficult to track errors

static W102(path) None[source]#

Warning raised when the Windows Register is modified by NaxToPy

static W103() None[source]#

Warning raised when the Windows Register is modified by NaxToPy: The Path value is deleted

static W104(naxver) None[source]#

Warning raised when the version NaxTo that this NaxToPy version is prepared for is not found

static W105() None[source]#

Warning raised when the assemblies founded are not saved as compatible

static W106(e) None[source]#

Warning raised when the register couldn’t be destroyed

static W107(versions: list) None[source]#

The NaxToModel.dll was loaded successfully, but it may not be fully compatible.

static W110(depre_method, new_method) None[source]#

Deprecated Warning

static W200() None[source]#

Warning raised when the executable file is build without the icon

static W201() None[source]#

Warning raised when the AbaqusVersion is asked but the solver is not Abaqus

static W202() None[source]#

Warning raised when the number of elements don’t match with the size of the results

static W203(key) None[source]#

Warning raised when there are two connectors with the same id. So they are saved in the connector dict as a list.

static W204() None[source]#

Warning raised when there is no Model Data from an Input File.

static W205() None[source]#

Warning raised when there the Deprecated function “Initialize” is called.

static W206() None[source]#

Warning raised when there the Deprecated property “ActiveIncrement” is called.

static W207() None[source]#

Warning raised when there the Deprecated class “N2PModelInputData” is called.

static W208(coord) None[source]#

Asking for results in self defined coordinate system at the same time in antother option.

static W209() None[source]#

An average variation parameter have been set when aveNodes value is not average (-3)

static W300() None[source]#

Warning raised when there are more dimensions than points in n2p.envelope

static W301(name) None[source]#

Warning raised when the name for the new derived load case already exist

static W500(listids) None[source]#

Warning raised when a CBUSH or CBAR has not a defined Diameter.

static W501(bolt) None[source]#

Warning raised when a CBUSH is defined with coincident nodes.

static W502(bolt) None[source]#

Warning raised when a CFAST is defined as PROP.

static W503(bolt) None[source]#

Warning raised when a Fastener property is not found.

static W504(bolt) None[source]#

Warning raised when a Fastener plates are not found.

static W505(bolt) None[source]#

Warning raised when a fastener element is not found.

static W506(bolt) None[source]#

Warning raised when a fastener intersection with the plate is not found.

static W507(bolt) None[source]#

Warning raised when different types of properties found in the same joined plate elements.

static W508(bolt) None[source]#

Warning raised when direction of elements 1D wrt connected plates not consistent.

static W509(bolt) None[source]#

Warning raised when different type of elements 1D in the same bolt.

static W510(listids) None[source]#

Warning raised when a fastener has not a provided head position.

static W511() None[source]#

Warning raised when calculation using the results in the centroid.

static W512(plate, bolt) None[source]#

Warning raised when element not found.

static W513(bolt) None[source]#

Warning raised when intersection point with plate not defined.

static W514(bolt) None[source]#

Warning raised when normal to plate not defined.

static W515(bolt) None[source]#

Warning raised when distance to edge not defined.

static W516(bolt) None[source]#

Warning raised when no plate elements found.

static W517() None[source]#

Warning raised when a plate is not an ARPlate.

static W518() None[source]#

Warning raised when a fastener is not an AR1DElement.

static W519(elem) None[source]#

Warning raised when a element is not CQUAD4 nor CTRIA3.

static W520(plate) None[source]#

Warning raised when a plate has no elements adjacent.

static W521(lcID) None[source]#

Warning raised when a load case doesn’t have a complete set of results

static W522() None[source]#

Warning raised when, in N2PGetLoadFasteners, the get_fasteners attribute is set while the model or list_joints attribute is also set

static W523() None[source]#

Warning raised when, in N2PGetLoadFasteners, the model attribute is set while the get_fasteners attribute is also set

static W524() None[source]#

Warning raised when, in N2PGetLoadFasteners, the list_joints attribute is set while the get_fasteners attribute is also set

static W525() None[source]#

Warning raised when, in N2PGetLoadFasteners, the type_export attribute is not NAXTOPY, PAG ALTAIR

static W526(parameter) None[source]#

Warning raised when the bypass parameters dictionary is not well defined

static W527(input, instance) None[source]#

Warning raised when an input is of a wrong instance.

static W528() None[source]#

Warning raised when, in N2PGetLoadFasteners, the export_precison attribute is not 4 or 8

static W529(joint) None[source]#

Warning raised when a CFAST has no attached plates

static W650() None[source]#

Warning raised when specific arguments have been introduce to the plastic class.

static W651() None[source]#

Warning raised when a non ISOTROPIC/MAT1 asociated to the element has been chosen.

static W700() None[source]#

Warning raised when a data entry does not have its compulsory information

static W701(elementType) None[source]#

Warning raised when, while writing an HDF5, the element type is not element, corner or node.

static W702() None[source]#

Error thrown when attempting to retrieve the material of a Beam General Section.

static W800() None[source]#

Warning raised when, given a list of elements, not all the elements have a composite PropertyType associated.

static W801() None[source]#

Warning raised when trying to initialize a Property class with a wrong N2PProperty / N2PMaterial instance / user input

static W850(LC) None[source]#

Warning raised when no Reference Temperature is set

static W851() None[source]#

Warning raised when no

static user(message) None[source]#

Method prepared to be used by the user so anyone who is using NaxToPy can write in the register their own warning message. Use the following structure as a standard message (W + four digits + Body).

“WXXXX: Body of the message”

classmethod activate_log() None[source]#

Method that activates the .log

clv = 'WARNING'#
classmethod deactivate_log() None[source]#

Method that deactivates the .log

flv = 'INFO'#
classmethod get_directory() str[source]#

Method that returns the folder where the .log file is being saved

classmethod get_file_name() str[source]#

Method that returns the name of the file of the .log

classmethod set_console_level(clv: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']) None[source]#

Method to set a different level for console register. The default level is “WARNING”. Only The level register and higher will be printed in the console. The possible levels are:

“DEBUG”, “INFO”, “WARNING”, “ERROR”, “CRITICAL”.

classmethod set_directory(value: str) None[source]#

Method that sets the folder where the .log file must be saved

Parameters:

value – str -> Path to the folder where the .log must be saved.

classmethod set_file_level(flv: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']) None[source]#

Method to set a different level for the file .log of the register. The default level is “INFO”. Only The level register and higher will be printed in the .log file. Higher levels could make more difficult to track errors. The possible levels are:

“DEBUG”, “INFO”, “WARNING”, “ERROR”, “CRITICAL”.

classmethod set_file_name(value: str) None[source]#

Method that sets the name of the file of the .log

Parameters:

value – str -> Name of the .log file

NaxToPy.envelope_list(*args: list) list[list][source]#

Function that generates the envelope of a cloud of points. Args could be DF or lists.

-args*: Lists as columns of the cloud of points: e = n2p.envelope([3,4,2,…], [6,2,7,…], …)

-arg: A single DataFrame: e = n2p.envelope(df)

Returns:

list[list]

Note

The column 0 is the solver element id when using DataFrame, but it is the position in the elements list when using lists!!! to know the solver id: get_elements()[index_0]

NaxToPy.envelope_ndarray(array2D: ndarray) ndarray[source]#

Function that generates the envelope of a cloud of points. Args must be a numpy.array. This function is faster than envelope_list.

Parameters:

array2D (ndarray) – 2D Array [n*m]. Each row is point of the cloud, so there are n points. Each column is a coordinate of the point, so it is an m dimensional space.

Returns:

ndarray

Note

The column 0 is the position in the elements list!!! to know the solver id: get_elements()[index_0]

NaxToPy.initialize(path: str, parallelprocessing: bool = False) N2PModelContent[source]#

Deprecated function. This funtion has been substituted by load_model()

NaxToPy.load_model(path: str, parallelprocessing: bool = True, file_type: Literal['InputFileNastran', 'InputFileAbaqus', 'Binary'] = None, dict_gen: dict = None, filter: Literal['ELEMENTS', 'PROPERTIES', 'PARTS', 'NODES'] = None) N2PModelContent[source]#

Read an output result file in binary format from Nastran, Abaqus, Optistruct or Ansys and transform it into a N2PModelContent Object. It also can read models from input files in Nastran format.

Supports .op2, .xdb, .odb, .h5, .h3d and .rst file extensions read from a local filesystem or URL.

Supports Nastran Input Files (typically .bdf extension) and Abaqus Input File (typically .inp extension)

Parameters:
  • path – str. Mandatory.

  • parallelprocessing – bool. Optional. If true, the low libraries open the result files in several processes. It is slightly faster.

  • file_type – str. Optional. It specifies if it is Nastran input file (“InputFileNastran”), Abaqus input file (“InputFileAbaqus”) or binary result file (“Binary”).

  • filter – str. Optional. It specifies what to load in dict_gen (elements, properties, parts or nodes)

  • dict_gem – dict. Optional. Dictionary that represents what elements/properties/parts/nodes to load. For elements and nodes, the dictionary is in the form {Part ID (str): [Elements ID/Nodes ID]}. For parts or properties, the dictionary could simply be in the form {Part ID (str) / Property ID (str): []}.

Returns:

Instance with all the model data.

Return type:

N2PModelContent

Examples

>>> model1 = load_model(r"C:\MODELS\FEM\model1.dat")
>>> # file_type is not needed. It only helps the program and saves a checking
>>> model2 = load_model(r"C:\MODELS\FEM\model2.dat", file_type="InputFileNastran")
>>> # parallelprocessing is only aviable for Binary files. It is helpful in some big files.
>>> model3 = load_model(r"C:\MODELS\RESULTS\model1.op2", parallelprocessing=True)
>>> model4 = load_model(r"C:\MODELS\RESULTS\model2.xdb", file_type="Binary")
>>> model5 = load_model(r"C:\MODELS\RESULTS\model5.h3d")
>>> model6 = load_model(r"C:\MODELS\RESULTS\model6.odb", True, "Binary")
NaxToPy.n2ptoexe(path: str, console: bool = True, solver: Literal['ALL', 'NASTRAN', 'ABAQUS', 'ANSYS', 'OPTISTRUCT'] = 'ALL', abaqusversion: list[Literal['2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024', '6.11', '6.12', '6.13', '6.14']] = None, splash: str = '', extra_packages: list[str] = None, extra_files: list[str] = None, hidden_imports: list[str] = None) None[source]#

Function that creates .exe files of programs that use NaxToPy

Parameters:
  • path – str -> path of the module that will be used to create the .exe file

  • console – bool -> If True (Default), the .exe will opne a console of python. If False, the .exe will not open any python console.

  • solver – srt | list[str] -> Default=”ALL” Solver or list of solvers that the module will work with. Posible solvers are: “NASTRAN”, “ABAQUS”, “ANSYS”, “OPTISTRUCT”

  • abaqusversion – str | list[srt] -> Default=’2022’. Only when “ABAQUS” is selected a str or a list of ABAQUS version are aviable. Posible abaqus versions: [‘2016’, ‘2017’, ‘2018’, ‘2019’, ‘2020’, ‘2021’, ‘2022’, ‘6.11’, ‘6.12’, ‘6.13’, ‘6.14’]

  • splash – str -> Optional. Path to the splash image. If used, the user must introduce pyi_splash.close() at the beginning of the execution of the module. Import pyi_splash first. The splash image will appear during the .exe unpacking. Image should be png and smaller than 500x500 pixels.

  • extra_packages – list[str] -> If some packages are not imported correctly by the function, they can be added manually. An example of a package that usually fails is ‘sv_ttk’.

  • extra_files – list[str] -> Lis of path of extra dll, images or other files the user want to add the exe. The files will be saved in the ./bin directory inside the exe. To acces to the files use: path_file = os.path.join(sys._MEIPASS, r”binmylib.dll”)

Examples

>>> n2ptoexe(r"C:\Scripts\myscript1.py")
>>> n2ptoexe(r"C:\Scripts\myscript2.py", console=False, solver="NASTRAN")
>>> n2ptoexe(r"C:\Scripts\myscript3.py", console=True, solver="OPTISTRUCT", splash=r"C:\Scripts\mysplash.jpg")
>>> n2ptoexe(r"C:\Scripts\myscript4.py", extra_packages=["sv_ttk"], extra_files=[r"C:\Scripts\icon.png"])
>>> n2ptoexe(r"C:\Scripts\myscript5.py", hidden_imports=["plyer.platforms.win.notification"])

Folders#