FEAPACK Quick Start Guide

Last updated on 2024-04-21.

Contents

  1. Introduction
    1. What is FEAPACK
    2. What FEAPACK is not
    3. How to generate a mesh input file
  2. Examples
    1. Basic examples
    2. Advanced examples

1. Introduction

This is a quick start guide for FEAPACK, a finite element analysis package for solids fully written in Python. Currently, FEAPACK works with Python 3.12 (or later) on Windows x64, and it is available via pip. This guide presents tutorials on how to use the software.

1.1. What is FEAPACK

FEAPACK is an open-source Python package for performing linear perturbation analyses on solids via the finite element method, including static, frequency, and buckling analyses. Several finite elements are implemented, which can be applied in plane stress, plane strain, axisymmetric, and general three-dimensional cases. Distinct loading conditions can be modelled via the application of concentrated nodal loads, distributed surface loads (namely, pressures and surface tractions), and inertia loads (namely, body forces and accelerations, e.g., due to gravity). FEAPACK also has built-in capabilities for visualizing and interacting with finite element models and results.

Under the hood, FEAPACK utilizes efficient and well-established computational routines. It uses NumPy for general computations during the solution phase, but also Intel's Math Kernel Library for the solution of large sparse systems of equations, namely PARDISO and the Extended Eigensolver. FEAPACK also uses a custom approach for building and storing large sparse matrices arising from the finite element method, enabling their computation in parallel. However, FEAPACK for Python is not meant to be an extremely fast or efficient finite element package, as it is inherently limited by Python's performance. Instead, FEAPACK is meant to be easy to use for academic and research purposes, as the source code can easily be modified to explore and implement new approaches based on the finite element method.

The three main modules of FEAPACK are:

1.2. What FEAPACK is not

FEAPACK is not a mesh generator nor does it have built-in CAD capabilities and may not be used to define physical geometries nor to generate meshes. Instead, the physical geometry to be analyzed must first be discretized into a finite element mesh. Ultimately, this means that FEAPACK requires the finite element mesh as an input in order to create a new finite element model.

1.3. How to generate a mesh input file

Currently, only Abaqus input files (*.inp) are accepted as mesh input files. In the future, support for other file types may be added. There are several ways to generate an Abaqus input file:

  1. For sufficiently simple meshes, the file may be created using a text editor or generated via a scripting language (e.g., Python or Matlab).
  2. For larger and more complex meshes, one may use Abaqus to define the physical geometry and then generate the mesh. This is not a particularly interesting way since Abaqus is paid software and the user may run a much more sophisticated finite element analysis directly in this software, nullifying the need for FEAPACK.
  3. The recommended way is to generate the finite element mesh via Gmsh (or other mesh generator). Gmsh is freely available and open-source. Gmsh has a built-in CAD engine, so it can be used to define the physical geometry and then a mesh can be generated. However, Gmsh can also be used as a meshing tool only, leaving the task of defining the physical geometry to another CAD software (e.g., FreeCAD). Gmsh is capable of exporting the generated mesh as an Abaqus input file.

Alternatively, for sufficiently simple meshes, one may skip generating a mesh input file entirely and define the mesh (nodal coordinates and element connectivity) directly in the FEAPACK job script (see the first example below).

2. Examples

The following consists of a series of examples on how to use FEAPACK to perform finite element analyses. As previously stated, a mesh input file of the discretized physical geometry that is to be analyzed is often required. Based on this file, a model database (MDB) is created in a job script. The user may then first start by defining node sets, element sets, and surface sets. Node sets are used to apply concentrated nodal loads and boundary conditions in the form of prescribed nodal displacements. Element sets are used to define sections, which in turn assign materials and stress states to the finite elements, and to apply inertia loads in the form of body forces and accelerations (e.g., due to gravity). Finally, surface sets are used for the definition of distributed surface loads, i.e., pressures and surface tractions. Although node and element sets can be defined in the FEAPACK job script, it is often more convenient to define these during the meshing process, e.g., using Gmsh's physical groups. The sets are then automatically imported during the MDB creation.

Important: before starting the MDB definition, always remember that FEAPACK, like many other finite element applications (e.g., Abaqus), assumes that a consistent system of units is being used. For each example, the units that are being considered are stated in the beginning.

Once a finite element model has been defined in the job script, e.g., my_job.py, the following command can be used to perform the finite element analysis: python my_job.py. Upon a successful run, the command python -m feapack.viewer can be used to launch the viewer application. The results are stored in the generated my_job.out file.

The files for the examples can be found here.

2.1. Basic examples

2.2. Advanced examples