Skip to content

d-zo/abapys

Repository files navigation

abapys 0.6.6

abapys is a collection of special purpose Python functions for creating parametrized models or postprocessing simulation results with the commercial Finite-Element-Analysis software Abaqus. It was created alongside work at the Institute of Geotechnical Engineering at the Hamburg University of Technology. Therefore it is centered around model creation and output processing for simulations of soil samples and soil-structure interaction. All functions were tested for Abaqus versions between 6.14-2 (2015) and Abaqus 2020.

DOI

Installation

abapys requires the commercial Finite-Element-Analysis software Abaqus and uses its Python interpreter. Although it could be integrated within Abaqus' Python environment, it can also be included in the module path and imported. Therefore it can be stored in an arbitrary folder and loaded by

abapys_dir = r'C:\path\to\abapys' # For Windows-based systems
abapys_dir = '/path/to/abapys'    # For Linux-based systems
sys.path.insert(0, abapys_dir);

from abapys import *

abapys can use material parameters from Spreadsheets (.xlsx-files). To read those files openpyxl and its dependencies et_xmlfile and jdcal are used as external dependencies and have to be provided. One possible solution is to install abapys and those dependencies in one folder, which has to be included in the module path. The structure should look like the following

abapys/
   +- abapys/
   |      +- __init__.py
   |      +- ausgabe.py
   |      +- beautify.py
   |      + ...
   |
   +- Materialdatenbank_20####.xlsx
   +- gewichtung.dll
   +- gewichtung.so
   |
   +- openpyxl/
   |      +- cell/
   |      +- chart/
   |      +- chartsheet/
   |      + ...
   |
   +- et_xmlfile/
   |      +- tests/
   |      +- __init__.py
   |      +- xmlfile.py
   |
   +- jdcal.py

Usage and Documentation

A simple function documentation (in german) created with pydoc can be found here. The functions can either be called in the Abaqus command prompt for interactive results or put in scripts with other commands to record a sequence of instructions. The basic usage and some examples are given in the ”Abaqus scripting with abapys“ tutorial. A html-version of the tutorial can be found here and a pdf-version here.

Another project called SimpleScriptGenerator can help to create scripts with abapys functions. SimpleScriptGenerator is providing a user interface for intuitive and interactive script creation. The logic and content of it can be adjusted with different configuration files. So a preconfigured configuration named abapys_front can be used to create scripts with Abaqus commands and abapys functions. Abaqus and abapys are not necessary to create these scripts. In order to run the scripts however, both tools are required.

If you have no or very little knowledge of Abaqus, you may want to have a look at some tutorials (and the resulting Python code) first. There is also a tutorial called ”Pile jacking example in Abaqus“, which can help getting started with Abaqus and Python. An html-version of the tutorial can be found here and an pdf-version here.

Structure

Originally all abapys functions were written in Python. Due to speed issues a library for finding points in elements and their weighting was converted to C++ (gewichtung.dll and gewichtung.so). The functions are saved in different files, but those with similar scope are usually saved in the same file:

  • ausgabe.py: Adjust/saving the viewport and extracting/plotting/saving simulation results
  • auswahl.py: Selection of geometric entities by condition/labels
  • beautify.py: Subjective viewport beautification function
  • boden.py: Create soil body and assign stress states
  • bodendatenbank.py: Load soil material parameters from spreadsheet
  • bohrprofil.py: Create screw and full displacement pile parts
  • erstellung.py: Connector constraints and reference point coupling
  • gewichtung.cpp: Weighting of one set of elements/nodes in regard to another set of elements/nodes
  • grundkoerper.py: Create basic geometric parts
  • hilfen.py: Initialisation and general-purpose functions
  • punktinelement.py: Point localisation/weighting and volume calculation of elements
  • uebertragung.py: Initialise/transfer state variables from one mesh to another
  • zahnrad.py: Create a gear wheel part (lantern pinion)
  • zeichnung.py: Create sketches for part extrusion or revolution

Contributing

Bug reports

If you found a bug, make sure you can reproduce it with the latest version of abapys. Please check that the expected results can actually be achieved by other means and are not considered invalid operations in Abaqus and its Python interpreter. Please give detailed and reproducible instructions in your report including

  • the abapys version
  • the expected result
  • the result you received
  • the command(s) used as a minimal working example

Note: The bug should ideally be reproducible by the minimal working example alone. Please keep the example code as short as possible (minimal). Try not to load additional files like .cae or .odb if possible. If it can't be avoided make them as small and simple as possible.

Feature requests

If you have an idea for a new feature, consider searching the open issues and closed issues first. Afterwards, please submit a report in the Issue tracker explaining the feature and especially

  • why this feature would be useful (use cases)
  • what could possible drawbacks be (e.g. compatibility, dependencies, ...)

Similar software

There is a project called abapy which also provides a collection of Python functions for use in Abaqus. But the intention and focus of the functions are completely different.

License

abapys is released under the GPL, version 3 or greater (see also LICENSE file). It is provided without any warranty.