NaxToPy


NameNaxToPy JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://www.idaerosolutions.com/Home/NaxToPy
SummaryPackage for postprocessing FEM results in Python
upload_time2024-04-25 12:27:58
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseCopyright (c) 2024 Idaero Solutions This freeware license agreement (“agreement”) is a legally binding contract between the individual who downloads the software (“you”) and the licensor, that should be read in its entirety. This is an agreement governing your use this software own by Idaero Solutions, further defined herein as “software”, and the licensor of the software is willing to provide you with access to the software only on the condition that you accept all of the terms and conditions contained in this agreement. You are deemed to have read, understood and accepted all such terms and conditions upon executing a download of any free software. 1. License Grant: Subject to the terms and conditions of this Agreement, Idaero Solutions grants the User a limited, non-exclusive, non-transferable license to use the Software solely for non commercial purposes. This license does not grant any rights to the source code of the Software. It is only free for non-professional and non-commercial purposes. For commercial and professional purposes, you must install the professional NaxTo(c) version. 2. Ownership: The User acknowledges that the Software, including any and all intellectual property rights associated with it, is the sole property of Idaero Solutions and/or its Suppliers. The User agrees not to claim ownership or proprietary rights over the Software. 3. Distribution: The User is allowed to distribute the Software to third parties free of charge, ONLY under .exe files that use the software as a dependence of the script, provided that the distribution includes the complete and unmodified Software package as originally provided by Idaero Solutions. The User must not charge any fees or payments for the distribution of the Software. 4. Modifications: The User agrees not to modify, adapt, reverse engineer, decompile or disassemble, the Software. Any attempt to do so shall be a violation of this Agreement. The User is allowed to develop further code based on the Software. However, the User agrees that the new software shall be subject to the same license terms as this Agreement, including the prohibition on modification, reverse engineering, and proprietization. 5. Proprietization: The User agrees not to use the Software or any part thereof to develop a competing product or service or engage in any activities that may lead to the proprietization of the Software. 6. Termination: This Agreement is effective until terminated. Idaero Solutions may terminate this Agreement immediately and without notice if the User fails to comply with any of the terms and conditions herein. Upon termination, the User must cease all use of the Software and destroy all copies in their possession. 7. Warranty and Liability: The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. 8. An extension of NaxTo(c) from Idaero Solutions: The software is an extension of the NaxTo software developed by Idaero Solutions. Therefore, the terms of use of this software are an extension of the NaxTo license. In the event of any discrepancies, the NaxTo license takes precedence. 9. Governing Law: This Agreement shall be governed by and construed in accordance with the laws of the jurisdiction in which Idaero Solutions is located. IDAERO DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IDAERO DOES NOT GUARANTEE THAT THE PRODUCTS WILL MEET LICENSEE'S REQUIREMENTS, OPERATE UNINTERRUPTED OR ERROR-FREE, OR BE COMPATIBLE WITH ANY SPECIFIC HARDWARE OR SOFTWARE. THE ENTIRE RISK ASSOCIATED WITH THE USE, PERFORMANCE, OR RESULTS OBTAINED FROM THE PRODUCTS RESTS WITH THE LICENSEE, NOT IDAERO. IDAERO MAKES NO WARRANTIES REGARDING THE ACCURACY, COMPLETENESS, FUNCTIONALITY, SAFETY, PERFORMANCE, OR ANY OTHER ASPECT OF ANY DESIGN, PROTOTYPE, OR FINAL PRODUCT DEVELOPED BY THE LICENSEE USING THE PRODUCTS. IN NO EVENT SHALL IDAERO OR ITS SUPPLIERS BE LIABLE FOR INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR DATA, DEFECTS IN DESIGN OR PRODUCTS CREATED USING THE PRODUCTS, OR ANY INJURY OR DAMAGE RESULTING FROM SUCH DEFECTS, SUFFERED BY THE LICENSEE OR ANY THIRD PARTY, EVEN IF IDAERO OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE PRODUCTS PROVIDED HEREUNDER ARE INTENDED ONLY TO AID THE LICENSEE IN DEVELOPING THEIR OWN PRODUCTS OR CONDUCTING DATA ANALYSIS AND ARE NOT INTENDED TO SUBSTITUTE FOR SOUND ENGINEERING JUDGMENT, INDEPENDENT TESTING OF PHYSICAL PROTOTYPES, CAREFUL NUMERICAL REVIEW, OR SOUND BUSINESS JUDGMENT. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
keywords naxto postprocessing fem
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Idaero](https://img.shields.io/badge/powered%20by-Idaero%20Solutions-299797)](https://idaerosolutions.com)
[![PyPi](https://img.shields.io/pypi/v/NaxToPy?color=ffd500)](https://pypi.org/project/NaxToPy/)
[![Python](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-00699d)](https://www.python.org/downloads/)
![License](https://img.shields.io/badge/license-proprietary-red)
[![MicrosoftStore](https://img.shields.io/badge/Microsoft%20Store-NaxTo-blue?logo=microsoftstore&logoColor=blue&labelColor=lightgrey)](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US)
[![PyPi - Downloads](https://img.shields.io/pypi/dm/NaxToPy?color=dgreen)](https://pypi.org/project/NaxToPy/#files)

![](https://idaerosolutions.com/images/icons/Logo_NaxToPy_Black.svg "NaxToPy")

# NaxToPy

**NaxToPy** is the [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US)
library designed for Python, which allows reading and manipulating FEM
analysis results files from the most common tools: Nastran (op2, xdb, h5), Abaqus (odb), Optistruct
(h3d, op2) and Ansys (rst); and stores them in a user-friendly Python structure. Additionally, it
can read input files from Nastran (bdf, fem) and change it contents.

It could be easily combined with other Python packages as Matplotlib or Pandas. This provides access
to the full coding power of Python to interpret and process the results, without the need to install
any additional software other than having NaxTo already installed (see the _Download_ and _Homepage_
links on the left).

**NaxToPy** is a powerful tool for FEM analysis post-processing!

**CAUTION:** To use NaxToPy, [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US) must be installed.
This version is compatible with **NaxTo 2024.1**. It may be compatible with all the steps of this version (2024.1.0, 2024.1.1, 2024.1.2, etc.).
Check in _Programs and Features_ the NaxTo version that is installed. 

## Installation


If python is callable from the command line:

`py -m pip install NaxToPy`

For **Visual Studio** users:
- Open "Python Environments" window
- Change the "general information" label to "Packages(Pypi)"
- Write the name of the package and press enter:

- `NaxToPy` + enter

For **Spyder** users:
- If pip is installed: `!pip install NaxToPy`
- If pip is not installed, download and run `get-pip.py` located in  https://bootstrap.pypa.io/get-pip.py . Then, run the
`!pip ...` command
- If no method worked, download the sorce ditribution of the package *NaxToPy* from Test PyPi and the source
distribution of the packages from PyPi *pythonnet*, *clr-loader*, *cffi*, *pycparser*. Copy and paste the five folder in the 
same directory. When ever you want to use the NaxToPy package add the following lines to your script:

      import sys
      sys.path.append("...\directory")
      import NaxToPy as n2p
## Updating NaxToPy

If python is callable from the command line:

`py -m pip install -U NaxToPy`

For Visual Studio users:
- Open "Python Environments" window
- Change the "general information" label to "Packages(Pypi)"
- Write the following command on the search bar and press enter:

  `-U NaxToPy` + enter


## Version updates:

To see previous version see the pre-release versions in https://test.pypi.org/project/NaxToPy/

### v.1.0.1
1. Bug Fix: A new dependece is added to support python 3.12
2. Bug Fix: N2PLog.set_directory now works correctly
3. New download page for NaxTo and NaxToPy

### v.1.1.0
1. Bug Fix: PSOLID with material coordinate = -1 is now suppported
2. Now, it is possible to modify the BDF data from Nastran and rewrite the files.

### v.1.1.1
1. New property for the class N2PLoadCase: Solver
2. New fille that allows the user to call the N2P classes. Useful for typing
3. N2PCoord don't have the property PartID any more, as it is considered that Coordinates systems don't have parts/superelements 
4. Method for the connectivity property of N2PNode have been optimized

### v.1.2.0
1. Bug Fix: Property IsTransformable of the N2PComponent class is now right.
2. Bug Fix: When calling the methods .get_nodes(), get_elements(), etc from a Nastran Input File, the user don't have to specify the part.

### v.1.2.1
1. New method to create N2PLoadCase as envelope load case of the selected load cases.
2. The name for derivated load cases is now checked to avoid a repeated name 

### v.1.3.0
1. New class N2PReport. This class allow to create tables of data with the components, incremenets, load cases, etc to generate big reports.
2. Improvement in typing
3. Small changes in the core of the package related to libraries finding and loading.

### v.1.4.0
1. Bug correction for N2PReport. Now it sorts correctly by "LC" or "IDS"
2. N2PLoadCase has a new property: PathFile.

### v.1.5.0
1. A bug is fixed that prevented requesting results on global axes.
2. The typing of some functions is improved.

### v.1.5.1
1. Bug Fix. If the name for a derivated load case is repeated for a second time, the name is changed. 
2. Bug Fix. Now is possible to change the criteria for a new envelope load case.

### v.1.5.2
1. Bug fix: A bug has been resolved that previously prevented the generation of a .log file while executing the N2PtoEXE module.
2. Bug fix: An internal error related to finding the libraries has been resolved.
3. The option to include a splash image in an executable has been added.

### v.1.5.3
1. Bug fix for the EXE generation.
2. Updates in the log messages.

### v.1.5.4
1. Bug Fix: After calling the method get_load_cases(), the new derived cases weren't found. Now they does.
2. N2PLoadCase has now two properties for the ID: OriginalID, that was in the files readed and ID that is the one that is used in NaxToPy. Usually, they are the same.
3. New method new_derived_component() in the class N2PResult that allows to create new N2PComponent based on the original components.
4. New module N2PUpdateFastener. This module updates the stiffness of the CBUSH and CFAST acordint to their properties and shells properties.

### v.1.5.5
1. Bug Fix: Now is possible to call the module N2PUpdateFastener

### v.1.5.6
1. The method new_envelope_loadcase() now has the option to choose the envelope group. Which means the user can ask for
the LoadCases that are critical or the Increment that is critical instead of the value.

### v.2.0.0
1. Changes made to align the library with updates in lower-level dependencies.
2. New internal methods to look for the compatibility with low-level dependencies.
3. The name of the .log is now NaxToPy_Year-Month-Day.log.

# Documentation

**NaxToPy** is a package developed by Idaero Solutions© as a part of the **NaxTo** software.

NaxToPy only use three dependeces:
- NumPy: https://numpy.org/
- PythonNET: https://pythonnet.github.io/
- Setuptools: https://setuptools.pypa.io/en/latest/index.html

## Supported Files

### Result files:
- **Nastran:** .op2, .h5, .xdb
- **Optistruct:** .op2, .h3d
- **Abaqus:** .odb
- **Ansys:** .rst, .rth(beta)

### Input files:
- **Nastran** (bdf)

## Initialize your model

Load your model:

```python
# results_fem.py
import NaxToPy as N2P

path = "results_fem.op2"

model = N2P.load_model(path)
```

## Load mesh items

```python
# results_fem.py

# Load a list with all the nodes (as N2PNode object) of the model
nodes = model.get_nodes()

# Load the nodes in the list [1, 2, 3] (as a list of N2PNode objects)
nodelist = model.get_nodes([1, 2, 3]) 

# Load the node with the id 1000 (as a N2PNode object)
node1000 = model.get_nodes(1000)

# Load a list with all the elements (as N2PElement object) of the model
element = model.get_elements()

# Load the elements in the list [10, 20, 30] (as a list of N2PElement objects)
elementlist = model.get_nodes([10, 20, 30])

# Load the connectors as N2PConnector:
connectorslist = model.get_connectors()

# Load the coordinate systems of the model:
coordslist = model.get_coords()
```
## Add your own messages to the .log

```python
# results_fem.py

N2P.N2PLog.Info.user("INFO-1000: Running results_fem.py")
```

## Look for LoadCases, Results and Components

```python
# results_fem.py

# Load the list of load cases as N2PLoadCase object
loadcaseslist = model.LoadCases

# Look for the Load Case with the name pressure
pressure_lc = model.get_load_case("pressure")

# Change the active increment (by default is the last one):
pressure_lc.ActiveIncrement = 10

# Look for all results
all_results = pressure_lc.Results

# Look for the Result with the name DISPLACEMENT
displacement = pressure_lc.get_result("DISPLACEMENT")

# Load all the components of the result
all_components = displacement.Components

# Look for the component X:
x_coord = displacement.get_component("X")
```

## Load the result data as a list

```python
# results_fem.py

# Obtain the result array as a list for a component
x_list = x_coord.get_result_list()[0]
```

## Load the result data as a NumPy array

```python
# results_fem.py

# Call the get_result_ndarray method of a N2PComponent to obtain a numpy array
# with the results of the component.
x_df = x_coord.get_result_ndarray()
```

## Create an executable file of your code
Using a different script:
```python
# extra_script.py

import NaxToPy as N2P
path1 = "results_fem.py"
path2 = "results_fem_abaqus.py"

N2P.n2ptoexe(path1, console=True, solver="NASTRAN")
N2P.n2ptoexe(path2, console=True, solver="ABAQUS", abaqusversion=["2021", "2022"])
```

## Create your own functions to work with other python packages:
Private function that generates the proper index for a data frame using the elemnts or nodes ids:
```python
# results_fem.py

import pandas as pd

def _index_dataframe(model: "N2PModelContent", component: "N2PComponent", sections, aveSections, cornerData, aveNodes,
                     variation, realPolar, coordsys, v1, v2) -> pd.Index:
    """ Function that returns the proper index for each component asked
    """
    # It is look if there is one part or several's:
    parts = len(model.Parts) - (model.Solver == "Abaqus")

    # Then the result array and where there results are placed is obtained
    on_items = component.get_result_ndarray(sections, aveSections, cornerData, aveNodes,
                                            variation, realPolar, coordsys, v1, v2)[1]

    # The ids and the index are selected. It takes into account where the results are and the number of parts
    if on_items == "NODES":
        nodes = model.get_nodes()
        ids = [(nodo.PartID, nodo.ID) if parts > 1 else nodo.ID for nodo in nodes]
        indexname = ["Part", "Grid"] if parts > 1 else ["Grid"]

    elif on_items == "ELEMENTS":
        elements = model.get_elements()
        connectors = model.get_connectors()
        ids = [(element.PartID, element.ID) if parts > 1 else element.ID for element in elements] + \
              [(co.PartID, co.ID) if parts > 1 else co.ID for con in connectors for co in (con if isinstance(con, list) else [con])]
        indexname = ["Part", "Element"] if parts > 1 else ["Element"]

    elif on_items == "ELEMENT NODAL":
        ids = model.elementnodal().values()
        indexname = ["Part", "Grid", "Element"]

    else:
        return None

    # If there are several parts, or it is corner data, MultiIndex is used:
    if isinstance(ids[0], tuple):
        index = pd.MultiIndex.from_tuples(ids, names=indexname)
    else:
        index = ids

    return index
```
Function that generates a DataFrame with the results of a component
```python
# results_fem.py

def dataframe_result(model: "N2PModelContent", component: "N2PComponent",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)) -> pd.DataFrame:
    """Function that returns as a dataframe of pandas the result array of a component
    """

    # DataFrame generation
    return pd.DataFrame(data={component.Name:
                              component.get_result_ndarray(sections, aveSections, cornerData, aveNodes, variation,
                                                           realPolar, coordsys, v1, v2)[0]},
                        index=_index_dataframe(model, component, sections, aveSections, cornerData, aveNodes, variation,
                                               realPolar, coordsys, v1, v2),
                        columns=[component.Name])
```
Function that generates a DataFrame for all the components of a result
```python
# results_fem.py

def dataframe_results(model: "N2PModelContent", result: "N2PResult", 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)) -> pd.DataFrame:
    """Function that generates a DataFrame of pandas with all the components of a result. It uses dataframe_result.
    It uses sequential computing.
    """
    return pd.DataFrame(data={component.Name:
                                  component.get_result_ndarray(sections, aveSections, cornerData, aveNodes, variation,
                                                               realPolar, coordsys, v1, v2)[0]
                                                               for component in result.Components.values()},
                        index=_index_dataframe(model, next(iter(result.Components.values())), sections, aveSections,
                                               cornerData, aveNodes, variation, realPolar, coordsys, v1, v2),
                        columns=[component.Name for component in result.Components.values()])
```

##
For more documentation visit https://idaerosolutions.com/Home/NaxToPy

Reference Guide at: https://www.idaerosolutions.com/NaxToPyDoc/NaxToPy.html


# License

Copyright is owned by Idaero Solutions©

            

Raw data

            {
    "_id": null,
    "home_page": "https://www.idaerosolutions.com/Home/NaxToPy",
    "name": "NaxToPy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "NaxTo, Postprocessing, FEM",
    "author": null,
    "author_email": "Idaero Solutions <manuel.sanchez@idaerosolutions.com>",
    "download_url": "https://files.pythonhosted.org/packages/b0/c9/51c597d8c57e93796a0eaafb8a7864da04f6ba4d58e49ce9c5c1fe14d91b/naxtopy-2.0.0.tar.gz",
    "platform": null,
    "description": "[![Idaero](https://img.shields.io/badge/powered%20by-Idaero%20Solutions-299797)](https://idaerosolutions.com)\r\n[![PyPi](https://img.shields.io/pypi/v/NaxToPy?color=ffd500)](https://pypi.org/project/NaxToPy/)\r\n[![Python](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-00699d)](https://www.python.org/downloads/)\r\n![License](https://img.shields.io/badge/license-proprietary-red)\r\n[![MicrosoftStore](https://img.shields.io/badge/Microsoft%20Store-NaxTo-blue?logo=microsoftstore&logoColor=blue&labelColor=lightgrey)](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US)\r\n[![PyPi - Downloads](https://img.shields.io/pypi/dm/NaxToPy?color=dgreen)](https://pypi.org/project/NaxToPy/#files)\r\n\r\n![](https://idaerosolutions.com/images/icons/Logo_NaxToPy_Black.svg \"NaxToPy\")\r\n\r\n# NaxToPy\r\n\r\n**NaxToPy** is the [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US)\r\nlibrary designed for Python, which allows reading and manipulating FEM\r\nanalysis results files from the most common tools: Nastran (op2, xdb, h5), Abaqus (odb), Optistruct\r\n(h3d, op2) and Ansys (rst); and stores them in a user-friendly Python structure. Additionally, it\r\ncan read input files from Nastran (bdf, fem) and change it contents.\r\n\r\nIt could be easily combined with other Python packages as Matplotlib or Pandas. This provides access\r\nto the full coding power of Python to interpret and process the results, without the need to install\r\nany additional software other than having NaxTo already installed (see the _Download_ and _Homepage_\r\nlinks on the left).\r\n\r\n**NaxToPy** is a powerful tool for FEM analysis post-processing!\r\n\r\n**CAUTION:** To use NaxToPy, [**NaxTo**](https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US) must be installed.\r\nThis version is compatible with **NaxTo 2024.1**. It may be compatible with all the steps of this version (2024.1.0, 2024.1.1, 2024.1.2, etc.).\r\nCheck in _Programs and Features_ the NaxTo version that is installed. \r\n\r\n## Installation\r\n\r\n\r\nIf python is callable from the command line:\r\n\r\n`py -m pip install NaxToPy`\r\n\r\nFor **Visual Studio** users:\r\n- Open \"Python Environments\" window\r\n- Change the \"general information\" label to \"Packages(Pypi)\"\r\n- Write the name of the package and press enter:\r\n\r\n- `NaxToPy` + enter\r\n\r\nFor **Spyder** users:\r\n- If pip is installed: `!pip install NaxToPy`\r\n- If pip is not installed, download and run `get-pip.py` located in  https://bootstrap.pypa.io/get-pip.py . Then, run the\r\n`!pip ...` command\r\n- If no method worked, download the sorce ditribution of the package *NaxToPy* from Test PyPi and the source\r\ndistribution of the packages from PyPi *pythonnet*, *clr-loader*, *cffi*, *pycparser*. Copy and paste the five folder in the \r\nsame directory. When ever you want to use the NaxToPy package add the following lines to your script:\r\n\r\n      import sys\r\n      sys.path.append(\"...\\directory\")\r\n      import NaxToPy as n2p\r\n## Updating NaxToPy\r\n\r\nIf python is callable from the command line:\r\n\r\n`py -m pip install -U NaxToPy`\r\n\r\nFor Visual Studio users:\r\n- Open \"Python Environments\" window\r\n- Change the \"general information\" label to \"Packages(Pypi)\"\r\n- Write the following command on the search bar and press enter:\r\n\r\n  `-U NaxToPy` + enter\r\n\r\n\r\n## Version updates:\r\n\r\nTo see previous version see the pre-release versions in https://test.pypi.org/project/NaxToPy/\r\n\r\n### v.1.0.1\r\n1. Bug Fix: A new dependece is added to support python 3.12\r\n2. Bug Fix: N2PLog.set_directory now works correctly\r\n3. New download page for NaxTo and NaxToPy\r\n\r\n### v.1.1.0\r\n1. Bug Fix: PSOLID with material coordinate = -1 is now suppported\r\n2. Now, it is possible to modify the BDF data from Nastran and rewrite the files.\r\n\r\n### v.1.1.1\r\n1. New property for the class N2PLoadCase: Solver\r\n2. New fille that allows the user to call the N2P classes. Useful for typing\r\n3. N2PCoord don't have the property PartID any more, as it is considered that Coordinates systems don't have parts/superelements \r\n4. Method for the connectivity property of N2PNode have been optimized\r\n\r\n### v.1.2.0\r\n1. Bug Fix: Property IsTransformable of the N2PComponent class is now right.\r\n2. Bug Fix: When calling the methods .get_nodes(), get_elements(), etc from a Nastran Input File, the user don't have to specify the part.\r\n\r\n### v.1.2.1\r\n1. New method to create N2PLoadCase as envelope load case of the selected load cases.\r\n2. The name for derivated load cases is now checked to avoid a repeated name \r\n\r\n### v.1.3.0\r\n1. New class N2PReport. This class allow to create tables of data with the components, incremenets, load cases, etc to generate big reports.\r\n2. Improvement in typing\r\n3. Small changes in the core of the package related to libraries finding and loading.\r\n\r\n### v.1.4.0\r\n1. Bug correction for N2PReport. Now it sorts correctly by \"LC\" or \"IDS\"\r\n2. N2PLoadCase has a new property: PathFile.\r\n\r\n### v.1.5.0\r\n1. A bug is fixed that prevented requesting results on global axes.\r\n2. The typing of some functions is improved.\r\n\r\n### v.1.5.1\r\n1. Bug Fix. If the name for a derivated load case is repeated for a second time, the name is changed. \r\n2. Bug Fix. Now is possible to change the criteria for a new envelope load case.\r\n\r\n### v.1.5.2\r\n1. Bug fix: A bug has been resolved that previously prevented the generation of a .log file while executing the N2PtoEXE module.\r\n2. Bug fix: An internal error related to finding the libraries has been resolved.\r\n3. The option to include a splash image in an executable has been added.\r\n\r\n### v.1.5.3\r\n1. Bug fix for the EXE generation.\r\n2. Updates in the log messages.\r\n\r\n### v.1.5.4\r\n1. Bug Fix: After calling the method get_load_cases(), the new derived cases weren't found. Now they does.\r\n2. N2PLoadCase has now two properties for the ID: OriginalID, that was in the files readed and ID that is the one that is used in NaxToPy. Usually, they are the same.\r\n3. New method new_derived_component() in the class N2PResult that allows to create new N2PComponent based on the original components.\r\n4. New module N2PUpdateFastener. This module updates the stiffness of the CBUSH and CFAST acordint to their properties and shells properties.\r\n\r\n### v.1.5.5\r\n1. Bug Fix: Now is possible to call the module N2PUpdateFastener\r\n\r\n### v.1.5.6\r\n1. The method new_envelope_loadcase() now has the option to choose the envelope group. Which means the user can ask for\r\nthe LoadCases that are critical or the Increment that is critical instead of the value.\r\n\r\n### v.2.0.0\r\n1. Changes made to align the library with updates in lower-level dependencies.\r\n2. New internal methods to look for the compatibility with low-level dependencies.\r\n3. The name of the .log is now NaxToPy_Year-Month-Day.log.\r\n\r\n# Documentation\r\n\r\n**NaxToPy** is a package developed by Idaero Solutions\u00a9 as a part of the **NaxTo** software.\r\n\r\nNaxToPy only use three dependeces:\r\n- NumPy: https://numpy.org/\r\n- PythonNET: https://pythonnet.github.io/\r\n- Setuptools: https://setuptools.pypa.io/en/latest/index.html\r\n\r\n## Supported Files\r\n\r\n### Result files:\r\n- **Nastran:** .op2, .h5, .xdb\r\n- **Optistruct:** .op2, .h3d\r\n- **Abaqus:** .odb\r\n- **Ansys:** .rst, .rth(beta)\r\n\r\n### Input files:\r\n- **Nastran** (bdf)\r\n\r\n## Initialize your model\r\n\r\nLoad your model:\r\n\r\n```python\r\n# results_fem.py\r\nimport NaxToPy as N2P\r\n\r\npath = \"results_fem.op2\"\r\n\r\nmodel = N2P.load_model(path)\r\n```\r\n\r\n## Load mesh items\r\n\r\n```python\r\n# results_fem.py\r\n\r\n# Load a list with all the nodes (as N2PNode object) of the model\r\nnodes = model.get_nodes()\r\n\r\n# Load the nodes in the list [1, 2, 3] (as a list of N2PNode objects)\r\nnodelist = model.get_nodes([1, 2, 3]) \r\n\r\n# Load the node with the id 1000 (as a N2PNode object)\r\nnode1000 = model.get_nodes(1000)\r\n\r\n# Load a list with all the elements (as N2PElement object) of the model\r\nelement = model.get_elements()\r\n\r\n# Load the elements in the list [10, 20, 30] (as a list of N2PElement objects)\r\nelementlist = model.get_nodes([10, 20, 30])\r\n\r\n# Load the connectors as N2PConnector:\r\nconnectorslist = model.get_connectors()\r\n\r\n# Load the coordinate systems of the model:\r\ncoordslist = model.get_coords()\r\n```\r\n## Add your own messages to the .log\r\n\r\n```python\r\n# results_fem.py\r\n\r\nN2P.N2PLog.Info.user(\"INFO-1000: Running results_fem.py\")\r\n```\r\n\r\n## Look for LoadCases, Results and Components\r\n\r\n```python\r\n# results_fem.py\r\n\r\n# Load the list of load cases as N2PLoadCase object\r\nloadcaseslist = model.LoadCases\r\n\r\n# Look for the Load Case with the name pressure\r\npressure_lc = model.get_load_case(\"pressure\")\r\n\r\n# Change the active increment (by default is the last one):\r\npressure_lc.ActiveIncrement = 10\r\n\r\n# Look for all results\r\nall_results = pressure_lc.Results\r\n\r\n# Look for the Result with the name DISPLACEMENT\r\ndisplacement = pressure_lc.get_result(\"DISPLACEMENT\")\r\n\r\n# Load all the components of the result\r\nall_components = displacement.Components\r\n\r\n# Look for the component X:\r\nx_coord = displacement.get_component(\"X\")\r\n```\r\n\r\n## Load the result data as a list\r\n\r\n```python\r\n# results_fem.py\r\n\r\n# Obtain the result array as a list for a component\r\nx_list = x_coord.get_result_list()[0]\r\n```\r\n\r\n## Load the result data as a NumPy array\r\n\r\n```python\r\n# results_fem.py\r\n\r\n# Call the get_result_ndarray method of a N2PComponent to obtain a numpy array\r\n# with the results of the component.\r\nx_df = x_coord.get_result_ndarray()\r\n```\r\n\r\n## Create an executable file of your code\r\nUsing a different script:\r\n```python\r\n# extra_script.py\r\n\r\nimport NaxToPy as N2P\r\npath1 = \"results_fem.py\"\r\npath2 = \"results_fem_abaqus.py\"\r\n\r\nN2P.n2ptoexe(path1, console=True, solver=\"NASTRAN\")\r\nN2P.n2ptoexe(path2, console=True, solver=\"ABAQUS\", abaqusversion=[\"2021\", \"2022\"])\r\n```\r\n\r\n## Create your own functions to work with other python packages:\r\nPrivate function that generates the proper index for a data frame using the elemnts or nodes ids:\r\n```python\r\n# results_fem.py\r\n\r\nimport pandas as pd\r\n\r\ndef _index_dataframe(model: \"N2PModelContent\", component: \"N2PComponent\", sections, aveSections, cornerData, aveNodes,\r\n                     variation, realPolar, coordsys, v1, v2) -> pd.Index:\r\n    \"\"\" Function that returns the proper index for each component asked\r\n    \"\"\"\r\n    # It is look if there is one part or several's:\r\n    parts = len(model.Parts) - (model.Solver == \"Abaqus\")\r\n\r\n    # Then the result array and where there results are placed is obtained\r\n    on_items = component.get_result_ndarray(sections, aveSections, cornerData, aveNodes,\r\n                                            variation, realPolar, coordsys, v1, v2)[1]\r\n\r\n    # The ids and the index are selected. It takes into account where the results are and the number of parts\r\n    if on_items == \"NODES\":\r\n        nodes = model.get_nodes()\r\n        ids = [(nodo.PartID, nodo.ID) if parts > 1 else nodo.ID for nodo in nodes]\r\n        indexname = [\"Part\", \"Grid\"] if parts > 1 else [\"Grid\"]\r\n\r\n    elif on_items == \"ELEMENTS\":\r\n        elements = model.get_elements()\r\n        connectors = model.get_connectors()\r\n        ids = [(element.PartID, element.ID) if parts > 1 else element.ID for element in elements] + \\\r\n              [(co.PartID, co.ID) if parts > 1 else co.ID for con in connectors for co in (con if isinstance(con, list) else [con])]\r\n        indexname = [\"Part\", \"Element\"] if parts > 1 else [\"Element\"]\r\n\r\n    elif on_items == \"ELEMENT NODAL\":\r\n        ids = model.elementnodal().values()\r\n        indexname = [\"Part\", \"Grid\", \"Element\"]\r\n\r\n    else:\r\n        return None\r\n\r\n    # If there are several parts, or it is corner data, MultiIndex is used:\r\n    if isinstance(ids[0], tuple):\r\n        index = pd.MultiIndex.from_tuples(ids, names=indexname)\r\n    else:\r\n        index = ids\r\n\r\n    return index\r\n```\r\nFunction that generates a DataFrame with the results of a component\r\n```python\r\n# results_fem.py\r\n\r\ndef dataframe_result(model: \"N2PModelContent\", component: \"N2PComponent\",sections=None, aveSections=-1, cornerData=False,\r\n                     aveNodes=-1, variation=100, realPolar=0, coordsys: int = -1000,\r\n                     v1: tuple = (1,0,0), v2: tuple = (0,1,0)) -> pd.DataFrame:\r\n    \"\"\"Function that returns as a dataframe of pandas the result array of a component\r\n    \"\"\"\r\n\r\n    # DataFrame generation\r\n    return pd.DataFrame(data={component.Name:\r\n                              component.get_result_ndarray(sections, aveSections, cornerData, aveNodes, variation,\r\n                                                           realPolar, coordsys, v1, v2)[0]},\r\n                        index=_index_dataframe(model, component, sections, aveSections, cornerData, aveNodes, variation,\r\n                                               realPolar, coordsys, v1, v2),\r\n                        columns=[component.Name])\r\n```\r\nFunction that generates a DataFrame for all the components of a result\r\n```python\r\n# results_fem.py\r\n\r\ndef dataframe_results(model: \"N2PModelContent\", result: \"N2PResult\", sections=None, aveSections=-1, cornerData=False,\r\n                     aveNodes=-1, variation=100, realPolar=0, coordsys: int = -1000,\r\n                     v1: tuple = (1,0,0), v2: tuple = (0,1,0)) -> pd.DataFrame:\r\n    \"\"\"Function that generates a DataFrame of pandas with all the components of a result. It uses dataframe_result.\r\n    It uses sequential computing.\r\n    \"\"\"\r\n    return pd.DataFrame(data={component.Name:\r\n                                  component.get_result_ndarray(sections, aveSections, cornerData, aveNodes, variation,\r\n                                                               realPolar, coordsys, v1, v2)[0]\r\n                                                               for component in result.Components.values()},\r\n                        index=_index_dataframe(model, next(iter(result.Components.values())), sections, aveSections,\r\n                                               cornerData, aveNodes, variation, realPolar, coordsys, v1, v2),\r\n                        columns=[component.Name for component in result.Components.values()])\r\n```\r\n\r\n##\r\nFor more documentation visit https://idaerosolutions.com/Home/NaxToPy\r\n\r\nReference Guide at: https://www.idaerosolutions.com/NaxToPyDoc/NaxToPy.html\r\n\r\n\r\n# License\r\n\r\nCopyright is owned by Idaero Solutions\u00a9\r\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2024 Idaero Solutions  This freeware license agreement (\u201cagreement\u201d) is a legally binding contract between the individual who downloads the software (\u201cyou\u201d) and the licensor, that should be read in its entirety. This is an agreement governing your use this software own by Idaero Solutions, further defined herein as \u201csoftware\u201d, and the licensor of the software is willing to provide you with access to the software only on the condition that you accept all of the terms and conditions contained in this agreement. You are deemed to have read, understood and accepted all such terms and conditions upon executing a download of any free software.  1. License Grant:  Subject to the terms and conditions of this Agreement, Idaero Solutions grants the User a limited, non-exclusive, non-transferable license to use the Software solely for non commercial purposes. This license does not grant any rights to the source code of the Software. It is only free for non-professional and non-commercial purposes. For commercial and professional purposes, you must install the professional NaxTo(c) version.  2. Ownership:  The User acknowledges that the Software, including any and all intellectual property rights associated with it, is the sole property of Idaero Solutions and/or its Suppliers. The User agrees not to claim ownership or proprietary rights over the Software.  3. Distribution:  The User is allowed to distribute the Software to third parties free of charge, ONLY under .exe files that use the software as a dependence of the script, provided that the distribution includes the complete and unmodified Software package as originally provided by Idaero Solutions. The User must not charge any fees or payments for the distribution of the Software.  4. Modifications:  The User agrees not to modify, adapt, reverse engineer, decompile or disassemble, the Software. Any attempt to do so shall be a violation of this Agreement. The User is allowed to develop further code based on the Software. However, the User agrees that the new software shall be subject to the same license terms as this Agreement, including the prohibition on modification, reverse engineering, and proprietization.  5. Proprietization:  The User agrees not to use the Software or any part thereof to develop a competing product or service or engage in any activities that may lead to the proprietization of the Software.  6. Termination:  This Agreement is effective until terminated. Idaero Solutions may terminate this Agreement immediately and without notice if the User fails to comply with any of the terms and conditions herein. Upon termination, the User must cease all use of the Software and destroy all copies in their possession.  7. Warranty and Liability:  The software is provided \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.  8. An extension of NaxTo(c) from Idaero Solutions:  The software is an extension of the NaxTo software developed by Idaero Solutions. Therefore, the terms of use of this software are an extension of the NaxTo license. In the event of any discrepancies, the NaxTo license takes precedence.  9. Governing Law:  This Agreement shall be governed by and construed in accordance with the laws of the jurisdiction in which Idaero Solutions is located.   IDAERO DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IDAERO DOES NOT GUARANTEE THAT THE PRODUCTS WILL MEET LICENSEE'S REQUIREMENTS, OPERATE UNINTERRUPTED OR ERROR-FREE, OR BE COMPATIBLE WITH ANY SPECIFIC HARDWARE OR SOFTWARE. THE ENTIRE RISK ASSOCIATED WITH THE USE, PERFORMANCE, OR RESULTS OBTAINED FROM THE PRODUCTS RESTS WITH THE LICENSEE, NOT IDAERO. IDAERO MAKES NO WARRANTIES REGARDING THE ACCURACY, COMPLETENESS, FUNCTIONALITY, SAFETY, PERFORMANCE, OR ANY OTHER ASPECT OF ANY DESIGN, PROTOTYPE, OR FINAL PRODUCT DEVELOPED BY THE LICENSEE USING THE PRODUCTS.  IN NO EVENT SHALL IDAERO OR ITS SUPPLIERS BE LIABLE FOR INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR DATA, DEFECTS IN DESIGN OR PRODUCTS CREATED USING THE PRODUCTS, OR ANY INJURY OR DAMAGE RESULTING FROM SUCH DEFECTS, SUFFERED BY THE LICENSEE OR ANY THIRD PARTY, EVEN IF IDAERO OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE PRODUCTS PROVIDED HEREUNDER ARE INTENDED ONLY TO AID THE LICENSEE IN DEVELOPING THEIR OWN PRODUCTS OR CONDUCTING DATA ANALYSIS AND ARE NOT INTENDED TO SUBSTITUTE FOR SOUND ENGINEERING JUDGMENT, INDEPENDENT TESTING OF PHYSICAL PROTOTYPES, CAREFUL NUMERICAL REVIEW, OR SOUND BUSINESS JUDGMENT.   The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
    "summary": "Package for postprocessing FEM results in Python",
    "version": "2.0.0",
    "project_urls": {
        "Documentation": "https://www.idaerosolutions.com/NaxToPyDoc/index.html",
        "Download": "https://apps.microsoft.com/detail/XP9MMH0KDKGRJN?hl=en-US&gl=US",
        "Homepage": "https://www.idaerosolutions.com/Home/NaxToPy",
        "LinkedIn": "https://www.linkedin.com/company/idaero/"
    },
    "split_keywords": [
        "naxto",
        " postprocessing",
        " fem"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d8b9f15eff1227ce0af045ac02a3f37e006ab6a1b04860021215ab295b701d3",
                "md5": "0f85b3b7d8a49820d7932ca31e137ce5",
                "sha256": "50097184a039208bf879b8cbae88b8327d198e8f0f06af996232cdd35ebe1080"
            },
            "downloads": -1,
            "filename": "NaxToPy-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0f85b3b7d8a49820d7932ca31e137ce5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 291330,
            "upload_time": "2024-04-25T12:27:56",
            "upload_time_iso_8601": "2024-04-25T12:27:56.713757Z",
            "url": "https://files.pythonhosted.org/packages/9d/8b/9f15eff1227ce0af045ac02a3f37e006ab6a1b04860021215ab295b701d3/NaxToPy-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0c951c597d8c57e93796a0eaafb8a7864da04f6ba4d58e49ce9c5c1fe14d91b",
                "md5": "5590e57907ec440043d718c41adfc437",
                "sha256": "8fd1ef4d5f7214527feab1bc02ba2ea7490618a430a04852c7dbdb647a4d5679"
            },
            "downloads": -1,
            "filename": "naxtopy-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5590e57907ec440043d718c41adfc437",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 200875,
            "upload_time": "2024-04-25T12:27:58",
            "upload_time_iso_8601": "2024-04-25T12:27:58.378714Z",
            "url": "https://files.pythonhosted.org/packages/b0/c9/51c597d8c57e93796a0eaafb8a7864da04f6ba4d58e49ce9c5c1fe14d91b/naxtopy-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-25 12:27:58",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "naxtopy"
}
        
Elapsed time: 0.24463s